Documentation
¶
Overview ¶
Package security provides helpers for handling sensitive fields and data safety.
It is primarily used by logging and telemetry packages to detect and obfuscate secrets before data leaves process boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSensitiveFields ¶
func DefaultSensitiveFields() []string
DefaultSensitiveFields returns a copy of the default sensitive field names. The returned slice is a clone — callers cannot mutate shared state.
func DefaultSensitiveFieldsMap ¶
DefaultSensitiveFieldsMap provides a map version of DefaultSensitiveFields for lookup operations. All field names are lowercase for case-insensitive matching. The underlying cache is initialized only once; each call returns a shallow clone so callers cannot mutate shared state.
func IsSensitiveField ¶
IsSensitiveField checks if a field name is considered sensitive based on the default sensitive fields list. The check is case-insensitive and handles camelCase field names by normalizing them to underscore-delimited tokens. Short tokens (like "key", "auth") use exact token matching to avoid false positives, while longer patterns use word-boundary matching.
Types ¶
This section is empty.