@@ -572,7 +572,13 @@ functions:
572
572
573
573
"iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
574
574
"iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
575
- "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}"
575
+ "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}",
576
+
577
+ "iam_auth_assume_web_role_name": "${iam_auth_assume_web_role_name}",
578
+ "iam_web_identity_issuer": "${iam_web_identity_issuer}",
579
+ "iam_web_identity_rsa_key": "${iam_web_identity_rsa_key}",
580
+ "iam_web_identity_jwks_uri": "${iam_web_identity_jwks_uri}",
581
+ "iam_web_identity_token_file": "${iam_web_identity_token_file}"
576
582
}
577
583
EOF
578
584
@@ -668,7 +674,67 @@ functions:
668
674
fi
669
675
# Write an empty prepare_mongodb_aws so no auth environment variables
670
676
# are set.
671
- echo "" > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
677
+ rm "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh" || true
678
+ PYTHON_BINARY=${PYTHON_BINARY} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
679
+
680
+ " run aws auth test with aws web identity credentials " :
681
+ - command : shell.exec
682
+ type : test
683
+ params :
684
+ working_dir : " src"
685
+ script : |
686
+ ${PREPARE_SHELL}
687
+ if [ "${skip_EC2_auth_test}" = "true" ]; then
688
+ echo "This platform does not support the web identity auth test, skipping..."
689
+ exit 0
690
+ fi
691
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
692
+ . ./activate_venv.sh
693
+ mongo aws_e2e_web_identity.js
694
+ - command : shell.exec
695
+ type : test
696
+ params :
697
+ working_dir : " src"
698
+ silent : true
699
+ script : |
700
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
701
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
702
+ export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
703
+ export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
704
+ EOF
705
+ - command : shell.exec
706
+ type : test
707
+ params :
708
+ working_dir : " src"
709
+ script : |
710
+ ${PREPARE_SHELL}
711
+ if [ "${skip_web_identity_auth_test}" = "true" ]; then
712
+ echo "This platform does not support the web identity auth test, skipping..."
713
+ exit 0
714
+ fi
715
+ PYTHON_BINARY=${PYTHON_BINARY} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
716
+ - command : shell.exec
717
+ type : test
718
+ params :
719
+ working_dir : " src"
720
+ silent : true
721
+ script : |
722
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
723
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
724
+ export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
725
+ export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
726
+ export AWS_ROLE_SESSION_NAME="test"
727
+ EOF
728
+ - command : shell.exec
729
+ type : test
730
+ params :
731
+ working_dir : " src"
732
+ script : |
733
+ ${PREPARE_SHELL}
734
+ if [ "${skip_web_identity_auth_test}" = "true" ]; then
735
+ echo "This platform does not support the web identity auth test, skipping..."
736
+ exit 0
737
+ fi
672
738
PYTHON_BINARY=${PYTHON_BINARY} ASSERT_NO_URI_CREDS=true .evergreen/run-mongodb-aws-test.sh
673
739
674
740
" run aws auth test with aws credentials as environment variables " :
@@ -1832,6 +1898,7 @@ tasks:
1832
1898
- func : " run aws auth test with aws credentials as environment variables"
1833
1899
- func : " run aws auth test with aws credentials and session token as environment variables"
1834
1900
- func : " run aws auth test with aws EC2 credentials"
1901
+ - func : " run aws auth test with aws web identity credentials"
1835
1902
- func : " run aws ECS auth test"
1836
1903
1837
1904
- name : " aws-auth-test-5.0"
@@ -1848,6 +1915,7 @@ tasks:
1848
1915
- func : " run aws auth test with aws credentials as environment variables"
1849
1916
- func : " run aws auth test with aws credentials and session token as environment variables"
1850
1917
- func : " run aws auth test with aws EC2 credentials"
1918
+ - func : " run aws auth test with aws web identity credentials"
1851
1919
- func : " run aws ECS auth test"
1852
1920
1853
1921
- name : " aws-auth-test-6.0"
@@ -1864,6 +1932,7 @@ tasks:
1864
1932
- func : " run aws auth test with aws credentials as environment variables"
1865
1933
- func : " run aws auth test with aws credentials and session token as environment variables"
1866
1934
- func : " run aws auth test with aws EC2 credentials"
1935
+ - func : " run aws auth test with aws web identity credentials"
1867
1936
- func : " run aws ECS auth test"
1868
1937
1869
1938
- name : " aws-auth-test-latest"
@@ -1880,6 +1949,7 @@ tasks:
1880
1949
- func : " run aws auth test with aws credentials as environment variables"
1881
1950
- func : " run aws auth test with aws credentials and session token as environment variables"
1882
1951
- func : " run aws auth test with aws EC2 credentials"
1952
+ - func : " run aws auth test with aws web identity credentials"
1883
1953
- func : " run aws ECS auth test"
1884
1954
- name : " aws-auth-test-rapid"
1885
1955
commands :
@@ -1895,6 +1965,7 @@ tasks:
1895
1965
- func : " run aws auth test with aws credentials as environment variables"
1896
1966
- func : " run aws auth test with aws credentials and session token as environment variables"
1897
1967
- func : " run aws auth test with aws EC2 credentials"
1968
+ - func : " run aws auth test with aws web identity credentials"
1898
1969
- func : " run aws ECS auth test"
1899
1970
1900
1971
- name : load-balancer-test
@@ -2076,6 +2147,7 @@ axes:
2076
2147
variables :
2077
2148
skip_EC2_auth_test : true
2078
2149
skip_ECS_auth_test : true
2150
+ skip_web_identity_auth_test : true
2079
2151
python3_binary : /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
2080
2152
libmongocrypt_url : https://s3.amazonaws.com/mciuploads/libmongocrypt/macos/master/latest/libmongocrypt.tar.gz
2081
2153
- id : macos-1100
@@ -2084,6 +2156,7 @@ axes:
2084
2156
variables :
2085
2157
skip_EC2_auth_test : true
2086
2158
skip_ECS_auth_test : true
2159
+ skip_web_identity_auth_test : true
2087
2160
python3_binary : /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
2088
2161
libmongocrypt_url : https://s3.amazonaws.com/mciuploads/libmongocrypt/macos/master/latest/libmongocrypt.tar.gz
2089
2162
- id : rhel62
@@ -2146,8 +2219,9 @@ axes:
2146
2219
run_on : windows-64-vsMulti-small
2147
2220
batchtime : 10080 # 7 days
2148
2221
variables :
2149
- skip_EC2_auth_test : true
2150
2222
skip_ECS_auth_test : true
2223
+ skip_EC2_auth_test : true
2224
+ skip_web_identity_auth_test : true
2151
2225
python3_binary : " C:/python/Python38/python.exe"
2152
2226
venv_bin_dir : " Scripts"
2153
2227
libmongocrypt_url : https://s3.amazonaws.com/mciuploads/libmongocrypt/windows-test/master/latest/libmongocrypt.tar.gz
0 commit comments