nemo_gym.config.secret_utils
nemo_gym.config.secret_utils
Module Contents
Functions
Data
API
Return the credential-safe config projection shared by saved artifacts and exporters.
Preserve unresolved interpolations without evaluating them. Secret ancestry masks every value,
including arbitrary names in a secrets mapping. The root token_id_capture mapping is a
settings namespace, not a credential; its own secret-shaped children still undergo masking.
Custom sink/resolver kwargs can contain credentials under arbitrary names, so their values stay masked.
Mask +key=value / ++key=value tokens whose key looks secret-shaped.
Mask the password in the user info of every URL inside text, keeping the user name and the rest of the URL.
Only a precaution for a credential pasted into a URL: it is the user’s job to keep secrets out of the config
in the first place (behind ${oc.env:NAME} or env.yaml). A password that is an interpolation is a reference
rather than a secret, so it stays as it is.
Mask every secret-shaped leaf in place with ’****’ so a config can be printed or exported.
A leaf is secret-shaped by its own name, or by sitting anywhere below a secret-shaped key: every
value of a secrets: mapping is a secret whatever its environment variable is called.
Used by the config parser and the exporters.