From 11b6b523f06d07c586350da2e09d71ce000489cc Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 11:05:53 -0700 Subject: [PATCH 01/15] more --- buildspec.yml | 16 ++++++++++ .../decrypt_golden_manifest_with_keyrings.yml | 31 +++++++++++++++++++ ...decrypt_golden_manifest_with_masterkey.yml | 30 ++++++++++++++++++ .../decrypt_golden_manifest_with_keyrings.yml | 31 +++++++++++++++++++ ...decrypt_golden_manifest_with_masterkey.yml | 30 ++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 codebuild/py311/decrypt_golden_manifest_with_keyrings.yml create mode 100644 codebuild/py311/decrypt_golden_manifest_with_masterkey.yml create mode 100644 codebuild/py312/decrypt_golden_manifest_with_keyrings.yml create mode 100644 codebuild/py312/decrypt_golden_manifest_with_masterkey.yml diff --git a/buildspec.yml b/buildspec.yml index 4665ac89e..4065dc4e8 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -206,6 +206,14 @@ batch: buildspec: codebuild/py311/decrypt_keyrings_with_js.yml env: image: aws/codebuild/standard:7.0 + - identifier: py311_decrypt_golden_manifest_with_keyrings + buildspec: codebuild/py311/decrypt_golden_manifest_with_keyrings.yml + env: + image: aws/codebuild/standard:7.0 + - identifier: py311_decrypt_golden_manifest_with_masterkey + buildspec: codebuild/py311/decrypt_golden_manifest_with_masterkey.yml + env: + image: aws/codebuild/standard:7.0 - identifier: py312_integ @@ -318,6 +326,14 @@ batch: buildspec: codebuild/py312/decrypt_hkeyring_with_net.yml env: image: aws/codebuild/standard:7.0 + - identifier: py312_decrypt_golden_manifest_with_keyrings + buildspec: codebuild/py312/decrypt_golden_manifest_with_keyrings.yml + env: + image: aws/codebuild/standard:7.0 + - identifier: py312_decrypt_golden_manifest_with_masterkey + buildspec: codebuild/py312/decrypt_golden_manifest_with_masterkey.yml + env: + image: aws/codebuild/standard:7.0 - identifier: code_coverage buildspec: codebuild/coverage/coverage.yml diff --git a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml new file mode 100644 index 000000000..88f807381 --- /dev/null +++ b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml @@ -0,0 +1,31 @@ +version: 0.2 + +env: + variables: + TOXENV: "py312-full_decrypt-mpl" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b35311ef1-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.11 + pre_build: + commands: + # Download "golden manifest" + - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip + - unzip python-2.3.0.zip + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../python-2.3.0/manifest.json \ + --keyrings diff --git a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml new file mode 100644 index 000000000..1070bd2a9 --- /dev/null +++ b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml @@ -0,0 +1,30 @@ +version: 0.2 + +env: + variables: + TOXENV: "py312-full_decrypt-mpl" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b35311ef1-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.11 + pre_build: + commands: + # Download "golden manifest" + - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip + - unzip python-2.3.0.zip + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../python-2.3.0/manifest.json diff --git a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml new file mode 100644 index 000000000..b37cce17f --- /dev/null +++ b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml @@ -0,0 +1,31 @@ +version: 0.2 + +env: + variables: + TOXENV: "py312-full_decrypt-mpl" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b35311ef1-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.12 + pre_build: + commands: + # Download "golden manifest" + - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip + - unzip python-2.3.0.zip + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../python-2.3.0/manifest.json \ + --keyrings diff --git a/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml b/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml new file mode 100644 index 000000000..6b2055aeb --- /dev/null +++ b/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml @@ -0,0 +1,30 @@ +version: 0.2 + +env: + variables: + TOXENV: "py312-full_decrypt-mpl" + AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- + arn:aws:kms:us-west-2:658956600833:key/b35311ef1-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.12 + pre_build: + commands: + # Download "golden manifest" + - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip + - unzip python-2.3.0.zip + build: + commands: + - pip install "tox < 4.0" + - cd test_vector_handlers + - | + tox -- \ + --input ../python-2.3.0/manifest.json From d5bd84c5f702feec5ad855370fc4d3be5fc624aa Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 11:15:42 -0700 Subject: [PATCH 02/15] m --- codebuild/py311/decrypt_golden_manifest_with_keyrings.yml | 1 + codebuild/py311/decrypt_golden_manifest_with_masterkey.yml | 1 + codebuild/py312/decrypt_golden_manifest_with_keyrings.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml index 88f807381..001f9c62e 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml @@ -24,6 +24,7 @@ phases: build: commands: - pip install "tox < 4.0" + - ls - cd test_vector_handlers - | tox -- \ diff --git a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml index 1070bd2a9..c093f0018 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml @@ -24,6 +24,7 @@ phases: build: commands: - pip install "tox < 4.0" + - ls - cd test_vector_handlers - | tox -- \ diff --git a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml index b37cce17f..9a24d2632 100644 --- a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml @@ -24,6 +24,7 @@ phases: build: commands: - pip install "tox < 4.0" + - ls - cd test_vector_handlers - | tox -- \ From 17020e2422ec877e2469324cc49de3b9aefd97b4 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 11:22:34 -0700 Subject: [PATCH 03/15] m --- codebuild/py311/decrypt_golden_manifest_with_keyrings.yml | 3 +-- codebuild/py311/decrypt_golden_manifest_with_masterkey.yml | 3 +-- codebuild/py312/decrypt_golden_manifest_with_keyrings.yml | 3 +-- codebuild/py312/decrypt_golden_manifest_with_masterkey.yml | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml index 001f9c62e..c322c02a4 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml @@ -20,11 +20,10 @@ phases: commands: # Download "golden manifest" - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip - - unzip python-2.3.0.zip + - unzip python-2.3.0.zip -d python-2.3.0 build: commands: - pip install "tox < 4.0" - - ls - cd test_vector_handlers - | tox -- \ diff --git a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml index c093f0018..aa62b00e2 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml @@ -20,11 +20,10 @@ phases: commands: # Download "golden manifest" - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip - - unzip python-2.3.0.zip + - unzip python-2.3.0.zip -d python-2.3.0 build: commands: - pip install "tox < 4.0" - - ls - cd test_vector_handlers - | tox -- \ diff --git a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml index 9a24d2632..54bb10c33 100644 --- a/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py312/decrypt_golden_manifest_with_keyrings.yml @@ -20,11 +20,10 @@ phases: commands: # Download "golden manifest" - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip - - unzip python-2.3.0.zip + - unzip python-2.3.0.zip -d python-2.3.0 build: commands: - pip install "tox < 4.0" - - ls - cd test_vector_handlers - | tox -- \ diff --git a/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml b/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml index 6b2055aeb..df204d4c5 100644 --- a/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml +++ b/codebuild/py312/decrypt_golden_manifest_with_masterkey.yml @@ -20,7 +20,7 @@ phases: commands: # Download "golden manifest" - curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip - - unzip python-2.3.0.zip + - unzip python-2.3.0.zip -d python-2.3.0 build: commands: - pip install "tox < 4.0" From d3dec8a161460c127733d5442ef0f47fe5219827 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 11:29:48 -0700 Subject: [PATCH 04/15] m --- codebuild/py311/decrypt_golden_manifest_with_keyrings.yml | 2 +- codebuild/py311/decrypt_golden_manifest_with_masterkey.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml index c322c02a4..154863bcc 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_keyrings.yml @@ -2,7 +2,7 @@ version: 0.2 env: variables: - TOXENV: "py312-full_decrypt-mpl" + TOXENV: "py311-full_decrypt-mpl" AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- arn:aws:kms:us-west-2:658956600833:key/b35311ef1-d8dc-4780-9f5a-55776cbb2f7f AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- diff --git a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml index aa62b00e2..4ae4bb280 100644 --- a/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml +++ b/codebuild/py311/decrypt_golden_manifest_with_masterkey.yml @@ -2,7 +2,7 @@ version: 0.2 env: variables: - TOXENV: "py312-full_decrypt-mpl" + TOXENV: "py311-full_decrypt-mpl" AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >- arn:aws:kms:us-west-2:658956600833:key/b35311ef1-d8dc-4780-9f5a-55776cbb2f7f AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >- From 7221587797a56fee67c252b9320c347bc163c5c0 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 13:06:07 -0700 Subject: [PATCH 05/15] m --- .../awses_test_vectors/manifests/full_message/decrypt.py | 8 ++++++-- .../src/awses_test_vectors/manifests/mpl_keyring.py | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index c942d8bf4..c23c8f817 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -333,8 +333,11 @@ def master_key_provider_fn(): # If this scenario does not have any key providers, # do not create a scenario. # Caller logic should expect `None` to mean "no scenario". - if master_key_provider_fn() is None: - return None + try: + if master_key_provider_fn() is None: + return None + except Exception as e: + pass return cls( ciphertext_uri=scenario["ciphertext"], @@ -625,6 +628,7 @@ def from_file(cls, input_file, keyrings): keys_abs_path = os.path.join(parent_dir, keys_filename) raw_keys_manifest = json.loads(root_reader(keys_uri).decode(ENCODING)) + print("yes") keys = KeysManifest.from_manifest_spec(raw_keys_manifest) client_name = raw_manifest["client"]["name"] # type: str diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py index 8d972d2c5..668f0a35d 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py @@ -113,6 +113,8 @@ def keyring(self, keys_uri, mode): input_kwargs["padding-algorithm"] = self.padding_algorithm if self.padding_hash is not None: input_kwargs["padding-hash"] = self.padding_hash + if self.default_mrk_region is not None: + input_kwargs["default-mrk-region"] = self.default_mrk_region if input_kwargs["type"] == "raw" \ and input_kwargs["encryption-algorithm"] == "rsa": From 72126269524d0a37c7e0a801daec526d82094792 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 13:12:44 -0700 Subject: [PATCH 06/15] m --- .../awses_test_vectors/manifests/full_message/decrypt.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index c23c8f817..d08118931 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -330,13 +330,15 @@ def master_key_provider_fn(): # If unspecified, set "Default" as the default cmm_type = "Default" - # If this scenario does not have any key providers, - # do not create a scenario. - # Caller logic should expect `None` to mean "no scenario". try: + # If this scenario does not have any key providers, + # do not create a scenario. + # Caller logic should expect `None` to mean "no scenario". if master_key_provider_fn() is None: return None except Exception as e: + # If there is some exception when loading the key, continue to create the test scenario. + # Some test scenarios have bad keys that should fail during the test execution. pass return cls( @@ -628,7 +630,6 @@ def from_file(cls, input_file, keyrings): keys_abs_path = os.path.join(parent_dir, keys_filename) raw_keys_manifest = json.loads(root_reader(keys_uri).decode(ENCODING)) - print("yes") keys = KeysManifest.from_manifest_spec(raw_keys_manifest) client_name = raw_manifest["client"]["name"] # type: str From 115b00e5dbdad974867232aee36393196ed8713e Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 13:53:05 -0700 Subject: [PATCH 07/15] m --- .../src/awses_test_vectors/manifests/mpl_keyring.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py index 668f0a35d..48bffa285 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py @@ -115,6 +115,12 @@ def keyring(self, keys_uri, mode): input_kwargs["padding-hash"] = self.padding_hash if self.default_mrk_region is not None: input_kwargs["default-mrk-region"] = self.default_mrk_region + if self.discovery_filter is not None: + input_kwargs["aws-kms-discovery-filter"] = {} + if self.discovery_filter.partition is not None: + input_kwargs["aws-kms-discovery-filter"]["partition"] = self.discovery_filter.partition + if self.discovery_filter.account_ids is not None: + input_kwargs["aws-kms-discovery-filter"]["account-ids"] = self.discovery_filter.account_ids if input_kwargs["type"] == "raw" \ and input_kwargs["encryption-algorithm"] == "rsa": From 01fc212e2d6c126e9c3960b7a3f7e779a0a18ccf Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 14:42:21 -0700 Subject: [PATCH 08/15] m --- .../awses_test_vectors/manifests/full_message/decrypt.py | 6 +++--- .../src/awses_test_vectors/manifests/mpl_keyring.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index d08118931..ea47d8f91 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -273,7 +273,7 @@ def from_scenario( keyrings, # type: bool keys_uri, # type: str ): - # pylint: disable=too-many-locals + # pylint: disable=too-many-locals,too-many-branches # type: (...) -> MessageDecryptionTestScenario """Load from a scenario specification. @@ -336,8 +336,8 @@ def master_key_provider_fn(): # Caller logic should expect `None` to mean "no scenario". if master_key_provider_fn() is None: return None - except Exception as e: - # If there is some exception when loading the key, continue to create the test scenario. + except Exception: # pylint: disable=broad-exception + # If there is any exception when loading the key, continue to create the test scenario. # Some test scenarios have bad keys that should fail during the test execution. pass diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py index 48bffa285..40ac61668 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py @@ -90,7 +90,7 @@ def from_scenario(cls, spec): padding_hash=spec.get("padding-hash"), ) - def keyring(self, keys_uri, mode): + def keyring(self, keys_uri, mode): # pylint: disable=too-many-branches # type: (KeysManifest) -> IKeyring """Build a keyring using this specification. :param str keys_uri: Path to the keys manifest From b79239965b7e28a65387e11d9481d02a711ffff9 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 14:44:58 -0700 Subject: [PATCH 09/15] m --- .../src/awses_test_vectors/manifests/full_message/decrypt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index ea47d8f91..da227ee73 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -336,7 +336,7 @@ def master_key_provider_fn(): # Caller logic should expect `None` to mean "no scenario". if master_key_provider_fn() is None: return None - except Exception: # pylint: disable=broad-exception + except Exception: # pylint: disable=broad-except # If there is any exception when loading the key, continue to create the test scenario. # Some test scenarios have bad keys that should fail during the test execution. pass From 00d8e7db3e2838e8972ec9b065f1ac2ec70a24c1 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 14:46:34 -0700 Subject: [PATCH 10/15] m --- .../src/awses_test_vectors/manifests/full_message/decrypt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index da227ee73..97cfe2ea7 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -336,7 +336,7 @@ def master_key_provider_fn(): # Caller logic should expect `None` to mean "no scenario". if master_key_provider_fn() is None: return None - except Exception: # pylint: disable=broad-except + except Exception: # nosec,pylint: disable=broad-except # If there is any exception when loading the key, continue to create the test scenario. # Some test scenarios have bad keys that should fail during the test execution. pass From 555c3faddfba729acc9a1d4475a25a65645a9abf Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 14:50:40 -0700 Subject: [PATCH 11/15] m --- .../src/awses_test_vectors/manifests/full_message/decrypt.py | 1 + .../src/awses_test_vectors/manifests/mpl_keyring.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index 97cfe2ea7..bd21f2963 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -274,6 +274,7 @@ def from_scenario( keys_uri, # type: str ): # pylint: disable=too-many-locals,too-many-branches + # noqa: C901 # type: (...) -> MessageDecryptionTestScenario """Load from a scenario specification. diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py index 40ac61668..e43260044 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py @@ -90,7 +90,7 @@ def from_scenario(cls, spec): padding_hash=spec.get("padding-hash"), ) - def keyring(self, keys_uri, mode): # pylint: disable=too-many-branches + def keyring(self, keys_uri, mode): # pylint: disable=too-many-branches, noqa: C901 # type: (KeysManifest) -> IKeyring """Build a keyring using this specification. :param str keys_uri: Path to the keys manifest From b1b6a7d15898135f970592a1d2fc28a06dc3a868 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 14:52:17 -0700 Subject: [PATCH 12/15] m --- .../src/awses_test_vectors/manifests/mpl_keyring.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py index e43260044..d892f64f6 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py @@ -90,7 +90,9 @@ def from_scenario(cls, spec): padding_hash=spec.get("padding-hash"), ) - def keyring(self, keys_uri, mode): # pylint: disable=too-many-branches, noqa: C901 + def keyring(self, keys_uri, mode): + # pylint: disable=too-many-branches + # noqa: C901 # type: (KeysManifest) -> IKeyring """Build a keyring using this specification. :param str keys_uri: Path to the keys manifest From b1ae11e9e43481accab90fdf2fb6303945f6dce7 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 14:54:35 -0700 Subject: [PATCH 13/15] m --- .../src/awses_test_vectors/manifests/full_message/decrypt.py | 3 +-- .../src/awses_test_vectors/manifests/mpl_keyring.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index bd21f2963..bd6ca94ae 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -272,9 +272,8 @@ def from_scenario( keys, # type: KeysManifest keyrings, # type: bool keys_uri, # type: str - ): + ): # noqa: C901 # pylint: disable=too-many-locals,too-many-branches - # noqa: C901 # type: (...) -> MessageDecryptionTestScenario """Load from a scenario specification. diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py index d892f64f6..3ed7913d2 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/mpl_keyring.py @@ -90,9 +90,8 @@ def from_scenario(cls, spec): padding_hash=spec.get("padding-hash"), ) - def keyring(self, keys_uri, mode): + def keyring(self, keys_uri, mode): # noqa: C901 # pylint: disable=too-many-branches - # noqa: C901 # type: (KeysManifest) -> IKeyring """Build a keyring using this specification. :param str keys_uri: Path to the keys manifest From c8d003dc8d7a171aa32628b55a0155efe3d42a24 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 15:00:08 -0700 Subject: [PATCH 14/15] m --- .../src/awses_test_vectors/manifests/full_message/decrypt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index bd6ca94ae..b5303fa7f 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -263,6 +263,7 @@ def __init__( self.description = description attr.validate(self) + # noqa: C901 @classmethod def from_scenario( cls, @@ -272,7 +273,7 @@ def from_scenario( keys, # type: KeysManifest keyrings, # type: bool keys_uri, # type: str - ): # noqa: C901 + ): # pylint: disable=too-many-locals,too-many-branches # type: (...) -> MessageDecryptionTestScenario """Load from a scenario specification. From d5ce93c6958785b8a5727d33a4422518aff88a30 Mon Sep 17 00:00:00 2001 From: Lucas McDonald Date: Wed, 30 Oct 2024 15:04:15 -0700 Subject: [PATCH 15/15] m --- .../src/awses_test_vectors/manifests/full_message/decrypt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py index b5303fa7f..a938106bd 100644 --- a/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py +++ b/test_vector_handlers/src/awses_test_vectors/manifests/full_message/decrypt.py @@ -263,9 +263,8 @@ def __init__( self.description = description attr.validate(self) - # noqa: C901 @classmethod - def from_scenario( + def from_scenario( # noqa: C901 cls, scenario, # type: DECRYPT_SCENARIO_SPEC plaintext_reader, # type: Callable[[str], bytes]