-
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-5050): support GCP automatic credential fetch for CSFLE
- Loading branch information
Showing
10 changed files
with
372 additions
and
40 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,21 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -o errexit | ||
|
||
pushd "src" | ||
PROJECT_DIRECTORY="$(pwd)" | ||
export PROJECT_DIRECTORY | ||
source ".evergreen/init-nvm.sh" | ||
|
||
set -o xtrace | ||
|
||
npm install 'mongodb-client-encryption@2.6.0-alpha.0' | ||
npm install 'gcp-metadata' | ||
|
||
export MONGODB_URI="mongodb://localhost:27017" | ||
|
||
export EXPECTED_GCPKMS_OUTCOME=${EXPECTED_GCPKMS_OUTCOME:-omitted} | ||
export TEST_CSFLE=true | ||
export CSFLE_KMS_PROVIDERS='not json' | ||
|
||
npx mocha --config test/mocha_mongodb.json test/integration/client-side-encryption/client_side_encryption.prose.17.on_demand_gcp.test.ts |
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,9 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -o errexit | ||
if [ -z ${testgcpkms_key_file+omitted} ]; then echo "testgcpkms_key_file is unset" && exit 1; fi | ||
|
||
echo "${testgcpkms_key_file}" > ./testgcpkms_key_file.json | ||
export GCPKMS_KEYFILE=./testgcpkms_key_file.json | ||
|
||
"$GCPKMS_DRIVERS_TOOLS/.evergreen/csfle/gcpkms/create-and-setup-instance.sh" |
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,28 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Assert required environment variables are present without printing them | ||
if [ -z ${GCPKMS_GCLOUD+omitted} ]; then echo "GCPKMS_GCLOUD is unset" && exit 1; fi | ||
if [ -z ${GCPKMS_PROJECT+omitted} ]; then echo "GCPKMS_PROJECT is unset" && exit 1; fi | ||
if [ -z ${GCPKMS_ZONE+omitted} ]; then echo "GCPKMS_ZONE is unset" && exit 1; fi | ||
if [ -z ${GCPKMS_INSTANCENAME+omitted} ]; then echo "GCPKMS_INSTANCENAME is unset" && exit 1; fi | ||
|
||
set -o errexit | ||
|
||
source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh" | ||
|
||
export GCPKMS_SRC=node-driver-source.tgz | ||
export GCPKMS_DST=$GCPKMS_INSTANCENAME: | ||
|
||
# Box up the entire driver and it's node_modules | ||
echo "compressing node driver source ... begin" | ||
tar -czf $GCPKMS_SRC src | ||
echo "compressing node driver source ... end" | ||
|
||
echo "copying node driver tar ... begin" | ||
"${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/copy-file.sh" | ||
echo "copying node driver tar ... end" | ||
|
||
echo "decompressing node driver tar on gcp ... begin" | ||
export GCPKMS_CMD="tar -xzf $GCPKMS_SRC" | ||
"${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh" | ||
echo "decompressing node driver tar on gcp ... end" |
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.