mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-09-19 02:18:25 +08:00
The request logger's sanitizeBody only matched lowercase / snake_case field names (api_key, apikey, access_token, ...), so values for the camelCase JSON fields actually used by the API (apiKey, secretKey, refreshToken, accessToken, ...) were written to logs in clear text. Replace the per-field patterns with a single case-insensitive regex that tolerates optional `_`/`-` separators, covering snake_case, camelCase and PascalCase variants, and extend coverage to id_token, client_secret, private_key, auth_token, api_secret and passwd. The field name is preserved; only its value is replaced with "***". Add unit tests for sanitizeBody covering the previously-leaking camelCase fields and common variants. Fixes #1287