You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 590376d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(auth): support mTLS in requests.Request for token refresh and impersonation (#18486)
Credential token refreshes and Regional Access Boundary lookups (such as
`impersonated_credentials` calling `iamcredentials.mtls.googleapis.com`)
make HTTP requests through `google.auth.transport.requests.Request`.
Because only `AuthorizedSession` previously configured
`_MutualTlsAdapter`, bare `Request` calls to `.mtls.googleapis.com`
endpoints did not present a client certificate and failed with `401
Unauthorized` when using certificate-bound tokens.
This change lazily mounts `_MutualTlsAdapter` per mTLS origin
(`https://<host>/`) on `requests.Request` when client certificates are
enabled, preserving existing `HTTPAdapter` settings and supporting
`copy.deepcopy` so background RAB refresh threads can clone the
transport without reloading certificates.
Fixes: b/555142182
Note: This change is based on
#18381, which will
be broken into 4 smaller PRs. This first PR is scoped to
google.auth.transport.requests.Request to unblock the primary request
path. Equivalent support for google.auth.transport.urllib3.Request and
certificate rotation support for both transports will follow in separate
PRs.
0 commit comments