maskAuthorizationHeader masks the Authorization header value while preserving the auth type prefix. Common formats: "Bearer ", "Basic ", "ApiKey ", etc. It preserves the prefix (e.g., "Bearer ") and only masks the token/credential part. Parameters: - value: The Authorizatio
(value string)
| 199 | // Returns: |
| 200 | // - string: The masked Authorization value with prefix preserved |
| 201 | func MaskAuthorizationHeader(value string) string { |
| 202 | parts := strings.SplitN(strings.TrimSpace(value), " ", 2) |
| 203 | if len(parts) < 2 { |
| 204 | return HideAPIKey(value) |
| 205 | } |
| 206 | return parts[0] + " " + HideAPIKey(parts[1]) |
| 207 | } |
| 208 | |
| 209 | // MaskSensitiveHeaderValue masks sensitive header values while preserving expected formats. |
| 210 | // |
no test coverage detected