From 522b239a46906013730bcbc8ffb8998e6381685e Mon Sep 17 00:00:00 2001 From: Henry Birge-Lee Date: Fri, 17 Jan 2025 20:14:39 -0500 Subject: [PATCH 1/4] Added support for *. wildcards in integration tests --- clean.sh | 6 ++++-- pyproject.toml | 4 ++-- tests/integration/test_deployed_mpic_api.py | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/clean.sh b/clean.sh index cf0d5c1..14c71ca 100755 --- a/clean.sh +++ b/clean.sh @@ -10,9 +10,11 @@ rm open-tofu/*.generated.tf rm -r layer/create_layer_virtualenv rm -r layer/python311_layer_content rm -r layer/mpic_coordinator_layer_content +rm -r layer/mpic_caa_checker_layer_content +rm -r layer/mpic_dcv_checker_layer_content +rm -r layer/mpic_common_layer_content -rm layer/python311_layer_content.zip -rm layer/mpic_coordinator_layer_content.zip +rm layer/*.zip rm "${FUNCTIONS_DIR}"/mpic_coordinator_lambda/mpic_coordinator_lambda.zip rm "${FUNCTIONS_DIR}"/mpic_caa_checker_lambda/mpic_caa_checker_lambda.zip diff --git a/pyproject.toml b/pyproject.toml index e08cc41..5d6b9b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - #"open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@main", + "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@ds-wildcard-caa-change", "pyyaml==6.0.1", "requests>=2.32.3", "dnspython==2.6.1", "pydantic==2.8.2", "aiohttp==3.11.11", "aws-lambda-powertools[parser]==3.2.0", - "open-mpic-core==4.1.2", + #"open-mpic-core==4.1.2", "aioboto3~=13.3.0", ] diff --git a/tests/integration/test_deployed_mpic_api.py b/tests/integration/test_deployed_mpic_api.py index 42777cf..5cdc991 100644 --- a/tests/integration/test_deployed_mpic_api.py +++ b/tests/integration/test_deployed_mpic_api.py @@ -114,11 +114,12 @@ def api_should_return_is_valid_false_for_all_tests_in_do_not_issue_caa_test_suit def api_should_return_is_valid_true_for_valid_tests_in_caa_test_suite_when_caa_domain_is_caatestsuite_com(self, api_client, domain_or_ip_target, purpose_of_test, is_wildcard_domain): print(f"Running test for {domain_or_ip_target} ({purpose_of_test})") + if is_wildcard_domain: + domain_or_ip_target = "*." + domain_or_ip_target request = MpicCaaRequest( domain_or_ip_target=domain_or_ip_target, orchestration_parameters=MpicRequestOrchestrationParameters(perspective_count=3, quorum_count=2), caa_check_parameters=CaaCheckParameters( - certificate_type=CertificateType.TLS_SERVER if not is_wildcard_domain else CertificateType.TLS_SERVER_WILDCARD, caa_domains=['caatestsuite.com', 'example.com']) ) response = api_client.post(MPIC_REQUEST_PATH, json.dumps(request.model_dump())) From 6eb0faa76a07572571e6d2138c9955a6ab7074dc Mon Sep 17 00:00:00 2001 From: Henry Birge-Lee Date: Fri, 17 Jan 2025 20:22:20 -0500 Subject: [PATCH 2/4] changed to main to fix issue with deleted branch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5d6b9b5..f7c546a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@ds-wildcard-caa-change", + "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@main", "pyyaml==6.0.1", "requests>=2.32.3", "dnspython==2.6.1", From b9797e1d6397cc4ba1a2811d80cc7be1ec56df7e Mon Sep 17 00:00:00 2001 From: Dmitry Sharkov Date: Sat, 18 Jan 2025 16:36:41 -0500 Subject: [PATCH 3/4] fixed wildcard tests --- tests/integration/test_deployed_mpic_api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_deployed_mpic_api.py b/tests/integration/test_deployed_mpic_api.py index 5cdc991..1050753 100644 --- a/tests/integration/test_deployed_mpic_api.py +++ b/tests/integration/test_deployed_mpic_api.py @@ -81,12 +81,14 @@ def api_should_return_200_and_passed_corroboration_given_successful_caa_check(se def api_should_return_is_valid_false_for_all_tests_in_do_not_issue_caa_test_suite(self, api_client, domain_or_ip_target, purpose_of_test, is_wildcard_domain): print(f"Running test for {domain_or_ip_target} ({purpose_of_test})") + if is_wildcard_domain: + domain_or_ip_target = "*." + domain_or_ip_target request = MpicCaaRequest( domain_or_ip_target=domain_or_ip_target, orchestration_parameters=MpicRequestOrchestrationParameters(perspective_count=3, quorum_count=2), caa_check_parameters=CaaCheckParameters( - certificate_type=CertificateType.TLS_SERVER if not is_wildcard_domain else CertificateType.TLS_SERVER_WILDCARD, - caa_domains=['example.com']) + certificate_type=CertificateType.TLS_SERVER, caa_domains=['example.com'] + ) ) response = api_client.post(MPIC_REQUEST_PATH, json.dumps(request.model_dump())) mpic_response = self.mpic_response_adapter.validate_json(response.text) @@ -120,7 +122,7 @@ def api_should_return_is_valid_true_for_valid_tests_in_caa_test_suite_when_caa_d domain_or_ip_target=domain_or_ip_target, orchestration_parameters=MpicRequestOrchestrationParameters(perspective_count=3, quorum_count=2), caa_check_parameters=CaaCheckParameters( - caa_domains=['caatestsuite.com', 'example.com']) + certificate_type=CertificateType.TLS_SERVER, caa_domains=['caatestsuite.com', 'example.com']) ) response = api_client.post(MPIC_REQUEST_PATH, json.dumps(request.model_dump())) mpic_response = self.mpic_response_adapter.validate_json(response.text) From 5cee73ca31bd9a3a493210a6f714ff7eddca3210 Mon Sep 17 00:00:00 2001 From: Dmitry Sharkov Date: Sat, 18 Jan 2025 16:39:26 -0500 Subject: [PATCH 4/4] updated open mpic core version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f7c546a..1aaff2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,14 +26,14 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@main", +# "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@main", "pyyaml==6.0.1", "requests>=2.32.3", "dnspython==2.6.1", "pydantic==2.8.2", "aiohttp==3.11.11", "aws-lambda-powertools[parser]==3.2.0", - #"open-mpic-core==4.1.2", + "open-mpic-core==4.4.0", "aioboto3~=13.3.0", ]