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-2836 OIDC: More Clarification and Test Cleanup #1578

Merged
merged 3 commits into from
May 7, 2024

Conversation

blink1073
Copy link
Member

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. PYTHON-4256 OIDC Test Cleanup mongo-python-driver#1632
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

Copy link
Contributor

@katcharov katcharov left a comment

Choose a reason for hiding this comment

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

LGTM, implemented in mongodb/mongo-java-driver#1380

Comment on lines 82 to 83
- Create an OIDC configured client with auth mechanism properties `{"ENVIRONMENT": "azure", "ALLOWED_HOSTS": []}`.
- 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.

Suggested change
- Create an OIDC configured client with auth mechanism properties `{"ENVIRONMENT": "azure", "ALLOWED_HOSTS": []}`.
- Assert it returns a client configuration error.
- Create an OIDC configured client with auth mechanism properties `{"ENVIRONMENT": "azure", "ALLOWED_HOSTS": []}`. Perform a find, if necessary, to cause the ensuing error.
- Assert it returns a client configuration error.

In Java we validate on use (when the OidcAuthenticator is created). The check can be moved earlier, but it would not be as clean.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated here and 2.4 as well.

@@ -96,7 +101,7 @@ source the `secrets-export.sh` file and use the associated env variables in your

**3.3 Unexpected error code does not clear the cache**

- Create a `MongoClient` with a human callback that returns a valid token.
- Create a `MongoClient` with an OIDC callback that returns a valid token.
Copy link
Member

Choose a reason for hiding this comment

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

There are similar changes required on line 123 and 125.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

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

LGTM

@blink1073 blink1073 merged commit ea6040e into mongodb:master May 7, 2024
3 checks passed
@blink1073 blink1073 deleted the DRIVERS-2836-may3 branch May 7, 2024 17:23
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.

3 participants