Skip to content

Commit 5ecb241

Browse files
committed
Security cleanup
Cleanup Use add_expansions_to_env Use add_expansions_to_env
1 parent 34fb128 commit 5ecb241

File tree

3 files changed

+20
-48
lines changed

3 files changed

+20
-48
lines changed

.evergreen/config.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -776,16 +776,19 @@ functions:
776776
- command: ec2.assume_role
777777
params:
778778
role_arn: ${aws_test_secrets_role}
779-
- command: shell.exec
780-
type: test
781-
params:
782-
working_dir: "src"
783-
silent: true
784-
script: |
785-
# DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
786-
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
787-
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
788-
export AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}
779+
add_expansions_to_env: true
780+
# - command: shell.exec
781+
# type: test
782+
# params:
783+
# working_dir: "src"
784+
# silent: true
785+
# script: |
786+
# # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
787+
# cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_aws_connection.sh"
788+
# export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
789+
# export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
790+
# export AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}
791+
# EOF
789792
- command: shell.exec
790793
type: test
791794
params:

.evergreen/run-mongodb-oidc-test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ fi
4848
# show test output
4949
set -x
5050

51-
# Workaround macOS python 3.9 incompatibility with system virtualenv.
52-
#if [ "$(uname -s)" = "Darwin" ]; then
53-
# VIRTUALENV="/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m virtualenv"
54-
#else
51+
Workaround macOS python 3.9 incompatibility with system virtualenv.
52+
if [ "$(uname -s)" = "Darwin" ]; then
53+
VIRTUALENV="/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m virtualenv"
54+
else
5555
VIRTUALENV=$(command -v virtualenv)
56-
#fi
56+
fi
5757

5858
authtest () {
5959
if [ "Windows_NT" = "$OS" ]; then
@@ -71,7 +71,7 @@ authtest () {
7171
fi
7272
python -m pip install -U pip setuptools
7373
python -m pip install '.[aws]'
74-
pytest -v test/auth_aws/test_auth_oidc.py
74+
python test/auth_aws/test_auth_oidc.py -v
7575
deactivate
7676
rm -rf venvoidc
7777
}

tox.ini

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ commands =
146146

147147
[testenv:test-atlas]
148148
deps =
149-
pytest>=7
149+
{[testenv:test]deps}
150150
passenv = *
151151
commands =
152152
python -m pytest -v {posargs} ./test/atlas/test_connection.py
@@ -169,34 +169,3 @@ allowlist_externals =
169169
bash
170170
commands =
171171
python {env:DRIVERS_TOOLS}/.evergreen/auth_aws/setup_secrets.py {posargs}
172-
173-
[testenv:test-aws-secrets]
174-
deps =
175-
PyYAML
176-
boto3
177-
pyjwkest
178-
pyop~=3.4.0
179-
azure-identity
180-
azure-keyvault-secrets
181-
pytest
182-
passenv = *
183-
setenv =
184-
OIDC_TOKEN_DIR=/tmp/tokens
185-
PYTHON_BINARY=python
186-
MONGODB_URI=mongodb+srv://oidc-rapid.oztdp.mongodb-dev.net
187-
MONGODB_URI_SINGLE="mongodb+srv://oidc-rapid.oztdp.mongodb-dev.net/?authMechanism=MONGODB-OIDC"
188-
MONGODB_URI_MULTIPLE="mongodb+srv://oidc-rapid.oztdp.mongodb-dev.net:27018/?authMechanism=MONGODB-OIDC&directConnection=true"
189-
allowlist_externals =
190-
bash
191-
source
192-
echo
193-
commands =
194-
; git clone -b DRIVERS-2585 https://github.com/NoahStapp/drivers-evergreen-tools.git
195-
python ./drivers-evergreen-tools/.evergreen/auth_aws/setup_secrets.py drivers/test
196-
bash ./secrets-export.sh
197-
198-
bash ./drivers-evergreen-tools/.evergreen/auth_oidc/activate-authoidcvenv.sh
199-
python ./drivers-evergreen-tools/.evergreen/auth_oidc/oidc_write_orchestration.py
200-
python ./drivers-evergreen-tools/.evergreen/auth_oidc/oidc_get_tokens.py
201-
202-
bash .evergreen/run-mongodb-oidc-test.sh

0 commit comments

Comments
 (0)