Update CA certificate tracking impl to use foreign ref instead of number

This commit is contained in:
Tuan Dang
2024-08-13 11:22:45 -07:00
parent 5af53d3398
commit bb6416acb7
10 changed files with 77 additions and 58 deletions
@@ -206,8 +206,9 @@ export const getCaCertChain = async ({
}: TGetCaCertChainDTO) => {
const ca = await certificateAuthorityDAL.findById(caId);
if (!ca) throw new BadRequestError({ message: "CA not found" });
if (!ca.activeCaCertId) throw new BadRequestError({ message: "CA does not have a certificate installed" });
const caCert = await certificateAuthorityCertDAL.findOne({ caId: ca.id });
const caCert = await certificateAuthorityCertDAL.findById(ca.activeCaCertId);
const keyId = await getProjectKmsCertificateKeyId({
projectId: ca.projectId,