Documentation
¶
Overview ¶
Package obfuscate centralizes redaction/obfuscation helpers used across the codebase.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObfuscateTokenByPrefix ¶
ObfuscateTokenByPrefix obfuscates tokens that follow a known prefix convention (e.g., "sk-"). If the string doesn't have the expected prefix, it falls back to the generic strategy. Behavior (kept for backward-compat with token.ObfuscateToken):
- With prefix: keep the prefix, then show first 4 and last 4 of the remainder, replacing the middle with '*' If remainder <= 8, return the input unmodified
- Without prefix: same result as ObfuscateTokenGeneric
func ObfuscateTokenGeneric ¶
ObfuscateTokenGeneric obfuscates arbitrary token-like strings for display/logging. Behavior (kept for backward-compat with previous utils implementation): - length <= 4 → all asterisks of same length - 5..12 → keep first 2 characters, replace the rest with asterisks - > 12 → keep first 8 characters, then "...", then last 4 characters
func ObfuscateTokenSimple ¶
ObfuscateTokenSimple obfuscates token-like strings with a fixed pattern suitable for UIs. Behavior (kept for backward-compat with Admin template helper): - length <= 8 → "****" - > 8 → first 4 + "****" + last 4
Types ¶
This section is empty.