Fix more tests

This commit is contained in:
Fang-Pen Lin
2025-11-06 23:05:00 -08:00
parent a057100274
commit d792a79da8
2 changed files with 3 additions and 2 deletions

View File

@@ -126,7 +126,7 @@ Feature: Access Control
"url": "<url>",
"kid": "{acme_account1.uri}"
},
"raw_payload": "<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"

View File

@@ -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));
};