From 4378652bec57cced87518fb0ce03b1b1651dcdc0 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 7 Oct 2025 13:43:17 -0400 Subject: [PATCH] feat(NODE-6473): remove MONGODB-CR auth --- src/cmap/auth/providers.ts | 1 - src/mongo_client_auth_providers.ts | 8 -------- test/unit/connection_string.test.ts | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/cmap/auth/providers.ts b/src/cmap/auth/providers.ts index 74e3638ecc5..fe6a57cef37 100644 --- a/src/cmap/auth/providers.ts +++ b/src/cmap/auth/providers.ts @@ -1,7 +1,6 @@ /** @public */ export const AuthMechanism = Object.freeze({ MONGODB_AWS: 'MONGODB-AWS', - MONGODB_CR: 'MONGODB-CR', MONGODB_DEFAULT: 'DEFAULT', MONGODB_GSSAPI: 'GSSAPI', MONGODB_PLAIN: 'PLAIN', diff --git a/src/mongo_client_auth_providers.ts b/src/mongo_client_auth_providers.ts index 54aab957a56..f458726db76 100644 --- a/src/mongo_client_auth_providers.ts +++ b/src/mongo_client_auth_providers.ts @@ -21,14 +21,6 @@ const AUTH_PROVIDERS = new Map< AuthMechanism.MONGODB_AWS, ({ AWS_CREDENTIAL_PROVIDER }) => new MongoDBAWS(AWS_CREDENTIAL_PROVIDER) ], - [ - AuthMechanism.MONGODB_CR, - () => { - throw new MongoInvalidArgumentError( - 'MONGODB-CR is no longer a supported auth mechanism in MongoDB 4.0+' - ); - } - ], [AuthMechanism.MONGODB_GSSAPI, () => new GSSAPI()], [AuthMechanism.MONGODB_OIDC, properties => new MongoDBOIDC(getWorkflow(properties))], [AuthMechanism.MONGODB_PLAIN, () => new Plain()], diff --git a/test/unit/connection_string.test.ts b/test/unit/connection_string.test.ts index 62adaab40bb..fa717a87017 100644 --- a/test/unit/connection_string.test.ts +++ b/test/unit/connection_string.test.ts @@ -596,7 +596,7 @@ describe('Connection String', function () { it('should validate authMechanism', function () { expect(() => parseOptions('mongodb://localhost/?authMechanism=DOGS')).to.throw( MongoParseError, - 'authMechanism one of MONGODB-AWS,MONGODB-CR,DEFAULT,GSSAPI,PLAIN,SCRAM-SHA-1,SCRAM-SHA-256,MONGODB-X509,MONGODB-OIDC, got DOGS' + 'authMechanism one of MONGODB-AWS,DEFAULT,GSSAPI,PLAIN,SCRAM-SHA-1,SCRAM-SHA-256,MONGODB-X509,MONGODB-OIDC, got DOGS' ); });