@@ -18,31 +18,30 @@ in the embedded ptest runtime without external certificate infrastructure.
Upstream-Status: Inappropriate [ptest environment limitation]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
- tests/transport/test_requests.py | 6 ++++++
- tests/transport/test_urllib3.py | 2 ++
+ tests/transport/test_requests.py | 6 ++++++
+ tests/transport/test_urllib3.py | 2 ++
2 files changed, 8 insertions(+)
diff --git a/tests/transport/test_requests.py b/tests/transport/test_requests.py
-index f14ccea..6a1cc55 100644
--- a/tests/transport/test_requests.py
+++ b/tests/transport/test_requests.py
-@@ -178,6 +178,7 @@ class TimeTickAdapterStub(AdapterStub):
+@@ -504,6 +504,7 @@
+
+
class TestMutualTlsAdapter(object):
++ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
@mock.patch.object(requests.adapters.HTTPAdapter, "init_poolmanager")
@mock.patch.object(requests.adapters.HTTPAdapter, "proxy_manager_for")
-+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
def test_success(self, mock_proxy_manager_for, mock_init_poolmanager):
- adapter = google.auth.transport.requests._MutualTlsAdapter(
- pytest.public_cert_bytes, pytest.private_key_bytes
-@@ -189,6 +190,7 @@ class TestMutualTlsAdapter(object):
- adapter.proxy_manager_for()
- mock_proxy_manager_for.assert_called_with(ssl_context=adapter._ctx_proxymanager)
+@@ -530,6 +531,7 @@
+ assert adapter._ctx_poolmanager.verify_mode == ssl.CERT_NONE
+ assert adapter._ctx_proxymanager.verify_mode == ssl.CERT_NONE
+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
def test_invalid_cert_or_key(self):
with pytest.raises(exceptions.MutualTLSChannelError):
google.auth.transport.requests._MutualTlsAdapter(
-@@ -408,6 +410,7 @@ class TestAuthorizedSession(object):
+@@ -750,6 +752,7 @@
"https://{}/".format(default_host)
)
@@ -50,35 +49,34 @@ index f14ccea..6a1cc55 100644
def test_configure_mtls_channel_with_callback(self):
mock_callback = mock.Mock()
mock_callback.return_value = (
-@@ -432,6 +435,7 @@ class TestAuthorizedSession(object):
+@@ -771,6 +774,7 @@
+ google.auth.transport.requests._MutualTlsAdapter,
+ )
+
++ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
@mock.patch(
"google.auth.transport._mtls_helper.get_client_cert_and_key", autospec=True
)
+@@ -1671,6 +1675,7 @@
+
+
+ class TestMutualTlsOffloadAdapter(object):
+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
- def test_configure_mtls_channel_with_metadata(self, mock_get_client_cert_and_key):
- mock_get_client_cert_and_key.return_value = (
- True,
-@@ -888,6 +892,7 @@ class TestMutualTlsOffloadAdapter(object):
- google.auth.transport._custom_tls_signer.CustomTlsSigner,
- "attach_to_ssl_context",
- )
-+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
- def test_success(
- self,
- mock_attach_to_ssl_context,
-@@ -921,6 +926,7 @@ class TestMutualTlsOffloadAdapter(object):
- google.auth.transport._custom_tls_signer.CustomTlsSigner,
- "attach_to_ssl_context",
- )
+ @mock.patch.object(requests.adapters.HTTPAdapter, "init_poolmanager")
+ @mock.patch.object(requests.adapters.HTTPAdapter, "proxy_manager_for")
+ @mock.patch.object(
+@@ -1701,6 +1706,7 @@
+ adapter.proxy_manager_for()
+ mock_proxy_manager_for.assert_called_with(ssl_context=adapter._ctx_proxymanager)
+
+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
- def test_success_should_use_provider(
- self,
- mock_attach_to_ssl_context,
+ @mock.patch.object(requests.adapters.HTTPAdapter, "init_poolmanager")
+ @mock.patch.object(requests.adapters.HTTPAdapter, "proxy_manager_for")
+ @mock.patch.object(
diff --git a/tests/transport/test_urllib3.py b/tests/transport/test_urllib3.py
-index 3367403..88d0963 100644
--- a/tests/transport/test_urllib3.py
+++ b/tests/transport/test_urllib3.py
-@@ -94,12 +94,14 @@ class ResponseStub(object):
+@@ -94,12 +94,14 @@
class TestMakeMutualTlsHttp(object):
@@ -93,6 +91,3 @@ index 3367403..88d0963 100644
def test_crypto_error(self):
with pytest.raises(exceptions.MutualTLSChannelError):
google.auth.transport.urllib3._make_mutual_tls_http(
-2.43.0
-
similarity index 90%
rename from meta-python/recipes-devtools/python/python3-google-auth_2.57.0.bb
rename to meta-python/recipes-devtools/python/python3-google-auth_2.62.2.bb
@@ -9,7 +9,7 @@ SRC_URI += " \
file://0001-python3-google-auth-Skip-mTLS-tests-in-ptest-environ.patch \
file://run-ptest \
"
-SRC_URI[sha256sum] = "9b4f96d6a1feb5f7201231f47cfb3de08d8f176f8a61f9e461555116e95a8789"
+SRC_URI[sha256sum] = "046c61a72d3a847d6df6417a7f0d5cf054e3b82bbcb54fb1e69d47880964049c"
RDEPENDS:${PN}-ptest += " \
python3-aioresponses \
@@ -28,6 +28,7 @@ RDEPENDS:${PN}-ptest += " \
python3-responses \
python3-unittest-automake-output \
python3-unixadmin \
+ python3-zoneinfo \
"
do_install_ptest() {
Rework the mTLS test skip patch for the reorganized tests. The transport tests import zoneinfo; add python3-zoneinfo to the ptest RDEPENDS. Changes: - oauth2.verify_firebase_token now validates the Firebase issuer and subject and warns when the audience is omitted (2.62.2). - mTLS: fix races during certificate rotation on 401 responses, use an unencrypted key for rotation, support mTLS in requests.Request refresh/impersonation, and add aiohttp reconfiguration on cert mismatch. - Add bound access and ID tokens for GKE and Cloud Run; sync credentials in AsyncAuthorizedSession; strip -fips from the AWS service name in SigV4 signing; declare Python 3.15 support. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> --- ...uth-Skip-mTLS-tests-in-ptest-environ.patch | 65 +++++++++---------- ....57.0.bb => python3-google-auth_2.62.2.bb} | 3 +- 2 files changed, 32 insertions(+), 36 deletions(-) rename meta-python/recipes-devtools/python/{python3-google-auth_2.57.0.bb => python3-google-auth_2.62.2.bb} (90%)