Skip to content

Commit 65d8e06

Browse files
committed
docs: describe redaction as masking every query value
1 parent 6474b57 commit 65d8e06

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎docs/middleware.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Middleware is for behavior that applies to every call through a client. Other ca
1313
- Side effects that don't need httpware's exceptions or chain order, including on post-redirect hops: use `event_hooks` on an `httpx2` client you build yourself and pass as `httpx2_client=`. Middleware and phase decorators run in the httpware chain, see httpware exceptions, and compose with `AsyncRetry` and `AsyncBulkhead`. `event_hooks` run a layer below, on every transport attempt. That is also why `httpware` refuses `event_hooks=` as a client option: an `httpx2.HTTPStatusError` raised in a hook (say, by `raise_for_status()`) reaches the chain as a plain `TransportError` instead of a `StatusError`, so `AsyncRetry` never retries it and the circuit breaker never counts it.
1414
- URL or header validation: `httpx2` already does it.
1515
- Creating HTTP spans for tracing: install `opentelemetry-instrumentation-httpx`, which already traces every transport call. See [Observability](observability.md).
16-
- Redaction: httpware redacts URLs before they reach logs, telemetry, and error messages. It strips `user:pass@` userinfo and masks the values of sensitive query and fragment parameters ([Errors](errors.md#excresponse-access-pattern) lists them). It does not touch headers or bodies, so if your middleware logs those, redact them yourself, for example with a `logging.Filter`.
16+
- Redaction: httpware redacts URLs before they reach logs, telemetry, and error messages. It strips `user:pass@` userinfo and replaces every query and fragment parameter value with `REDACTED`, keeping the keys ([Errors](errors.md#excresponse-access-pattern) has an example). It does not touch headers or bodies, so if your middleware logs those, redact them yourself, for example with a `logging.Filter`.
1717

1818
## Writing your own
1919

‎src/httpware/_internal/observability.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _emit_event(
2626
2727
The ``url`` attribute, when present, is run through
2828
``redaction.redact_url`` here — at the single emission boundary — so a
29-
request URL's userinfo and known-sensitive query/fragment secrets never
29+
request URL's userinfo and query/fragment parameter values never
3030
reach a log record or span event, regardless of how a caller built the
3131
attributes dict.
3232

0 commit comments

Comments
 (0)