google-auth: Avoid auto-retrying 401s on streaming/non-repeatable payloads in sync HTTP transports
Les mainteneurs répondent en général sous 1 jour
@agrawalradhika-cell y travaille déjà.
Depuis le 1/9/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Determine this is the right repository
- I determined this is the correct repository in which to report this bug.
Summary of the issue
Description
In google.auth.transport.requests.AuthorizedSession and google.auth.transport.urllib3.AuthorizedHttp, receiving a 401 Unauthorized triggers an automatic credential refresh / mTLS channel reconfiguration, followed by a recursive request retry (self.request(...) / self.urlopen(...)).
If the request payload (data or body) is a streaming payload (e.g., a file-like object, generator, or iterator), the initial request consumes the stream. The recursive retry then blindly attempts to send the exact same exhausted stream instance. This results in transmitting a 0-byte body (Content-Length: 0) to the server on the retried attempt.
For streaming payloads, the transport should likely not attempt an automatic retry and instead return the 401 response to the caller so they can safely reconstruct the stream and retry on their end. See HLD: go/sdk-mds-bound-token
Note on implementation: If the fix involves short-circuiting the auto-retry for streaming payloads, it is critical that credential refresh and mTLS channel reconfiguration still execute prior to returning the 401. If the logic returns early before running self.credentials.refresh() and self.configure_mtls_channel(), the internal session state remains stale. When the caller reconstructs the stream and issues a manual retry, it will immediately fail again with the exact same expired token or old mTLS certificate.
Affected Files
packages/google-auth/google/auth/transport/requests.py(AuthorizedSession.request)packages/google-auth/google/auth/transport/urllib3.py(AuthorizedHttp.urlopen)
- Langage dominant
- Python
- Étoiles
- 5.4k
- Forks
- 1.8k
- Merge moyen
- 2 j 7 h
- PR mergées (30 j)
- 173
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de googleapis/google-cloud-python
-
firestore: field path with a quoted name ending in a backslash is misparsedPeut-être pris @sebxt l’a pris il y a 25 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
googleapis/google-cloud-python#18771 ·
Les mainteneurs répondent en général sous 1 jour
-
api: spanner type: feature request
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
googleapis/google-cloud-python#18584 ·
Les mainteneurs répondent en général sous 1 jour
-
auth: `impersonated_credentials` loses `subject` on copy, so `with_scopes()` and `with_quota_project()` turn off domain wide delegationPeut-être pris @Om-singhaI l’a pris il y a 55 jours. Ouverteauth priority: p2 type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
googleapis/google-cloud-python#18428 ·
Les mainteneurs répondent en général sous 1 jour
-
A client called `run_in_transaction` be stuck if Spanner is downPeut-être pris @founderinaction l’a pris il y a 7 jours. Ouvertepriority: p2 type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
googleapis/google-cloud-python#18375 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
ci: enable --strict flag in presubmit twine_checkPeut-être à nouveau libre @ohmayr l’a pris il y a 44 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 76/100
googleapis/google-cloud-python#18339 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de googleapis/google-cloud-python
Issues similaires
-
plot_graph crashes when a mesh node has no m2m edgePeut-être pris @tygvi l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
mllam/neural-lam#883 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
enhancement possible-duplicate
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
AOSSIE-Org/PictoPy#1715 · 2 commentaires ·
Les mainteneurs répondent en général sous 6 jours
-
SQLite connector omits generated columns from the catalog, and drops relationships sourced on themOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NVIDIA/auto-ontology#511 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ethereum/execution-specs#3996 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
cpp-best-practices/project_validator#267 ·
Les mainteneurs répondent en général sous 1 jour