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] 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,