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
More ACME db stuff
Fang-Pen Lin2832884ff75e
diff --git a/backend/src/db/schemas/pki-certificate-profiles.ts b/backend/src/db/schemas/pki-certificate-profiles.tsindex 368770c3e8..8141363bd8 100644--- a/backend/src/db/schemas/pki-certificate-profiles.ts+++ b/backend/src/db/schemas/pki-certificate-profiles.ts@@ -17,6 +17,7 @@ export const PkiCertificateProfilesSchema = z.object({enrollmentType: z.string(),estConfigId: z.string().uuid().nullable().optional(),apiConfigId: z.string().uuid().nullable().optional(),+ acmeConfigId: z.string().uuid().nullable().optional(),createdAt: z.date(),updatedAt: z.date()});diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex 0e25e9aee9..e9ab34b175 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -185,6 +185,7 @@ import { cmekServiceFactory } from "@app/services/cmek/cmek-service";import { convertorServiceFactory } from "@app/services/convertor/convertor-service";import { apiEnrollmentConfigDALFactory } from "@app/services/enrollment-config/api-enrollment-config-dal";import { estEnrollmentConfigDALFactory } from "@app/services/enrollment-config/est-enrollment-config-dal";+import { acmeEnrollmentConfigDALFactory } from "@app/services/enrollment-config/acme-enrollment-config-dal";import { externalGroupOrgRoleMappingDALFactory } from "@app/services/external-group-org-role-mapping/external-group-org-role-mapping-dal";import { externalGroupOrgRoleMappingServiceFactory } from "@app/services/external-group-org-role-mapping/external-group-org-role-mapping-service";import { externalMigrationQueueFactory } from "@app/services/external-migration/external-migration-queue";@@ -1062,6 +1063,7 @@ export const registerRoutes = async (const certificateProfileDAL = certificateProfileDALFactory(db);const apiEnrollmentConfigDAL = apiEnrollmentConfigDALFactory(db);const estEnrollmentConfigDAL = estEnrollmentConfigDALFactory(db);+ const acmeEnrollmentConfigDAL = acmeEnrollmentConfigDALFactory(db);const certificateDAL = certificateDALFactory(db);const certificateBodyDAL = certificateBodyDALFactory(db);diff --git a/backend/src/services/certificate-profile/certificate-profile-dal.ts b/backend/src/services/certificate-profile/certificate-profile-dal.tsindex b66475bbf9..7029d4b37f 100644--- a/backend/src/services/certificate-profile/certificate-profile-dal.ts+++ b/backend/src/services/certificate-profile/certificate-profile-dal.ts@@ -88,6 +88,11 @@ export const certificateProfileDALFactory = (db: TDbClient) => {`${TableName.PkiCertificateProfile}.apiConfigId`,`${TableName.PkiApiEnrollmentConfig}.id`)+ .leftJoin(+ TableName.PkiAcmeEnrollmentConfig,+ `${TableName.PkiCertificateProfile}.acmeConfigId`,+ `${TableName.PkiAcmeEnrollmentConfig}.id`+ ).select(selectAllTableCols(TableName.PkiCertificateProfile)).select(db.ref("id").withSchema(TableName.CertificateAuthority).as("caId"),@@ -107,7 +112,8 @@ export const certificateProfileDALFactory = (db: TDbClient) => {db.ref("encryptedCaChain").withSchema(TableName.PkiEstEnrollmentConfig).as("estConfigEncryptedCaChain"),db.ref("id").withSchema(TableName.PkiApiEnrollmentConfig).as("apiConfigId"),db.ref("autoRenew").withSchema(TableName.PkiApiEnrollmentConfig).as("apiConfigAutoRenew"),- db.ref("renewBeforeDays").withSchema(TableName.PkiApiEnrollmentConfig).as("apiConfigRenewBeforeDays")+ db.ref("renewBeforeDays").withSchema(TableName.PkiApiEnrollmentConfig).as("apiConfigRenewBeforeDays"),+ db.ref("id").withSchema(TableName.PkiAcmeEnrollmentConfig).as("acmeConfigId")).where(`${TableName.PkiCertificateProfile}.id`, id).first();@@ -134,6 +140,10 @@ export const certificateProfileDALFactory = (db: TDbClient) => {} as TCertificateProfileWithConfigs["apiConfig"]): undefined;+ const acmeConfig = result.acmeConfigId+ ? ({ id: result.acmeConfigId } as TCertificateProfileWithConfigs["acmeConfig"])+ : undefined;+const certificateAuthority =result.caId && result.caProjectId && result.caStatus && result.caName? ({@@ -164,10 +174,12 @@ export const certificateProfileDALFactory = (db: TDbClient) => {enrollmentType: result.enrollmentType as EnrollmentType,estConfigId: result.estConfigId,apiConfigId: result.apiConfigId,+ acmeConfigId: result.acmeConfigId,createdAt: result.createdAt,updatedAt: result.updatedAt,estConfig,apiConfig,+ acmeConfig,certificateAuthority,certificateTemplate};diff --git a/backend/src/services/certificate-profile/certificate-profile-types.ts b/backend/src/services/certificate-profile/certificate-profile-types.tsindex 5dac470c88..6e1d64fb5a 100644--- a/backend/src/services/certificate-profile/certificate-profile-types.ts+++ b/backend/src/services/certificate-profile/certificate-profile-types.ts@@ -6,7 +6,8 @@ import {export enum EnrollmentType {API = "api",- EST = "est"+ EST = "est",+ ACME = "acme"}export type TCertificateProfile = Omit<TPkiCertificateProfiles, "enrollmentType"> & {@@ -28,6 +29,7 @@ export type TCertificateProfileUpdate = Omit<TPkiCertificateProfilesUpdate, "enrautoRenew?: boolean;renewBeforeDays?: number;};+ acmeConfig?: {};};export type TCertificateProfileWithConfigs = TCertificateProfile & {@@ -54,6 +56,10 @@ export type TCertificateProfileWithConfigs = TCertificateProfile & {autoRenew: boolean;renewBeforeDays?: number;};+ acmeConfig?: {+ id: string;+ };+ metrics?: TCertificateProfileMetrics;};export interface TCertificateProfileCertificate {