-
Notifications
You must be signed in to change notification settings - Fork 244
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
Changes from 36 commits
fbc3d72
f01c678
62130cf
d09ae6c
67c9794
b7f750c
a333353
aa1ada7
93d9b27
46afc8d
2c0e07a
becadd5
5b0665e
88de5b9
e9972de
17fd8a5
cf5455e
b349eb2
1fb61b6
be7f515
48f9fd4
f841d13
9523a84
98eec93
f8c3b4b
1ec045c
82a20d4
9ff52c0
4e1a5f5
7f79ecd
697bed6
cd1470d
9ef2650
bb09469
f2135be
9b6bd5f
11357db
357cad9
09554a6
37102c5
03a0f8b
95395e2
f41bb37
6b07e16
353fa83
4203a6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,59 +350,30 @@ tests: | |
mechanism: MONGODB-AWS | ||
mechanism_properties: | ||
AWS_SESSION_TOKEN: token!@#$%^&*()_+ | ||
- description: should recognise the mechanism and request callback (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC | ||
callback: | ||
- oidcRequest | ||
- description: should recognise the mechanism with aws provider (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws | ||
valid: true | ||
credential: | ||
username: | ||
password: | ||
source: "$external" | ||
mechanism: MONGODB-OIDC | ||
mechanism_properties: | ||
REQUEST_TOKEN_CALLBACK: true | ||
- description: should recognise the mechanism when auth source is explicitly specified | ||
and with request callback (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authSource=$external | ||
callback: | ||
- oidcRequest | ||
PROVIDER_NAME: aws | ||
- description: should recognise the mechanism when auth source is explicitly specified and with provider (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authSource=$external&authMechanismProperties=PROVIDER_NAME:aws | ||
valid: true | ||
credential: | ||
username: | ||
password: | ||
source: "$external" | ||
mechanism: MONGODB-OIDC | ||
mechanism_properties: | ||
REQUEST_TOKEN_CALLBACK: true | ||
- description: should recognise the mechanism with request and refresh callback (MONGODB-OIDC) | ||
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 | ||
callback: | ||
- oidcRequest | ||
- oidcRefresh | ||
valid: true | ||
credential: | ||
username: | ||
password: | ||
source: "$external" | ||
mechanism: MONGODB-OIDC | ||
mechanism_properties: | ||
REQUEST_TOKEN_CALLBACK: true | ||
REFRESH_TOKEN_CALLBACK: true | ||
- description: should recognise the mechanism and username with request callback (MONGODB-OIDC) | ||
uri: mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC | ||
callback: | ||
- oidcRequest | ||
valid: true | ||
credential: | ||
username: principalName | ||
password: | ||
source: "$external" | ||
mechanism: MONGODB-OIDC | ||
mechanism_properties: | ||
REQUEST_TOKEN_CALLBACK: true | ||
- description: should recognise the mechanism with aws device (MONGODB-OIDC) | ||
durran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws | ||
valid: true | ||
credential: | ||
username: | ||
|
@@ -411,46 +382,23 @@ tests: | |
mechanism: MONGODB-OIDC | ||
mechanism_properties: | ||
PROVIDER_NAME: aws | ||
- description: should recognise the mechanism when auth source is explicitly specified | ||
and with aws device (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authSource=$external&authMechanismProperties=PROVIDER_NAME:aws | ||
valid: true | ||
credential: | ||
username: | ||
password: | ||
source: "$external" | ||
mechanism: MONGODB-OIDC | ||
mechanism_properties: | ||
PROVIDER_NAME: aws | ||
- description: should throw an exception if username and password are specified (MONGODB-OIDC) | ||
uri: mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC | ||
callback: | ||
- oidcRequest | ||
- description: should throw an exception if username is specified for aws (MONGODB-OIDC) | ||
uri: mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&PROVIDER_NAME:aws | ||
valid: false | ||
credential: | ||
- description: should throw an exception if username and deviceName are specified | ||
(MONGODB-OIDC) | ||
uri: mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&PROVIDER_NAME:gcp | ||
- description: should throw an exception if specified provider is not supported (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:invalid | ||
valid: false | ||
credential: | ||
- description: should throw an exception if specified deviceName is not supported | ||
(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 | ||
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. I suppose "custom" is not allowed value for PROVIDER_NAME. As far as I remember there is only "aws" allowed so far. 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. 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. |
||
valid: false | ||
credential: | ||
- description: should throw an exception if neither deviceName nor callbacks specified | ||
(MONGODB-OIDC) | ||
- description: should throw an exception if neither provider nor callbacks specified (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC | ||
valid: false | ||
credential: | ||
- description: should throw an exception when only refresh callback is specified (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC | ||
callback: | ||
- oidcRefresh | ||
valid: false | ||
credential: | ||
- description: should throw an exception when unsupported auth property is specified | ||
(MONGODB-OIDC) | ||
- description: should throw an exception when unsupported auth property is specified (MONGODB-OIDC) | ||
uri: mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=UnsupportedProperty:unexisted | ||
valid: false | ||
credential: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.