|
StripeKit 0.1.1
Stripe integration toolkit for C++
|
Routing StripeKit's diagnostics into the host application's log, with helpers for keeping secrets out of log output. More...
Classes | |
| struct | stripekit::LogContext |
| Extra identifiers attached to a log entry. More... | |
| class | stripekit::Logger |
| Receives StripeKit's log entries. More... | |
| class | stripekit::NullLogger |
| A logger that discards everything. More... | |
| class | stripekit::ConsoleLogger |
| A logger that writes to the process's standard error stream. More... | |
Enumerations | |
| enum class | stripekit::LogLevel { stripekit::LogLevel::Trace , stripekit::LogLevel::Debug , stripekit::LogLevel::Info , stripekit::LogLevel::Warn , stripekit::LogLevel::Error , stripekit::LogLevel::Off } |
| Severity of a log entry. More... | |
Functions | |
| bool | stripekit::is_sensitive_field_name (std::string_view field_name) |
| Reports whether a field is one whose value should never be logged. | |
| std::string | stripekit::redact_sensitive_value (std::string_view value) |
| Replaces a secret value with a placeholder. | |
| std::string | stripekit::redact_sensitive_text (std::string_view text) |
| Strips secret-looking tokens out of free-form text. | |
Routing StripeKit's diagnostics into the host application's log, with helpers for keeping secrets out of log output.
|
strong |
| bool stripekit::is_sensitive_field_name | ( | std::string_view | field_name | ) |
Reports whether a field is one whose value should never be logged.
Recognises the names Stripe uses for keys, secrets, and card details.
| field_name | Name of the field being considered. |
| std::string stripekit::redact_sensitive_value | ( | std::string_view | value | ) |
Replaces a secret value with a placeholder.
| value | The value to hide. |
| std::string stripekit::redact_sensitive_text | ( | std::string_view | text | ) |
Strips secret-looking tokens out of free-form text.
Catches API keys and signing secrets by their recognisable prefixes, which makes it useful for sanitising an error message or a response body before writing it to a log.
| text | The text to sanitise. |