What
Add a recipes/fastapi_middleware.py example showing how to use redact_url_query inside a FastAPI middleware that logs request URLs without leaking secret query params.
Expected outcome
- New file
recipes/fastapi_middleware.py (under 50 lines)
- Drop-in
RedactingLogMiddleware class that:
- Reads the request URL
- Passes it through
redact_url_query
- Logs the redacted form before calling
await call_next(request)
- README "Three killer examples" section gets a fourth bullet linking to the recipe
- No tests required (it's an integration example, not library code)
Why this is good for newcomers
- Doesn't touch any library internals
- Pattern is well-defined in FastAPI docs
- Showcases a real-world use case redactkit users will want to copy-paste
Pointers
- Source:
src/redactkit/url_query.py
- README example block to mirror:
## Three killer examples
What
Add a
recipes/fastapi_middleware.pyexample showing how to useredact_url_queryinside a FastAPI middleware that logs request URLs without leaking secret query params.Expected outcome
recipes/fastapi_middleware.py(under 50 lines)RedactingLogMiddlewareclass that:redact_url_queryawait call_next(request)Why this is good for newcomers
Pointers
src/redactkit/url_query.py## Three killer examples