More linter

This commit is contained in:
Fang-Pen Lin
2025-11-07 09:21:08 -08:00
parent 6b192c56fd
commit 694a13fce2
2 changed files with 5 additions and 2 deletions
@@ -86,7 +86,7 @@ export const pkiAcmeChallengeServiceFactory = ({
const { cause } = exp; const { cause } = exp;
let errors: Error[] = []; let errors: Error[] = [];
if (cause instanceof AggregateError) { if (cause instanceof AggregateError) {
errors = cause.errors; errors = cause.errors as Error[];
} else if (cause instanceof Error) { } else if (cause instanceof Error) {
errors = [cause]; errors = [cause];
} }
@@ -97,6 +97,8 @@ export const pkiAcmeChallengeServiceFactory = ({
return new AcmeConnectionError({ message: "Connection refused" }); return new AcmeConnectionError({ message: "Connection refused" });
} else if (fetchError.code === "ENOTFOUND" || fetchError.message.includes("ENOTFOUND")) { } else if (fetchError.code === "ENOTFOUND" || fetchError.message.includes("ENOTFOUND")) {
return new AcmeDnsFailureError({ message: "Hostname could not be resolved (DNS failure)" }); 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) { } else if (exp instanceof Error) {
@@ -222,6 +222,7 @@ export const pkiAcmeServiceFactory = ({
}; };
const validateExistingAccountJwsPayload = async < const validateExistingAccountJwsPayload = async <
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TSchema extends z.ZodSchema<any> | undefined = undefined, TSchema extends z.ZodSchema<any> | undefined = undefined,
T = TSchema extends z.ZodSchema<infer R> ? R : string 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 // Make sure the JWK in the EAB payload matches the one provided in the outer JWS payload
const decoder = new TextDecoder(); const decoder = new TextDecoder();
const decodedEabPayload = decoder.decode(eabPayload); const decodedEabPayload = decoder.decode(eabPayload);
const eabJWK = JSON.parse(decodedEabPayload); const eabJWK = JSON.parse(decodedEabPayload) as JsonWebKey;
const eabPayloadJwkThumbprint = await calculateJwkThumbprint(eabJWK, "sha256"); const eabPayloadJwkThumbprint = await calculateJwkThumbprint(eabJWK, "sha256");
if (eabPayloadJwkThumbprint !== publicKeyThumbprint) { if (eabPayloadJwkThumbprint !== publicKeyThumbprint) {
throw new AcmeBadPublicKeyError({ throw new AcmeBadPublicKeyError({