Add ASGI scope access-log atoms - #379
Open
Gonghan-Princess wants to merge 1 commit into
Open
Gonghan-Princess wants to merge 1 commit into
Gonghan-Princess wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a non-breaking
{Variable}saccess-log atom for string and byte values in the request's ASGI scope, as requested in #359. This makes request-specific trace IDs loggable without storing them in process-wide environment variables. The existing{Variable}eatom remains unchanged.Scope byte values use Latin-1, consistent with the existing header atoms. Missing keys and unsupported value types render as
-. Documentation and a regression test cover formatting, bytes, unsupported values, and coexistence with environment atoms.Verification
pytest tests -qwith seven known Windows/incompatible cases deselected: 190 passed, 7 deselected. Without deselection, the six failures are identical on the pristine base checkout (186 passed there, 187 passed with this change); the seventh case uses Unix/tmp/pathfor a file handler.git diff --check: pass.--no-warn-unused-ignores: pass. Unmodified base already has obsoletetype: ignoreand Windows-only socket typing errors with the installed mypy version.-W --keep-goingaftersphinx-apidoc: pass.This contribution was prepared with AI assistance and verified against the pristine base checkout.