File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010//
1111// Usage Guidelines:
1212//
13- // - Use ParseAuthHeader() for complete authentication with error handling:
14- // Returns both API key and agent ID, with errors for missing/invalid headers.
13+ // - Use ParseAuthHeader() for complete authentication with error handling:
14+ // Returns both API key and agent ID, with errors for missing/invalid headers.
1515//
16- // - Use ExtractAgentID() when you only need the agent ID and want automatic
17- // fallback to "default" instead of error handling.
16+ // - Use ExtractAgentID() when you only need the agent ID and want automatic
17+ // fallback to "default" instead of error handling.
1818//
19- // - Use ValidateAPIKey() to check if a provided key matches the expected value.
20- // Automatically handles the case where authentication is disabled (no expected key).
19+ // - Use ValidateAPIKey() to check if a provided key matches the expected value.
20+ // Automatically handles the case where authentication is disabled (no expected key).
2121//
2222// Example:
2323//
Original file line number Diff line number Diff line change 22//
33// This package offers two complementary approaches to secret sanitization:
44//
5- // 1. Pattern-based detection: SanitizeString() and SanitizeJSON() use regex patterns
6- // to identify and redact secrets like API keys, tokens, and passwords.
5+ // 1. Pattern-based detection: SanitizeString() and SanitizeJSON() use regex patterns
6+ // to identify and redact secrets like API keys, tokens, and passwords.
77//
8- // 2. Prefix truncation: TruncateSecret() and TruncateSecretMap() show only the first
9- // 4 characters of values, making them safe for logging without exposing full secrets.
8+ // 2. Prefix truncation: TruncateSecret() and TruncateSecretMap() show only the first
9+ // 4 characters of values, making them safe for logging without exposing full secrets.
1010//
1111// Usage Guidelines:
1212//
13- // - Use TruncateSecret()/TruncateSecretMap() for auth headers and environment variables
14- // where you want to preserve a hint of the value for debugging.
13+ // - Use TruncateSecret()/TruncateSecretMap() for auth headers and environment variables
14+ // where you want to preserve a hint of the value for debugging.
1515//
16- // - Use SanitizeString()/SanitizeJSON() for full payload sanitization where secrets
17- // may appear in various formats throughout the data.
16+ // - Use SanitizeString()/SanitizeJSON() for full payload sanitization where secrets
17+ // may appear in various formats throughout the data.
1818//
1919// Example:
2020//
You can’t perform that action at this time.
0 commit comments