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 e53eb7e51f2..1d9f8773933 100644 --- a/test/unit/connection_string.test.ts +++ b/test/unit/connection_string.test.ts @@ -595,7 +595,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' ); });