fix: redact secret property values in SessionContext Debug - #2960
fix: redact secret property values in SessionContext Debug#2960plusplusjiajia wants to merge 1 commit into
Conversation
767c783 to
36f0722
Compare
36f0722 to
f7ceb7e
Compare
|
Do we really need this? The sessionContext will be fully controlled by users, and they can set them in |
Fair question — credentials didn't exist when I opened this (it came with #2971), and with it there, redacting by key name is largely redundant. |
|
I also don't think this added much value. It should be user's responsibility to put sensitive properties in credentials, and it's hard to figure out what property is sensitive from keys. |
|
I'll close this pr for now, feel free to reopen it if necessary. |
What changes are included in this PR?
SessionContext's derivedDebugprintedpropertiesverbatim, while session properties routinely carry secrets. Redaction now happens on two levels:token,s3.secret-access-key,AWS_SECRET_ACCESS_KEY,clientSecret,Authorization,Cookie, ...) since property keys carry no casing contract.uriholdingpostgres://user:pass@host/db) and signed URLs (X-Amz-Signature=, SASsig=).Plain values (warehouse names, credential-free URIs) stay visible, so
Credential's redaction isn't undone by the map next to it. Same approach as the REST catalog config redaction in #2838.Are these changes tested?
Table-driven tests pin both matchers (key casings/separators, URI/signed-URL values, plus negative cases), and a
Debugformatting test asserts secret values are redacted while plain values remain visible.