mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 08:28:22 +00:00
misc: corrected direct issuance checks for CAs
This commit is contained in:
-3
@@ -62,9 +62,6 @@ export const InternalCertificateAuthorityFns = ({
|
|||||||
if (ca.internalCa?.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
|
if (ca.internalCa?.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
|
||||||
if (!ca.internalCa?.activeCaCertId)
|
if (!ca.internalCa?.activeCaCertId)
|
||||||
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
||||||
if (ca.disableDirectIssuance) {
|
|
||||||
throw new BadRequestError({ message: "Certificate template is required for issuance" });
|
|
||||||
}
|
|
||||||
|
|
||||||
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1235,7 +1235,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
if (!ca.internalCa.activeCaCertId)
|
if (!ca.internalCa.activeCaCertId)
|
||||||
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
||||||
if (ca.disableDirectIssuance && !certificateTemplate) {
|
if (ca.disableDirectIssuance && !certificateTemplate) {
|
||||||
throw new BadRequestError({ message: "Certificate template is required for issuance" });
|
throw new BadRequestError({ message: "Certificate template or subscriber is required for issuance" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
||||||
@@ -1593,7 +1593,7 @@ export const internalCertificateAuthorityServiceFactory = ({
|
|||||||
if (!ca.internalCa.activeCaCertId)
|
if (!ca.internalCa.activeCaCertId)
|
||||||
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
||||||
if (ca.disableDirectIssuance && !certificateTemplate) {
|
if (ca.disableDirectIssuance && !certificateTemplate) {
|
||||||
throw new BadRequestError({ message: "Certificate template is required for issuance" });
|
throw new BadRequestError({ message: "Certificate template or subscriber is required for issuance" });
|
||||||
}
|
}
|
||||||
|
|
||||||
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
||||||
|
|||||||
@@ -426,9 +426,7 @@ export const pkiSubscriberServiceFactory = ({
|
|||||||
if (ca.internalCa?.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
|
if (ca.internalCa?.status !== CaStatus.ACTIVE) throw new BadRequestError({ message: "CA is not active" });
|
||||||
if (!ca.internalCa?.activeCaCertId)
|
if (!ca.internalCa?.activeCaCertId)
|
||||||
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
throw new BadRequestError({ message: "CA does not have a certificate installed" });
|
||||||
if (ca.disableDirectIssuance) {
|
|
||||||
throw new BadRequestError({ message: "Certificate template is required for issuance" });
|
|
||||||
}
|
|
||||||
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
const caCert = await certificateAuthorityCertDAL.findById(ca.internalCa.activeCaCertId);
|
||||||
|
|
||||||
const certificateManagerKmsId = await getProjectKmsCertificateKeyId({
|
const certificateManagerKmsId = await getProjectKmsCertificateKeyId({
|
||||||
|
|||||||
Reference in New Issue
Block a user