-
Notifications
You must be signed in to change notification settings - Fork 246
DRIVERS-2416 OIDC: Automatic token acquisition for Azure Identity Provider #1421
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
Changes from all commits
b5e9702
4bf1b5f
a71272a
2d65c4c
bb11f08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ Drivers MUST test the following scenarios: | |
|
||
- ``Callback-Driven Auth`` | ||
- ``AWS Automatic Auth`` | ||
- ``Azure Automatic Auth`` | ||
- ``Callback Validation`` | ||
- ``Cached Credentials`` | ||
- ``Speculative Authentication`` | ||
|
@@ -141,6 +142,83 @@ Allowed Hosts Ignored | |
- Assert that a ``find`` operation succeeds. | ||
- Close the client. | ||
|
||
Azure Automatic Auth | ||
================== | ||
|
||
Drivers MUST be able to authenticate using the "azure" provider workflow, using | ||
an Azure VM provisioned using the helper scripts in Drivers Evergreen Tools. | ||
These tests will most likely need to be run in a separate test file from the | ||
rest of the tests, to avoid needing to skip multiple tests. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it's worth noting here that the URI for all tests is the same, and must be equal to:
Then each individual test can reuse the same URI. Thoughts? I did the same as Python and just set it as the |
||
|
||
Connect | ||
~~~~~~~ | ||
- Create a client with a url of the form ``mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:azure,TOKEN_AUDIENCE:<foo>``. | ||
- Assert that a ``find`` operation succeeds. | ||
- Close the client. | ||
|
||
Allowed Hosts Ignored | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
- Create a client with a url of the form ``mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:azure,TOKEN_AUDIENCE:<foo>``, and an | ||
``ALLOWED_HOSTS`` that is an empty list. | ||
- Assert that a ``find`` operation succeeds. | ||
- Close the client. | ||
|
||
Main Cache Not Used | ||
~~~~~~~~~~~~~~~~~~~ | ||
- Clear the main OIDC cache. | ||
- Create a client with a url of the form ``mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:azure,TOKEN_AUDIENCE:<foo>``. | ||
- Assert that a ``find`` operation succeeds. | ||
- Close the client. | ||
- Assert that the main OIDC cache is empty. | ||
|
||
Azure Cache is Used | ||
~~~~~~~~~~~~~~~~~~~ | ||
- Clear the Azure OIDC cache. | ||
- Create a client with a url of the form ``mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:azure,TOKEN_AUDIENCE:<foo>``. | ||
- Assert that a ``find`` operation succeeds. | ||
- Close the client. | ||
- Assert that the Azure OIDC cache has one entry. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not combine the |
||
|
||
Reauthentication Succeeds | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
- Clear the Azure OIDC cache. | ||
- Create a client with an event listener. The following | ||
assumes that the driver does not emit ``saslStart`` or ``saslContinue`` | ||
events. If the driver does emit those events, ignore/filter them for the | ||
purposes of this test. | ||
- Perform a ``find`` operation that succeeds. | ||
- Clear the listener state if possible. | ||
- Force a reauthenication using a ``failCommand`` of the form: | ||
|
||
.. code:: javascript | ||
|
||
{ | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"find" | ||
], | ||
"errorCode": 391 | ||
} | ||
} | ||
|
||
.. note:: | ||
|
||
the driver MUST either use a unique ``appName`` or explicitly | ||
remove the ``failCommand`` after the test to prevent leakage. | ||
|
||
- Perform another find operation that succeeds. | ||
- Assert that the ordering of list started events is [``find``], | ||
, ``find``. Note that if the listener stat could not be cleared then there | ||
will and be extra ``find`` command. | ||
- Assert that the list of command succeeded events is [``find``]. | ||
- Assert that a ``find`` operation failed once during the command execution. | ||
- Close the client. | ||
|
||
|
||
Callback Validation | ||
=================== | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.