Skip to content

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

Return eab kid as well

Fang-Pen Lin49ad8ab63066
diff --git a/backend/src/server/routes/v1/certificate-profiles-router.ts b/backend/src/server/routes/v1/certificate-profiles-router.ts
index 1a670c254d..f85f8a677d 100644
--- a/backend/src/server/routes/v1/certificate-profiles-router.ts
+++ b/backend/src/server/routes/v1/certificate-profiles-router.ts
@@ -506,20 +506,21 @@ export const registerCertificateProfilesRouter = async (server: FastifyZodProvid
}),
response: {
200: z.object({
+ eabKid: z.string(),
eabSecret: z.string()
})
}
},
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
handler: async (req) => {
- const eabSecret = await server.services.certificateProfile.revealAcmeEabSecret({
+ const { eabKid, eabSecret } = await server.services.certificateProfile.revealAcmeEabSecret({
actor: req.permission.type,
actorId: req.permission.id,
actorAuthMethod: req.permission.authMethod,
actorOrgId: req.permission.orgId,
profileId: req.params.id
});
- return { eabSecret };
+ return { eabKid, eabSecret };
}
});
};
diff --git a/backend/src/services/certificate-profile/certificate-profile-dal.ts b/backend/src/services/certificate-profile/certificate-profile-dal.ts
index beea084e3b..f8f511ab45 100644
--- a/backend/src/services/certificate-profile/certificate-profile-dal.ts
+++ b/backend/src/services/certificate-profile/certificate-profile-dal.ts
@@ -130,7 +130,8 @@ export const certificateProfileDALFactory = (db: TDbClient) => {
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("id").withSchema(TableName.PkiAcmeEnrollmentConfig).as("acmeConfigId")
+ db.ref("id").withSchema(TableName.PkiAcmeEnrollmentConfig).as("acmeConfigId"),
+ db.ref("encryptedEabSecret").withSchema(TableName.PkiAcmeEnrollmentConfig).as("acmeConfigEncryptedEabSecret")
)
.where(`${TableName.PkiCertificateProfile}.id`, id)
.first();
@@ -158,7 +159,10 @@ export const certificateProfileDALFactory = (db: TDbClient) => {
: undefined;
const acmeConfig = result.acmeConfigId
- ? ({ id: result.acmeConfigId } as TCertificateProfileWithConfigs["acmeConfig"])
+ ? ({
+ id: result.acmeConfigId,
+ encryptedEabSecret: result.acmeConfigEncryptedEabSecret
+ } as TCertificateProfileWithConfigs["acmeConfig"])
: undefined;
const certificateAuthority =
diff --git a/backend/src/services/certificate-profile/certificate-profile-service.ts b/backend/src/services/certificate-profile/certificate-profile-service.ts
index f896bb071e..2e92c4b023 100644
--- a/backend/src/services/certificate-profile/certificate-profile-service.ts
+++ b/backend/src/services/certificate-profile/certificate-profile-service.ts
@@ -832,7 +832,7 @@ export const certificateProfileServiceFactory = ({
kmsId: certificateManagerKmsId
});
const eabSecret = await kmsDecryptor({ cipherTextBlob: profile.acmeConfig.encryptedEabSecret });
- return eabSecret.toString();
+ return { eabKid: profile.id, eabSecret: eabSecret.toString() };
};
return {