Skip to content

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

fix(kmip): allow clearing certificate TTL back to the default

bernie-g5f63866ded64
diff --git a/backend/src/ee/routes/v1/kmip-server-router.ts b/backend/src/ee/routes/v1/kmip-server-router.ts
index 1456ed7585..48d09cd796 100644
--- a/backend/src/ee/routes/v1/kmip-server-router.ts
+++ b/backend/src/ee/routes/v1/kmip-server-router.ts
@@ -228,7 +228,10 @@ export const registerKmipServerRouter = async (server: FastifyZodProvider) => {
params: z.object({ kmipServerId: z.string().uuid() }),
body: z.object({
hostnamesOrIps: hostnamesOrIpsField.optional(),
- ttl: ttlField.optional(),
+ ttl: ttlField
+ .nullable()
+ .optional()
+ .describe("Validity period of the server certificate. Pass null to clear a custom TTL and use the default."),
keyAlgorithm: z.nativeEnum(CertKeyAlgorithm).optional(),
authMethod: SettableAuthMethodInputSchema.optional()
}),
diff --git a/backend/src/ee/services/kmip-server/kmip-server-service.ts b/backend/src/ee/services/kmip-server/kmip-server-service.ts
index 88be01e83c..660bcb58f7 100644
--- a/backend/src/ee/services/kmip-server/kmip-server-service.ts
+++ b/backend/src/ee/services/kmip-server/kmip-server-service.ts
@@ -80,7 +80,7 @@ export const kmipServerServiceFactory = ({
}: {
kmipServerId: string;
hostnamesOrIps?: string;
- ttl?: string;
+ ttl?: string | null;
keyAlgorithm?: string;
actor: TActor;
}) => {
diff --git a/frontend/src/hooks/api/kmipServers/types.ts b/frontend/src/hooks/api/kmipServers/types.ts
index 32334cfb65..c58106903b 100644
--- a/frontend/src/hooks/api/kmipServers/types.ts
+++ b/frontend/src/hooks/api/kmipServers/types.ts
@@ -59,7 +59,7 @@ export type TCreateKmipServerDTO = {
export type TUpdateKmipServerDTO = {
kmipServerId: string;
hostnamesOrIps?: string;
- ttl?: string;
+ ttl?: string | null;
keyAlgorithm?: CertKeyAlgorithm;
authMethod?:
| {
diff --git a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx
index ec98f18fa2..91571f9436 100644
--- a/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx
+++ b/frontend/src/pages/organization/KmipServersPage/KmipServerDetailsByIDPage/components/KmipServerCertConfig/KmipServerCertConfigModal.tsx
@@ -81,7 +81,7 @@ export const KmipServerCertConfigModal = ({ isOpen, onOpenChange, kmipServer }:
await updateKmipServer({
kmipServerId: kmipServer.id,
hostnamesOrIps: form.hostnamesOrIps,
- ttl: form.ttl || undefined,
+ ttl: form.ttl || null,
keyAlgorithm: form.keyAlgorithm
});
createNotification({