GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(auth): parse hostname for mTLS and PSC endpoint certificate rotat… by attharva-24 · Pull Request #18153 · googleapis/google-cloud-python Conversation
Contributor
Fixes #18147 DescriptionThis PR resolves two defects in the mTLS endpoint detection logic previously used in
Tests
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request centralizes and improves mTLS endpoint detection by introducing the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
attharva-24
force-pushed
the
fix-mtls-url-check
branch
from
e33b6c9 to
f217bfc
Compare
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code ReviewThis pull request refactors the mTLS endpoint detection logic by introducing a centralized
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+866
to
+876
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In To prevent this and ensure robust compatibility with
Suggested change
References
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @attharva-24 PTAL
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in the latest commit!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
attharva-24
force-pushed
the
fix-mtls-url-check
branch
from
f217bfc to
7fecb67
Compare
macastelaz
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I believe technically FQDNs can end with a trailing root dot (e.g. "https://pubsub.mtls.googleapis.com." is technically valid - although not expected in the wild). For complete coverage, perhaps we should also strip "." (e.g. hostname = hostname.rstrip(".").lower();
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added .rstrip(".") before matching so trailing root dots on FQDNs are stripped cleanly, along with unit test cases for standard mTLS, PSC, exact hosts, and edge cases.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This lacks examples with explicit port numbers (example: https://pubsub.mtls.googleapis.com:443/v1) and queries and fragments (e.g. "https://pubsub.mtls.googleapis.com/v1/projects?pageSize=10#frag")
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added unit test cases in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a bare PSC case (example "https://p.googleapis.com").
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally a case like https://[2001:db8::1]:443/mtls.googleapis.com would be good to demonstrated handling of IPv6 syntax handling
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added "p.googleapis.com" to Added IPv6 test cases (https://[2001:db8::1]:443/mtls.googleapis.com and https://[::1]:8443/mtls.googleapis.com) to confirm that bracketed IPv6 host syntax is handled properly.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of Any can you use "object"? I think ideally we'd avoid usage of Any wherever possible.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @@ -937,9 +940,19 @@ def test_cert_rotation_logic_skipped_on_other_refresh_status_codes(self): | |||
| # Assert mTLS check logic was SKIPPED (Inner Check was False) | |||
| assert not mock_helper.check_parameters_for_unauthorized_response.called | |||
|
|
|||
| def test_cert_rotation_skipped_on_non_mtls_url(self): | |||
| @pytest.mark.parametrize( | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this is redundant - these transports are no longer responsible for mtls checks themselves and the thing under test here shouldn't be if various forms on non-mtls endpoints are detected correctly (that is already covered in the new mtls_helper tests). Instead, I'd suggest just covering one example of mtls and one example of non mtls here to cover the requests logic specifically. Same for urllib3
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks like just this comment is pending and then I'll take one more look.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Simplified the transport test cases. One represents mTLS endpoint and one represents non-mTLS endpoint, while keeping the full endpoint permutations covered in test__mtls_helper.py.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7fecb67 to
6f85765
Compare
…ion (googleapis#18147) * Isolate hostname using urllib.parse.urlsplit in _mtls_helper.is_mtls_endpoint * Eliminate false positives on non-mTLS URLs containing mtls substrings in paths/queries * Add support for Private Service Connect (*.p.googleapis.com) custom mTLS endpoints * Update AuthorizedSession and AuthorizedHttp to use shared is_mtls_endpoint helper * Add comprehensive unit tests in test__mtls_helper, test_requests, and test_urllib3 Fixes googleapis#18147 Follow-up to googleapis#17928
dafe9d1 to
2eb5fe3
Compare
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- <details><summary>django-google-spanner: 5.0.1</summary> ## [5.0.1](django-google-spanner-v5.0.0...django-google-spanner-v5.0.1) (2026-08-21) ### Bug Fixes * **django-spanner:** declare django dependency in setup.py ([#18044](#18044)) ([c341469](c341469)) ### Documentation * **django-spanner, common-protos:** centralize CONTRIBUTING.rst pointers ([#18041](#18041)) ([2b056ab](2b056ab)) </details> <details><summary>gapic-generator: 1.39.0</summary> ## [1.39.0](gapic-generator-v1.38.0...gapic-generator-v1.39.0) (2026-08-21) ### Features * **generator:** add fallback compatibility imports for google-api-core helpers ([#17999](#17999)) ([9c13ae2](9c13ae2)) ### Bug Fixes * **generator:** check for api_version header in metadata list ([#18015](#18015)) ([0e63510](0e63510)) * **generator:** move version checks after __all__ in __init__.py temlate ([#18100](#18100)) ([d0efb4d](d0efb4d)) * **generator:** switch core_deps_from_source to DEFAULT_PYTHON_VERSION ([#18050](#18050)) ([895ffa2](895ffa2)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>gcp-sphinx-docfx-yaml: 3.3.2</summary> ## [3.3.2](gcp-sphinx-docfx-yaml-v3.3.1...gcp-sphinx-docfx-yaml-v3.3.2) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-ads-admanager: 0.10.2</summary> ## [0.10.2](google-ads-admanager-v0.10.1...google-ads-admanager-v0.10.2) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-ads-datamanager: 0.9.2</summary> ## [0.9.2](google-ads-datamanager-v0.9.1...google-ads-datamanager-v0.9.2) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-api-core: 2.35.0</summary> ## [2.35.0](google-api-core-v2.34.0...google-api-core-v2.35.0) (2026-08-21) ### Features * **api_core:** add deprecation warning for grpcio < 1.83.0 for PQC ([#18045](#18045)) ([7e2e23e](7e2e23e)) ### Bug Fixes * **api_core:** improve rest path validation ([#17753](#17753)) ([63bfb96](63bfb96)) * **api_core:** support suppress_metrics_header fallback in AuthMetadataPlugin ([#18029](#18029)) ([dd2000d](dd2000d)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-apps-chat: 0.10.5</summary> ## [0.10.5](google-apps-chat-v0.10.4...google-apps-chat-v0.10.5) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-auth: 2.57.0</summary> ## [2.57.0](google-auth-v2.56.3...google-auth-v2.57.0) (2026-08-21) ### Features * **auth:** add deprecation warning for grpcio < 1.83.0 (PQC support) ([#18070](#18070)) ([68bdaba](68bdaba)) ### Bug Fixes * **auth:** parse hostname for mTLS and PSC endpoint certificate rotat… ([#18153](#18153)) ([b642373](b642373)) * **auth:** prevent TypeError and support home-dir cert fallback for X… ([#18016](#18016)) ([b9a1379](b9a1379)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-auth-httplib2: 0.4.2</summary> ## [0.4.2](google-auth-httplib2-v0.4.1...google-auth-httplib2-v0.4.2) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-auth-oauthlib: 1.4.1</summary> ## [1.4.1](google-auth-oauthlib-v1.4.0...google-auth-oauthlib-v1.4.1) (2026-08-21) ### Bug Fixes * **google-auth-oauthlib:** prevent port re-use on windows ([#18166](#18166)) ([e20796a](e20796a)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-alloydb: 0.11.1</summary> ## [0.11.1](google-cloud-alloydb-v0.11.0...google-cloud-alloydb-v0.11.1) (2026-08-21) ### Features * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-cloud-audit-log: 0.6.2</summary> ## [0.6.2](google-cloud-audit-log-v0.6.1...google-cloud-audit-log-v0.6.2) (2026-08-21) ### Bug Fixes * `google-cloud-audit-log` wheel installs unintended top-level `docs` package ([#17271](#17271)) ([ad99ed1](ad99ed1)) </details> <details><summary>google-cloud-auditmanager: 0.3.1</summary> ## [0.3.1](google-cloud-auditmanager-v0.3.0...google-cloud-auditmanager-v0.3.1) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-cloud-automl: 2.20.1</summary> ## [2.20.1](google-cloud-automl-v2.20.0...google-cloud-automl-v2.20.1) (2026-08-21) ### Bug Fixes * **automl:** remove unused libcst extra and constraints ([#18056](#18056)) ([9ba4449](9ba4449)) </details> <details><summary>google-cloud-bigquery: 3.44.0</summary> ## [3.44.0](google-cloud-bigquery-v3.43.0...google-cloud-bigquery-v3.44.0) (2026-08-21) ### Features * add PendingDeprecationWarning for to_dataframe and to_arrow conversion methods ([#18021](#18021)) ([6bebf30](6bebf30)) * **bigquery:** add PendingDeprecationWarning for from_dataframe methods ([#18048](#18048)) ([b84b754](b84b754)) * **bigquery:** support queryResultsFormat and compressionCodec in query_and_wait ([#18027](#18027)) ([d172408](d172408)) * check python and dependency versions in bigquery and ndb ([#18075](#18075)) ([62ff6f3](62ff6f3)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-bigquery-reservation: 1.26.0</summary> ## [1.26.0](google-cloud-bigquery-reservation-v1.25.0...google-cloud-bigquery-reservation-v1.26.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-bigquery-storage: 2.41.0</summary> ## [2.41.0](google-cloud-bigquery-storage-v2.40.0...google-cloud-bigquery-storage-v2.41.0) (2026-08-21) ### Features * add pandas-gbq to optional extras ([#18020](#18020)) ([fe91d93](fe91d93)) * **bigquery-storage:** add deprecation warning for to_dataframe ([#18022](#18022)) ([57e7822](57e7822)) * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) ### Bug Fixes * **storage:** support updated GapicCallable metadata in tests ([#18031](#18031)) ([24fe2e3](24fe2e3)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-bigtable: 2.43.0</summary> ## [2.43.0](google-cloud-bigtable-v2.42.0...google-cloud-bigtable-v2.43.0) (2026-08-21) ### Features * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-build: 3.39.0</summary> ## [3.39.0](google-cloud-build-v3.38.1...google-cloud-build-v3.39.0) (2026-08-21) ### Features * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-cloud-commerceproducer: 0.1.2</summary> ## [0.1.2](google-cloud-commerceproducer-v0.1.1...google-cloud-commerceproducer-v0.1.2) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-compute: 1.51.0</summary> ## [1.51.0](google-cloud-compute-v1.50.0...google-cloud-compute-v1.51.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-compute-v1beta: 0.12.2</summary> ## [0.12.2](google-cloud-compute-v1beta-v0.12.1...google-cloud-compute-v1beta-v0.12.2) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-core: 2.7.0</summary> ## [2.7.0](google-cloud-core-v2.6.1...google-cloud-core-v2.7.0) (2026-08-21) ### Features * **core:** implement PEP 0810 explicit lazy imports in google-cloud-core ([#18052](#18052)) ([5a7ed02](5a7ed02)) ### Bug Fixes * use lowercase x-goog-api-client header ([#18064](#18064)) ([d465d1e](d465d1e)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-dataform: 0.11.3</summary> ## [0.11.3](google-cloud-dataform-v0.11.2...google-cloud-dataform-v0.11.3) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-cloud-datastore: 2.26.1</summary> ## [2.26.1](google-cloud-datastore-v2.26.0...google-cloud-datastore-v2.26.1) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-dns: 0.37.1</summary> ## [0.37.1](google-cloud-dns-v0.37.0...google-cloud-dns-v0.37.1) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-documentai-toolbox: 0.17.3</summary> ## [0.17.3](google-cloud-documentai-toolbox-v0.17.2...google-cloud-documentai-toolbox-v0.17.3) (2026-08-21) ### Bug Fixes * **documentai-toolbox:** contain split_pdf output to output_path ([#18063](#18063)) ([d206212](d206212)) * **documentai-toolbox:** enable autoescape in export_hocr_str ([#18140](#18140)) ([0d671d2](0d671d2)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-error-reporting: 1.16.1</summary> ## [1.16.1](google-cloud-error-reporting-v1.16.0...google-cloud-error-reporting-v1.16.1) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-firestore: 2.29.0</summary> ## [2.29.0](google-cloud-firestore-v2.28.1...google-cloud-firestore-v2.29.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-iam: 2.25.0</summary> ## [2.25.0](google-cloud-iam-v2.24.1...google-cloud-iam-v2.25.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-logging: 3.16.3</summary> ## [3.16.3](google-cloud-logging-v3.16.2...google-cloud-logging-v3.16.3) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-monitoring-dashboards: 3.0.0</summary> ## [3.0.0](google-cloud-monitoring-dashboards-v2.22.0...google-cloud-monitoring-dashboards-v3.0.0) (2026-08-21) ### ⚠ BREAKING CHANGES * Remove erroneous google/monitoring/dashboard clients ([#18165](#18165)) ### Bug Fixes * Remove erroneous google/monitoring/dashboard clients ([#18165](#18165)) ([fb0c1b9](fb0c1b9)) </details> <details><summary>google-cloud-ndb: 2.6.0</summary> ## [2.6.0](google-cloud-ndb-v2.5.1...google-cloud-ndb-v2.6.0) (2026-08-21) ### Features * check python and dependency versions in bigquery and ndb ([#18075](#18075)) ([62ff6f3](62ff6f3)) ### Bug Fixes * **ndb:** avoid unbound lock in delete callback ([#17969](#17969)) ([c513b39](c513b39)) * **ndb:** use the single-argument generator.throw() signature ([#18159](#18159)) ([dfb0e36](dfb0e36)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-oracledatabase: 0.6.2</summary> ## [0.6.2](google-cloud-oracledatabase-v0.6.1...google-cloud-oracledatabase-v0.6.2) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-pubsub: 2.39.2</summary> ## [2.39.2](google-cloud-pubsub-v2.39.1...google-cloud-pubsub-v2.39.2) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-recaptcha-enterprise: 1.33.0</summary> ## [1.33.0](google-cloud-recaptcha-enterprise-v1.32.0...google-cloud-recaptcha-enterprise-v1.33.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-retail: 2.12.0</summary> ## [2.12.0](google-cloud-retail-v2.11.0...google-cloud-retail-v2.12.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-runtimeconfig: 0.37.1</summary> ## [0.37.1](google-cloud-runtimeconfig-v0.37.0...google-cloud-runtimeconfig-v0.37.1) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-spanner: 3.70.0</summary> ## [3.70.0](google-cloud-spanner-v3.69.1...google-cloud-spanner-v3.70.0) (2026-08-21) ### Features * check python and dependency versions in spanner packages ([#18177](#18177)) ([b4d9717](b4d9717)) * **spanner:** add DataBoost and auto_partition_mode support to DBAPI driver ([#18161](#18161)) ([5bc3899](5bc3899)) ### Bug Fixes * **spanner:** buffer returned rows in autocommit DML statements ([#18152](#18152)) ([7f8a552](7f8a552)) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-storage: 3.14.0</summary> ## [3.14.0](google-cloud-storage-v3.13.1...google-cloud-storage-v3.14.0) (2026-08-21) ### Features * **storage:** expose metadata parameter in asyncio gRPC calls ([#17634](#17634)) ([aaa263d](aaa263d)) * **storage:** expose object_metadata on AsyncMultiRangeDownloader ([#17411](#17411)) ([a0171ae](a0171ae)) ### Bug Fixes * **storage:** add retry support for finalize and close in AsyncAppendableObjectWriter ([#17733](#17733)) ([92bb6dc](92bb6dc)) * **storage:** ensure bidi-gRPC stream is cleaned up on open failure and close ([#18119](#18119)) ([ac0dfd1](ac0dfd1)) * **storage:** resume bidi reads after idle-stream aborts ([#18061](#18061)) ([3fe1e21](3fe1e21)) * use lowercase x-goog-api-client header ([#18064](#18064)) ([d465d1e](d465d1e)) ### Documentation * correct typos and grammar in README ([#16535](#16535)) ([593a8b0](593a8b0)) * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-storage-control: 1.14.0</summary> ## [1.14.0](google-cloud-storage-control-v1.13.0...google-cloud-storage-control-v1.14.0) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-cloud-support: 0.5.3</summary> ## [0.5.3](google-cloud-support-v0.5.2...google-cloud-support-v0.5.3) (2026-08-21) ### Features * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-cloud-testutils: 1.9.3</summary> ## [1.9.3](google-cloud-testutils-v1.9.2...google-cloud-testutils-v1.9.3) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>google-cloud-vectorsearch: 0.11.2</summary> ## [0.11.2](google-cloud-vectorsearch-v0.11.1...google-cloud-vectorsearch-v0.11.2) (2026-08-21) ### Features * update googleapis and regenerate ([#18087](#18087)) ([db1622a](db1622a)) </details> <details><summary>google-devicesandservices-health: 0.1.2</summary> ## [0.1.2](google-devicesandservices-health-v0.1.1...google-devicesandservices-health-v0.1.2) (2026-08-21) ### Features * update sources and regenerate ([#18164](#18164)) ([5ff8274](5ff8274)) </details> <details><summary>google-resumable-media: 2.10.2</summary> ## [2.10.2](google-resumable-media-v2.10.1...google-resumable-media-v2.10.2) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>googleapis-common-protos: 1.75.2</summary> ## [1.75.2](googleapis-common-protos-v1.75.1...googleapis-common-protos-v1.75.2) (2026-08-21) ### Documentation * **django-spanner, common-protos:** centralize CONTRIBUTING.rst pointers ([#18041](#18041)) ([2b056ab](2b056ab)) </details> <details><summary>pandas-gbq: 0.35.2</summary> ## [0.35.2](pandas-gbq-v0.35.1...pandas-gbq-v0.35.2) (2026-08-21) ### Bug Fixes * **pandas-gbq:** reject backticks in parse_table_id ([#18156](#18156)) ([f687060](f687060)) </details> <details><summary>proto-plus: 1.28.4</summary> ## [1.28.4](proto-plus-v1.28.3...proto-plus-v1.28.4) (2026-08-21) ### Documentation * **handwritten:** centralize CONTRIBUTING.rst pointers ([#17642](#17642)) ([23b9499](23b9499)) </details> <details><summary>sqlalchemy-spanner: 1.20.0</summary> ## [1.20.0](sqlalchemy-spanner-v1.19.0...sqlalchemy-spanner-v1.20.0) (2026-08-21) ### Features * **sqlalchemy-spanner:** export MAX_SIZE constant ([#17922](#17922)) ([e15c21d](e15c21d)) * **sqlalchemy-spanner:** native UUID data type support in dialect ([#17913](#17913)) ([6431932](6431932)) ### Bug Fixes * bump sqlparse from 0.5.5 to 0.6.0 in /packages/sqlalchemy-spanner ([#18136](#18136)) ([3ba7d02](3ba7d02)) * **sqlalchemy-spanner:** fix get_multi_indexes crash on SEARCH indexes ([#17907](#17907)) ([5b2da81](5b2da81)) * **sqlalchemy-spanner:** register TOKENLIST in _type_map for reflection ([#17911](#17911)) ([788208b](788208b)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…ion (#18147) (#18201) Relands #18153 with all review feedback addressed, full test coverage, and live manual verification against Google Cloud mTLS endpoints. Fixes #18147 ### Changes * Replaced naive `any(prefix in url for prefix in MTLS_URL_PREFIXES)` substring matching with `_mtls_helper.is_mtls_endpoint(url)`. * Parsed hostname using `urllib.parse.urlsplit` to avoid false positives on URL path/query parameters. * Added support for Private Service Connect (PSC) custom domains (`*.p.googleapis.com`, `p.googleapis.com`). * Normalized hostnames by stripping trailing root dots (`.rstrip(".")`) for FQDNs. * Annotated `is_mtls_endpoint` with `object` instead of `Any` for strict static type checking. * Added comprehensive parametrized unit tests (57 cases in `test__mtls_helper.py`). --- ### Manual Verification & Findings 1. **Non-mTLS URLs (`storage.googleapis.com`)**: On receiving `401 Unauthorized`, `AuthorizedSession` executes the standard OAuth token refresh & retry (2 HTTP requests: 401 ➔ 200 OK), and completely **skips certificate rotation (`spy_check Call Count: 0`)**. 2. **PSC / mTLS URLs (`storage.p.googleapis.com`)**: On receiving `401 Unauthorized`, `AuthorizedSession` **triggers certificate rotation inspection (`spy_check Call Count: 1`)** before refreshing credentials and retrying with `200 OK`. <details> <summary><b>Click to expand Live Manual Test Output (100% Green)</b></summary> ```text ======================================================================== Real Production mTLS Certificate & Endpoint Live Manual Verification ======================================================================== =========================================================================== >>> 1. INSPECTING ACTUAL CLIENT CERTIFICATE ON MACHINE =========================================================================== Client Certificate Status: LOADED FROM DISK / ECP Certificate Size: 1428 bytes Private Key Size: 1675 bytes Certificate Subject: <Name(CN=www.example.com,OU=Google Testing unit,O=Google Testing)> Certificate Issuer: <Name(CN=Google Testing Intermediate CA,OU=Google Testing unit,O=Google Testing)> SHA-256 Fingerprint: <SHA256_CERT_FINGERPRINT_REDACTED> =========================================================================== >>> 2. ESTABLISHING REAL LIVE mTLS HANDSHAKE (pubsub.mtls.googleapis.com) =========================================================================== Session mTLS Enabled: True Cached Cert Size in Session: 1428 bytes Connecting to: https://pubsub.mtls.googleapis.com/v1/projects/<PROJECT_ID>/topics Live mTLS Handshake Status: SUCCESS (HTTP 403) =========================================================================== >>> 3. LIVE 401 TEST: NON-mTLS URL WITH PATH TRAP (Bug 1 Fix) =========================================================================== Target URL: https://storage.googleapis.com/storage/v1/b/mtls.googleapis.com Notice: Path has 'mtls.googleapis.com', but host is standard 'storage.googleapis.com' HTTP Requests Sent: 2 (1st: 401 Unauthorized -> 2nd [Retry]: 200 OK) Endpoint Detected as mTLS: False (Expected: False) spy_check Call Count: 0 (Expected: 0) [PASS] Successfully avoided cert rotation check (0 calls) despite 401 and retry! =========================================================================== >>> 4. LIVE 401 TEST: PRIVATE SERVICE CONNECT (PSC) URL (Bug 2 Fix) =========================================================================== Target URL: https://storage.p.googleapis.com/b/production-bucket Notice: Private Service Connect domain (*.p.googleapis.com) HTTP Requests Sent: 2 (1st: 401 Unauthorized -> 2nd [Retry]: 200 OK) Endpoint Detected as mTLS: True (Expected: True) spy_check Call Count: 1 (Expected: 1 on 401) Cert Check Triggered: True (Inspected disk certificate and computed fingerprint) [PASS] Successfully triggered cert inspection on 401 (1 call) and retried with 200 OK! ======================================================================== ALL REAL CERTIFICATE LIVE MANUAL TESTS PASSED SUCCESSFULLY! (100% GREEN) ========================================================================
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Fix(auth): incorrect mTLS endpoint detection causes false positive cert rotations and breaks PSC endpoints
There was an error while loading. Please reload this page.