This commit is contained in:
Fang-Pen Lin
2025-10-29 18:36:32 -07:00
parent 61af9734b4
commit dd5bd35ad4
3 changed files with 21 additions and 11 deletions

View File

@@ -198,9 +198,16 @@ export const registerPkiAcmeRouter = async (server: FastifyZodProvider) => {
},
// TODO: replace with verify ACME signature here instead
// onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
handler: async (req) => {
const result = await server.services.pkiAcme.deactivateAcmeAccount(req.params.profileId, req.params.accountId);
return result;
handler: async (req, res) => {
return sendAcmeResponse(
res,
req.params.profileId,
await server.services.pkiAcme.deactivateAcmeAccount({
profileId: req.params.profileId,
accountId: req.params.accountId,
payload: req.body
})
);
}
});

View File

@@ -303,9 +303,8 @@ export const pkiAcmeServiceFactory = ({
return {
status: 201,
body: {
status: "pending",
// TODO: read config from the profile to get the expiration time instead
expires: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
status: order.status,
expires: order.expiresAt.toISOString(),
identifiers: order.authorizations.map((auth: TPkiAcmeAuths) => ({
type: auth.identifierType,
value: auth.identifierValue

View File

@@ -85,11 +85,15 @@ export type TPkiAcmeServiceFactory = {
accountId: string;
payload: TCreateAcmeOrderPayload;
}) => Promise<TAcmeResponse<TCreateAcmeOrderResponse>>;
deactivateAcmeAccount: (
profileId: string,
accountId: string,
body?: TDeactivateAcmeAccountPayload
) => Promise<TDeactivateAcmeAccountResponse>;
deactivateAcmeAccount: ({
profileId,
accountId,
payload
}: {
profileId: string;
accountId: string;
payload?: TDeactivateAcmeAccountPayload;
}) => Promise<TAcmeResponse<TDeactivateAcmeAccountResponse>>;
listAcmeOrders: ({
profileId,
accountId