From b0e4afba2872044b0e4fd46ad9d9bbf4fef38024 Mon Sep 17 00:00:00 2001 From: Maxim Katcharov Date: Fri, 7 Jun 2024 09:51:27 -0600 Subject: [PATCH] Add authMechanism option where needed, minor fixes --- source/connection-string/connection-string-spec.md | 4 ++-- source/connection-string/tests/valid-options.json | 2 +- source/connection-string/tests/valid-options.yml | 6 +++--- source/connection-string/tests/valid-warnings.json | 4 ++-- source/connection-string/tests/valid-warnings.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/connection-string/connection-string-spec.md b/source/connection-string/connection-string-spec.md index 07c7c87c2e..5ee78434a4 100644 --- a/source/connection-string/connection-string-spec.md +++ b/source/connection-string/connection-string-spec.md @@ -224,10 +224,10 @@ The values in connection options MUST be URL decoded by the parser. The values c ?readPreferenceTags=dc:ny,rack:1 ``` - Drivers MUST handle unencoded colon signs (":") within the value. For example, given the connection string: + Drivers MUST handle unencoded colon signs (":") within the value. For example, given the connection string option: ``` - ?authMechanismProperties=TOKEN_RESOURCE:mongodb://foo + authMechanismProperties=TOKEN_RESOURCE:mongodb://foo ``` the driver MUST interpret the key as `TOKEN_RESOURCE` and the value as `mongodb://foo`. diff --git a/source/connection-string/tests/valid-options.json b/source/connection-string/tests/valid-options.json index 3d174c5abe..3c79fe7ae5 100644 --- a/source/connection-string/tests/valid-options.json +++ b/source/connection-string/tests/valid-options.json @@ -40,7 +40,7 @@ }, { "description": "Colon in a key value pair", - "uri": "mongodb://example.com?authMechanismProperties=TOKEN_RESOURCE:mongodb://test-cluster", + "uri": "mongodb://example.com/?authMechanism=MONGODB-OIDC&authMechanismProperties=TOKEN_RESOURCE:mongodb://test-cluster", "valid": true, "warning": false, "hosts": [ diff --git a/source/connection-string/tests/valid-options.yml b/source/connection-string/tests/valid-options.yml index d77cababb1..d0d0f80fd3 100644 --- a/source/connection-string/tests/valid-options.yml +++ b/source/connection-string/tests/valid-options.yml @@ -30,7 +30,7 @@ tests: tls: true - description: Colon in a key value pair - uri: mongodb://example.com?authMechanismProperties=TOKEN_RESOURCE:mongodb://test-cluster + uri: mongodb://example.com/?authMechanism=MONGODB-OIDC&authMechanismProperties=TOKEN_RESOURCE:mongodb://test-cluster valid: true warning: false hosts: @@ -40,5 +40,5 @@ tests: port: ~ auth: ~ options: - authmechanismProperties: - TOKEN_RESOURCE: 'mongodb://test-cluster' \ No newline at end of file + authmechanismProperties: + TOKEN_RESOURCE: 'mongodb://test-cluster' \ No newline at end of file diff --git a/source/connection-string/tests/valid-warnings.json b/source/connection-string/tests/valid-warnings.json index 996fe5b71e..cbe29f058a 100644 --- a/source/connection-string/tests/valid-warnings.json +++ b/source/connection-string/tests/valid-warnings.json @@ -93,10 +93,10 @@ ], "auth": null, "options": null - }, + }, { "description": "Comma in a key value pair causes a warning", - "uri": "mongodb://example.com?authMechanismProperties=TOKEN_RESOURCE:mongodb://host1%2Chost2", + "uri": "mongodb://example.com?authMechanism=MONGODB-OIDC&authMechanismProperties=TOKEN_RESOURCE:mongodb://host1%2Chost2", "valid": true, "warning": true, "hosts": [ diff --git a/source/connection-string/tests/valid-warnings.yml b/source/connection-string/tests/valid-warnings.yml index ba8cad34ba..d9ddcf5d22 100644 --- a/source/connection-string/tests/valid-warnings.yml +++ b/source/connection-string/tests/valid-warnings.yml @@ -75,7 +75,7 @@ tests: options: ~ - description: Comma in a key value pair causes a warning - uri: mongodb://example.com?authMechanismProperties=TOKEN_RESOURCE:mongodb://host1%2Chost2 + uri: mongodb://example.com?authMechanism=MONGODB-OIDC&authMechanismProperties=TOKEN_RESOURCE:mongodb://host1%2Chost2 valid: true warning: true hosts: