Skip to content

Commit 1d91e3e

Browse files
author
Lucas McDonald
committed
refactor(release): source test vector values from one file
Replace the inlined values with a single util/integration-test-vectors.sh that the integration-* and verdaccio-* scripts source.
1 parent ee14512 commit 1d91e3e

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@
3434
"coverage": "run-s coverage-*",
3535
"report-coverage": "nyc report --extension .ts --check-coverage -r html",
3636
"test": "npm run build && npm run coverage",
37-
"integration-browser-decrypt": "npm run build; integration-browser decrypt -v aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0.zip --karma -c cpu",
38-
"integration-browser-encrypt": "npm run build; integration-browser encrypt -m https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v1.json -k https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0002-keys.v1.json -o https://xi1mwx3ttb.execute-api.us-west-2.amazonaws.com/api/v0/decrypt --karma -c cpu",
37+
"integration-browser-decrypt": "npm run build; . util/integration-test-vectors.sh && integration-browser decrypt -v $LOCAL_TEST_VECTORS --karma -c cpu",
38+
"integration-browser-encrypt": "npm run build; . util/integration-test-vectors.sh && integration-browser encrypt -m $ENCRYPT_MANIFEST_LIST -k $ENCRYPT_KEY_MANIFEST -o $DECRYPT_ORACLE --karma -c cpu",
3939
"browser-integration": "run-s integration-browser-*",
40-
"integration-node-decrypt": "npm run build; integration-node decrypt -v aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0.zip -c cpu",
41-
"integration-node-decrypt-legacy": "node --security-revert=CVE-2023-46809 ./modules/integration-node/build/main/src/cli.js decrypt -v aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0.zip -c cpu --CVE-2023-46809",
42-
"integration-node-encrypt": "npm run build; integration-node encrypt -m https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v1.json -k https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0002-keys.v1.json -o https://xi1mwx3ttb.execute-api.us-west-2.amazonaws.com/api/v0/decrypt -c cpu",
40+
"integration-node-decrypt": "npm run build; . util/integration-test-vectors.sh && integration-node decrypt -v $LOCAL_TEST_VECTORS -c cpu",
41+
"integration-node-decrypt-legacy": ". util/integration-test-vectors.sh && node --security-revert=CVE-2023-46809 ./modules/integration-node/build/main/src/cli.js decrypt -v $LOCAL_TEST_VECTORS -c cpu --CVE-2023-46809",
42+
"integration-node-encrypt": "npm run build; . util/integration-test-vectors.sh && integration-node encrypt -m $ENCRYPT_MANIFEST_LIST -k $ENCRYPT_KEY_MANIFEST -o $DECRYPT_ORACLE -c cpu",
4343
"node-integration": "run-s integration-node-*",
4444
"integration": "run-s integration-*",
4545
"verdaccio": "run-s verdaccio-*",
4646
"verdaccio-publish": "./util/local_verdaccio_publish",
47-
"verdaccio-browser-decrypt": "./util/npx_verdaccio @aws-crypto/integration-browser decrypt -v $PWD/aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0.zip --karma -c cpu",
48-
"verdaccio-browser-encrypt": "./util/npx_verdaccio @aws-crypto/integration-browser encrypt -m https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v1.json -k https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0002-keys.v1.json -o https://xi1mwx3ttb.execute-api.us-west-2.amazonaws.com/api/v0/decrypt --karma -c cpu",
49-
"verdaccio-node-decrypt": "./util/npx_verdaccio @aws-crypto/integration-node decrypt -v $PWD/aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0.zip -c cpu",
50-
"verdaccio-node-encrypt": "./util/npx_verdaccio @aws-crypto/integration-node encrypt -m https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v1.json -k https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0002-keys.v1.json -o https://xi1mwx3ttb.execute-api.us-west-2.amazonaws.com/api/v0/decrypt -c cpu",
47+
"verdaccio-browser-decrypt": ". util/integration-test-vectors.sh && ./util/npx_verdaccio @aws-crypto/integration-browser decrypt -v $PWD/$LOCAL_TEST_VECTORS --karma -c cpu",
48+
"verdaccio-browser-encrypt": ". util/integration-test-vectors.sh && ./util/npx_verdaccio @aws-crypto/integration-browser encrypt -m $ENCRYPT_MANIFEST_LIST -k $ENCRYPT_KEY_MANIFEST -o $DECRYPT_ORACLE --karma -c cpu",
49+
"verdaccio-node-decrypt": ". util/integration-test-vectors.sh && ./util/npx_verdaccio @aws-crypto/integration-node decrypt -v $PWD/$LOCAL_TEST_VECTORS -c cpu",
50+
"verdaccio-node-encrypt": ". util/integration-test-vectors.sh && ./util/npx_verdaccio @aws-crypto/integration-node encrypt -m $ENCRYPT_MANIFEST_LIST -k $ENCRYPT_KEY_MANIFEST -o $DECRYPT_ORACLE -c cpu",
5151
"test_conditions": "./aws-encryption-sdk-specification/util/test_conditions -s 'modules/**/src/*.ts' -t 'modules/**/test/*.ts' -s 'compliance_exceptions/*.ts'",
5252
"duvet-report": "aws-encryption-sdk-specification/util/report.js modules/**/src/**/*.ts modules/**/test/**/*.ts compliance_exceptions/*.ts"
5353
},

util/integration-test-vectors.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Single source of truth for integration test vector locations.
2+
# Sourced by the integration-* and verdaccio-* npm scripts.
3+
export LOCAL_TEST_VECTORS="aws-encryption-sdk-test-vectors/vectors/awses-decrypt/python-2.3.0.zip"
4+
export ENCRYPT_MANIFEST_LIST="https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v1.json"
5+
export ENCRYPT_KEY_MANIFEST="https://raw.githubusercontent.com/awslabs/aws-crypto-tools-test-vector-framework/master/features/CANONICAL-GENERATED-MANIFESTS/0002-keys.v1.json"
6+
export DECRYPT_ORACLE="https://xi1mwx3ttb.execute-api.us-west-2.amazonaws.com/api/v0/decrypt"

0 commit comments

Comments
 (0)