Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

auth: AuthorizedHttp.configure_mtls_channel() drops custom PoolManager settings

未關閉
#18,366 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
76/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python

研究方向

先在 packages/google-auth/google/auth/transport/urllib3.py 中閱讀 _make_mutual_tls_http() 和 AuthorizedHttp.configure_mtls_channel(),然後比較 requests 傳輸中的保留行為。更新 packages/google-auth/tests/transport/test_urllib3.py 中相關的單元測試涵蓋範圍,確保自訂的重試、池大小、逾時和標頭設定在 mTLS 設定後仍然保留,並執行這些測試。

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
5.4k
分支
1.8k
平均合併
2 天 5 小時
30 天內合併 PR
108

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

googleapis/google-cloud-python 的其他 Issue

查看 googleapis/google-cloud-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。