-
Notifications
You must be signed in to change notification settings - Fork 9
CLOUDP-314916: OIDC e2e test single cluster #55
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
Merged
Merged
Changes from all commits
Commits
Show all changes
97 commits
Select commit
Hold shift + click to select a range
f0b6a96
CRD changes
MaciejKaras d344589
Authorization package refactor - part 1
MaciejKaras 99479f1
Authorization package refactor - part 2
MaciejKaras 7c23143
Added validation logic + tests
MaciejKaras 8cba1c1
Add URL test validation
MaciejKaras 2528892
Fixed MDB Multi code
MaciejKaras 1eaf9ab
Merge branch 'feature/mk-authorization-refactor' into feature/mk-oidc…
MaciejKaras 6d27458
Propagating CRD values
MaciejKaras 81e6107
Moved OIDCProviderConfigs to Deployment.Auth where it belongs
MaciejKaras 024fa63
Fixed migrating to mongodb-kubernetes repository
MaciejKaras 7a53fd7
Fixed unit tests + CRD generation
MaciejKaras 97a5c99
Add unit tests
MaciejKaras 6dd4976
Temporal fix for AC
MaciejKaras 8b34222
Fix kubebuilder validation rules
MaciejKaras 1cbe97a
Fixes for util.ParseURL
MaciejKaras 0ce0874
Proper OIDC AC merging
MaciejKaras e4cfb11
Unit test fixes
MaciejKaras 1667045
Fixed issue with disabling OIDC
MaciejKaras e882a8c
Resolve review comments
MaciejKaras 8f5ff0a
Added getMechanismByName() func and removed global variables
MaciejKaras e533976
Review fixes
MaciejKaras 279886f
Merge branch 'master' into feature/mk-oidc-crd-validations
MaciejKaras a8306a7
Add one more validation test
MaciejKaras 866d6ae
Merge branch 'master' into feature/mk-authorization-refactor
MaciejKaras 09e4628
Merge branch 'feature/mk-oidc-crd-validations' into feature/mk-oidc-c…
MaciejKaras 23de25e
Merge branch 'feature/mk-authorization-refactor' into feature/mk-oidc…
MaciejKaras bcc1136
Fix bug
lucian-tosa 2c08662
Merge remote-tracking branch 'origin/master' into feature/mk-oidc-crd…
lucian-tosa 68750a4
Fix linter
lucian-tosa e7d3d06
Merge branch 'master' into feature/mk-oidc-crd-propagation
lucian-tosa 2b306f5
remove refs
anandsyncs e4743bf
add more validations
anandsyncs d6e6ce7
lint fix
anandsyncs fe5cdef
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs db52705
lint fix
anandsyncs 2fb5a96
Merge remote-tracking branch 'origin/anandsingh/oidc-e2e-tests' into …
anandsyncs efacc00
make sure env vars are included
anandsyncs 715c627
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs 764d3d5
Merge branch 'master' into feature/mk-oidc-crd-propagation
anandsyncs 21647a0
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 63927a0
upgrade pymongo
anandsyncs bec3f6b
Merge remote-tracking branch 'origin/anandsingh/oidc-e2e-tests' into …
anandsyncs 1b82b29
env vars tracer
anandsyncs ce6eb85
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs 9d2a304
env vars tracer
anandsyncs 0b86f84
Merge remote-tracking branch 'origin/anandsingh/oidc-e2e-tests' into …
anandsyncs cb7cd70
fix lint
anandsyncs 8da5102
env vars tracer
anandsyncs 890fb13
env vars tracer
anandsyncs 8b396d6
change version in the config
anandsyncs a5e357b
run separate e2e tests for different oidc flavors
anandsyncs b4db2e6
lint-fix
anandsyncs db45441
add sharded cluster tests to evergreen run
anandsyncs 1bce820
Merge branch 'master' into feature/mk-oidc-crd-propagation
anandsyncs f7ec0f1
implement the authentication_mechanism interface correctly for oidc
anandsyncs c1f54a5
lint-fix
anandsyncs f271051
Merge branch 'master' into feature/mk-oidc-crd-propagation
anandsyncs 390998c
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 3eed7fa
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs bca4aa2
fix duplicate issuer uri problem
anandsyncs 8dc9bd5
Merge remote-tracking branch 'origin/anandsingh/oidc-e2e-tests' into …
anandsyncs d5f406a
cleanup
anandsyncs 4593b6f
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs e6ed367
update external auth validation
anandsyncs 8d8bcdc
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 6ffe3f4
fix clean up error
anandsyncs 1190494
Merge branch 'anandsingh/oidc-e2e-tests' of github.com:mongodb/mongod…
anandsyncs 727979c
remove sharded cluster workforce test
anandsyncs 0d8fd6e
Webhook validation tests
lucian-tosa 0f1b385
assert cluster running state before asserting automation config
anandsyncs 2d621b3
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 39c6702
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs 86f0be0
lint fix
anandsyncs 19f161b
Merge branch 'master' into feature/mk-oidc-crd-propagation
anandsyncs 26e24a0
remove default value for GroupsClaim
anandsyncs 7257b4e
remove default value for GroupsClaim
anandsyncs ed2748d
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 1be8af8
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs 30bb749
remove default value for GroupsClaim from tests
anandsyncs 5df3e5c
Merge branch 'master' into feature/mk-oidc-crd-propagation
anandsyncs 9d56078
fix test
anandsyncs 0b03de4
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 00adfc7
remove incorrect field
anandsyncs 95c58de
Merge remote-tracking branch 'origin/anandsingh/oidc-e2e-tests' into …
anandsyncs a29f737
add explanation for manual aws setup
anandsyncs 09409f1
lint fix
anandsyncs aad26e6
Update controllers/operator/authentication/oidc.go
anandsyncs 49cb8ce
Merge branch 'master' into anandsingh/oidc-e2e-tests
anandsyncs 05903d5
fix typo
anandsyncs 13e76a3
Moved `mongoDBOIDCMechanism` to oidc_test.go as local variable
MaciejKaras 646bec6
Removed `util.MergoDelete` from oidc implementation
MaciejKaras 3e2839e
unit test fixes
MaciejKaras d0c2844
Merge branch 'master' into feature/mk-oidc-crd-propagation
anandsyncs 8362cfb
Merge branch 'feature/mk-oidc-crd-propagation' into anandsingh/oidc-e…
anandsyncs 1e91d2f
review fixes
MaciejKaras b9b58e8
Merge branch 'master' into anandsingh/oidc-e2e-tests
MaciejKaras 0035c47
Fix e2e tests after master merge
MaciejKaras File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
|
||
# Note: The project uses AWS Cognito in the mongodb-mms-testing AWS account to facilitate OIDC authentication testing. | ||
# This setup includes: | ||
|
||
# User Pool: A user pool in Cognito manages the identities. | ||
# Users: We use the user credentials to do authentication. | ||
# App Client: An app client is configured for machine-to-machine (M2M) authentication. | ||
# Groups: Cognito groups are used to manage users from the user pool for GroupMembership access. | ||
|
||
# Environment variables and secrets required for these tests (like client IDs, URLs, and user IDs, as seen in the Python code) | ||
# are stored in Evergreen and fetched from there during test execution. | ||
|
||
# A session explaining the setup can be found here: http://go/k8s-oidc-session | ||
|
||
|
||
def get_cognito_workload_client_id() -> str: | ||
MaciejKaras marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return os.getenv("cognito_workload_federation_client_id", "") | ||
|
||
|
||
def get_cognito_workload_url() -> str: | ||
return os.getenv("cognito_workload_url", "") | ||
|
||
|
||
def get_cognito_workload_user_id() -> str: | ||
return os.getenv("cognito_workload_user_id", "") |
13 changes: 13 additions & 0 deletions
13
docker/mongodb-kubernetes-tests/tests/authentication/fixtures/oidc/oidc-user.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: mongodb.com/v1 | ||
kind: MongoDBUser | ||
metadata: | ||
name: oidc-user-0 | ||
spec: | ||
username: "<filled-in-test>" | ||
db: "$external" | ||
mongodbResourceRef: | ||
name: oidc-replica-set | ||
roles: | ||
- db: "admin" | ||
name: "readWriteAnyDatabase" |
32 changes: 32 additions & 0 deletions
32
docker/mongodb-kubernetes-tests/tests/authentication/fixtures/oidc/replica-set-m2m-user.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
apiVersion: mongodb.com/v1 | ||
kind: MongoDB | ||
metadata: | ||
name: oidc-replica-set | ||
spec: | ||
type: ReplicaSet | ||
members: 3 | ||
version: 7.0.5-ent | ||
|
||
opsManager: | ||
configMapRef: | ||
name: my-project | ||
credentials: my-credentials | ||
|
||
security: | ||
authentication: | ||
agents: | ||
mode: SCRAM | ||
enabled: true | ||
modes: | ||
- SCRAM | ||
- OIDC | ||
oidcProviderConfigs: | ||
- audience: "<filled-in-test>" | ||
clientId: "<filled-in-test>" | ||
issuerURI: "<filled-in-test>" | ||
requestedScopes: [ ] | ||
userClaim: "sub" | ||
authorizationMethod: "WorkloadIdentityFederation" | ||
authorizationType: "UserID" | ||
configurationName: "OIDC-test-user" |
47 changes: 47 additions & 0 deletions
47
...er/mongodb-kubernetes-tests/tests/authentication/fixtures/oidc/replica-set-workforce.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
apiVersion: mongodb.com/v1 | ||
kind: MongoDB | ||
metadata: | ||
name: oidc-replica-set | ||
spec: | ||
type: ReplicaSet | ||
members: 3 | ||
version: 7.0.5-ent | ||
|
||
opsManager: | ||
configMapRef: | ||
name: my-project | ||
credentials: my-credentials | ||
|
||
security: | ||
authentication: | ||
agents: | ||
mode: SCRAM | ||
enabled: true | ||
modes: | ||
- SCRAM | ||
- OIDC | ||
oidcProviderConfigs: | ||
- audience: "<filled-in-test>" | ||
clientId: "<filled-in-test>" | ||
issuerURI: "<filled-in-test>" | ||
requestedScopes: [ ] | ||
userClaim: "sub" | ||
groupsClaim: "cognito:groups" | ||
authorizationMethod: "WorkforceIdentityFederation" | ||
authorizationType: "GroupMembership" | ||
configurationName: "OIDC-test-group" | ||
- audience: "dummy-audience" | ||
clientId: "dummy-client-id" | ||
issuerURI: "https://valid-issuer.example.com" | ||
requestedScopes: [ ] | ||
userClaim: "sub" | ||
authorizationMethod: "WorkloadIdentityFederation" | ||
authorizationType: "UserID" | ||
configurationName: "OIDC-test-user" | ||
roles: | ||
- role: "OIDC-test-group/test" | ||
db: "admin" | ||
roles: | ||
- role: "readWriteAnyDatabase" | ||
db: "admin" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.