Start moving CRL generation to queue

This commit is contained in:
Tuan Dang
2024-06-03 16:16:05 -07:00
parent 31de0755a2
commit 7ee440fa3f
13 changed files with 346 additions and 6 deletions
@@ -419,4 +419,36 @@ export const registerCaRouter = async (server: FastifyZodProvider) => {
};
}
});
server.route({
method: "GET",
url: "/:caId/crl/rotate",
config: {
rateLimit: writeLimit
},
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
schema: {
description: "Rotate CRL of the CA",
params: z.object({
caId: z.string().trim()
}),
response: {
200: z.object({
message: z.string()
})
}
},
handler: async (req) => {
await server.services.certificateAuthority.rotateCaCrl({
caId: req.params.caId,
actor: req.permission.type,
actorId: req.permission.id,
actorAuthMethod: req.permission.authMethod,
actorOrgId: req.permission.orgId
});
return {
message: "Successfully rotated CA CRL"
};
}
});
};