Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Fix challenge bdd tests
Fang-Pen Linf14df38eaaad
diff --git a/backend/bdd/features/pki/acme/challenge.feature b/backend/bdd/features/pki/acme/challenge.featureindex 543e4cea35..b4aaa1a345 100644--- a/backend/bdd/features/pki/acme/challenge.feature+++ b/backend/bdd/features/pki/acme/challenge.feature@@ -20,6 +20,8 @@ Feature: ChallengeAnd I poll and finalize the ACME order order as finalized_orderAnd the value finalized_order.body with jq ".status" should be equal to "valid"+ # TODO: add challenge with SANs+Scenario: Did not finish all challengesGiven I have an ACME cert profile as "acme_profile"When I have an ACME client connecting to "{BASE_URL}/api/v1/pki/acme/profiles/{acme_profile.id}/directory"@@ -151,6 +153,7 @@ Feature: ChallengeAnd I memorize response.headers with jq ".["replay-nonce"]" as nonceAnd I memorize response as orderAnd I pass all challenges with type http-01 for order in order+ And I encode CSR csr_pem as JOSE Base-64 DER as base64_csr_derWhen I send a raw ACME request to "{finalize_url}""""{@@ -161,11 +164,11 @@ Feature: Challenge"kid": "{acme_account.uri}"},"payload": {- "csr": "{csr_pem}"+ "csr": "{base64_csr_der}"}}"""Then the value response.status_code should be equal to 400And the value response with jq ".status" should be equal to 400- And the value response with jq ".type" should be equal to "urn:ietf:params:acme:error:malformed"- And the value response with jq ".detail" should be equal to "<error_detail>"+ And the value response with jq ".type" should be equal to "urn:ietf:params:acme:error:badCSR"+ And the value response with jq ".detail" should be equal to "Invalid CSR: Common name + SANs mismatch with order identifiers"diff --git a/backend/bdd/features/steps/pki_acme.py b/backend/bdd/features/steps/pki_acme.pyindex f8e6da300c..604aa5e7a1 100644--- a/backend/bdd/features/steps/pki_acme.py+++ b/backend/bdd/features/steps/pki_acme.py@@ -389,6 +389,15 @@ def step_impl(context: Context, url: str):send_raw_acme_req(context, url)+@then(+ "I encode CSR {pem_var} as JOSE Base-64 DER as {var_name}",+)+def step_impl(context: Context, pem_var: str, var_name: str):+ csr = eval_var(context, pem_var)+ parsed_csr = x509.load_pem_x509_csr(csr)+ context.vars[var_name] = json_util.encode_csr(parsed_csr)++@then("I submit the certificate signing request PEM {pem_var} certificate order to the ACME server as {order_var}")