From 303907529628b6013b1cb8aebc47beae03b8c785 Mon Sep 17 00:00:00 2001 From: Anirav Kareddy <142655873+akareddy04@users.noreply.github.com> Date: Tue, 17 Nov 2026 09:17:33 -0800 Subject: [PATCH 1/2] chore: Revert "fix: detect Base64 encoded messages on decrypt (#831)" This reverts commit 8136b2b57b72a05ce2c5f6361e5f244fec2be5aa. --- .github/workflows/ci_codebuild-tests.yml | 6 +- .github/workflows/ci_codebuild_batch.yml | 408 +++++++++++++++--- .github/workflows/ci_decrypt-oracle.yaml | 4 +- .github/workflows/ci_static-analysis.yaml | 2 +- .github/workflows/ci_test-vector-handler.yaml | 29 +- .github/workflows/ci_tests.yaml | 43 +- .github/workflows/dependabot-auto-merge.yml | 2 +- .github/workflows/pull.yml | 26 +- .github/workflows/repo-sync.yml | 2 +- .readthedocs.yaml | 2 +- README.rst | 2 +- .../decrypt_dafny_esdk_vectors_keyrings.yml | 2 +- .../decrypt_golden_manifest_with_keyrings.yml | 2 +- .../py311/decrypt_keyrings_with_keyrings.yml | 2 +- .../py311/decrypt_masterkey_with_keyrings.yml | 2 +- .../decrypt_net_401_vectors_keyrings.yml | 2 +- codebuild/py311/encrypt_keyrings.yml | 2 +- .../generate_decrypt_vectors_keyrings.yml | 2 +- .../decrypt_dafny_esdk_vectors_keyrings.yml | 2 +- .../decrypt_golden_manifest_with_keyrings.yml | 2 +- .../py312/decrypt_hkeyring_with_keyrings.yml | 2 +- codebuild/py312/decrypt_hkeyring_with_net.yml | 4 - .../py312/decrypt_keyrings_with_keyrings.yml | 2 +- .../py312/decrypt_masterkey_with_keyrings.yml | 2 +- .../decrypt_net_401_vectors_keyrings.yml | 2 +- codebuild/py312/encrypt_keyrings.yml | 2 +- .../generate_decrypt_vectors_keyrings.yml | 2 +- codebuild/py38/awses_local.yml | 25 ++ codebuild/py38/decrypt_dafny_esdk_vectors.yml | 58 +++ codebuild/py38/decrypt_masterkey_with_js.yml | 34 ++ .../py38/decrypt_masterkey_with_masterkey.yml | 30 ++ codebuild/py38/decrypt_net_401_vectors.yml | 35 ++ codebuild/py38/encrypt_masterkey.yml | 25 ++ codebuild/py38/examples.yml | 22 + .../generate_decrypt_vectors_masterkey.yml | 28 ++ codebuild/py38/integ.yml | 22 + codebuild/py39/awses_1.7.1.yml | 25 ++ codebuild/py39/awses_2.0.0.yml | 25 ++ codebuild/py39/awses_latest.yml | 25 ++ codebuild/py39/awses_local.yml | 25 ++ codebuild/py39/decrypt_dafny_esdk_vectors.yml | 58 +++ codebuild/py39/decrypt_masterkey_with_js.yml | 34 ++ .../py39/decrypt_masterkey_with_masterkey.yml | 30 ++ codebuild/py39/decrypt_net_401_vectors.yml | 35 ++ codebuild/py39/encrypt_masterkey.yml | 25 ++ codebuild/py39/examples.yml | 22 + .../generate_decrypt_vectors_masterkey.yml | 28 ++ codebuild/py39/integ.yml | 22 + codebuild/release/validate.yml | 4 +- performance_tests/README.rst | 2 +- setup.py | 2 + src/aws_encryption_sdk/compatability.py | 4 +- .../internal/formatting/deserialize.py | 17 +- .../test_f_aws_encryption_sdk_client.py | 24 +- test/unit/test_compatability.py | 8 - test/unit/test_deserialize.py | 23 - test_vector_handlers/README.rst | 2 +- test_vector_handlers/setup.py | 2 + test_vector_handlers/tox.ini | 2 +- tox.ini | 2 +- 60 files changed, 1062 insertions(+), 223 deletions(-) create mode 100644 codebuild/py38/awses_local.yml create mode 100644 codebuild/py38/decrypt_dafny_esdk_vectors.yml create mode 100644 codebuild/py38/decrypt_masterkey_with_js.yml create mode 100644 codebuild/py38/decrypt_masterkey_with_masterkey.yml create mode 100644 codebuild/py38/decrypt_net_401_vectors.yml create mode 100644 codebuild/py38/encrypt_masterkey.yml create mode 100644 codebuild/py38/examples.yml create mode 100644 codebuild/py38/generate_decrypt_vectors_masterkey.yml create mode 100644 codebuild/py38/integ.yml create mode 100644 codebuild/py39/awses_1.7.1.yml create mode 100644 codebuild/py39/awses_2.0.0.yml create mode 100644 codebuild/py39/awses_latest.yml create mode 100644 codebuild/py39/awses_local.yml create mode 100644 codebuild/py39/decrypt_dafny_esdk_vectors.yml create mode 100644 codebuild/py39/decrypt_masterkey_with_js.yml create mode 100644 codebuild/py39/decrypt_masterkey_with_masterkey.yml create mode 100644 codebuild/py39/decrypt_net_401_vectors.yml create mode 100644 codebuild/py39/encrypt_masterkey.yml create mode 100644 codebuild/py39/examples.yml create mode 100644 codebuild/py39/generate_decrypt_vectors_masterkey.yml create mode 100644 codebuild/py39/integ.yml diff --git a/.github/workflows/ci_codebuild-tests.yml b/.github/workflows/ci_codebuild-tests.yml index 77076e49d..323a8ca48 100644 --- a/.github/workflows/ci_codebuild-tests.yml +++ b/.github/workflows/ci_codebuild-tests.yml @@ -19,10 +19,14 @@ permissions: jobs: codebuild-tests: name: AWS CodeBuild CI - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest strategy: matrix: python: + - python_version: "38" + image: "aws/codebuild/standard:5.0" + - python_version: "39" + image: "aws/codebuild/standard:5.0" - python_version: "310" image: "aws/codebuild/standard:6.0" - python_version: "311" diff --git a/.github/workflows/ci_codebuild_batch.yml b/.github/workflows/ci_codebuild_batch.yml index 3eb026045..243638f65 100644 --- a/.github/workflows/ci_codebuild_batch.yml +++ b/.github/workflows/ci_codebuild_batch.yml @@ -12,10 +12,304 @@ permissions: contents: read jobs: + # Python 3.8 jobs + py38_integ: + name: Python 3.8 Integration Tests + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/integ.yml + image-override: aws/codebuild/standard:5.0 + + py38_examples: + name: Python 3.8 Examples + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/examples.yml + image-override: aws/codebuild/standard:5.0 + + py38_decrypt_dafny_esdk_vectors: + name: Python 3.8 Decrypt Dafny ESDK Vectors + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/decrypt_dafny_esdk_vectors.yml + image-override: aws/codebuild/standard:5.0 + + py38_decrypt_net_401_vectors: + name: Python 3.8 Decrypt .NET 4.0.1 Vectors + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/decrypt_net_401_vectors.yml + image-override: aws/codebuild/standard:5.0 + + py38_encrypt_masterkey: + name: Python 3.8 Encrypt Masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/encrypt_masterkey.yml + image-override: aws/codebuild/standard:5.0 + + py38_generate_decrypt_vectors_masterkey: + name: Python 3.8 Generate Decrypt Vectors Masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/generate_decrypt_vectors_masterkey.yml + image-override: aws/codebuild/standard:5.0 + + py38_decrypt_masterkey_with_masterkey: + name: Python 3.8 Decrypt Masterkey with Masterkey + needs: py38_generate_decrypt_vectors_masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/decrypt_masterkey_with_masterkey.yml + image-override: aws/codebuild/standard:5.0 + + py38_decrypt_masterkey_with_js: + name: Python 3.8 Decrypt Masterkey with JS + needs: py38_generate_decrypt_vectors_masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py38/decrypt_masterkey_with_js.yml + image-override: aws/codebuild/standard:5.0 + + # Python 3.9 jobs + py39_integ: + name: Python 3.9 Integration Tests + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/integ.yml + image-override: aws/codebuild/standard:5.0 + + py39_examples: + name: Python 3.9 Examples + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/examples.yml + image-override: aws/codebuild/standard:5.0 + + py39_decrypt_dafny_esdk_vectors: + name: Python 3.9 Decrypt Dafny ESDK Vectors + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/decrypt_dafny_esdk_vectors.yml + image-override: aws/codebuild/standard:5.0 + + py39_decrypt_net_401_vectors: + name: Python 3.9 Decrypt .NET 4.0.1 Vectors + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/decrypt_net_401_vectors.yml + image-override: aws/codebuild/standard:5.0 + + py39_encrypt_masterkey: + name: Python 3.9 Encrypt Masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/encrypt_masterkey.yml + image-override: aws/codebuild/standard:5.0 + + py39_generate_decrypt_vectors_masterkey: + name: Python 3.9 Generate Decrypt Vectors Masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/generate_decrypt_vectors_masterkey.yml + image-override: aws/codebuild/standard:5.0 + + py39_decrypt_masterkey_with_masterkey: + name: Python 3.9 Decrypt Masterkey with Masterkey + needs: py39_generate_decrypt_vectors_masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/decrypt_masterkey_with_masterkey.yml + image-override: aws/codebuild/standard:5.0 + + py39_decrypt_masterkey_with_js: + name: Python 3.9 Decrypt Masterkey with JS + needs: py39_generate_decrypt_vectors_masterkey + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} + aws-region: us-west-2 + role-duration-seconds: 7200 + - name: Run CodeBuild + uses: aws-actions/aws-codebuild-run-build@v1 + timeout-minutes: 120 + with: + project-name: python-esdk + buildspec-override: codebuild/py39/decrypt_masterkey_with_js.yml + image-override: aws/codebuild/standard:5.0 + # Python 3.10 jobs py310_integ: name: Python 3.10 Integration Tests - runs-on: &codebuild-linux codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -33,7 +327,7 @@ jobs: py310_examples: name: Python 3.10 Examples - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -51,7 +345,7 @@ jobs: py310_decrypt_dafny_esdk_vectors: name: Python 3.10 Decrypt Dafny ESDK Vectors - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -69,7 +363,7 @@ jobs: py310_decrypt_net_401_vectors: name: Python 3.10 Decrypt .NET 4.0.1 Vectors - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -87,7 +381,7 @@ jobs: py310_encrypt_masterkey: name: Python 3.10 Encrypt Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -105,7 +399,7 @@ jobs: py310_generate_decrypt_vectors_masterkey: name: Python 3.10 Generate Decrypt Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -124,7 +418,7 @@ jobs: py310_decrypt_masterkey_with_masterkey: name: Python 3.10 Decrypt Masterkey with Masterkey needs: py310_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -143,7 +437,7 @@ jobs: py310_decrypt_masterkey_with_js: name: Python 3.10 Decrypt Masterkey with JS needs: py310_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -162,7 +456,7 @@ jobs: # Python 3.11 jobs py311_integ: name: Python 3.11 Integration Tests - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -180,7 +474,7 @@ jobs: py311_integ_mpl: name: Python 3.11 Integration MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -198,7 +492,7 @@ jobs: py311_performance_tests_mpl: name: Python 3.11 Performance Tests MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -216,7 +510,7 @@ jobs: py311_examples: name: Python 3.11 Examples - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -234,7 +528,7 @@ jobs: py311_examples_mpl: name: Python 3.11 Examples MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -252,7 +546,7 @@ jobs: py311_decrypt_dafny_esdk_vectors_masterkey: name: Python 3.11 Decrypt Dafny ESDK Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -270,7 +564,7 @@ jobs: py311_decrypt_dafny_esdk_vectors_keyrings: name: Python 3.11 Decrypt Dafny ESDK Vectors Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -288,7 +582,7 @@ jobs: py311_decrypt_net_401_vectors_masterkey: name: Python 3.11 Decrypt .NET 4.0.1 Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -306,7 +600,7 @@ jobs: py311_decrypt_net_401_vectors_keyrings: name: Python 3.11 Decrypt .NET 4.0.1 Vectors Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -324,7 +618,7 @@ jobs: py311_encrypt_masterkey: name: Python 3.11 Encrypt Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -342,7 +636,7 @@ jobs: py311_encrypt_keyrings: name: Python 3.11 Encrypt Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -360,7 +654,7 @@ jobs: py311_generate_decrypt_vectors_masterkey: name: Python 3.11 Generate Decrypt Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -379,7 +673,7 @@ jobs: py311_decrypt_masterkey_with_masterkey: name: Python 3.11 Decrypt Masterkey with Masterkey needs: py311_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -398,7 +692,7 @@ jobs: py311_decrypt_masterkey_with_keyrings: name: Python 3.11 Decrypt Masterkey with Keyrings needs: py311_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -417,7 +711,7 @@ jobs: py311_decrypt_masterkey_with_js: name: Python 3.11 Decrypt Masterkey with JS needs: py311_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -435,7 +729,7 @@ jobs: py311_generate_decrypt_vectors_keyrings: name: Python 3.11 Generate Decrypt Vectors Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -454,7 +748,7 @@ jobs: py311_decrypt_keyrings_with_masterkey: name: Python 3.11 Decrypt Keyrings with Masterkey needs: py311_generate_decrypt_vectors_keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -473,7 +767,7 @@ jobs: py311_decrypt_keyrings_with_keyrings: name: Python 3.11 Decrypt Keyrings with Keyrings needs: py311_generate_decrypt_vectors_keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -492,7 +786,7 @@ jobs: py311_decrypt_keyrings_with_js: name: Python 3.11 Decrypt Keyrings with JS needs: py311_generate_decrypt_vectors_keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -510,7 +804,7 @@ jobs: py311_decrypt_golden_manifest_with_keyrings: name: Python 3.11 Decrypt Golden Manifest with Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -528,7 +822,7 @@ jobs: py311_decrypt_golden_manifest_with_masterkey: name: Python 3.11 Decrypt Golden Manifest with Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -547,7 +841,7 @@ jobs: # Python 3.12 jobs py312_integ: name: Python 3.12 Integration Tests - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -565,7 +859,7 @@ jobs: py312_integ_mpl: name: Python 3.12 Integration MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -583,7 +877,7 @@ jobs: py312_performance_tests_mpl: name: Python 3.12 Performance Tests MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -601,7 +895,7 @@ jobs: py312_examples: name: Python 3.12 Examples - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -619,7 +913,7 @@ jobs: py312_examples_mpl: name: Python 3.12 Examples MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -637,7 +931,7 @@ jobs: py312_decrypt_dafny_esdk_vectors_masterkey: name: Python 3.12 Decrypt Dafny ESDK Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -655,7 +949,7 @@ jobs: py312_decrypt_dafny_esdk_vectors_keyrings: name: Python 3.12 Decrypt Dafny ESDK Vectors Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -673,7 +967,7 @@ jobs: py312_decrypt_net_401_vectors_masterkey: name: Python 3.12 Decrypt .NET 4.0.1 Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -691,7 +985,7 @@ jobs: py312_decrypt_net_401_vectors_keyrings: name: Python 3.12 Decrypt .NET 4.0.1 Vectors Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -709,7 +1003,7 @@ jobs: py312_encrypt_masterkey: name: Python 3.12 Encrypt Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -727,7 +1021,7 @@ jobs: py312_encrypt_keyrings: name: Python 3.12 Encrypt Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -745,7 +1039,7 @@ jobs: py312_generate_decrypt_vectors_masterkey: name: Python 3.12 Generate Decrypt Vectors Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -764,7 +1058,7 @@ jobs: py312_decrypt_masterkey_with_masterkey: name: Python 3.12 Decrypt Masterkey with Masterkey needs: py312_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -783,7 +1077,7 @@ jobs: py312_decrypt_masterkey_with_keyrings: name: Python 3.12 Decrypt Masterkey with Keyrings needs: py312_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -802,7 +1096,7 @@ jobs: py312_decrypt_masterkey_with_js: name: Python 3.12 Decrypt Masterkey with JS needs: py312_generate_decrypt_vectors_masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -820,7 +1114,7 @@ jobs: py312_generate_decrypt_vectors_keyrings: name: Python 3.12 Generate Decrypt Vectors Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -839,7 +1133,7 @@ jobs: py312_decrypt_keyrings_with_masterkey: name: Python 3.12 Decrypt Keyrings with Masterkey needs: py312_generate_decrypt_vectors_keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -858,7 +1152,7 @@ jobs: py312_decrypt_keyrings_with_keyrings: name: Python 3.12 Decrypt Keyrings with Keyrings needs: py312_generate_decrypt_vectors_keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -877,7 +1171,7 @@ jobs: py312_decrypt_keyrings_with_js: name: Python 3.12 Decrypt Keyrings with JS needs: py312_generate_decrypt_vectors_keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -895,7 +1189,7 @@ jobs: py312_generate_hkeyring_decrypt_vectors: name: Python 3.12 Generate HKeyring Decrypt Vectors - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -914,7 +1208,7 @@ jobs: py312_decrypt_hkeyring_with_masterkey: name: Python 3.12 Decrypt HKeyring with Masterkey needs: py312_generate_hkeyring_decrypt_vectors - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -933,7 +1227,7 @@ jobs: py312_decrypt_hkeyring_with_keyrings: name: Python 3.12 Decrypt HKeyring with Keyrings needs: py312_generate_hkeyring_decrypt_vectors - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -952,7 +1246,7 @@ jobs: py312_decrypt_hkeyring_with_net: name: Python 3.12 Decrypt HKeyring with .NET needs: py312_generate_hkeyring_decrypt_vectors - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -970,7 +1264,7 @@ jobs: py312_decrypt_golden_manifest_with_keyrings: name: Python 3.12 Decrypt Golden Manifest with Keyrings - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -988,7 +1282,7 @@ jobs: py312_decrypt_golden_manifest_with_masterkey: name: Python 3.12 Decrypt Golden Manifest with Masterkey - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1007,7 +1301,7 @@ jobs: # Code Coverage and Compliance jobs code_coverage: name: Code Coverage - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1024,7 +1318,7 @@ jobs: code_coverage_mpl: name: Code Coverage MPL - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1042,7 +1336,7 @@ jobs: compliance: name: Compliance - runs-on: *codebuild-linux + runs-on: ubuntu-latest steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 diff --git a/.github/workflows/ci_decrypt-oracle.yaml b/.github/workflows/ci_decrypt-oracle.yaml index 6f79d67f7..c56e43a63 100644 --- a/.github/workflows/ci_decrypt-oracle.yaml +++ b/.github/workflows/ci_decrypt-oracle.yaml @@ -8,7 +8,7 @@ permissions: jobs: tests: - runs-on: &codebuild-linux codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -25,7 +25,7 @@ jobs: cd decrypt_oracle tox -- -vv static-analysis: - runs-on: *codebuild-linux + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_static-analysis.yaml b/.github/workflows/ci_static-analysis.yaml index 9b7dc1460..d8175396e 100644 --- a/.github/workflows/ci_static-analysis.yaml +++ b/.github/workflows/ci_static-analysis.yaml @@ -8,7 +8,7 @@ permissions: jobs: analysis: - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_test-vector-handler.yaml b/.github/workflows/ci_test-vector-handler.yaml index 159a09f92..340d4d5a9 100644 --- a/.github/workflows/ci_test-vector-handler.yaml +++ b/.github/workflows/ci_test-vector-handler.yaml @@ -8,15 +8,6 @@ on: required: true INTEG_AWS_SECRET_ACCESS_KEY: required: true - inputs: - platforms: - type: string - # runs on macos-15-intel as macos-latest does not work in all python versions. - default: >- - [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}, - {"os": "windows-latest", "runner": "windows-latest"}, - {"os": "macos-latest", "runner": "macos-latest"}, - {"os": "macos-15-intel", "runner": "macos-15-intel"}] permissions: contents: read @@ -26,13 +17,18 @@ jobs: # Leaving this defined but disabled # until we address the credentials problem. if: 1 == 0 - runs-on: ${{ matrix.platform.runner }} + runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: - platform: ${{ fromJSON(inputs.platforms) }} + os: + - ubuntu-latest + - windows-latest + - macos-latest + # runs on macos-15-intel as macos-latest does not work in all python versions. + - macos-15-intel python: - - "3.10" + - 3.8 - 3.x architecture: - x64 @@ -43,11 +39,9 @@ jobs: - awses_latest exclude: # x86 builds are only meaningful for Windows - - platform: - os: ubuntu-latest + - os: ubuntu-latest architecture: x86 - - platform: - os: macos-latest + - os: macos-latest architecture: x86 steps: - uses: aws-actions/configure-aws-credentials@v4 @@ -70,8 +64,7 @@ jobs: cd test_vector_handlers tox -- -vv static-analysis: - if: contains(fromJSON(inputs.platforms).*.os, 'ubuntu-latest') - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 94d9e0e2d..607b5c9e1 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -2,13 +2,6 @@ name: Continuous Integration tests on: workflow_call: - inputs: - platforms: - type: string - default: >- - [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}, - {"os": "windows-latest", "runner": "windows-latest"}, - {"os": "macos-latest", "runner": "macos-latest"}] env: AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: | @@ -25,12 +18,17 @@ permissions: jobs: tests: - runs-on: ${{ matrix.platform.runner }} + runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: - platform: ${{ fromJSON(inputs.platforms) }} + os: + - ubuntu-latest + - windows-latest + - macos-latest python: + - 3.8 + - 3.9 - "3.10" - "3.11" - "3.12" @@ -54,16 +52,19 @@ jobs: exclude: # Python <3.11 incompatible with macOS ARM64 runners # https://github.com/actions/setup-python/issues/948 + - python: 3.7 + os: macos-latest + - python: 3.8 + os: macos-latest + - python: 3.9 + os: macos-latest - python: 3.10 - platform: - os: macos-latest + os: macos-latest # x86 builds are only meaningful for Windows - - platform: - os: ubuntu-latest + - os: ubuntu-latest architecture: x86 - - platform: - os: macos-latest + - os: macos-latest architecture: x86 # `cryptography` no longer publishes 32-bit Windows wheels for @@ -76,11 +77,16 @@ jobs: # provisioning (i686 Rust target + 32-bit OpenSSL) per cell, # which isn't worth it for a configuration upstream no longer # supports. - - platform: - os: windows-latest + - os: windows-latest architecture: x86 # MPL is not supported on <3.11 + - python: 3.7 + optional_mpl_dependency: -mpl + - python: 3.8 + optional_mpl_dependency: -mpl + - python: 3.9 + optional_mpl_dependency: -mpl - python: 3.10 optional_mpl_dependency: -mpl # mpllocal requires the MPL to be installed @@ -106,8 +112,7 @@ jobs: TOXENV: ${{ matrix.category }}${{ matrix.optional_mpl_dependency }} run: tox -- -vv upstream-py311: - if: contains(fromJSON(inputs.platforms).*.os, 'ubuntu-latest') - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest strategy: fail-fast: true matrix: diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index e8bc3b093..308bfbda2 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -10,7 +10,7 @@ permissions: jobs: dependabot: - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Dependabot metadata diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index e07fc2a14..01caa4904 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -29,35 +29,11 @@ jobs: uses: ./.github/workflows/ci_static-analysis.yaml test_vector_handler: uses: ./.github/workflows/ci_test-vector-handler.yaml - with: - platforms: >- - [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}] - secrets: - INTEG_AWS_ACCESS_KEY_ID: ${{ secrets.INTEG_AWS_ACCESS_KEY_ID }} - INTEG_AWS_SECRET_ACCESS_KEY: ${{ secrets.INTEG_AWS_SECRET_ACCESS_KEY }} - test_vector_handler_macos_windows: - name: test_vector_handler (macOS, Windows) - uses: ./.github/workflows/ci_test-vector-handler.yaml - with: - platforms: >- - [{"os": "windows-latest", "runner": "windows-latest"}, - {"os": "macos-latest", "runner": "macos-latest"}, - {"os": "macos-15-intel", "runner": "macos-15-intel"}] secrets: INTEG_AWS_ACCESS_KEY_ID: ${{ secrets.INTEG_AWS_ACCESS_KEY_ID }} INTEG_AWS_SECRET_ACCESS_KEY: ${{ secrets.INTEG_AWS_SECRET_ACCESS_KEY }} tests: uses: ./.github/workflows/ci_tests.yaml - with: - platforms: >- - [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}] - tests_macos_windows: - name: tests (macOS, Windows) - uses: ./.github/workflows/ci_tests.yaml - with: - platforms: >- - [{"os": "windows-latest", "runner": "windows-latest"}, - {"os": "macos-latest", "runner": "macos-latest"}] pr-ci-all-required: if: always() needs: @@ -67,7 +43,7 @@ jobs: - static_analysis - test_vector_handler - tests - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-22.04 steps: - name: Verify all required jobs passed uses: re-actors/alls-green@release/v1 diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index b5b795101..cf250b944 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -11,7 +11,7 @@ jobs: repo-sync: name: Repo Sync environment: repo-sync - runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: repo-sync/github-sync@v2 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9fa906b74..82c9c983c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.10" + python: "3.8" # Build documentation in the doc/ directory with Sphinx sphinx: diff --git a/README.rst b/README.rst index 5b12e74ec..daa345b02 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,7 @@ Getting Started Required Prerequisites ====================== -* Python 3.10+ +* Python 3.8+ * cryptography >= 3.4.6 * boto3 >= 1.10.0 * attrs diff --git a/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml b/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml index a991f54ea..bc7086d96 100644 --- a/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml +++ b/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml @@ -20,7 +20,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml index 6cb254375..a26105627 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_keyrings_with_keyrings.yml b/codebuild/py311/decrypt_keyrings_with_keyrings.yml index 1301e2278..8e4e81972 100644 --- a/codebuild/py311/decrypt_keyrings_with_keyrings.yml +++ b/codebuild/py311/decrypt_keyrings_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_masterkey_with_keyrings.yml b/codebuild/py311/decrypt_masterkey_with_keyrings.yml index d4ca65da0..ddb3ebc0a 100644 --- a/codebuild/py311/decrypt_masterkey_with_keyrings.yml +++ b/codebuild/py311/decrypt_masterkey_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_net_401_vectors_keyrings.yml b/codebuild/py311/decrypt_net_401_vectors_keyrings.yml index b36b310cd..f9a0b7db6 100644 --- a/codebuild/py311/decrypt_net_401_vectors_keyrings.yml +++ b/codebuild/py311/decrypt_net_401_vectors_keyrings.yml @@ -17,7 +17,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/encrypt_keyrings.yml b/codebuild/py311/encrypt_keyrings.yml index 0c53de97e..ef2492086 100644 --- a/codebuild/py311/encrypt_keyrings.yml +++ b/codebuild/py311/encrypt_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/generate_decrypt_vectors_keyrings.yml b/codebuild/py311/generate_decrypt_vectors_keyrings.yml index 3d514263c..78b9658c9 100644 --- a/codebuild/py311/generate_decrypt_vectors_keyrings.yml +++ b/codebuild/py311/generate_decrypt_vectors_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 10.0 + dotnet: 6.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml b/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml index 1dfc6d0d2..55f6661cc 100644 --- a/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml +++ b/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml @@ -20,7 +20,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml index 449834304..856810375 100644 --- a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_hkeyring_with_keyrings.yml b/codebuild/py312/decrypt_hkeyring_with_keyrings.yml index bae796b4c..971859af7 100644 --- a/codebuild/py312/decrypt_hkeyring_with_keyrings.yml +++ b/codebuild/py312/decrypt_hkeyring_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_hkeyring_with_net.yml b/codebuild/py312/decrypt_hkeyring_with_net.yml index 2ad7eafaa..d3ed7b7a3 100644 --- a/codebuild/py312/decrypt_hkeyring_with_net.yml +++ b/codebuild/py312/decrypt_hkeyring_with_net.yml @@ -11,15 +11,11 @@ env: arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - # The .NET test vectors (aws/aws-encryption-sdk) only target net6.0, which the CodeBuild - # image no longer provides. Let the net6.0 test host roll forward to the installed .NET 10 runtime. - DOTNET_ROLL_FORWARD: "Major" phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 pre_build: commands: # Download previously generated vectors diff --git a/codebuild/py312/decrypt_keyrings_with_keyrings.yml b/codebuild/py312/decrypt_keyrings_with_keyrings.yml index 39e443726..23c3310b5 100644 --- a/codebuild/py312/decrypt_keyrings_with_keyrings.yml +++ b/codebuild/py312/decrypt_keyrings_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_masterkey_with_keyrings.yml b/codebuild/py312/decrypt_masterkey_with_keyrings.yml index a56b7b338..a006205c4 100644 --- a/codebuild/py312/decrypt_masterkey_with_keyrings.yml +++ b/codebuild/py312/decrypt_masterkey_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_net_401_vectors_keyrings.yml b/codebuild/py312/decrypt_net_401_vectors_keyrings.yml index a9a7caaf0..d89b93af1 100644 --- a/codebuild/py312/decrypt_net_401_vectors_keyrings.yml +++ b/codebuild/py312/decrypt_net_401_vectors_keyrings.yml @@ -17,7 +17,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/encrypt_keyrings.yml b/codebuild/py312/encrypt_keyrings.yml index bcc728533..3c0f0e36e 100644 --- a/codebuild/py312/encrypt_keyrings.yml +++ b/codebuild/py312/encrypt_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/generate_decrypt_vectors_keyrings.yml b/codebuild/py312/generate_decrypt_vectors_keyrings.yml index b5ce62fa7..f995a82e6 100644 --- a/codebuild/py312/generate_decrypt_vectors_keyrings.yml +++ b/codebuild/py312/generate_decrypt_vectors_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 10.0 + dotnet: 6.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py38/awses_local.yml b/codebuild/py38/awses_local.yml new file mode 100644 index 000000000..9876de247 --- /dev/null +++ b/codebuild/py38/awses_local.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-awses_local" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" + +phases: + install: + runtime-versions: + python: 3.8 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - tox diff --git a/codebuild/py38/decrypt_dafny_esdk_vectors.yml b/codebuild/py38/decrypt_dafny_esdk_vectors.yml new file mode 100644 index 000000000..3bc966126 --- /dev/null +++ b/codebuild/py38/decrypt_dafny_esdk_vectors.yml @@ -0,0 +1,58 @@ +version: 0.2 +# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM + +env: + variables: + TOXENV: "py38-full_decrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + git-credential-helper: yes + secrets-manager: + GITHUB_TOKEN: Github/lucasmcdonald3-fgpat:actions read + +phases: + install: + runtime-versions: + python: 3.8 + pre_build: + commands: + # Fetch test vectors from Dafny ESDK's most recent run + # (Assuming the first result is most recent; seems to be correct...) + - | + MOST_RECENT_RUN_ID=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs?branch=mainline&status=completed&page=1&exclude_pull_requests=true" \ + | jq 'first(.workflow_runs[] | select(.name=="Daily CI") | .id)') + - | + echo "DEBUG: Fetching artifact from run $MOST_RECENT_RUN_ID" + - | + MOST_RECENT_RUN_DOWNLOAD_URL=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs/$MOST_RECENT_RUN_ID/artifacts?name=ubuntu-22.04_vector_artifact" \ + | jq '.artifacts[0].archive_download_url') + - | + echo "DEBUG: Fetching artifact at $MOST_RECENT_RUN_DOWNLOAD_URL" + - | + curl -L -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + $(echo $MOST_RECENT_RUN_DOWNLOAD_URL | tr -d '"') -o ubuntu-22.04_vector_artifact.zip + # This unzips to `net41.zip`. + - unzip ubuntu-22.04_vector_artifact + # This unzips to `net41/`. + - unzip net41.zip -d net41 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../net41/manifest.json diff --git a/codebuild/py38/decrypt_masterkey_with_js.yml b/codebuild/py38/decrypt_masterkey_with_js.yml new file mode 100644 index 000000000..5ed891732 --- /dev/null +++ b/codebuild/py38/decrypt_masterkey_with_js.yml @@ -0,0 +1,34 @@ +version: 0.2 + +env: + variables: + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + commands: + - n 22 + # Install the Javascript ESDK run test vectors + - npm install -g @aws-crypto/integration-node + + pre_build: + commands: + # Download previously generated vectors + - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/38_masterkey.zip 38_masterkey.zip + # Repackage zip in expected format + - unzip 38_masterkey.zip + - cd 38_masterkey + - zip -r vectors.zip . + build: + commands: + # Decrypt generated vectors with Javascript ESDK + - integration-node decrypt -v vectors.zip \ No newline at end of file diff --git a/codebuild/py38/decrypt_masterkey_with_masterkey.yml b/codebuild/py38/decrypt_masterkey_with_masterkey.yml new file mode 100644 index 000000000..6b32dcf15 --- /dev/null +++ b/codebuild/py38/decrypt_masterkey_with_masterkey.yml @@ -0,0 +1,30 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-full_decrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + pre_build: + commands: + # Download previously generated vectors + - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/38_masterkey.zip 38_masterkey.zip + - unzip 38_masterkey.zip + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../38_masterkey/manifest.json \ No newline at end of file diff --git a/codebuild/py38/decrypt_net_401_vectors.yml b/codebuild/py38/decrypt_net_401_vectors.yml new file mode 100644 index 000000000..91163f14d --- /dev/null +++ b/codebuild/py38/decrypt_net_401_vectors.yml @@ -0,0 +1,35 @@ +version: 0.2 +# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM + +env: + variables: + TOXENV: "py38-full_decrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + pre_build: + commands: + # Fetch ESDK .NET v4.0.1 Test Vectors + - VECTOR_ZIP=$CODEBUILD_SRC_DIR/v4-Net-4.0.1.zip + - VECTORS_URL=https://github.com/aws/aws-encryption-sdk/raw/mainline/AwsEncryptionSDK/runtimes/net/TestVectorsNative/TestVectors/resources/v4-Net-4.0.1.zip + - curl -s --output $VECTOR_ZIP --location $VECTORS_URL + - UNZIPPED_VECTORS_DIR=$CODEBUILD_SRC_DIR/test_vector_handlers/net_401_vectors + - unzip $VECTOR_ZIP -d $UNZIPPED_VECTORS_DIR + build: + commands: + # NOTE: We need to pass the absolute path of the vectors + - pip install "tox < 4.0" + - cd $CODEBUILD_SRC_DIR/test_vector_handlers + - | + tox -- \ + --input $UNZIPPED_VECTORS_DIR/manifest.json diff --git a/codebuild/py38/encrypt_masterkey.yml b/codebuild/py38/encrypt_masterkey.yml new file mode 100644 index 000000000..b05396cc2 --- /dev/null +++ b/codebuild/py38/encrypt_masterkey.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-full_encrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v2.json diff --git a/codebuild/py38/examples.yml b/codebuild/py38/examples.yml new file mode 100644 index 000000000..4dff71d65 --- /dev/null +++ b/codebuild/py38/examples.yml @@ -0,0 +1,22 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-examples" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + build: + commands: + - pip install "tox < 4.0" + - tox diff --git a/codebuild/py38/generate_decrypt_vectors_masterkey.yml b/codebuild/py38/generate_decrypt_vectors_masterkey.yml new file mode 100644 index 000000000..8705ef57c --- /dev/null +++ b/codebuild/py38/generate_decrypt_vectors_masterkey.yml @@ -0,0 +1,28 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-full_decrypt_generate" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0006-awses-message-decryption-generation.v2.json \ + --output 38_masterkey + - zip -r 38_masterkey.zip 38_masterkey + - aws s3 cp 38_masterkey.zip s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/38_masterkey.zip diff --git a/codebuild/py38/integ.yml b/codebuild/py38/integ.yml new file mode 100644 index 000000000..8b7acafe1 --- /dev/null +++ b/codebuild/py38/integ.yml @@ -0,0 +1,22 @@ +version: 0.2 + +env: + variables: + TOXENV: "py38-integ" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.8 + build: + commands: + - pip install "tox < 4.0" + - tox diff --git a/codebuild/py39/awses_1.7.1.yml b/codebuild/py39/awses_1.7.1.yml new file mode 100644 index 000000000..22267ad8f --- /dev/null +++ b/codebuild/py39/awses_1.7.1.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-awses_1.7.1" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - tox diff --git a/codebuild/py39/awses_2.0.0.yml b/codebuild/py39/awses_2.0.0.yml new file mode 100644 index 000000000..d35e7e98c --- /dev/null +++ b/codebuild/py39/awses_2.0.0.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-awses_2.0.0" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - tox diff --git a/codebuild/py39/awses_latest.yml b/codebuild/py39/awses_latest.yml new file mode 100644 index 000000000..719ab2238 --- /dev/null +++ b/codebuild/py39/awses_latest.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-awses_latest" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - tox diff --git a/codebuild/py39/awses_local.yml b/codebuild/py39/awses_local.yml new file mode 100644 index 000000000..e56a9ff45 --- /dev/null +++ b/codebuild/py39/awses_local.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-awses_local" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" + AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - tox diff --git a/codebuild/py39/decrypt_dafny_esdk_vectors.yml b/codebuild/py39/decrypt_dafny_esdk_vectors.yml new file mode 100644 index 000000000..a22c4d079 --- /dev/null +++ b/codebuild/py39/decrypt_dafny_esdk_vectors.yml @@ -0,0 +1,58 @@ +version: 0.2 +# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM + +env: + variables: + TOXENV: "py39-full_decrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + git-credential-helper: yes + secrets-manager: + GITHUB_TOKEN: Github/lucasmcdonald3-fgpat:actions read + +phases: + install: + runtime-versions: + python: 3.9 + pre_build: + commands: + # Fetch test vectors from Dafny ESDK's most recent run + # (Assuming the first result is most recent; seems to be correct...) + - | + MOST_RECENT_RUN_ID=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs?branch=mainline&status=completed&page=1&exclude_pull_requests=true" \ + | jq 'first(.workflow_runs[] | select(.name=="Daily CI") | .id)') + - | + echo "DEBUG: Fetching artifact from run $MOST_RECENT_RUN_ID" + - | + MOST_RECENT_RUN_DOWNLOAD_URL=$(curl -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs/$MOST_RECENT_RUN_ID/artifacts?name=ubuntu-22.04_vector_artifact" \ + | jq '.artifacts[0].archive_download_url') + - | + echo "DEBUG: Fetching artifact at $MOST_RECENT_RUN_DOWNLOAD_URL" + - | + curl -L -H "Accept: application/vnd.github+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + $(echo $MOST_RECENT_RUN_DOWNLOAD_URL | tr -d '"') -o ubuntu-22.04_vector_artifact.zip + # This unzips to `net41.zip`. + - unzip ubuntu-22.04_vector_artifact + # This unzips to `net41/`. + - unzip net41.zip -d net41 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../net41/manifest.json diff --git a/codebuild/py39/decrypt_masterkey_with_js.yml b/codebuild/py39/decrypt_masterkey_with_js.yml new file mode 100644 index 000000000..ccb097f39 --- /dev/null +++ b/codebuild/py39/decrypt_masterkey_with_js.yml @@ -0,0 +1,34 @@ +version: 0.2 + +env: + variables: + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + commands: + - n 22 + # Install the Javascript ESDK run test vectors + - npm install -g @aws-crypto/integration-node + + pre_build: + commands: + # Download previously generated vectors + - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/39_masterkey.zip 39_masterkey.zip + # Repackage zip in expected format + - unzip 39_masterkey.zip + - cd 39_masterkey + - zip -r vectors.zip . + build: + commands: + # Decrypt generated vectors with Javascript ESDK + - integration-node decrypt -v vectors.zip \ No newline at end of file diff --git a/codebuild/py39/decrypt_masterkey_with_masterkey.yml b/codebuild/py39/decrypt_masterkey_with_masterkey.yml new file mode 100644 index 000000000..fcd9d3220 --- /dev/null +++ b/codebuild/py39/decrypt_masterkey_with_masterkey.yml @@ -0,0 +1,30 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-full_decrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + pre_build: + commands: + # Download previously generated vectors + - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/39_masterkey.zip 39_masterkey.zip + - unzip 39_masterkey.zip + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../39_masterkey/manifest.json \ No newline at end of file diff --git a/codebuild/py39/decrypt_net_401_vectors.yml b/codebuild/py39/decrypt_net_401_vectors.yml new file mode 100644 index 000000000..d8a9ff453 --- /dev/null +++ b/codebuild/py39/decrypt_net_401_vectors.yml @@ -0,0 +1,35 @@ +version: 0.2 +# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM + +env: + variables: + TOXENV: "py39-full_decrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + pre_build: + commands: + # Fetch ESDK .NET v4.0.1 Test Vectors + - VECTOR_ZIP=$CODEBUILD_SRC_DIR/v4-Net-4.0.1.zip + - VECTORS_URL=https://github.com/aws/aws-encryption-sdk/raw/mainline/AwsEncryptionSDK/runtimes/net/TestVectorsNative/TestVectors/resources/v4-Net-4.0.1.zip + - curl -s --output $VECTOR_ZIP --location $VECTORS_URL + - UNZIPPED_VECTORS_DIR=$CODEBUILD_SRC_DIR/test_vector_handlers/net_401_vectors + - unzip $VECTOR_ZIP -d $UNZIPPED_VECTORS_DIR + build: + commands: + # NOTE: We need to pass the absolute path of the vectors + - pip install "tox < 4.0" + - cd $CODEBUILD_SRC_DIR/test_vector_handlers + - | + tox -- \ + --input $UNZIPPED_VECTORS_DIR/manifest.json diff --git a/codebuild/py39/encrypt_masterkey.yml b/codebuild/py39/encrypt_masterkey.yml new file mode 100644 index 000000000..3bf18fbde --- /dev/null +++ b/codebuild/py39/encrypt_masterkey.yml @@ -0,0 +1,25 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-full_encrypt" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v2.json diff --git a/codebuild/py39/examples.yml b/codebuild/py39/examples.yml new file mode 100644 index 000000000..3d1399251 --- /dev/null +++ b/codebuild/py39/examples.yml @@ -0,0 +1,22 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-examples" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - tox diff --git a/codebuild/py39/generate_decrypt_vectors_masterkey.yml b/codebuild/py39/generate_decrypt_vectors_masterkey.yml new file mode 100644 index 000000000..eb57d915a --- /dev/null +++ b/codebuild/py39/generate_decrypt_vectors_masterkey.yml @@ -0,0 +1,28 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-full_decrypt_generate" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0006-awses-message-decryption-generation.v2.json \ + --output 39_masterkey + - zip -r 39_masterkey.zip 39_masterkey + - aws s3 cp 39_masterkey.zip s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/39_masterkey.zip diff --git a/codebuild/py39/integ.yml b/codebuild/py39/integ.yml new file mode 100644 index 000000000..6dec85b07 --- /dev/null +++ b/codebuild/py39/integ.yml @@ -0,0 +1,22 @@ +version: 0.2 + +env: + variables: + TOXENV: "py39-integ" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- + arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- + arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- + arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + +phases: + install: + runtime-versions: + python: 3.9 + build: + commands: + - pip install "tox < 4.0" + - tox diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index 5e459c142..154261a39 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -8,8 +8,8 @@ phases: python: latest pre_build: commands: - - pyenv install --skip-existing 3.10.12 - - pyenv local 3.10.12 + - pyenv install --skip-existing 3.8.12 + - pyenv local 3.8.12 - pip install "tox < 4.0" build: commands: diff --git a/performance_tests/README.rst b/performance_tests/README.rst index a6c90cee9..67b2dd1ac 100644 --- a/performance_tests/README.rst +++ b/performance_tests/README.rst @@ -39,7 +39,7 @@ performance_tests directory. Required Prerequisites ********************** -* Python 3.10+ +* Python 3.8+ * aws-encryption-sdk * boto3 >= 1.10.0 * click diff --git a/setup.py b/setup.py index 3b30b8fcf..fb249a3f6 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,8 @@ def get_requirements(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/src/aws_encryption_sdk/compatability.py b/src/aws_encryption_sdk/compatability.py index 191c11cf9..9900a8893 100644 --- a/src/aws_encryption_sdk/compatability.py +++ b/src/aws_encryption_sdk/compatability.py @@ -14,11 +14,9 @@ def _warn_deprecated_python(): (3, 4): {"date": DEPRECATION_DATE_MAP["2.x"]}, (3, 5): {"date": "2021-11-10"}, (3, 7): {"date": "2024-03-04"}, - (3, 8): {"date": "2024-10-07"}, - (3, 9): {"date": "2025-10-31"}, } py_version = (sys.version_info.major, sys.version_info.minor) - minimum_version = (3, 10) + minimum_version = (3, 8) if py_version in deprecated_versions: params = deprecated_versions[py_version] diff --git a/src/aws_encryption_sdk/internal/formatting/deserialize.py b/src/aws_encryption_sdk/internal/formatting/deserialize.py index bb8fde331..c90dc9124 100644 --- a/src/aws_encryption_sdk/internal/formatting/deserialize.py +++ b/src/aws_encryption_sdk/internal/formatting/deserialize.py @@ -74,15 +74,11 @@ def validate_header(header, header_auth, raw_header, data_key): raise SerializationError("Header authorization failed") -def _verified_version_from_id(version_id, stream): - # type: (int, IO) -> SerializationVersion +def _verified_version_from_id(version_id): + # type: (int) -> SerializationVersion """Load a message :class:`SerializationVersion` for the specified version ID. - If the version ID is not supported, reads one more byte from ``stream`` to check - whether the message appears to be Base64 encoded. - :param int version_id: Message format version ID - :param io.BytesIO stream: Source data stream :return: Message format version :rtype: SerializationVersion :raises NotSupportedError: if unsupported version ID is received @@ -90,13 +86,6 @@ def _verified_version_from_id(version_id, stream): try: return SerializationVersion(version_id) except ValueError as error: - # A common mistake is for users to attempt decryption on the Base64 encoding of the encrypted message. - # Detect this from the Base64 encoding of the first two bytes of each supported message format version: - # V1: version 0x01, type 0x80 -> Base64 encoded as "AY" - # V2: version 0x02, algorithm suite ID 0x04XX or 0x05XX -> Base64 encoded as "Ag" - prefix = struct.pack(">B", version_id) + stream.read(1) - if prefix in {b"AY", b"Ag"}: - raise NotSupportedError("Message appears to be Base64 encoded, decode it before decrypting") from error raise NotSupportedError("Unsupported version {}".format(version_id), error) @@ -355,7 +344,7 @@ def deserialize_header(stream, max_encrypted_data_keys=None): tee = io.BytesIO() tee_stream = TeeStream(stream, tee) (version_id,) = unpack_values(">B", tee_stream) - version = _verified_version_from_id(version_id, tee_stream) + version = _verified_version_from_id(version_id) header = {} header["version"] = version diff --git a/test/functional/test_f_aws_encryption_sdk_client.py b/test/functional/test_f_aws_encryption_sdk_client.py index 0fcd713c1..244f8f7d7 100644 --- a/test/functional/test_f_aws_encryption_sdk_client.py +++ b/test/functional/test_f_aws_encryption_sdk_client.py @@ -3,7 +3,6 @@ """Functional test suite for aws_encryption_sdk.kms_thick_client""" from __future__ import division -import base64 import io import logging @@ -19,7 +18,7 @@ import aws_encryption_sdk from aws_encryption_sdk.caches import build_decryption_materials_cache_key, build_encryption_materials_cache_key -from aws_encryption_sdk.exceptions import CustomMaximumValueExceeded, NotSupportedError +from aws_encryption_sdk.exceptions import CustomMaximumValueExceeded from aws_encryption_sdk.identifiers import Algorithm, CommitmentPolicy, EncryptionKeyType, WrappingAlgorithm from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey from aws_encryption_sdk.internal.defaults import LINE_LENGTH @@ -626,27 +625,6 @@ def test_decrypt_oneshot_no_seek_input(): assert decrypted == VALUES["plaintext_128"] -@pytest.mark.parametrize( - "algorithm", - ( - Algorithm.AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384, # message format version 1 - Algorithm.AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384, # message format version 2 - ), -) -def test_decrypt_base64_encoded_message(algorithm): - """Test that decrypt raises a specific error when given the Base64 encoding of a message.""" - commitment_policy = CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT - if algorithm.is_committing(): - commitment_policy = CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT - client = aws_encryption_sdk.EncryptionSDKClient(commitment_policy=commitment_policy) - key_provider = fake_kms_key_provider(algorithm.kdf_input_len) - ciphertext, _header = client.encrypt(source=VALUES["plaintext_128"], key_provider=key_provider, algorithm=algorithm) - - with pytest.raises(NotSupportedError) as excinfo: - client.decrypt(source=base64.b64encode(ciphertext), key_provider=key_provider) - excinfo.match("Message appears to be Base64 encoded, decode it before decrypting") - - def test_stream_encryptor_readable(): """Verify that open StreamEncryptor instances report as readable.""" key_provider = fake_kms_key_provider() diff --git a/test/unit/test_compatability.py b/test/unit/test_compatability.py index a29f3867a..11400e241 100644 --- a/test/unit/test_compatability.py +++ b/test/unit/test_compatability.py @@ -28,11 +28,3 @@ def test_below_warn(self): v_info.minor = 7 with pytest.warns(DeprecationWarning): _warn_deprecated_python() - - @pytest.mark.parametrize("minor", (8, 9)) - def test_deprecated_py38_py39_warn(self, minor): - with mock.patch.object(sys, "version_info") as v_info: - v_info.major = 3 - v_info.minor = minor - with pytest.warns(DeprecationWarning, match="upgrade to Python 3.10 or later"): - _warn_deprecated_python() diff --git a/test/unit/test_deserialize.py b/test/unit/test_deserialize.py index 5af9b0134..f0273c428 100644 --- a/test/unit/test_deserialize.py +++ b/test/unit/test_deserialize.py @@ -1,7 +1,6 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Unit test suite for aws_encryption_sdk.deserialize""" -import base64 import io import struct @@ -131,28 +130,6 @@ def test_deserialize_header_unknown_version(self): aws_encryption_sdk.internal.formatting.deserialize.deserialize_header(stream) excinfo.match("Unsupported version *") - @pytest.mark.parametrize( - "serialized_header", (VALUES["serialized_header"], VALUES["serialized_header_v2_committing"]) - ) - def test_deserialize_header_base64_encoded(self, serialized_header): - """Validate that the deserialize_header function behaves - as expected for a Base64 encoded message. - """ - with pytest.raises(NotSupportedError) as excinfo: - stream = io.BytesIO(base64.b64encode(serialized_header)) - aws_encryption_sdk.internal.formatting.deserialize.deserialize_header(stream) - excinfo.match("Message appears to be Base64 encoded, decode it before decrypting") - - @pytest.mark.parametrize("serialized_header", (b"A", b"AX", b"BY")) - def test_deserialize_header_unknown_version_not_base64_encoded(self, serialized_header): - """Validate that the deserialize_header function behaves - as expected for an unknown message version that is not a Base64 encoded message. - """ - with pytest.raises(NotSupportedError) as excinfo: - stream = io.BytesIO(serialized_header) - aws_encryption_sdk.internal.formatting.deserialize.deserialize_header(stream) - excinfo.match("Unsupported version *") - @patch("aws_encryption_sdk.internal.formatting.deserialize.AlgorithmSuite.get_by_id") def test_deserialize_header_unsupported_data_encryption_algorithm(self, mock_algorithm_get): """Validate that the deserialize_header function behaves diff --git a/test_vector_handlers/README.rst b/test_vector_handlers/README.rst index 825756028..9bf6e5ce5 100644 --- a/test_vector_handlers/README.rst +++ b/test_vector_handlers/README.rst @@ -12,7 +12,7 @@ Getting Started Required Prerequisites ====================== -* Python 3.10+ +* Python 3.8+ * aws-encryption-sdk Use diff --git a/test_vector_handlers/setup.py b/test_vector_handlers/setup.py index 56f62ce6f..f09126929 100644 --- a/test_vector_handlers/setup.py +++ b/test_vector_handlers/setup.py @@ -46,6 +46,8 @@ def get_requirements(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Security", "Topic :: Security :: Cryptography", diff --git a/test_vector_handlers/tox.ini b/test_vector_handlers/tox.ini index 7d156369c..49d45cb3f 100644 --- a/test_vector_handlers/tox.ini +++ b/test_vector_handlers/tox.ini @@ -2,7 +2,7 @@ envlist = # The test vectors depend on new features now, # so until release we can only effectively test the local version of the ESDK. - py310-awses_local + py{37,38,39,310}-awses_local py{311,312}-awses_local{,-mpl} # 1.2.0 and 1.2.max are being difficult because of attrs bandit, doc8, readme, diff --git a/tox.ini b/tox.ini index 6b4df5785..a6666e3b1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = # <3.11: run all non-MPL tests - py310-{local,integ,accept,examples}, + py{38,39,310}-{local,integ,accept,examples}, # >=3.11: run all tests with MPL installed and without MPL installed # The `-mpl` suffix tells tox to install the MPL. # In the case where the suffix IS NOT appended, From 811747c0f8e428aaab0b0298a3cb4be728bfcac9 Mon Sep 17 00:00:00 2001 From: Anirav Kareddy Date: Tue, 17 Nov 2026 09:17:35 -0800 Subject: [PATCH 2/2] fix: detect Base64 encoded messages on decrypt, stop testing on Python 3.8 and 3.9 Co-authored-by: Eugene Pisarchik Co-authored-by: Lucas McDonald Co-authored-by: Anirav Kareddy --- .github/workflows/ci_codebuild-tests.yml | 6 +- .github/workflows/ci_codebuild_batch.yml | 408 +++--------------- .github/workflows/ci_decrypt-oracle.yaml | 4 +- .github/workflows/ci_static-analysis.yaml | 2 +- .github/workflows/ci_test-vector-handler.yaml | 29 +- .github/workflows/ci_tests.yaml | 43 +- .github/workflows/dependabot-auto-merge.yml | 2 +- .github/workflows/pull.yml | 26 +- .github/workflows/repo-sync.yml | 2 +- .readthedocs.yaml | 2 +- README.rst | 2 +- .../decrypt_dafny_esdk_vectors_keyrings.yml | 2 +- .../decrypt_golden_manifest_with_keyrings.yml | 2 +- .../py311/decrypt_keyrings_with_keyrings.yml | 2 +- .../py311/decrypt_masterkey_with_keyrings.yml | 2 +- .../decrypt_net_401_vectors_keyrings.yml | 2 +- codebuild/py311/encrypt_keyrings.yml | 2 +- .../generate_decrypt_vectors_keyrings.yml | 2 +- .../decrypt_dafny_esdk_vectors_keyrings.yml | 2 +- .../decrypt_golden_manifest_with_keyrings.yml | 2 +- .../py312/decrypt_hkeyring_with_keyrings.yml | 2 +- codebuild/py312/decrypt_hkeyring_with_net.yml | 4 + .../py312/decrypt_keyrings_with_keyrings.yml | 2 +- .../py312/decrypt_masterkey_with_keyrings.yml | 2 +- .../decrypt_net_401_vectors_keyrings.yml | 2 +- codebuild/py312/encrypt_keyrings.yml | 2 +- .../generate_decrypt_vectors_keyrings.yml | 2 +- codebuild/py38/awses_local.yml | 25 -- codebuild/py38/decrypt_dafny_esdk_vectors.yml | 58 --- codebuild/py38/decrypt_masterkey_with_js.yml | 34 -- .../py38/decrypt_masterkey_with_masterkey.yml | 30 -- codebuild/py38/decrypt_net_401_vectors.yml | 35 -- codebuild/py38/encrypt_masterkey.yml | 25 -- codebuild/py38/examples.yml | 22 - .../generate_decrypt_vectors_masterkey.yml | 28 -- codebuild/py38/integ.yml | 22 - codebuild/py39/awses_1.7.1.yml | 25 -- codebuild/py39/awses_2.0.0.yml | 25 -- codebuild/py39/awses_latest.yml | 25 -- codebuild/py39/awses_local.yml | 25 -- codebuild/py39/decrypt_dafny_esdk_vectors.yml | 58 --- codebuild/py39/decrypt_masterkey_with_js.yml | 34 -- .../py39/decrypt_masterkey_with_masterkey.yml | 30 -- codebuild/py39/decrypt_net_401_vectors.yml | 35 -- codebuild/py39/encrypt_masterkey.yml | 25 -- codebuild/py39/examples.yml | 22 - .../generate_decrypt_vectors_masterkey.yml | 28 -- codebuild/py39/integ.yml | 22 - codebuild/release/validate.yml | 4 +- performance_tests/README.rst | 2 +- setup.py | 2 - src/aws_encryption_sdk/compatability.py | 4 +- .../internal/formatting/deserialize.py | 17 +- .../test_f_aws_encryption_sdk_client.py | 24 +- test/unit/test_compatability.py | 8 + test/unit/test_deserialize.py | 23 + test_vector_handlers/README.rst | 2 +- test_vector_handlers/setup.py | 2 - test_vector_handlers/tox.ini | 2 +- tox.ini | 2 +- 60 files changed, 223 insertions(+), 1062 deletions(-) delete mode 100644 codebuild/py38/awses_local.yml delete mode 100644 codebuild/py38/decrypt_dafny_esdk_vectors.yml delete mode 100644 codebuild/py38/decrypt_masterkey_with_js.yml delete mode 100644 codebuild/py38/decrypt_masterkey_with_masterkey.yml delete mode 100644 codebuild/py38/decrypt_net_401_vectors.yml delete mode 100644 codebuild/py38/encrypt_masterkey.yml delete mode 100644 codebuild/py38/examples.yml delete mode 100644 codebuild/py38/generate_decrypt_vectors_masterkey.yml delete mode 100644 codebuild/py38/integ.yml delete mode 100644 codebuild/py39/awses_1.7.1.yml delete mode 100644 codebuild/py39/awses_2.0.0.yml delete mode 100644 codebuild/py39/awses_latest.yml delete mode 100644 codebuild/py39/awses_local.yml delete mode 100644 codebuild/py39/decrypt_dafny_esdk_vectors.yml delete mode 100644 codebuild/py39/decrypt_masterkey_with_js.yml delete mode 100644 codebuild/py39/decrypt_masterkey_with_masterkey.yml delete mode 100644 codebuild/py39/decrypt_net_401_vectors.yml delete mode 100644 codebuild/py39/encrypt_masterkey.yml delete mode 100644 codebuild/py39/examples.yml delete mode 100644 codebuild/py39/generate_decrypt_vectors_masterkey.yml delete mode 100644 codebuild/py39/integ.yml diff --git a/.github/workflows/ci_codebuild-tests.yml b/.github/workflows/ci_codebuild-tests.yml index 323a8ca48..77076e49d 100644 --- a/.github/workflows/ci_codebuild-tests.yml +++ b/.github/workflows/ci_codebuild-tests.yml @@ -19,14 +19,10 @@ permissions: jobs: codebuild-tests: name: AWS CodeBuild CI - runs-on: ubuntu-latest + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} strategy: matrix: python: - - python_version: "38" - image: "aws/codebuild/standard:5.0" - - python_version: "39" - image: "aws/codebuild/standard:5.0" - python_version: "310" image: "aws/codebuild/standard:6.0" - python_version: "311" diff --git a/.github/workflows/ci_codebuild_batch.yml b/.github/workflows/ci_codebuild_batch.yml index 243638f65..3eb026045 100644 --- a/.github/workflows/ci_codebuild_batch.yml +++ b/.github/workflows/ci_codebuild_batch.yml @@ -12,304 +12,10 @@ permissions: contents: read jobs: - # Python 3.8 jobs - py38_integ: - name: Python 3.8 Integration Tests - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/integ.yml - image-override: aws/codebuild/standard:5.0 - - py38_examples: - name: Python 3.8 Examples - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/examples.yml - image-override: aws/codebuild/standard:5.0 - - py38_decrypt_dafny_esdk_vectors: - name: Python 3.8 Decrypt Dafny ESDK Vectors - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/decrypt_dafny_esdk_vectors.yml - image-override: aws/codebuild/standard:5.0 - - py38_decrypt_net_401_vectors: - name: Python 3.8 Decrypt .NET 4.0.1 Vectors - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/decrypt_net_401_vectors.yml - image-override: aws/codebuild/standard:5.0 - - py38_encrypt_masterkey: - name: Python 3.8 Encrypt Masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/encrypt_masterkey.yml - image-override: aws/codebuild/standard:5.0 - - py38_generate_decrypt_vectors_masterkey: - name: Python 3.8 Generate Decrypt Vectors Masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/generate_decrypt_vectors_masterkey.yml - image-override: aws/codebuild/standard:5.0 - - py38_decrypt_masterkey_with_masterkey: - name: Python 3.8 Decrypt Masterkey with Masterkey - needs: py38_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/decrypt_masterkey_with_masterkey.yml - image-override: aws/codebuild/standard:5.0 - - py38_decrypt_masterkey_with_js: - name: Python 3.8 Decrypt Masterkey with JS - needs: py38_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py38/decrypt_masterkey_with_js.yml - image-override: aws/codebuild/standard:5.0 - - # Python 3.9 jobs - py39_integ: - name: Python 3.9 Integration Tests - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/integ.yml - image-override: aws/codebuild/standard:5.0 - - py39_examples: - name: Python 3.9 Examples - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/examples.yml - image-override: aws/codebuild/standard:5.0 - - py39_decrypt_dafny_esdk_vectors: - name: Python 3.9 Decrypt Dafny ESDK Vectors - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/decrypt_dafny_esdk_vectors.yml - image-override: aws/codebuild/standard:5.0 - - py39_decrypt_net_401_vectors: - name: Python 3.9 Decrypt .NET 4.0.1 Vectors - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/decrypt_net_401_vectors.yml - image-override: aws/codebuild/standard:5.0 - - py39_encrypt_masterkey: - name: Python 3.9 Encrypt Masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/encrypt_masterkey.yml - image-override: aws/codebuild/standard:5.0 - - py39_generate_decrypt_vectors_masterkey: - name: Python 3.9 Generate Decrypt Vectors Masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/generate_decrypt_vectors_masterkey.yml - image-override: aws/codebuild/standard:5.0 - - py39_decrypt_masterkey_with_masterkey: - name: Python 3.9 Decrypt Masterkey with Masterkey - needs: py39_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/decrypt_masterkey_with_masterkey.yml - image-override: aws/codebuild/standard:5.0 - - py39_decrypt_masterkey_with_js: - name: Python 3.9 Decrypt Masterkey with JS - needs: py39_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} - aws-region: us-west-2 - role-duration-seconds: 7200 - - name: Run CodeBuild - uses: aws-actions/aws-codebuild-run-build@v1 - timeout-minutes: 120 - with: - project-name: python-esdk - buildspec-override: codebuild/py39/decrypt_masterkey_with_js.yml - image-override: aws/codebuild/standard:5.0 - # Python 3.10 jobs py310_integ: name: Python 3.10 Integration Tests - runs-on: ubuntu-latest + runs-on: &codebuild-linux codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -327,7 +33,7 @@ jobs: py310_examples: name: Python 3.10 Examples - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -345,7 +51,7 @@ jobs: py310_decrypt_dafny_esdk_vectors: name: Python 3.10 Decrypt Dafny ESDK Vectors - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -363,7 +69,7 @@ jobs: py310_decrypt_net_401_vectors: name: Python 3.10 Decrypt .NET 4.0.1 Vectors - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -381,7 +87,7 @@ jobs: py310_encrypt_masterkey: name: Python 3.10 Encrypt Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -399,7 +105,7 @@ jobs: py310_generate_decrypt_vectors_masterkey: name: Python 3.10 Generate Decrypt Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -418,7 +124,7 @@ jobs: py310_decrypt_masterkey_with_masterkey: name: Python 3.10 Decrypt Masterkey with Masterkey needs: py310_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -437,7 +143,7 @@ jobs: py310_decrypt_masterkey_with_js: name: Python 3.10 Decrypt Masterkey with JS needs: py310_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -456,7 +162,7 @@ jobs: # Python 3.11 jobs py311_integ: name: Python 3.11 Integration Tests - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -474,7 +180,7 @@ jobs: py311_integ_mpl: name: Python 3.11 Integration MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -492,7 +198,7 @@ jobs: py311_performance_tests_mpl: name: Python 3.11 Performance Tests MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -510,7 +216,7 @@ jobs: py311_examples: name: Python 3.11 Examples - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -528,7 +234,7 @@ jobs: py311_examples_mpl: name: Python 3.11 Examples MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -546,7 +252,7 @@ jobs: py311_decrypt_dafny_esdk_vectors_masterkey: name: Python 3.11 Decrypt Dafny ESDK Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -564,7 +270,7 @@ jobs: py311_decrypt_dafny_esdk_vectors_keyrings: name: Python 3.11 Decrypt Dafny ESDK Vectors Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -582,7 +288,7 @@ jobs: py311_decrypt_net_401_vectors_masterkey: name: Python 3.11 Decrypt .NET 4.0.1 Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -600,7 +306,7 @@ jobs: py311_decrypt_net_401_vectors_keyrings: name: Python 3.11 Decrypt .NET 4.0.1 Vectors Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -618,7 +324,7 @@ jobs: py311_encrypt_masterkey: name: Python 3.11 Encrypt Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -636,7 +342,7 @@ jobs: py311_encrypt_keyrings: name: Python 3.11 Encrypt Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -654,7 +360,7 @@ jobs: py311_generate_decrypt_vectors_masterkey: name: Python 3.11 Generate Decrypt Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -673,7 +379,7 @@ jobs: py311_decrypt_masterkey_with_masterkey: name: Python 3.11 Decrypt Masterkey with Masterkey needs: py311_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -692,7 +398,7 @@ jobs: py311_decrypt_masterkey_with_keyrings: name: Python 3.11 Decrypt Masterkey with Keyrings needs: py311_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -711,7 +417,7 @@ jobs: py311_decrypt_masterkey_with_js: name: Python 3.11 Decrypt Masterkey with JS needs: py311_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -729,7 +435,7 @@ jobs: py311_generate_decrypt_vectors_keyrings: name: Python 3.11 Generate Decrypt Vectors Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -748,7 +454,7 @@ jobs: py311_decrypt_keyrings_with_masterkey: name: Python 3.11 Decrypt Keyrings with Masterkey needs: py311_generate_decrypt_vectors_keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -767,7 +473,7 @@ jobs: py311_decrypt_keyrings_with_keyrings: name: Python 3.11 Decrypt Keyrings with Keyrings needs: py311_generate_decrypt_vectors_keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -786,7 +492,7 @@ jobs: py311_decrypt_keyrings_with_js: name: Python 3.11 Decrypt Keyrings with JS needs: py311_generate_decrypt_vectors_keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -804,7 +510,7 @@ jobs: py311_decrypt_golden_manifest_with_keyrings: name: Python 3.11 Decrypt Golden Manifest with Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -822,7 +528,7 @@ jobs: py311_decrypt_golden_manifest_with_masterkey: name: Python 3.11 Decrypt Golden Manifest with Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -841,7 +547,7 @@ jobs: # Python 3.12 jobs py312_integ: name: Python 3.12 Integration Tests - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -859,7 +565,7 @@ jobs: py312_integ_mpl: name: Python 3.12 Integration MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -877,7 +583,7 @@ jobs: py312_performance_tests_mpl: name: Python 3.12 Performance Tests MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -895,7 +601,7 @@ jobs: py312_examples: name: Python 3.12 Examples - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -913,7 +619,7 @@ jobs: py312_examples_mpl: name: Python 3.12 Examples MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -931,7 +637,7 @@ jobs: py312_decrypt_dafny_esdk_vectors_masterkey: name: Python 3.12 Decrypt Dafny ESDK Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -949,7 +655,7 @@ jobs: py312_decrypt_dafny_esdk_vectors_keyrings: name: Python 3.12 Decrypt Dafny ESDK Vectors Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -967,7 +673,7 @@ jobs: py312_decrypt_net_401_vectors_masterkey: name: Python 3.12 Decrypt .NET 4.0.1 Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -985,7 +691,7 @@ jobs: py312_decrypt_net_401_vectors_keyrings: name: Python 3.12 Decrypt .NET 4.0.1 Vectors Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1003,7 +709,7 @@ jobs: py312_encrypt_masterkey: name: Python 3.12 Encrypt Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1021,7 +727,7 @@ jobs: py312_encrypt_keyrings: name: Python 3.12 Encrypt Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1039,7 +745,7 @@ jobs: py312_generate_decrypt_vectors_masterkey: name: Python 3.12 Generate Decrypt Vectors Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1058,7 +764,7 @@ jobs: py312_decrypt_masterkey_with_masterkey: name: Python 3.12 Decrypt Masterkey with Masterkey needs: py312_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1077,7 +783,7 @@ jobs: py312_decrypt_masterkey_with_keyrings: name: Python 3.12 Decrypt Masterkey with Keyrings needs: py312_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1096,7 +802,7 @@ jobs: py312_decrypt_masterkey_with_js: name: Python 3.12 Decrypt Masterkey with JS needs: py312_generate_decrypt_vectors_masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1114,7 +820,7 @@ jobs: py312_generate_decrypt_vectors_keyrings: name: Python 3.12 Generate Decrypt Vectors Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1133,7 +839,7 @@ jobs: py312_decrypt_keyrings_with_masterkey: name: Python 3.12 Decrypt Keyrings with Masterkey needs: py312_generate_decrypt_vectors_keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1152,7 +858,7 @@ jobs: py312_decrypt_keyrings_with_keyrings: name: Python 3.12 Decrypt Keyrings with Keyrings needs: py312_generate_decrypt_vectors_keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1171,7 +877,7 @@ jobs: py312_decrypt_keyrings_with_js: name: Python 3.12 Decrypt Keyrings with JS needs: py312_generate_decrypt_vectors_keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1189,7 +895,7 @@ jobs: py312_generate_hkeyring_decrypt_vectors: name: Python 3.12 Generate HKeyring Decrypt Vectors - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1208,7 +914,7 @@ jobs: py312_decrypt_hkeyring_with_masterkey: name: Python 3.12 Decrypt HKeyring with Masterkey needs: py312_generate_hkeyring_decrypt_vectors - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1227,7 +933,7 @@ jobs: py312_decrypt_hkeyring_with_keyrings: name: Python 3.12 Decrypt HKeyring with Keyrings needs: py312_generate_hkeyring_decrypt_vectors - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1246,7 +952,7 @@ jobs: py312_decrypt_hkeyring_with_net: name: Python 3.12 Decrypt HKeyring with .NET needs: py312_generate_hkeyring_decrypt_vectors - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1264,7 +970,7 @@ jobs: py312_decrypt_golden_manifest_with_keyrings: name: Python 3.12 Decrypt Golden Manifest with Keyrings - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1282,7 +988,7 @@ jobs: py312_decrypt_golden_manifest_with_masterkey: name: Python 3.12 Decrypt Golden Manifest with Masterkey - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1301,7 +1007,7 @@ jobs: # Code Coverage and Compliance jobs code_coverage: name: Code Coverage - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1318,7 +1024,7 @@ jobs: code_coverage_mpl: name: Code Coverage MPL - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 @@ -1336,7 +1042,7 @@ jobs: compliance: name: Compliance - runs-on: ubuntu-latest + runs-on: *codebuild-linux steps: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 diff --git a/.github/workflows/ci_decrypt-oracle.yaml b/.github/workflows/ci_decrypt-oracle.yaml index c56e43a63..6f79d67f7 100644 --- a/.github/workflows/ci_decrypt-oracle.yaml +++ b/.github/workflows/ci_decrypt-oracle.yaml @@ -8,7 +8,7 @@ permissions: jobs: tests: - runs-on: ubuntu-latest + runs-on: &codebuild-linux codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -25,7 +25,7 @@ jobs: cd decrypt_oracle tox -- -vv static-analysis: - runs-on: ubuntu-latest + runs-on: *codebuild-linux strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_static-analysis.yaml b/.github/workflows/ci_static-analysis.yaml index d8175396e..9b7dc1460 100644 --- a/.github/workflows/ci_static-analysis.yaml +++ b/.github/workflows/ci_static-analysis.yaml @@ -8,7 +8,7 @@ permissions: jobs: analysis: - runs-on: ubuntu-latest + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_test-vector-handler.yaml b/.github/workflows/ci_test-vector-handler.yaml index 340d4d5a9..159a09f92 100644 --- a/.github/workflows/ci_test-vector-handler.yaml +++ b/.github/workflows/ci_test-vector-handler.yaml @@ -8,6 +8,15 @@ on: required: true INTEG_AWS_SECRET_ACCESS_KEY: required: true + inputs: + platforms: + type: string + # runs on macos-15-intel as macos-latest does not work in all python versions. + default: >- + [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}, + {"os": "windows-latest", "runner": "windows-latest"}, + {"os": "macos-latest", "runner": "macos-latest"}, + {"os": "macos-15-intel", "runner": "macos-15-intel"}] permissions: contents: read @@ -17,18 +26,13 @@ jobs: # Leaving this defined but disabled # until we address the credentials problem. if: 1 == 0 - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform.runner }} strategy: fail-fast: true matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - # runs on macos-15-intel as macos-latest does not work in all python versions. - - macos-15-intel + platform: ${{ fromJSON(inputs.platforms) }} python: - - 3.8 + - "3.10" - 3.x architecture: - x64 @@ -39,9 +43,11 @@ jobs: - awses_latest exclude: # x86 builds are only meaningful for Windows - - os: ubuntu-latest + - platform: + os: ubuntu-latest architecture: x86 - - os: macos-latest + - platform: + os: macos-latest architecture: x86 steps: - uses: aws-actions/configure-aws-credentials@v4 @@ -64,7 +70,8 @@ jobs: cd test_vector_handlers tox -- -vv static-analysis: - runs-on: ubuntu-latest + if: contains(fromJSON(inputs.platforms).*.os, 'ubuntu-latest') + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 607b5c9e1..94d9e0e2d 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -2,6 +2,13 @@ name: Continuous Integration tests on: workflow_call: + inputs: + platforms: + type: string + default: >- + [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}, + {"os": "windows-latest", "runner": "windows-latest"}, + {"os": "macos-latest", "runner": "macos-latest"}] env: AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: | @@ -18,17 +25,12 @@ permissions: jobs: tests: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform.runner }} strategy: fail-fast: true matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest + platform: ${{ fromJSON(inputs.platforms) }} python: - - 3.8 - - 3.9 - "3.10" - "3.11" - "3.12" @@ -52,19 +54,16 @@ jobs: exclude: # Python <3.11 incompatible with macOS ARM64 runners # https://github.com/actions/setup-python/issues/948 - - python: 3.7 - os: macos-latest - - python: 3.8 - os: macos-latest - - python: 3.9 - os: macos-latest - python: 3.10 - os: macos-latest + platform: + os: macos-latest # x86 builds are only meaningful for Windows - - os: ubuntu-latest + - platform: + os: ubuntu-latest architecture: x86 - - os: macos-latest + - platform: + os: macos-latest architecture: x86 # `cryptography` no longer publishes 32-bit Windows wheels for @@ -77,16 +76,11 @@ jobs: # provisioning (i686 Rust target + 32-bit OpenSSL) per cell, # which isn't worth it for a configuration upstream no longer # supports. - - os: windows-latest + - platform: + os: windows-latest architecture: x86 # MPL is not supported on <3.11 - - python: 3.7 - optional_mpl_dependency: -mpl - - python: 3.8 - optional_mpl_dependency: -mpl - - python: 3.9 - optional_mpl_dependency: -mpl - python: 3.10 optional_mpl_dependency: -mpl # mpllocal requires the MPL to be installed @@ -112,7 +106,8 @@ jobs: TOXENV: ${{ matrix.category }}${{ matrix.optional_mpl_dependency }} run: tox -- -vv upstream-py311: - runs-on: ubuntu-latest + if: contains(fromJSON(inputs.platforms).*.os, 'ubuntu-latest') + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} strategy: fail-fast: true matrix: diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 308bfbda2..e8bc3b093 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -10,7 +10,7 @@ permissions: jobs: dependabot: - runs-on: ubuntu-latest + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Dependabot metadata diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 01caa4904..e07fc2a14 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -29,11 +29,35 @@ jobs: uses: ./.github/workflows/ci_static-analysis.yaml test_vector_handler: uses: ./.github/workflows/ci_test-vector-handler.yaml + with: + platforms: >- + [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}] + secrets: + INTEG_AWS_ACCESS_KEY_ID: ${{ secrets.INTEG_AWS_ACCESS_KEY_ID }} + INTEG_AWS_SECRET_ACCESS_KEY: ${{ secrets.INTEG_AWS_SECRET_ACCESS_KEY }} + test_vector_handler_macos_windows: + name: test_vector_handler (macOS, Windows) + uses: ./.github/workflows/ci_test-vector-handler.yaml + with: + platforms: >- + [{"os": "windows-latest", "runner": "windows-latest"}, + {"os": "macos-latest", "runner": "macos-latest"}, + {"os": "macos-15-intel", "runner": "macos-15-intel"}] secrets: INTEG_AWS_ACCESS_KEY_ID: ${{ secrets.INTEG_AWS_ACCESS_KEY_ID }} INTEG_AWS_SECRET_ACCESS_KEY: ${{ secrets.INTEG_AWS_SECRET_ACCESS_KEY }} tests: uses: ./.github/workflows/ci_tests.yaml + with: + platforms: >- + [{"os": "ubuntu-latest", "runner": "codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }}"}] + tests_macos_windows: + name: tests (macOS, Windows) + uses: ./.github/workflows/ci_tests.yaml + with: + platforms: >- + [{"os": "windows-latest", "runner": "windows-latest"}, + {"os": "macos-latest", "runner": "macos-latest"}] pr-ci-all-required: if: always() needs: @@ -43,7 +67,7 @@ jobs: - static_analysis - test_vector_handler - tests - runs-on: ubuntu-22.04 + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} steps: - name: Verify all required jobs passed uses: re-actors/alls-green@release/v1 diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index cf250b944..b5b795101 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -11,7 +11,7 @@ jobs: repo-sync: name: Repo Sync environment: repo-sync - runs-on: ubuntu-latest + runs-on: codebuild-CryptoToolsCI-linux-aws-encryption-sdk-python-${{ github.run_id }}-${{ github.run_attempt }} steps: - uses: actions/checkout@v4 - uses: repo-sync/github-sync@v2 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 82c9c983c..9fa906b74 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.10" # Build documentation in the doc/ directory with Sphinx sphinx: diff --git a/README.rst b/README.rst index daa345b02..5b12e74ec 100644 --- a/README.rst +++ b/README.rst @@ -34,7 +34,7 @@ Getting Started Required Prerequisites ====================== -* Python 3.8+ +* Python 3.10+ * cryptography >= 3.4.6 * boto3 >= 1.10.0 * attrs diff --git a/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml b/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml index bc7086d96..a991f54ea 100644 --- a/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml +++ b/codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml @@ -20,7 +20,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml index a26105627..6cb254375 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_keyrings_with_keyrings.yml b/codebuild/py311/decrypt_keyrings_with_keyrings.yml index 8e4e81972..1301e2278 100644 --- a/codebuild/py311/decrypt_keyrings_with_keyrings.yml +++ b/codebuild/py311/decrypt_keyrings_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_masterkey_with_keyrings.yml b/codebuild/py311/decrypt_masterkey_with_keyrings.yml index ddb3ebc0a..d4ca65da0 100644 --- a/codebuild/py311/decrypt_masterkey_with_keyrings.yml +++ b/codebuild/py311/decrypt_masterkey_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/decrypt_net_401_vectors_keyrings.yml b/codebuild/py311/decrypt_net_401_vectors_keyrings.yml index f9a0b7db6..b36b310cd 100644 --- a/codebuild/py311/decrypt_net_401_vectors_keyrings.yml +++ b/codebuild/py311/decrypt_net_401_vectors_keyrings.yml @@ -17,7 +17,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/encrypt_keyrings.yml b/codebuild/py311/encrypt_keyrings.yml index ef2492086..0c53de97e 100644 --- a/codebuild/py311/encrypt_keyrings.yml +++ b/codebuild/py311/encrypt_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py311/generate_decrypt_vectors_keyrings.yml b/codebuild/py311/generate_decrypt_vectors_keyrings.yml index 78b9658c9..3d514263c 100644 --- a/codebuild/py311/generate_decrypt_vectors_keyrings.yml +++ b/codebuild/py311/generate_decrypt_vectors_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.11 - dotnet: 6.0 + dotnet: 10.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml b/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml index 55f6661cc..1dfc6d0d2 100644 --- a/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml +++ b/codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml @@ -20,7 +20,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml index 856810375..449834304 100644 --- a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_hkeyring_with_keyrings.yml b/codebuild/py312/decrypt_hkeyring_with_keyrings.yml index 971859af7..bae796b4c 100644 --- a/codebuild/py312/decrypt_hkeyring_with_keyrings.yml +++ b/codebuild/py312/decrypt_hkeyring_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_hkeyring_with_net.yml b/codebuild/py312/decrypt_hkeyring_with_net.yml index d3ed7b7a3..2ad7eafaa 100644 --- a/codebuild/py312/decrypt_hkeyring_with_net.yml +++ b/codebuild/py312/decrypt_hkeyring_with_net.yml @@ -11,11 +11,15 @@ env: arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 + # The .NET test vectors (aws/aws-encryption-sdk) only target net6.0, which the CodeBuild + # image no longer provides. Let the net6.0 test host roll forward to the installed .NET 10 runtime. + DOTNET_ROLL_FORWARD: "Major" phases: install: runtime-versions: python: 3.12 + dotnet: 10.0 pre_build: commands: # Download previously generated vectors diff --git a/codebuild/py312/decrypt_keyrings_with_keyrings.yml b/codebuild/py312/decrypt_keyrings_with_keyrings.yml index 23c3310b5..39e443726 100644 --- a/codebuild/py312/decrypt_keyrings_with_keyrings.yml +++ b/codebuild/py312/decrypt_keyrings_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_masterkey_with_keyrings.yml b/codebuild/py312/decrypt_masterkey_with_keyrings.yml index a006205c4..a56b7b338 100644 --- a/codebuild/py312/decrypt_masterkey_with_keyrings.yml +++ b/codebuild/py312/decrypt_masterkey_with_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/decrypt_net_401_vectors_keyrings.yml b/codebuild/py312/decrypt_net_401_vectors_keyrings.yml index d89b93af1..a9a7caaf0 100644 --- a/codebuild/py312/decrypt_net_401_vectors_keyrings.yml +++ b/codebuild/py312/decrypt_net_401_vectors_keyrings.yml @@ -17,7 +17,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 pre_build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/encrypt_keyrings.yml b/codebuild/py312/encrypt_keyrings.yml index 3c0f0e36e..bcc728533 100644 --- a/codebuild/py312/encrypt_keyrings.yml +++ b/codebuild/py312/encrypt_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py312/generate_decrypt_vectors_keyrings.yml b/codebuild/py312/generate_decrypt_vectors_keyrings.yml index f995a82e6..b5ce62fa7 100644 --- a/codebuild/py312/generate_decrypt_vectors_keyrings.yml +++ b/codebuild/py312/generate_decrypt_vectors_keyrings.yml @@ -16,7 +16,7 @@ phases: install: runtime-versions: python: 3.12 - dotnet: 6.0 + dotnet: 10.0 build: commands: # Build Python MPL TestVector runner from source diff --git a/codebuild/py38/awses_local.yml b/codebuild/py38/awses_local.yml deleted file mode 100644 index 9876de247..000000000 --- a/codebuild/py38/awses_local.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py38-awses_local" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" - -phases: - install: - runtime-versions: - python: 3.8 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - tox diff --git a/codebuild/py38/decrypt_dafny_esdk_vectors.yml b/codebuild/py38/decrypt_dafny_esdk_vectors.yml deleted file mode 100644 index 3bc966126..000000000 --- a/codebuild/py38/decrypt_dafny_esdk_vectors.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: 0.2 -# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM - -env: - variables: - TOXENV: "py38-full_decrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - git-credential-helper: yes - secrets-manager: - GITHUB_TOKEN: Github/lucasmcdonald3-fgpat:actions read - -phases: - install: - runtime-versions: - python: 3.8 - pre_build: - commands: - # Fetch test vectors from Dafny ESDK's most recent run - # (Assuming the first result is most recent; seems to be correct...) - - | - MOST_RECENT_RUN_ID=$(curl -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${GITHUB_TOKEN}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs?branch=mainline&status=completed&page=1&exclude_pull_requests=true" \ - | jq 'first(.workflow_runs[] | select(.name=="Daily CI") | .id)') - - | - echo "DEBUG: Fetching artifact from run $MOST_RECENT_RUN_ID" - - | - MOST_RECENT_RUN_DOWNLOAD_URL=$(curl -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs/$MOST_RECENT_RUN_ID/artifacts?name=ubuntu-22.04_vector_artifact" \ - | jq '.artifacts[0].archive_download_url') - - | - echo "DEBUG: Fetching artifact at $MOST_RECENT_RUN_DOWNLOAD_URL" - - | - curl -L -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - $(echo $MOST_RECENT_RUN_DOWNLOAD_URL | tr -d '"') -o ubuntu-22.04_vector_artifact.zip - # This unzips to `net41.zip`. - - unzip ubuntu-22.04_vector_artifact - # This unzips to `net41/`. - - unzip net41.zip -d net41 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input ../net41/manifest.json diff --git a/codebuild/py38/decrypt_masterkey_with_js.yml b/codebuild/py38/decrypt_masterkey_with_js.yml deleted file mode 100644 index 5ed891732..000000000 --- a/codebuild/py38/decrypt_masterkey_with_js.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 0.2 - -env: - variables: - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - commands: - - n 22 - # Install the Javascript ESDK run test vectors - - npm install -g @aws-crypto/integration-node - - pre_build: - commands: - # Download previously generated vectors - - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/38_masterkey.zip 38_masterkey.zip - # Repackage zip in expected format - - unzip 38_masterkey.zip - - cd 38_masterkey - - zip -r vectors.zip . - build: - commands: - # Decrypt generated vectors with Javascript ESDK - - integration-node decrypt -v vectors.zip \ No newline at end of file diff --git a/codebuild/py38/decrypt_masterkey_with_masterkey.yml b/codebuild/py38/decrypt_masterkey_with_masterkey.yml deleted file mode 100644 index 6b32dcf15..000000000 --- a/codebuild/py38/decrypt_masterkey_with_masterkey.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py38-full_decrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - pre_build: - commands: - # Download previously generated vectors - - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/38_masterkey.zip 38_masterkey.zip - - unzip 38_masterkey.zip - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input ../38_masterkey/manifest.json \ No newline at end of file diff --git a/codebuild/py38/decrypt_net_401_vectors.yml b/codebuild/py38/decrypt_net_401_vectors.yml deleted file mode 100644 index 91163f14d..000000000 --- a/codebuild/py38/decrypt_net_401_vectors.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: 0.2 -# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM - -env: - variables: - TOXENV: "py38-full_decrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - pre_build: - commands: - # Fetch ESDK .NET v4.0.1 Test Vectors - - VECTOR_ZIP=$CODEBUILD_SRC_DIR/v4-Net-4.0.1.zip - - VECTORS_URL=https://github.com/aws/aws-encryption-sdk/raw/mainline/AwsEncryptionSDK/runtimes/net/TestVectorsNative/TestVectors/resources/v4-Net-4.0.1.zip - - curl -s --output $VECTOR_ZIP --location $VECTORS_URL - - UNZIPPED_VECTORS_DIR=$CODEBUILD_SRC_DIR/test_vector_handlers/net_401_vectors - - unzip $VECTOR_ZIP -d $UNZIPPED_VECTORS_DIR - build: - commands: - # NOTE: We need to pass the absolute path of the vectors - - pip install "tox < 4.0" - - cd $CODEBUILD_SRC_DIR/test_vector_handlers - - | - tox -- \ - --input $UNZIPPED_VECTORS_DIR/manifest.json diff --git a/codebuild/py38/encrypt_masterkey.yml b/codebuild/py38/encrypt_masterkey.yml deleted file mode 100644 index b05396cc2..000000000 --- a/codebuild/py38/encrypt_masterkey.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py38-full_encrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v2.json diff --git a/codebuild/py38/examples.yml b/codebuild/py38/examples.yml deleted file mode 100644 index 4dff71d65..000000000 --- a/codebuild/py38/examples.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py38-examples" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - build: - commands: - - pip install "tox < 4.0" - - tox diff --git a/codebuild/py38/generate_decrypt_vectors_masterkey.yml b/codebuild/py38/generate_decrypt_vectors_masterkey.yml deleted file mode 100644 index 8705ef57c..000000000 --- a/codebuild/py38/generate_decrypt_vectors_masterkey.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py38-full_decrypt_generate" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0006-awses-message-decryption-generation.v2.json \ - --output 38_masterkey - - zip -r 38_masterkey.zip 38_masterkey - - aws s3 cp 38_masterkey.zip s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/38_masterkey.zip diff --git a/codebuild/py38/integ.yml b/codebuild/py38/integ.yml deleted file mode 100644 index 8b7acafe1..000000000 --- a/codebuild/py38/integ.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py38-integ" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.8 - build: - commands: - - pip install "tox < 4.0" - - tox diff --git a/codebuild/py39/awses_1.7.1.yml b/codebuild/py39/awses_1.7.1.yml deleted file mode 100644 index 22267ad8f..000000000 --- a/codebuild/py39/awses_1.7.1.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-awses_1.7.1" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - tox diff --git a/codebuild/py39/awses_2.0.0.yml b/codebuild/py39/awses_2.0.0.yml deleted file mode 100644 index d35e7e98c..000000000 --- a/codebuild/py39/awses_2.0.0.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-awses_2.0.0" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - tox diff --git a/codebuild/py39/awses_latest.yml b/codebuild/py39/awses_latest.yml deleted file mode 100644 index 719ab2238..000000000 --- a/codebuild/py39/awses_latest.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-awses_latest" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - tox diff --git a/codebuild/py39/awses_local.yml b/codebuild/py39/awses_local.yml deleted file mode 100644 index e56a9ff45..000000000 --- a/codebuild/py39/awses_local.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-awses_local" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_API_DEPLOYMENT_ID: "xi1mwx3ttb" - AWS_ENCRYPTION_SDK_PYTHON_DECRYPT_ORACLE_REGION: "us-west-2" - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - tox diff --git a/codebuild/py39/decrypt_dafny_esdk_vectors.yml b/codebuild/py39/decrypt_dafny_esdk_vectors.yml deleted file mode 100644 index a22c4d079..000000000 --- a/codebuild/py39/decrypt_dafny_esdk_vectors.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: 0.2 -# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM - -env: - variables: - TOXENV: "py39-full_decrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - git-credential-helper: yes - secrets-manager: - GITHUB_TOKEN: Github/lucasmcdonald3-fgpat:actions read - -phases: - install: - runtime-versions: - python: 3.9 - pre_build: - commands: - # Fetch test vectors from Dafny ESDK's most recent run - # (Assuming the first result is most recent; seems to be correct...) - - | - MOST_RECENT_RUN_ID=$(curl -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${GITHUB_TOKEN}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs?branch=mainline&status=completed&page=1&exclude_pull_requests=true" \ - | jq 'first(.workflow_runs[] | select(.name=="Daily CI") | .id)') - - | - echo "DEBUG: Fetching artifact from run $MOST_RECENT_RUN_ID" - - | - MOST_RECENT_RUN_DOWNLOAD_URL=$(curl -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/repos/aws/aws-encryption-sdk/actions/runs/$MOST_RECENT_RUN_ID/artifacts?name=ubuntu-22.04_vector_artifact" \ - | jq '.artifacts[0].archive_download_url') - - | - echo "DEBUG: Fetching artifact at $MOST_RECENT_RUN_DOWNLOAD_URL" - - | - curl -L -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - $(echo $MOST_RECENT_RUN_DOWNLOAD_URL | tr -d '"') -o ubuntu-22.04_vector_artifact.zip - # This unzips to `net41.zip`. - - unzip ubuntu-22.04_vector_artifact - # This unzips to `net41/`. - - unzip net41.zip -d net41 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input ../net41/manifest.json diff --git a/codebuild/py39/decrypt_masterkey_with_js.yml b/codebuild/py39/decrypt_masterkey_with_js.yml deleted file mode 100644 index ccb097f39..000000000 --- a/codebuild/py39/decrypt_masterkey_with_js.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 0.2 - -env: - variables: - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - commands: - - n 22 - # Install the Javascript ESDK run test vectors - - npm install -g @aws-crypto/integration-node - - pre_build: - commands: - # Download previously generated vectors - - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/39_masterkey.zip 39_masterkey.zip - # Repackage zip in expected format - - unzip 39_masterkey.zip - - cd 39_masterkey - - zip -r vectors.zip . - build: - commands: - # Decrypt generated vectors with Javascript ESDK - - integration-node decrypt -v vectors.zip \ No newline at end of file diff --git a/codebuild/py39/decrypt_masterkey_with_masterkey.yml b/codebuild/py39/decrypt_masterkey_with_masterkey.yml deleted file mode 100644 index fcd9d3220..000000000 --- a/codebuild/py39/decrypt_masterkey_with_masterkey.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-full_decrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - pre_build: - commands: - # Download previously generated vectors - - aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/39_masterkey.zip 39_masterkey.zip - - unzip 39_masterkey.zip - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input ../39_masterkey/manifest.json \ No newline at end of file diff --git a/codebuild/py39/decrypt_net_401_vectors.yml b/codebuild/py39/decrypt_net_401_vectors.yml deleted file mode 100644 index d8a9ff453..000000000 --- a/codebuild/py39/decrypt_net_401_vectors.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: 0.2 -# Runs Only the ESDK-NET v4.0.1 Decryption Vectors, testing Required EC CMM - -env: - variables: - TOXENV: "py39-full_decrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - pre_build: - commands: - # Fetch ESDK .NET v4.0.1 Test Vectors - - VECTOR_ZIP=$CODEBUILD_SRC_DIR/v4-Net-4.0.1.zip - - VECTORS_URL=https://github.com/aws/aws-encryption-sdk/raw/mainline/AwsEncryptionSDK/runtimes/net/TestVectorsNative/TestVectors/resources/v4-Net-4.0.1.zip - - curl -s --output $VECTOR_ZIP --location $VECTORS_URL - - UNZIPPED_VECTORS_DIR=$CODEBUILD_SRC_DIR/test_vector_handlers/net_401_vectors - - unzip $VECTOR_ZIP -d $UNZIPPED_VECTORS_DIR - build: - commands: - # NOTE: We need to pass the absolute path of the vectors - - pip install "tox < 4.0" - - cd $CODEBUILD_SRC_DIR/test_vector_handlers - - | - tox -- \ - --input $UNZIPPED_VECTORS_DIR/manifest.json diff --git a/codebuild/py39/encrypt_masterkey.yml b/codebuild/py39/encrypt_masterkey.yml deleted file mode 100644 index 3bf18fbde..000000000 --- a/codebuild/py39/encrypt_masterkey.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-full_encrypt" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0003-awses-message-encryption.v2.json diff --git a/codebuild/py39/examples.yml b/codebuild/py39/examples.yml deleted file mode 100644 index 3d1399251..000000000 --- a/codebuild/py39/examples.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-examples" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - tox diff --git a/codebuild/py39/generate_decrypt_vectors_masterkey.yml b/codebuild/py39/generate_decrypt_vectors_masterkey.yml deleted file mode 100644 index eb57d915a..000000000 --- a/codebuild/py39/generate_decrypt_vectors_masterkey.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-full_decrypt_generate" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - cd test_vector_handlers - - | - tox -- \ - --input test/aws-crypto-tools-test-vector-framework/features/CANONICAL-GENERATED-MANIFESTS/0006-awses-message-decryption-generation.v2.json \ - --output 39_masterkey - - zip -r 39_masterkey.zip 39_masterkey - - aws s3 cp 39_masterkey.zip s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/39_masterkey.zip diff --git a/codebuild/py39/integ.yml b/codebuild/py39/integ.yml deleted file mode 100644 index 6dec85b07..000000000 --- a/codebuild/py39/integ.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 0.2 - -env: - variables: - TOXENV: "py39-integ" - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- - arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- - arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_1: >- - arn:aws:kms:us-west-2:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_MRK_KEY_ID_2: >- - arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7 - -phases: - install: - runtime-versions: - python: 3.9 - build: - commands: - - pip install "tox < 4.0" - - tox diff --git a/codebuild/release/validate.yml b/codebuild/release/validate.yml index 154261a39..5e459c142 100644 --- a/codebuild/release/validate.yml +++ b/codebuild/release/validate.yml @@ -8,8 +8,8 @@ phases: python: latest pre_build: commands: - - pyenv install --skip-existing 3.8.12 - - pyenv local 3.8.12 + - pyenv install --skip-existing 3.10.12 + - pyenv local 3.10.12 - pip install "tox < 4.0" build: commands: diff --git a/performance_tests/README.rst b/performance_tests/README.rst index 67b2dd1ac..a6c90cee9 100644 --- a/performance_tests/README.rst +++ b/performance_tests/README.rst @@ -39,7 +39,7 @@ performance_tests directory. Required Prerequisites ********************** -* Python 3.8+ +* Python 3.10+ * aws-encryption-sdk * boto3 >= 1.10.0 * click diff --git a/setup.py b/setup.py index fb249a3f6..3b30b8fcf 100644 --- a/setup.py +++ b/setup.py @@ -52,8 +52,6 @@ def get_requirements(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/src/aws_encryption_sdk/compatability.py b/src/aws_encryption_sdk/compatability.py index 9900a8893..191c11cf9 100644 --- a/src/aws_encryption_sdk/compatability.py +++ b/src/aws_encryption_sdk/compatability.py @@ -14,9 +14,11 @@ def _warn_deprecated_python(): (3, 4): {"date": DEPRECATION_DATE_MAP["2.x"]}, (3, 5): {"date": "2021-11-10"}, (3, 7): {"date": "2024-03-04"}, + (3, 8): {"date": "2024-10-07"}, + (3, 9): {"date": "2025-10-31"}, } py_version = (sys.version_info.major, sys.version_info.minor) - minimum_version = (3, 8) + minimum_version = (3, 10) if py_version in deprecated_versions: params = deprecated_versions[py_version] diff --git a/src/aws_encryption_sdk/internal/formatting/deserialize.py b/src/aws_encryption_sdk/internal/formatting/deserialize.py index c90dc9124..bb8fde331 100644 --- a/src/aws_encryption_sdk/internal/formatting/deserialize.py +++ b/src/aws_encryption_sdk/internal/formatting/deserialize.py @@ -74,11 +74,15 @@ def validate_header(header, header_auth, raw_header, data_key): raise SerializationError("Header authorization failed") -def _verified_version_from_id(version_id): - # type: (int) -> SerializationVersion +def _verified_version_from_id(version_id, stream): + # type: (int, IO) -> SerializationVersion """Load a message :class:`SerializationVersion` for the specified version ID. + If the version ID is not supported, reads one more byte from ``stream`` to check + whether the message appears to be Base64 encoded. + :param int version_id: Message format version ID + :param io.BytesIO stream: Source data stream :return: Message format version :rtype: SerializationVersion :raises NotSupportedError: if unsupported version ID is received @@ -86,6 +90,13 @@ def _verified_version_from_id(version_id): try: return SerializationVersion(version_id) except ValueError as error: + # A common mistake is for users to attempt decryption on the Base64 encoding of the encrypted message. + # Detect this from the Base64 encoding of the first two bytes of each supported message format version: + # V1: version 0x01, type 0x80 -> Base64 encoded as "AY" + # V2: version 0x02, algorithm suite ID 0x04XX or 0x05XX -> Base64 encoded as "Ag" + prefix = struct.pack(">B", version_id) + stream.read(1) + if prefix in {b"AY", b"Ag"}: + raise NotSupportedError("Message appears to be Base64 encoded, decode it before decrypting") from error raise NotSupportedError("Unsupported version {}".format(version_id), error) @@ -344,7 +355,7 @@ def deserialize_header(stream, max_encrypted_data_keys=None): tee = io.BytesIO() tee_stream = TeeStream(stream, tee) (version_id,) = unpack_values(">B", tee_stream) - version = _verified_version_from_id(version_id) + version = _verified_version_from_id(version_id, tee_stream) header = {} header["version"] = version diff --git a/test/functional/test_f_aws_encryption_sdk_client.py b/test/functional/test_f_aws_encryption_sdk_client.py index 244f8f7d7..0fcd713c1 100644 --- a/test/functional/test_f_aws_encryption_sdk_client.py +++ b/test/functional/test_f_aws_encryption_sdk_client.py @@ -3,6 +3,7 @@ """Functional test suite for aws_encryption_sdk.kms_thick_client""" from __future__ import division +import base64 import io import logging @@ -18,7 +19,7 @@ import aws_encryption_sdk from aws_encryption_sdk.caches import build_decryption_materials_cache_key, build_encryption_materials_cache_key -from aws_encryption_sdk.exceptions import CustomMaximumValueExceeded +from aws_encryption_sdk.exceptions import CustomMaximumValueExceeded, NotSupportedError from aws_encryption_sdk.identifiers import Algorithm, CommitmentPolicy, EncryptionKeyType, WrappingAlgorithm from aws_encryption_sdk.internal.crypto.wrapping_keys import WrappingKey from aws_encryption_sdk.internal.defaults import LINE_LENGTH @@ -625,6 +626,27 @@ def test_decrypt_oneshot_no_seek_input(): assert decrypted == VALUES["plaintext_128"] +@pytest.mark.parametrize( + "algorithm", + ( + Algorithm.AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384, # message format version 1 + Algorithm.AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384, # message format version 2 + ), +) +def test_decrypt_base64_encoded_message(algorithm): + """Test that decrypt raises a specific error when given the Base64 encoding of a message.""" + commitment_policy = CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT + if algorithm.is_committing(): + commitment_policy = CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT + client = aws_encryption_sdk.EncryptionSDKClient(commitment_policy=commitment_policy) + key_provider = fake_kms_key_provider(algorithm.kdf_input_len) + ciphertext, _header = client.encrypt(source=VALUES["plaintext_128"], key_provider=key_provider, algorithm=algorithm) + + with pytest.raises(NotSupportedError) as excinfo: + client.decrypt(source=base64.b64encode(ciphertext), key_provider=key_provider) + excinfo.match("Message appears to be Base64 encoded, decode it before decrypting") + + def test_stream_encryptor_readable(): """Verify that open StreamEncryptor instances report as readable.""" key_provider = fake_kms_key_provider() diff --git a/test/unit/test_compatability.py b/test/unit/test_compatability.py index 11400e241..a29f3867a 100644 --- a/test/unit/test_compatability.py +++ b/test/unit/test_compatability.py @@ -28,3 +28,11 @@ def test_below_warn(self): v_info.minor = 7 with pytest.warns(DeprecationWarning): _warn_deprecated_python() + + @pytest.mark.parametrize("minor", (8, 9)) + def test_deprecated_py38_py39_warn(self, minor): + with mock.patch.object(sys, "version_info") as v_info: + v_info.major = 3 + v_info.minor = minor + with pytest.warns(DeprecationWarning, match="upgrade to Python 3.10 or later"): + _warn_deprecated_python() diff --git a/test/unit/test_deserialize.py b/test/unit/test_deserialize.py index f0273c428..5af9b0134 100644 --- a/test/unit/test_deserialize.py +++ b/test/unit/test_deserialize.py @@ -1,6 +1,7 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Unit test suite for aws_encryption_sdk.deserialize""" +import base64 import io import struct @@ -130,6 +131,28 @@ def test_deserialize_header_unknown_version(self): aws_encryption_sdk.internal.formatting.deserialize.deserialize_header(stream) excinfo.match("Unsupported version *") + @pytest.mark.parametrize( + "serialized_header", (VALUES["serialized_header"], VALUES["serialized_header_v2_committing"]) + ) + def test_deserialize_header_base64_encoded(self, serialized_header): + """Validate that the deserialize_header function behaves + as expected for a Base64 encoded message. + """ + with pytest.raises(NotSupportedError) as excinfo: + stream = io.BytesIO(base64.b64encode(serialized_header)) + aws_encryption_sdk.internal.formatting.deserialize.deserialize_header(stream) + excinfo.match("Message appears to be Base64 encoded, decode it before decrypting") + + @pytest.mark.parametrize("serialized_header", (b"A", b"AX", b"BY")) + def test_deserialize_header_unknown_version_not_base64_encoded(self, serialized_header): + """Validate that the deserialize_header function behaves + as expected for an unknown message version that is not a Base64 encoded message. + """ + with pytest.raises(NotSupportedError) as excinfo: + stream = io.BytesIO(serialized_header) + aws_encryption_sdk.internal.formatting.deserialize.deserialize_header(stream) + excinfo.match("Unsupported version *") + @patch("aws_encryption_sdk.internal.formatting.deserialize.AlgorithmSuite.get_by_id") def test_deserialize_header_unsupported_data_encryption_algorithm(self, mock_algorithm_get): """Validate that the deserialize_header function behaves diff --git a/test_vector_handlers/README.rst b/test_vector_handlers/README.rst index 9bf6e5ce5..825756028 100644 --- a/test_vector_handlers/README.rst +++ b/test_vector_handlers/README.rst @@ -12,7 +12,7 @@ Getting Started Required Prerequisites ====================== -* Python 3.8+ +* Python 3.10+ * aws-encryption-sdk Use diff --git a/test_vector_handlers/setup.py b/test_vector_handlers/setup.py index f09126929..56f62ce6f 100644 --- a/test_vector_handlers/setup.py +++ b/test_vector_handlers/setup.py @@ -46,8 +46,6 @@ def get_requirements(): "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Security", "Topic :: Security :: Cryptography", diff --git a/test_vector_handlers/tox.ini b/test_vector_handlers/tox.ini index 49d45cb3f..7d156369c 100644 --- a/test_vector_handlers/tox.ini +++ b/test_vector_handlers/tox.ini @@ -2,7 +2,7 @@ envlist = # The test vectors depend on new features now, # so until release we can only effectively test the local version of the ESDK. - py{37,38,39,310}-awses_local + py310-awses_local py{311,312}-awses_local{,-mpl} # 1.2.0 and 1.2.max are being difficult because of attrs bandit, doc8, readme, diff --git a/tox.ini b/tox.ini index a6666e3b1..6b4df5785 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = # <3.11: run all non-MPL tests - py{38,39,310}-{local,integ,accept,examples}, + py310-{local,integ,accept,examples}, # >=3.11: run all tests with MPL installed and without MPL installed # The `-mpl` suffix tells tox to install the MPL. # In the case where the suffix IS NOT appended,