GitHub

RedactedNames

API reference for RedactedNames.

Query parameters, headers and path params whose values are only sometimes secret, redacted in the client and server spans of an endpoint without being modelled as Redacted.

Names are wire names after encoding, matched as headers.is_redacted_name does: a string ignoring case, a re.Pattern by search. A string query name also matches the bracketed keys of a nested parameter (buildargs[NPM_TOKEN] for buildargs). They extend url_params.CurrentRedactedNames and headers.CurrentRedactedNames, and the names of the API, its groups and its endpoints are combined. add_http_api copies the added API's annotations onto its groups, so a group's own RedactedNames replaces them. Only URL and header attributes use these names: the values sent and decoded, and user_agent.original, are unchanged::

build = HttpApiEndpoint.post("build", "/build", query=...).annotate(
    RedactedNames, {"query": ["buildargs"], "headers": ["x-registry-config"]}
)

params are path param names, matched exactly. On the server they become the route's redacted_params, so the server span and the middleware.logger entry record the path with those values replaced by REDACTED; client spans record the path as sent. builder.endpoint returns a handler without a route, so set redacted_params on the route it is mounted with.