-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(NODE-5464): OIDC machine workflow
- Loading branch information
Showing
44 changed files
with
885 additions
and
1,756 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,38 @@ | ||
#!/bin/bash | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
set -o xtrace # Write all commands first to stderr | ||
|
||
PROVIDER_NAME=${PROVIDER_NAME:-"aws"} | ||
PROJECT_DIRECTORY=${PROJECT_DIRECTORY:-"."} | ||
source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh" | ||
|
||
MONGODB_URI=${MONGODB_URI:-"mongodb://127.0.0.1:27017"} | ||
|
||
export OIDC_TOKEN_DIR=${OIDC_TOKEN_DIR} | ||
|
||
export MONGODB_URI=${MONGODB_URI:-"mongodb://localhost"} | ||
|
||
if [ "$PROVIDER_NAME" = "azure" ]; then | ||
if [ -z "${AZUREOIDC_CLIENTID}" ]; then | ||
echo "Must specify an AZUREOIDC_CLIENTID" | ||
exit 1 | ||
fi | ||
|
||
export UTIL_CLIENT_USER=$AZUREOIDC_USERNAME | ||
export UTIL_CLIENT_PASSWORD="pwd123" | ||
MONGODB_URI="${MONGODB_URI}/?authMechanism=MONGODB-OIDC" | ||
MONGODB_URI="${MONGODB_URI}&authMechanismProperties=PROVIDER_NAME:azure" | ||
MONGODB_URI="${MONGODB_URI},TOKEN_AUDIENCE:api%3A%2F%2F${AZUREOIDC_CLIENTID}" | ||
export MONGODB_URI="${MONGODB_URI},TOKEN_CLIENT_ID:${AZUREOIDC_TOKENCLIENT}" | ||
else | ||
if [ -z "${OIDC_TOKEN_DIR}" ]; then | ||
echo "Must specify OIDC_TOKEN_DIR" | ||
exit 1 | ||
fi | ||
|
||
export UTIL_CLIENT_USER="bob" | ||
export UTIL_CLIENT_PASSWORD="pwd123" | ||
export MONGODB_URI="${MONGODB_URI}/test?authMechanism=MONGODB-OIDC&authMechanismProperties=PROVIDER_NAME:aws" | ||
fi | ||
|
||
npm run check:oidc-auth |
This file contains 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
Oops, something went wrong.