google-auth: Avoid auto-retrying 401s on streaming/non-repeatable payloads in sync HTTP transports
Mantenedores costumam responder em até 1 dia
@agrawalradhika-cell já está trabalhando nisso.
Desde 1/9/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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)
- Linguagem predominante
- Python
- Estrelas
- 5.4k
- Forks
- 1.8k
- Merge médio
- 2d 7h
- PRs com merge (30d)
- 173
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de googleapis/google-cloud-python
-
firestore: field path with a quoted name ending in a backslash is misparsedTalvez já em andamento @sebxt assumiu há 25 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
googleapis/google-cloud-python#18771 ·
Mantenedores costumam responder em até 1 dia
-
api: spanner type: feature request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
googleapis/google-cloud-python#18584 ·
Mantenedores costumam responder em até 1 dia
-
auth: `impersonated_credentials` loses `subject` on copy, so `with_scopes()` and `with_quota_project()` turn off domain wide delegationTalvez já em andamento @Om-singhaI assumiu há 55 dias. Abertaauth priority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
googleapis/google-cloud-python#18428 ·
Mantenedores costumam responder em até 1 dia
-
A client called `run_in_transaction` be stuck if Spanner is downTalvez já em andamento @founderinaction assumiu há 7 dias. Abertapriority: p2 type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
googleapis/google-cloud-python#18375 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
ci: enable --strict flag in presubmit twine_checkTalvez livre de novo @ohmayr assumiu há 44 dias e não há nenhum pull request aberto. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 76/100
googleapis/google-cloud-python#18339 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de googleapis/google-cloud-python
Issues semelhantes
-
plot_graph crashes when a mesh node has no m2m edgeTalvez já em andamento @tygvi assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
mllam/neural-lam#883 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
enhancement possible-duplicate
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
AOSSIE-Org/PictoPy#1715 · 2 comentários ·
Mantenedores costumam responder em até 6 dias
-
SQLite connector omits generated columns from the catalog, and drops relationships sourced on themAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NVIDIA/auto-ontology#511 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ethereum/execution-specs#3996 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
cpp-best-practices/project_validator#267 ·
Mantenedores costumam responder em até 1 dia