More linter

This commit is contained in:
Fang-Pen Lin
2025-11-04 16:35:33 -08:00
parent 6b192c56fd
commit 694a13fce2
2 changed files with 5 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ export const pkiAcmeChallengeServiceFactory = ({
const { cause } = exp;
let errors: Error[] = [];
if (cause instanceof AggregateError) {
errors = cause.errors;
errors = cause.errors as Error[];
} else if (cause instanceof Error) {
errors = [cause];
}
@@ -97,6 +97,8 @@ export const pkiAcmeChallengeServiceFactory = ({
return new AcmeConnectionError({ message: "Connection refused" });
} else if (fetchError.code === "ENOTFOUND" || fetchError.message.includes("ENOTFOUND")) {
return new AcmeDnsFailureError({ message: "Hostname could not be resolved (DNS failure)" });
} else {
return new AcmeServerInternalError({ message: "Unknown error validating ACME challenge response" });
}
}
} else if (exp instanceof Error) {

View File

@@ -222,6 +222,7 @@ export const pkiAcmeServiceFactory = ({
};
const validateExistingAccountJwsPayload = async <
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TSchema extends z.ZodSchema<any> | undefined = undefined,
T = TSchema extends z.ZodSchema<infer R> ? R : string
>({
@@ -385,7 +386,7 @@ export const pkiAcmeServiceFactory = ({
// Make sure the JWK in the EAB payload matches the one provided in the outer JWS payload
const decoder = new TextDecoder();
const decodedEabPayload = decoder.decode(eabPayload);
const eabJWK = JSON.parse(decodedEabPayload);
const eabJWK = JSON.parse(decodedEabPayload) as JsonWebKey;
const eabPayloadJwkThumbprint = await calculateJwkThumbprint(eabJWK, "sha256");
if (eabPayloadJwkThumbprint !== publicKeyThumbprint) {
throw new AcmeBadPublicKeyError({