Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Address greptile comments
Carlos Monastyrskib41d5b3c103a
diff --git a/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts b/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.tsindex f47524e7f8..90d2b813ad 100644--- a/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts+++ b/backend/src/services/certificate-authority/internal/internal-certificate-authority-service.ts@@ -204,7 +204,7 @@ export const internalCertificateAuthorityServiceFactory = ({// if undefined, set [notAfterDate] to 10 years from nowlet notAfterDate: Date | undefined;if (notAfter) {- notAfterDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10));+ notAfterDate = new Date(notAfter);}const serialNumber = createSerialNumber();@@ -1202,7 +1202,7 @@ export const internalCertificateAuthorityServiceFactory = ({actorId: string;actorAuthMethod: ActorAuthMethod;actor: ActorType;- actorOrgId: string | undefined;+ actorOrgId: string;tx?: Knex.Transaction;}) => {const intermediateCa = await certificateAuthorityDAL.findByIdWithAssociatedCa(caId, tx);@@ -1225,6 +1225,11 @@ export const internalCertificateAuthorityServiceFactory = ({subject(ProjectPermissionSub.CertificateAuthorities, { name: intermediateCa.name }));+ ForbiddenError.from(permission).throwUnlessCan(+ ProjectPermissionCertificateAuthorityActions.Create,+ subject(ProjectPermissionSub.CertificateAuthorities, { name: parentCa.name })+ );+const caSecret = await certificateAuthoritySecretDAL.findOne({caId: intermediateCa.id@@ -1290,7 +1295,7 @@ export const internalCertificateAuthorityServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId: actorOrgId!+ actorOrgId});await importCertToCa({@@ -1300,7 +1305,7 @@ export const internalCertificateAuthorityServiceFactory = ({actorId,actorAuthMethod,actor,- actorOrgId: actorOrgId!+ actorOrgId});return {diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaGenerateRootCertModal.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaGenerateRootCertModal.tsxindex 6fecf6e8fc..811b7c665b 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaGenerateRootCertModal.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/components/CaGenerateRootCertModal.tsx@@ -82,7 +82,7 @@ export const CaGenerateRootCertModal = ({ popUp, handlePopUpToggle }: Props) =>caId: popUpData.caId,notBefore: now,notAfter,- maxPathLength: maxPathLength !== "-1" ? Number(maxPathLength) : undefined+ maxPathLength: maxPathLength ? Number(maxPathLength) : undefined});handlePopUpToggle("generateRootCaCert", false);