From 88719b831d6f02ca6f4af7db2139a38be6dd3d57 Mon Sep 17 00:00:00 2001 From: Oleksandr Poliakov Date: Thu, 11 Jul 2024 16:05:00 -0700 Subject: [PATCH] DRIVERS-2938: Remove MONGODB-CR from spec tests --- .../auth/tests/legacy/connection-string.json | 41 ------------------- .../auth/tests/legacy/connection-string.yml | 30 -------------- .../connection-string/tests/valid-auth.json | 27 ++---------- source/connection-string/tests/valid-auth.yml | 22 ++-------- .../tests/valid-options.json | 4 +- .../connection-string/tests/valid-options.yml | 4 +- 6 files changed, 10 insertions(+), 118 deletions(-) diff --git a/source/auth/tests/legacy/connection-string.json b/source/auth/tests/legacy/connection-string.json index d980a117e0..67aafbff6e 100644 --- a/source/auth/tests/legacy/connection-string.json +++ b/source/auth/tests/legacy/connection-string.json @@ -163,47 +163,6 @@ "uri": "mongodb://localhost/?authMechanism=GSSAPI", "valid": false }, - { - "description": "should recognize the mechanism (MONGODB-CR)", - "uri": "mongodb://user:password@localhost/?authMechanism=MONGODB-CR", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "admin", - "mechanism": "MONGODB-CR", - "mechanism_properties": null - } - }, - { - "description": "should use the database when no authSource is specified (MONGODB-CR)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "foo", - "mechanism": "MONGODB-CR", - "mechanism_properties": null - } - }, - { - "description": "should use the authSource when specified (MONGODB-CR)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR&authSource=bar", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "bar", - "mechanism": "MONGODB-CR", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if no username is supplied (MONGODB-CR)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-CR", - "valid": false - }, { "description": "should recognize the mechanism (MONGODB-X509)", "uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509", diff --git a/source/auth/tests/legacy/connection-string.yml b/source/auth/tests/legacy/connection-string.yml index 8b46dfb56a..ded258f29d 100644 --- a/source/auth/tests/legacy/connection-string.yml +++ b/source/auth/tests/legacy/connection-string.yml @@ -116,36 +116,6 @@ tests: - description: should throw an exception if no username (GSSAPI) uri: mongodb://localhost/?authMechanism=GSSAPI valid: false -- description: should recognize the mechanism (MONGODB-CR) - uri: mongodb://user:password@localhost/?authMechanism=MONGODB-CR - valid: true - credential: - username: user - password: password - source: admin - mechanism: MONGODB-CR - mechanism_properties: -- description: should use the database when no authSource is specified (MONGODB-CR) - uri: mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR - valid: true - credential: - username: user - password: password - source: foo - mechanism: MONGODB-CR - mechanism_properties: -- description: should use the authSource when specified (MONGODB-CR) - uri: mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR&authSource=bar - valid: true - credential: - username: user - password: password - source: bar - mechanism: MONGODB-CR - mechanism_properties: -- description: should throw an exception if no username is supplied (MONGODB-CR) - uri: mongodb://localhost/?authMechanism=MONGODB-CR - valid: false - description: should recognize the mechanism (MONGODB-X509) uri: mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509 valid: true diff --git a/source/connection-string/tests/valid-auth.json b/source/connection-string/tests/valid-auth.json index 176a54a096..60f63f4e3f 100644 --- a/source/connection-string/tests/valid-auth.json +++ b/source/connection-string/tests/valid-auth.json @@ -220,29 +220,8 @@ "options": null }, { - "description": "Escaped user info and database (MONGODB-CR)", - "uri": "mongodb://%24am:f%3Azzb%40z%2Fz%3D@127.0.0.1/admin%3F?authMechanism=MONGODB-CR", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "$am", - "password": "f:zzb@z/z=", - "db": "admin?" - }, - "options": { - "authmechanism": "MONGODB-CR" - } - }, - { - "description": "Subdelimiters in user/pass don't need escaping (MONGODB-CR)", - "uri": "mongodb://!$&'()*+,;=:!$&'()*+,;=@127.0.0.1/admin?authMechanism=MONGODB-CR", + "description": "Subdelimiters in user/pass don't need escaping (PLAIN)", + "uri": "mongodb://!$&'()*+,;=:!$&'()*+,;=@127.0.0.1/admin?authMechanism=PLAIN", "valid": true, "warning": false, "hosts": [ @@ -258,7 +237,7 @@ "db": "admin" }, "options": { - "authmechanism": "MONGODB-CR" + "authmechanism": "PLAIN" } }, { diff --git a/source/connection-string/tests/valid-auth.yml b/source/connection-string/tests/valid-auth.yml index f40c748fa6..02ed287428 100644 --- a/source/connection-string/tests/valid-auth.yml +++ b/source/connection-string/tests/valid-auth.yml @@ -173,24 +173,8 @@ tests: db: "my=db" options: ~ - - description: "Escaped user info and database (MONGODB-CR)" - uri: "mongodb://%24am:f%3Azzb%40z%2Fz%3D@127.0.0.1/admin%3F?authMechanism=MONGODB-CR" - valid: true - warning: false - hosts: - - - type: "ipv4" - host: "127.0.0.1" - port: ~ - auth: - username: "$am" - password: "f:zzb@z/z=" - db: "admin?" - options: - authmechanism: "MONGODB-CR" - - - description: "Subdelimiters in user/pass don't need escaping (MONGODB-CR)" - uri: "mongodb://!$&'()*+,;=:!$&'()*+,;=@127.0.0.1/admin?authMechanism=MONGODB-CR" + description: "Subdelimiters in user/pass don't need escaping (PLAIN)" + uri: "mongodb://!$&'()*+,;=:!$&'()*+,;=@127.0.0.1/admin?authMechanism=PLAIN" valid: true warning: false hosts: @@ -203,7 +187,7 @@ tests: password: "!$&'()*+,;=" db: "admin" options: - authmechanism: "MONGODB-CR" + authmechanism: "PLAIN" - description: "Escaped username (MONGODB-X509)" uri: "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509" diff --git a/source/connection-string/tests/valid-options.json b/source/connection-string/tests/valid-options.json index 3c79fe7ae5..6c86172d08 100644 --- a/source/connection-string/tests/valid-options.json +++ b/source/connection-string/tests/valid-options.json @@ -2,7 +2,7 @@ "tests": [ { "description": "Option names are normalized to lowercase", - "uri": "mongodb://alice:secret@example.com/admin?AUTHMechanism=MONGODB-CR", + "uri": "mongodb://alice:secret@example.com/admin?AUTHMechanism=PLAIN", "valid": true, "warning": false, "hosts": [ @@ -18,7 +18,7 @@ "db": "admin" }, "options": { - "authmechanism": "MONGODB-CR" + "authmechanism": "PLAIN" } }, { diff --git a/source/connection-string/tests/valid-options.yml b/source/connection-string/tests/valid-options.yml index d0d0f80fd3..86523c7f39 100644 --- a/source/connection-string/tests/valid-options.yml +++ b/source/connection-string/tests/valid-options.yml @@ -1,7 +1,7 @@ tests: - description: "Option names are normalized to lowercase" - uri: "mongodb://alice:secret@example.com/admin?AUTHMechanism=MONGODB-CR" + uri: "mongodb://alice:secret@example.com/admin?AUTHMechanism=PLAIN" valid: true warning: false hosts: @@ -14,7 +14,7 @@ tests: password: "secret" db: "admin" options: - authmechanism: "MONGODB-CR" + authmechanism: "PLAIN" - description: "Missing delimiting slash between hosts and options" uri: "mongodb://example.com?tls=true"