Repository navigation
feat(agentregistry): add ADK authentication samples - #15003
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
Here is the summary of changes. You are about to add 5 region tags.
This comment is generated by snippet-bot.
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several new Python scripts and corresponding tests under agentregistry/adk/ demonstrating how to authenticate and resolve bindings for MCP toolsets and remote A2A agents using the Agent Registry ADK. Feedback on the changes suggests simplifying the custom authentication flow in auth_remote_a2a_agent.py by utilizing the official google.auth.transport.httpx.Auth class instead of implementing a custom httpx.Auth class, which also helps streamline the imported dependencies.
evelyn-goo
left a comment
There was a problem hiding this comment.
Thanks for putting together the auth samples
|
|
||
| def resolve_auth_bindings( | ||
| mcp_server_name: str = "mcpServers/SERVER_ID", | ||
| model: str = "gemini-2.5-flash", |
There was a problem hiding this comment.
Suggestion: Gemini 2.5 reached end-of-life today. Under the hood, I believe Gemini Flash 3+ would be used here. Consider changing the model.
| """Retrieves an MCP toolset authenticated with Application Default Credentials.""" | ||
| # Initialize the registry client | ||
| project_id = os.environ.get("GOOGLE_CLOUD_PROJECT") | ||
| location = os.environ.get("GOOGLE_CLOUD_LOCATION", "global") |
There was a problem hiding this comment.
Nit: Location and Project ID should come in through the sample function params.
See: https://googlecloudsamples.github.io/catalog/docs/effective-samples/author-samples/#minimal-arguments
This applies to all samples in this PR.
NimJay
left a comment
There was a problem hiding this comment.
Thank you, @fatoboist, for getting these samples in! 👏
Note that integration testing in this repo is currently broken/ignored.
Those _test.py files will not be run/verified.
I trust that you've tested these samples adequately.
I left a few non-blocking comments; feel free to address them in a follow-up PR. Merging!
Description
Adds the Agent Registry authentication samples and pytest suites under
agentregistry/adk/(PR B of migrating inline Agent Registry documentation snippets to GitHub; builds on #15002; internal tracking:b/581932768).Files added
agentregistry/adk/auth_remote_a2a_agent.py+auth_remote_a2a_agent_test.py(agentregistry_adk_auth_remote_a2a_agent)agentregistry/adk/auth_mcp_toolset.py+auth_mcp_toolset_test.py(agentregistry_adk_auth_mcp_toolset)agentregistry/adk/resolve_auth_bindings.py+resolve_auth_bindings_test.py(agentregistry_adk_resolve_auth_bindings)agentregistry/adk/resolve_auth_bindings_3lo.py+resolve_auth_bindings_3lo_test.py(agentregistry_adk_resolve_auth_bindings_3lo)agentregistry/adk/mcp_custom_headers.py+mcp_custom_headers_test.py(agentregistry_adk_mcp_custom_headers)API & Test Infrastructure Notes
agentregistry/adk/requirements.txt,noxfile_config.py, andagentregistry/README.mdfrom feat(agentregistry): add ADK and Agent Engine samples with CI scaffolding #15002, plusagentregistry.googleapis.comenablement and fixture setup on the shared test project (AGENTREGISTRY_TEST_AGENT_ID,AGENTREGISTRY_TEST_MCP_SERVER_ID).AGENTREGISTRY_TEST_3LO_MCP_SERVER_IDandAGENTREGISTRY_TEST_EXTERNAL_MCP_SERVER_ID(these tests skip cleanly when not set;test_my_auth_headersruns as a unit test without API calls).Checklist
Testing
agentregistry.googleapis.comenablement, and fixture setup in the shared test project.)Compliance & Style
Post-Approval Actions