Detail and message are mostly the same for acme error, use just one to avoid conufsing

This commit is contained in:
Fang-Pen Lin
2025-11-12 09:12:14 -08:00
parent 159eb3138d
commit f11c4084ac
6 changed files with 144 additions and 206 deletions
@@ -16,13 +16,13 @@ Feature: Account
Given 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
Then I register a new ACME account with email fangpen@infisical.com and EAB key id "<eab_kid>" with secret "<eab_secret>" as acme_account
Then the value error with jq ".type" should be equal to "urn:ietf:params:acme:error:malformed"
Then the value error with jq ".detail" should be equal to "Invalid external account binding JWS signature"
Then the value error with jq ".type" should be equal to "<error_type>"
Then the value error with jq ".detail" should be equal to "<error_msg>"
Examples: Bad Credentials
| eab_kid | eab_secret |
| bad | Cg== |
| bad | Cg== |
| {acme_profile.eab_kid} | Cg== |
| {acme_profile.eab_kid} | YmFkLXNjcmV0Cg== |
| 4bc7959c-fe2d-4447-ae91-0cd893667af6 | {acme_profile.eab_secret} |
| eab_kid | eab_secret | error_type | error_msg |
| bad | Cg== | urn:ietf:params:acme:error:externalAccountRequired | fixme |
| bad | Cg== | urn:ietf:params:acme:error:externalAccountRequired | fixme |
| {acme_profile.eab_kid} | Cg== | urn:ietf:params:acme:error:externalAccountRequired | fixme |
| {acme_profile.eab_kid} | YmFkLXNjcmV0Cg== | urn:ietf:params:acme:error:externalAccountRequired | fixme |
| 4bc7959c-fe2d-4447-ae91-0cd893667af6 | {acme_profile.eab_secret} | urn:ietf:params:acme:error:externalAccountRequired | fixme |
+2 -2
View File
@@ -251,8 +251,8 @@ def step_impl(context: Context, email: str, kid: str, secret: str, account_var:
)
try:
context.vars[account_var] = acme_client.new_account(registration)
except Exception:
context.vars["error"] = acme_client.new_account(registration)
except Exception as exp:
context.vars["error"] = exp
@then("I register a new ACME account with email {email} without EAB")