Conversation
… flows Closes #576 (partial — handler.py pop follows in next commit) https://claude.ai/code/session_01R254Wmibw6fxiDDTvhuw9b
_build_ctx now pops metadata["adcp.auth_info"] after calling _extract_auth_info, preventing the AuthInfo object from surviving into RequestContext.metadata where it would be opaque to downstream serializers. Mirrors the existing adcp.buyer_agent pop pattern. https://claude.ai/code/session_01R254Wmibw6fxiDDTvhuw9b
0db54bd to
51f8d63
Compare
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
auth_context_factorynow constructsAuthInfo(kind="bearer", principal=..., credential=None)and stores it atmetadata["adcp.auth_info"]when the request is authenticated, soRequestContext.auth_infois non-Nonefor bearer flows — the same typed surface signed-request flows already populate_build_ctxpopsadcp.auth_infofromtool_ctx.metadataafter extraction so theAuthInfoobject never reachesRequestContext.metadataor the context-echo/idempotency path (mirrors the existingadcp.buyer_agentpop)test_auth_middleware.pyRoot cause
auth_context_factorypopulatedcaller_identityandtenant_idon theToolContextbut never setmetadata["adcp.auth_info"].PlatformHandler._extract_auth_inforeads that key — so for every bearer-authenticated request it silently returnedNone, leavingctx.auth_infounset even thoughctx.auth_principalwas populated (fixed in #574).Test plan
pytest tests/test_auth_middleware.py— 38/38 passpytest tests/— 4092 pass (excluding pre-existing network flaketest_real_tls_handshake_still_validates_hostname)ruff check src/— cleanmypy src/adcp/— cleanAuthInfo, object popped before context-echo path,credential=Nonesuppresses synthesisCloses #576
https://claude.ai/code/session_01R254Wmibw6fxiDDTvhuw9b
Generated by Claude Code