Skip to content

Commit 4378652

Browse files
committed
feat(NODE-6473): remove MONGODB-CR auth
1 parent 3f7196e commit 4378652

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

src/cmap/auth/providers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/** @public */
22
export const AuthMechanism = Object.freeze({
33
MONGODB_AWS: 'MONGODB-AWS',
4-
MONGODB_CR: 'MONGODB-CR',
54
MONGODB_DEFAULT: 'DEFAULT',
65
MONGODB_GSSAPI: 'GSSAPI',
76
MONGODB_PLAIN: 'PLAIN',

src/mongo_client_auth_providers.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ const AUTH_PROVIDERS = new Map<
2121
AuthMechanism.MONGODB_AWS,
2222
({ AWS_CREDENTIAL_PROVIDER }) => new MongoDBAWS(AWS_CREDENTIAL_PROVIDER)
2323
],
24-
[
25-
AuthMechanism.MONGODB_CR,
26-
() => {
27-
throw new MongoInvalidArgumentError(
28-
'MONGODB-CR is no longer a supported auth mechanism in MongoDB 4.0+'
29-
);
30-
}
31-
],
3224
[AuthMechanism.MONGODB_GSSAPI, () => new GSSAPI()],
3325
[AuthMechanism.MONGODB_OIDC, properties => new MongoDBOIDC(getWorkflow(properties))],
3426
[AuthMechanism.MONGODB_PLAIN, () => new Plain()],

test/unit/connection_string.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ describe('Connection String', function () {
596596
it('should validate authMechanism', function () {
597597
expect(() => parseOptions('mongodb://localhost/?authMechanism=DOGS')).to.throw(
598598
MongoParseError,
599-
'authMechanism one of MONGODB-AWS,MONGODB-CR,DEFAULT,GSSAPI,PLAIN,SCRAM-SHA-1,SCRAM-SHA-256,MONGODB-X509,MONGODB-OIDC, got DOGS'
599+
'authMechanism one of MONGODB-AWS,DEFAULT,GSSAPI,PLAIN,SCRAM-SHA-1,SCRAM-SHA-256,MONGODB-X509,MONGODB-OIDC, got DOGS'
600600
);
601601
});
602602

0 commit comments

Comments
 (0)