-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-5050): support GCP automatic credential fetch for CSFLE #3574
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps dumb question – does this task also start a server? And is that server always a standalone? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will soon have both AWS and Azure as well - maybe we can just have a generic task group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you'll be able to reuse this variant, it's specific to GCP / GCP setup scripts. I tried to use the scripts on our typical rhel8 setup but it fails, it needs to be on debian11, so azure might have a diff config too (windows? 😱)