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

feat(NODE-5054): add AssumeRoleWithWebIdentity support to 4x driver #3566

Merged
merged 3 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,12 @@ functions:
"iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
"iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
"iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
"iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}"
"iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}",
"iam_auth_assume_web_role_name": "${iam_auth_assume_web_role_name}",
"iam_web_identity_issuer": "${iam_web_identity_issuer}",
"iam_web_identity_rsa_key": "${iam_web_identity_rsa_key}",
"iam_web_identity_jwks_uri": "${iam_web_identity_jwks_uri}",
"iam_web_identity_token_file": "${iam_web_identity_token_file}"
}
EOF

Expand Down Expand Up @@ -697,6 +702,55 @@ functions:
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

"run aws auth test AssumeRoleWithWebIdentity with AWS_ROLE_SESSION_NAME set":
- command: shell.exec
type: test
params:
working_dir: "src"
silent: true
script: |
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js
cd -
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file}
export AWS_ROLE_ARN=${iam_auth_assume_web_role_name}
export AWS_ROLE_SESSION_NAME='test'
export MONGODB_URI="mongodb://localhost:27017/aws?authMechanism=MONGODB-AWS"
EOF
- command: shell.exec
type: test
params:
working_dir: "src"
script: |
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

"run aws auth test AssumeRoleWithWebIdentity with AWS_ROLE_SESSION_NAME unset":
- command: shell.exec
type: test
params:
working_dir: "src"
silent: true
script: |
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
${MONGODB_BINARIES}/mongo --verbose aws_e2e_web_identity.js
cd -
cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
export AWS_WEB_IDENTITY_TOKEN_FILE=${iam_web_identity_token_file}
export AWS_ROLE_ARN=${iam_auth_assume_web_role_name}
export MONGODB_URI="mongodb://localhost:27017/aws?authMechanism=MONGODB-AWS"
EOF
- command: shell.exec
type: test
params:
working_dir: "src"
script: |
${PREPARE_SHELL}
${PROJECT_DIRECTORY}/.evergreen/run-mongodb-aws-test.sh

"run aws ECS auth test":
- command: shell.exec
type: test
Expand Down
Loading