Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

auth: AuthorizedHttp.configure_mtls_channel() drops custom PoolManager settings

Aberta
#18,366 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
authentication

Direção de pesquisa

Comece em packages/google-auth/google/auth/transport/urllib3.py lendo _make_mutual_tls_http() e AuthorizedHttp.configure_mtls_channel(), depois compare o comportamento de preservação no transporte requests. Atualize a cobertura de testes unitários relacionada em packages/google-auth/tests/transport/test_urllib3.py para que as configurações personalizadas de retry, tamanho do pool, timeout e headers permaneçam após a configuração de mTLS, e execute esses testes.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

auth priority: p2 type: bug

In packages/google-auth/google/auth/transport/urllib3.py, calling AuthorizedHttp.configure_mtls_channel() replaces self.http by calling _make_mutual_tls_http(cert, key), which constructs a new urllib3.PoolManager(ssl_context=ctx) without copying non-SSL pool settings from the existing self.http instance.

When callers initialize AuthorizedHttp(credentials, http=custom_pool_manager) with custom retry policies (retries), connection pool sizing (maxsize, num_pools), timeouts (timeout), or default headers (headers), calling configure_mtls_channel() discards all of those custom configurations and emits a UserWarning stating that the http object provided in the constructor is overwritten.

By contrast, AuthorizedSession.configure_mtls_channel() in packages/google-auth/google/auth/transport/requests.py preserves custom retry and connection pool sizing (max_retries, pool_connections, pool_maxsize, pool_block) from the existing HTTPAdapter when mounting _MutualTlsAdapter.

Proposed Fix

Update _make_mutual_tls_http() in packages/google-auth/google/auth/transport/urllib3.py to accept optional PoolManager keyword arguments, and update AuthorizedHttp.configure_mtls_channel() to extract non-SSL configuration settings (retries, maxsize, block, timeout, headers, and num_pools) from self.http and forward them when constructing the mTLS PoolManager.

Update unit tests in packages/google-auth/tests/transport/test_urllib3.py to verify that custom retry, pool sizing, timeout, and header configurations on a user-provided PoolManager are preserved across configure_mtls_channel() calls.

Linguagem predominante
Python
Estrelas
5.4k
Forks
1.8k
Merge médio
2d 5h
PRs com merge (30d)
108

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de googleapis/google-cloud-python

Todas as issues de googleapis/google-cloud-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.