This commit is contained in:
Fang-Pen Lin
2025-11-07 09:21:05 -08:00
parent 4791b16b00
commit e02afc5eef
3 changed files with 5 additions and 4 deletions
@@ -3,6 +3,8 @@
* https://datatracker.ietf.org/doc/html/rfc8555#section-6.7 * https://datatracker.ietf.org/doc/html/rfc8555#section-6.7
*/ */
/* eslint-disable max-classes-per-file */
// RFC 8555 Section 6.7 - Error Types // RFC 8555 Section 6.7 - Error Types
export enum AcmeErrorType { export enum AcmeErrorType {
AccountDoesNotExist = "accountDoesNotExist", AccountDoesNotExist = "accountDoesNotExist",
@@ -1,7 +1,7 @@
import { Knex } from "knex"; import { Knex } from "knex";
import { TDbClient } from "@app/db"; import { TDbClient } from "@app/db";
import { TableName, TPkiAcmeAuths, TPkiAcmeOrderAuths } from "@app/db/schemas"; import { TableName } from "@app/db/schemas";
import { DatabaseError } from "@app/lib/errors"; import { DatabaseError } from "@app/lib/errors";
import { ormify, selectAllTableCols, sqlNestRelationships } from "@app/lib/knex"; import { ormify, selectAllTableCols, sqlNestRelationships } from "@app/lib/knex";
@@ -1,6 +1,5 @@
import { z } from "zod"; import { z } from "zod";
import { TPkiAcmeChallenges } from "@app/db/schemas";
import { JWSHeaderParameters } from "jose"; import { JWSHeaderParameters } from "jose";
import { import {
AcmeOrderResourceSchema, AcmeOrderResourceSchema,
@@ -51,7 +50,7 @@ export type TAcmeResponse<TPayload> = {
export type TPkiAcmeServiceFactory = { export type TPkiAcmeServiceFactory = {
validateJwsPayload: < validateJwsPayload: <
TSchema extends z.ZodSchema<any> | undefined = undefined, TSchema extends z.ZodSchema<unknown> | undefined = undefined,
T = TSchema extends z.ZodSchema<infer R> ? R : string T = TSchema extends z.ZodSchema<infer R> ? R : string
>({ >({
url, url,
@@ -72,7 +71,7 @@ export type TPkiAcmeServiceFactory = {
rawJwsPayload: TRawJwsPayload; rawJwsPayload: TRawJwsPayload;
}) => Promise<TJwsPayload<TCreateAcmeAccountPayload>>; }) => Promise<TJwsPayload<TCreateAcmeAccountPayload>>;
validateExistingAccountJwsPayload: < validateExistingAccountJwsPayload: <
TSchema extends z.ZodSchema<any> | undefined = undefined, TSchema extends z.ZodSchema<unknown> | undefined = undefined,
T = TSchema extends z.ZodSchema<infer R> ? R : string T = TSchema extends z.ZodSchema<infer R> ? R : string
>({ >({
url, url,