Repository navigation
Conversation
Let an auto-resolved Agent Registry auth provider send its token in an explicit header with an optional prefix. Preserve the override when the deployed toolset resolves its binding again. Redact credential headers in MCP debug and telemetry records and prevent non-Authorization credential headers from following cross-origin redirects. Closes google#6814
This was referenced Nov 28, 2026
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.
Link to Issue or Description of Change
An Agent Registry binding can supply a token through
X-Api-Keywhile the registered MCP endpoint expectsAuthorization: Bearer <token>. Callers can now choose the outbound credential header on a registry-resolved binding:A header name alone sends the raw token. Both the Agent Identity and legacy IAM Connector credential services use the override, including when a deployment resolves its binding again. Omitting the options keeps the provider's legacy formatting. The override requires an automatically resolved binding. The fetched token goes only in the chosen credential header.
MCP's built-in HTTP debug and experimental telemetry records redact managed credential headers by name. HTTP requests carrying a non-
Authorizationcredential header can follow same-origin redirects. Cross-origin redirects are rejected before a follow-up request is sent.Testing Plan
Unit Tests
The regressions cover successful immediate and polled credentials from both services, format validation, old serialized schemes, binding resolution and rebind, credential-key isolation, and HTTP redaction and redirect handling. The redirect regression and registry/header tests were also exercised against MCP SDK 1.x and 2.x.
Full repository
toxmatrix using the four configureduv-venv-lock-runnerenvironments, thetestextra, and the project's dependency lock policy. Each environment ranpytest tests/unittests -n 2 -p no:cacheprovider --tb=short.The same 13 failed test IDs reproduced on unchanged main (
bee78e7) with the matching interpreter, dependencies, and local permissions. The failures are 9 OpenAPI tests, 3load_web_pagetests, and 1 MCP Google-auth HTTP transport test affected by macOS system proxy discovery. The main comparison re-ran those failed tests rather than the entire main suite. No new failures appeared in the full patch runs. The affected suite above ran separately without that system proxy and passed all 1,014 cases.Full-suite failure IDs reproduced on main
Manual End-to-End (E2E) Tests
I ran ADK's
Runnerwith a scriptedBaseLlmand a loopback Streamable HTTP MCP server. The server handledinitialize,notifications/initialized,tools/list, andtools/call, and rejected requests whose credential headers differed from the expected set. The Agent Registry API and credentials response were stubbed with one synthetic token. I ran the same probe against source and against the installed wheel outside the checkout.The probe used a real local HTTP connection. The Runner completed each call and returned the scripted final response. Regression tests also exercise the IAM Connector response path and deployment rebind with fixture data. Cloud-service and model requests were stubbed.
Checklist
The public usage guide is updated in the companion docs PR.
mkdocs build --strictpassed there.