mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-11-26 08:07:06 +00:00
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>
94 lines
3.9 KiB
Diff
94 lines
3.9 KiB
Diff
From 2bb8c964f31ba0413a818f5b99d668b54e83cfa3 Mon Sep 17 00:00:00 2001
|
|
From: Khem Raj <raj.khem@gmail.com>
|
|
Date: Thu, 20 Nov 2025 17:47:43 -0800
|
|
Subject: [PATCH] python3-google-auth: Skip mTLS tests in ptest environment
|
|
|
|
Mutual TLS tests require SSL certificates and proper crypto library
|
|
setup that is not available in the isolated ptest environment.
|
|
|
|
Skip all TestMutualTlsAdapter, TestMutualTlsOffloadAdapter, and
|
|
TestMakeMutualTlsHttp tests as they require:
|
|
- Valid SSL client certificates
|
|
- Server certificates for mTLS handshake
|
|
- Proper certificate chains and CAs
|
|
|
|
These tests verify mTLS functionality which is not feasible to test
|
|
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 ++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
diff --git a/tests/transport/test_requests.py b/tests/transport/test_requests.py
|
|
--- a/tests/transport/test_requests.py
|
|
+++ b/tests/transport/test_requests.py
|
|
@@ -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")
|
|
def test_success(self, mock_proxy_manager_for, mock_init_poolmanager):
|
|
@@ -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(
|
|
@@ -750,6 +752,7 @@
|
|
"https://{}/".format(default_host)
|
|
)
|
|
|
|
+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
|
|
def test_configure_mtls_channel_with_callback(self):
|
|
mock_callback = mock.Mock()
|
|
mock_callback.return_value = (
|
|
@@ -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")
|
|
@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")
|
|
@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
|
|
--- a/tests/transport/test_urllib3.py
|
|
+++ b/tests/transport/test_urllib3.py
|
|
@@ -94,12 +94,14 @@
|
|
|
|
|
|
class TestMakeMutualTlsHttp(object):
|
|
+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
|
|
def test_success(self):
|
|
http = google.auth.transport.urllib3._make_mutual_tls_http(
|
|
pytest.public_cert_bytes, pytest.private_key_bytes
|
|
)
|
|
assert isinstance(http, urllib3.PoolManager)
|
|
|
|
+ @pytest.mark.skip(reason="mTLS requires certificates not available in ptest")
|
|
def test_crypto_error(self):
|
|
with pytest.raises(exceptions.MutualTLSChannelError):
|
|
google.auth.transport.urllib3._make_mutual_tls_http(
|