Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add cert foreign key

Fang-Pen Lin3c887522ec94
diff --git a/backend/src/db/migrations/20251029234547_add-pki-acme.ts b/backend/src/db/migrations/20251029234547_add-pki-acme.ts
index e765871593..f9db5c2ac5 100644
--- a/backend/src/db/migrations/20251029234547_add-pki-acme.ts
+++ b/backend/src/db/migrations/20251029234547_add-pki-acme.ts
@@ -80,6 +80,10 @@ export async function up(knex: Knex): Promise<void> {
t.uuid("accountId").notNullable();
t.foreign("accountId").references("id").inTable(TableName.PkiAcmeAccount).onDelete("CASCADE");
+ // Foreign key to certificate
+ t.uuid("certificateId").nullable();
+ t.foreign("certificateId").references("id").inTable(TableName.Certificate).onDelete("CASCADE");
+
t.timestamp("notBefore").nullable();
t.timestamp("notAfter").nullable();
diff --git a/backend/src/ee/services/pki-acme/pki-acme-service.ts b/backend/src/ee/services/pki-acme/pki-acme-service.ts
index 43c77b3d1c..86c5607d35 100644
--- a/backend/src/ee/services/pki-acme/pki-acme-service.ts
+++ b/backend/src/ee/services/pki-acme/pki-acme-service.ts
@@ -319,7 +319,7 @@ export const pkiAcmeServiceFactory = ({
const kmsDecryptor = await kmsService.decryptWithKmsKey({
kmsId: certificateManagerKmsId
});
- const eabSecret = await kmsDecryptor({ cipherTextBlob: profile.acmeConfig!.encryptedEabSecret });
+ const eabSecret = await kmsDecryptor({ cipherTextBlob: profile.acmeConfig!.encryptedEabSecret! });
try {
const { payload: eabPayload, protectedHeader: eabProtectedHeader } = await flattenedVerify(
externalAccountBinding,
@@ -393,7 +393,6 @@ export const pkiAcmeServiceFactory = ({
emails: contact ?? []
});
// TODO: create audit log here
- // TODO: check EAB authentication here
return {
status: 201,
body: {