fix(auth): redact non-OAuth credential secrets from the auth request event - #6993
Open
herdiyana256 wants to merge 1 commit into
Open
fix(auth): redact non-OAuth credential secrets from the auth request event#6993herdiyana256 wants to merge 1 commit into
herdiyana256 wants to merge 1 commit into
Conversation
…th2 client secret The adk_request_credential event is streamed to the client and stored in the session, so the redaction applied before sending it must cover every secret the credential can carry. _credential_without_client_secret nulled only oauth2.client_secret, so for a non-OAuth scheme an api_key, an HTTP Basic password, or a service account private key reached the client verbatim through generate_auth_request and build_auth_request_event. The workflow human-in-the-loop path had the same oauth2-only gap in its own helper. Null api_key, http.credentials.password and the service account private_key alongside oauth2.client_secret on both paths. A normal OAuth2 request keeps its client_id and generated auth_uri and only loses client_secret.
herdiyana256
force-pushed
the
redact-nonoauth-secrets-in-auth-request
branch
from
September 2, 2026 18:31
4b0e988 to
132ae57
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.
The
adk_request_credentialevent is streamed to the client and appended to the session, so the redaction applied before it goes out has to cover every secret the credential can carry._credential_without_client_secretinauth/auth_handler.pyonly nulledoauth2.client_secret, and_generate_auth_requestreturns the auth config unchanged for any non-OAuth scheme, so anapi_key, an HTTP Basicpassword, or a service accountprivate_keyreached the client verbatim throughgenerate_auth_requestandflows/llm_flows/functions.py:build_auth_request_event, and stayed readable in the session. The workflow human-in-the-loop path had the same oauth2-only gap in its own_without_client_secrethelper.This is the same class the A2A relay path already handles by dropping the whole credential-bearing part (
agents/remote_a2a_agent.py), whose comment notes the arguments carry "an OAuth2 client secret or a service account key". The direct-to-client and workflow paths keep the non-secret fields the client legitimately needs (scheme,client_id, generatedauth_uri, state) and strip the secrets instead of the whole part.This change nulls
api_key,http.credentials.password, and the service accountprivate_keyalongsideoauth2.client_secreton both helpers. A normal OAuth2 request keeps itsclient_idand generatedauth_uriand only losesclient_secret, so the consent flow is unchanged. Adds unit tests for the API-key and service-account cases and updates the existing non-OAuth test that had asserted the full credential was returned.