From eed9d02a2e2c3e0b7fcde6ad4d07d09832254eaa Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 13 Jun 2023 11:30:50 -0500 Subject: [PATCH] PYTHON-3731 Disable MONGODB-OIDC Auth for 4.4 (#1230) --- .evergreen/config.yml | 2 +- pymongo/auth.py | 1 - test/auth_aws/test_auth_oidc.py | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index f62cb0d0c..c3e8a3d1f 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -3204,7 +3204,7 @@ buildvariants: - matrix_name: "oidc-auth-test" matrix_spec: - platform: [ ubuntu-20.04 ] + platform: [ rhel84 ] python-version: ["3.9"] display_name: "MONGODB-OIDC Auth ${platform} ${python-version}" tasks: diff --git a/pymongo/auth.py b/pymongo/auth.py index ac7cb254e..00b6faa6f 100644 --- a/pymongo/auth.py +++ b/pymongo/auth.py @@ -510,7 +510,6 @@ _AUTH_MAP: Mapping[str, Callable] = { "MONGODB-CR": _authenticate_mongo_cr, "MONGODB-X509": _authenticate_x509, "MONGODB-AWS": _authenticate_aws, - "MONGODB-OIDC": _authenticate_oidc, "PLAIN": _authenticate_plain, "SCRAM-SHA-1": functools.partial(_authenticate_scram, mechanism="SCRAM-SHA-1"), "SCRAM-SHA-256": functools.partial(_authenticate_scram, mechanism="SCRAM-SHA-256"), diff --git a/test/auth_aws/test_auth_oidc.py b/test/auth_aws/test_auth_oidc.py index 26e71573d..7b42f98a1 100644 --- a/test/auth_aws/test_auth_oidc.py +++ b/test/auth_aws/test_auth_oidc.py @@ -28,12 +28,16 @@ from test.utils import EventListener from bson import SON from pymongo import MongoClient +from pymongo.auth import _AUTH_MAP, _authenticate_oidc from pymongo.auth_oidc import _CACHE as _oidc_cache from pymongo.cursor import CursorType from pymongo.errors import ConfigurationError, OperationFailure from pymongo.hello import HelloCompat from pymongo.operations import InsertOne +# Force MONGODB-OIDC to be enabled. +_AUTH_MAP["MONGODB-OIDC"] = _authenticate_oidc # type:ignore + class TestAuthOIDC(unittest.TestCase): uri: str