Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRIVERS-2672 Add OIDC machine workflow spec. #1471

Merged
merged 46 commits into from
Jan 31, 2024

Conversation

matthewdale
Copy link
Contributor

@matthewdale matthewdale commented Oct 22, 2023

DRIVERS-2672

Please complete the following before merging:

  • Update changelog.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless).

@durran durran self-requested a review October 30, 2023 14:02
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial comments.

source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Show resolved Hide resolved
@blink1073 blink1073 mentioned this pull request Nov 1, 2023
4 tasks
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
@blink1073 blink1073 mentioned this pull request Nov 16, 2023
4 tasks
@matthewdale matthewdale marked this pull request as ready for review December 7, 2023 11:05
@matthewdale matthewdale requested review from a team as code owners December 7, 2023 11:05
@matthewdale matthewdale requested review from alcaeus and JamesKovacs and removed request for a team December 7, 2023 11:05
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
source/auth/tests/mongodb-oidc.rst Outdated Show resolved Hide resolved
Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unified test format changes look good. Can you please add tests for authMechanism similar to the invalid/runOnRequirement-auth-type test?

source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
@matthewdale
Copy link
Contributor Author

@alcaeus Added an invalid test for the type of authMechanism.

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unified test format changes LGTM.

matthewdale and others added 2 commits January 23, 2024 16:53
Co-authored-by: Jeff Yemin <jeff.yemin@mongodb.com>
(MONGODB-OIDC)
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:unexisted
- description: should throw an exception custom callback is chosen but no callback is provided (MONGODB-OIDC)
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:custom
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose "custom" is not allowed value for PROVIDER_NAME. As far as I remember there is only "aws" allowed so far.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, that test is vestigial from an earlier version of the spec. I've removed this test case because it's no longer relevant.

uri: mongodb://localhost/?authMechanism=MONGODB-OIDC
PROVIDER_NAME: aws
- description: should ignore username and password if specified for aws provider (MONGODB-OIDC)
uri: mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PROVIDER_NAME and callbacks are mutual exclusive. Callback parameter probably has to be removed from this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct. The callback legacy test case parameter was never documented and is not supported by most drivers, so I intended to remove it from all test cases here, but accidentally left that one in. I've updated that test case to assert that providing a password causes a validation error, which matches the spec.

Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion for a wording change that I leave to your discretion.

LGTM!

source/auth/auth.rst Outdated Show resolved Hide resolved
source/auth/auth.rst Outdated Show resolved Hide resolved
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Check to see if the noted prose test is truly a duplicate of the unified test or not.


- Create a ``MongoClient`` configured with an OIDC callback and auth mechanism
property ``PROVIDER_NAME:aws``.
- Assert it returns a client configuration error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prose test is already covered by the unified connection string tests above. Isn't this an unnecessary duplicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated Auth connection string tests don't support passing an OIDC callback, so I believe this prose test covers a case that the Auth connection string tests can't. The previous Auth connection string OIDC tests did include a "callback" param, but it was not documented in the test format README, was only implemented in 1 or 2 drivers, and was confusing with the updated OIDC callback API, so I decided to replace it with a prose test instead.

@matthewdale matthewdale merged commit a288630 into mongodb:master Jan 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants