fix(redaction): split camelCase keys in normalizeKey - #994
Conversation
A lower-to-upper boundary now inserts an underscore, so accessToken and refreshToken match the registry instead of leaking into logs. Token-count fields such as promptTokens stay unredacted. Fixes Gitlawb#922
camelCase normalization treats credentialConfigured as a credential segment, so check() redacted the set/not-set indicator. authConfigured does not match the registry.
|
Warning Review limit reachedNext included review available in 12 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Comment |
anandh8x
left a comment
There was a problem hiding this comment.
Reviewed the latest head. The camelCase normalization closes a real redaction gap for accessToken, refreshToken, and apiKey while preserving token-count fields. The Doctor metadata rename is necessary to keep its set/not set indicator visible. Focused race tests for redaction, Doctor, and config pass.
Fixes #922
normalizeKeyonly inserted_on non-alphanumeric runes, soaccessTokenbecameaccesstokenand missed theaccess_tokenregistry entry. OAuth tokens in camelCase JSON/maps leaked into logs, TUI, and CLI.This treats a lowercase-to-uppercase boundary as a delimiter (
accessToken→access_token). Token-count fields (promptTokens,maxTokens) stay unredacted because the trailing segment is the pluraltokens.doctorreported credential presence undercredentialConfigured, which the same split now treats as sensitive. The indicator is renamed toauthConfiguredsoset/not setis not replaced by[REDACTED].The
reflect.Pointerone-liner is independent govet on currentmain(deprecatedreflect.Ptr). It can be dropped if maintainers prefer it on its own.