Logging `secret_names` design record
Status: completed. All four language ports expose logging initialization paths that accept legacy secret names and apply them through the same redaction options used by normal output formatting.
What shipped
- Rust:
afdata_tracing::init_*_with_optionsandtry_init_*_with_optionsacceptRedactionOptions. - Go:
NewAfdataHandlerWithOptions,Init*WithOptions, andInit*LevelWithOptionsacceptRedactionOptions. - Python:
AfdataHandler,init_json,init_plain, andinit_yamlaccept eitherredaction=orsecret_names=. - TypeScript:
initJson,initPlain, andinitYamlaccept{ secretNames }.
Preserved invariants
codeis always pinned to"log"; event fields cannot override it.- Required envelope fields stay
timestamp_epoch_ms,message,code, andlevel. - The free-form
messagestring is not name-redacted; secrets belong in named_secretfields or configured legacy fields. - Redaction runs before formatting through
output_*_with_options. - Log/protocol events continue to use stdout only; stderr is not a protocol stream.
Redaction behavior
Configured legacy names are exact matches. When secret_names / SecretNames / secretNames includes authorization, a log field named authorization is redacted to ***, and an _url field with a query parameter named authorization has that parameter value redacted. Without the option, those legacy names stay visible.
This record replaces the original implementation TODO so future changes have a concise compatibility checklist.