From d792a79da8f6062afe8043870701ffa406d68ca6 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Thu, 6 Nov 2025 23:05:00 -0800 Subject: [PATCH] Fix more tests --- backend/bdd/features/pki/acme/access-control.feature | 3 ++- backend/src/ee/services/pki-acme/pki-acme-fns.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/bdd/features/pki/acme/access-control.feature b/backend/bdd/features/pki/acme/access-control.feature index 96da3f7c8..3bbc458db 100644 --- a/backend/bdd/features/pki/acme/access-control.feature +++ b/backend/bdd/features/pki/acme/access-control.feature @@ -126,7 +126,7 @@ Feature: Access Control "url": "", "kid": "{acme_account1.uri}" }, - "raw_payload": "" + "payload": {} } """ Then the value response.status_code should be equal to 404 @@ -140,6 +140,7 @@ Feature: Access Control | order | .authorizations[0].uri | auth_uri | {auth_uri} | | | order | .authorizations[0].body.challenges[0].url | challenge_uri | {challenge_uri} | {} | + Scenario Outline: Access resources across a different profile with the same key pair 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" diff --git a/backend/src/ee/services/pki-acme/pki-acme-fns.ts b/backend/src/ee/services/pki-acme/pki-acme-fns.ts index 08659c853..d82877891 100644 --- a/backend/src/ee/services/pki-acme/pki-acme-fns.ts +++ b/backend/src/ee/services/pki-acme/pki-acme-fns.ts @@ -13,7 +13,7 @@ export const buildUrl = (profileId: string, path: string): string => { export const extractAccountIdFromKid = (kid: string, profileId: string): string => { const kidPrefix = buildUrl(profileId, "/accounts/"); if (!kid.startsWith(kidPrefix)) { - throw new AcmeMalformedError({ message: "KID must start with the profile account URL" }); + throw new AcmeAccountDoesNotExistError({ message: "KID must start with the profile account URL" }); } return z.string().uuid().parse(kid.slice(kidPrefix.length)); };