This commit is contained in:
Fang-Pen Lin
2025-11-07 09:18:32 -08:00
parent 61af9734b4
commit dd5bd35ad4
3 changed files with 21 additions and 11 deletions
+10 -3
View File
@@ -198,9 +198,16 @@ export const registerPkiAcmeRouter = async (server: FastifyZodProvider) => {
}, },
// TODO: replace with verify ACME signature here instead // TODO: replace with verify ACME signature here instead
// onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]), // onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
handler: async (req) => { handler: async (req, res) => {
const result = await server.services.pkiAcme.deactivateAcmeAccount(req.params.profileId, req.params.accountId); return sendAcmeResponse(
return result; res,
req.params.profileId,
await server.services.pkiAcme.deactivateAcmeAccount({
profileId: req.params.profileId,
accountId: req.params.accountId,
payload: req.body
})
);
} }
}); });
@@ -303,9 +303,8 @@ export const pkiAcmeServiceFactory = ({
return { return {
status: 201, status: 201,
body: { body: {
status: "pending", status: order.status,
// TODO: read config from the profile to get the expiration time instead expires: order.expiresAt.toISOString(),
expires: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
identifiers: order.authorizations.map((auth: TPkiAcmeAuths) => ({ identifiers: order.authorizations.map((auth: TPkiAcmeAuths) => ({
type: auth.identifierType, type: auth.identifierType,
value: auth.identifierValue value: auth.identifierValue
@@ -85,11 +85,15 @@ export type TPkiAcmeServiceFactory = {
accountId: string; accountId: string;
payload: TCreateAcmeOrderPayload; payload: TCreateAcmeOrderPayload;
}) => Promise<TAcmeResponse<TCreateAcmeOrderResponse>>; }) => Promise<TAcmeResponse<TCreateAcmeOrderResponse>>;
deactivateAcmeAccount: ( deactivateAcmeAccount: ({
profileId: string, profileId,
accountId: string, accountId,
body?: TDeactivateAcmeAccountPayload payload
) => Promise<TDeactivateAcmeAccountResponse>; }: {
profileId: string;
accountId: string;
payload?: TDeactivateAcmeAccountPayload;
}) => Promise<TAcmeResponse<TDeactivateAcmeAccountResponse>>;
listAcmeOrders: ({ listAcmeOrders: ({
profileId, profileId,
accountId accountId