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
Fixes
Carlos Monastyrskia76da29f3746
diff --git a/backend/CLAUDE.md b/backend/CLAUDE.mdindex b93550d327..58f07120f0 100644--- a/backend/CLAUDE.md+++ b/backend/CLAUDE.md@@ -953,18 +953,11 @@ pointing at something. Things that rely on that:- **Every background or enumeration query filters `whereNull("deletedAt")`**: expiry alerts, auto-renewal,syncs, discovery, HSM connector usage and stats. A new query over `certificates` needs the same filter unlessit is deliberately showing deleted rows. Reads the API serves skip deleted certificates by default too:- `GET /certificates/:id` returns 404 and list or search returns none unless the caller passes- `includeDeleted` (or a `deleted` status filter), so clients written before soft delete keep seeing what they- saw when the row was hard deleted. The one background job that still reads deleted rows is the DigiCert+ `GET /certificates/:id` returns 404 unless the caller passes `includeDeleted`, and list or search returns+ them only for a `deleted` status filter, so clients written before soft delete keep seeing what they saw+ when the row was hard deleted. The one background job that still reads deleted rows is the DigiCertrevocation sync: it records an upstream revocation on a deleted certificate (without alerts) so the quotastops counting it.-- **The foreign key no longer stops a write that references a deleted certificate.** A hard delete made any- later insert pointing at the row fail; the kept row accepts it. So every write that attaches something to a- certificate (sync link, collection item, signer, metadata, Application) locks the row `FOR SHARE` or- `FOR UPDATE` inside its own transaction and rechecks `deletedAt` on the locked copy; a check before the- transaction races the delete. `certificateSyncDAL.addCertificates` and `claimExternalIdentifier` do this- themselves and skip deleted ids, so every sync provider is covered. A new writer belongs in that DAL or- follows the same pattern.- **The licence quota still counts a deleted certificate Infisical issued until it expires or is revoked**,because deleting neither revokes it nor requires it to be expired, so excluding it would let an org freeits cap while the certificate stays trusted. Deleted imported and discovered certificates stop counting, as@@ -972,14 +965,9 @@ pointing at something. Things that rely on that:- **CRL and OCSP keep deleted certificates.** Deletion is not revocation, so a revoked certificate stays onthe CRL after it is deleted, and revoking a deleted certificate is still allowed.- **A deleted certificate is never renewed or changed.** `assertCertificateNotDeleted` guards the renewal- entry points, EST re-enroll and SCEP renewal refuse a deleted client certificate, and- external-CA renewals lock the original with `lockRenewalOriginalCertificate` as the first statement of- the transaction that stores the successor (before the insert, whose foreign key would otherwise take a- weaker lock first and deadlock two concurrent renewals), so a delete that commits while a CA is still- issuing aborts the link, and the error names the serial the CA issued so it can be revoked upstream.- Internal-CA and self-signed renewals run in one transaction that checks the original first, so they take no- extra lock. The issuance queue and the DigiCert and GoDaddy pollers also check the original before calling- the CA.+ entry points and the issuance queue, and EST re-enroll and SCEP renewal refuse a deleted client+ certificate. A renewal the CA already accepted before the delete still completes and links to the deleted+ original, because the CA has issued that certificate and discarding it would lose it.- **Re-import restores the row** (`restoreDeleted`) when the deleted row has the same fingerprint, Application,project, profile and CA (`canRestoreDeletedCertificate`). The import has to name the deleted row's profile, so theprofile's `IssueCert` check always runs before a profile-managed certificate comes back. Both restore pathsdiff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex 168126116c..400f429e10 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -1121,7 +1121,6 @@ export const PROJECTS = {offset: "The offset to start from. If you enter 10, it will start from the 10th certificate.",limit: "The number of certificates to return.",forPkiSync: "Retrieve only certificates available for PKI sync.",- includeDeleted: "Also return deleted certificates when no status filter is set.",search: "Search by SAN, CN, certificate ID, or serial number.",status:"Comma-separated list of certificate statuses to filter by. Supported values are active, renewed, expired, revoked and deleted. A certificate superseded by a renewal matches renewed rather than active until it expires or is revoked. Deleted certificates match only deleted.",diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex a555b458e1..73f3dc7378 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -4169,7 +4169,6 @@ export const registerRoutes = async (});const digicertCaQueue = digicertCertificateAuthorityQueueServiceFactory({- certificateDAL,cronJob,certificateRequestDAL,certificateRequestService,@@ -4196,7 +4195,6 @@ export const registerRoutes = async (});const godaddyCaQueue = godaddyCertificateAuthorityQueueServiceFactory({- certificateDAL,cronJob,certificateRequestDAL,certificateRequestService,diff --git a/backend/src/server/routes/v1/project-router.ts b/backend/src/server/routes/v1/project-router.tsindex 0283b94291..b1cd61e148 100644--- a/backend/src/server/routes/v1/project-router.ts+++ b/backend/src/server/routes/v1/project-router.ts@@ -1494,7 +1494,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {.array(z.string().uuid()).optional().describe("Filter to certificates issued through any of the supplied Applications."),- includeDeleted: z.boolean().optional().describe(PROJECTS.SEARCH_CERTIFICATES.includeDeleted),sortBy: z.enum(["notAfter", "notBefore", "createdAt", "commonName", "keyAlgorithm", "status"]).optional()diff --git a/backend/src/services/certificate-authority/acme/acme-certificate-authority-fns.ts b/backend/src/services/certificate-authority/acme/acme-certificate-authority-fns.tsindex 3e58aa1322..2449121370 100644--- a/backend/src/services/certificate-authority/acme/acme-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/acme/acme-certificate-authority-fns.ts@@ -34,8 +34,7 @@ import { TCertificateBodyDALFactory } from "@app/services/certificate/certificatimport { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";import {extractExternallyIssuedCertificateFields,- linkRenewedCertificate,- lockRenewalOriginalCertificate+ linkRenewedCertificate} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import {@@ -156,10 +155,7 @@ type TAcmeCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update" | "findOne">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -180,10 +176,7 @@ type TOrderCertificateDeps = {appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findByIdWithAssociatedCa">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -705,16 +698,6 @@ export const executeAcmeOrder = async (const parsedFields = extractExternallyIssuedCertificateFields(certObj);return (tx || certificateDAL).transaction(async (innerTx: Knex) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(- certificateDAL,- originalCertificateId,- innerTx,- parsedFields.serialNumber- )- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -735,8 +718,8 @@ export const executeAcmeOrder = async (innerTx);- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, innerTx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, innerTx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/adcs/adcs-certificate-authority-fns.ts b/backend/src/services/certificate-authority/adcs/adcs-certificate-authority-fns.tsindex e182dc6db8..ffc8a06eb0 100644--- a/backend/src/services/certificate-authority/adcs/adcs-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/adcs/adcs-certificate-authority-fns.ts@@ -23,8 +23,7 @@ import { TCertificateBodyDALFactory } from "@app/services/certificate/certificatimport { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";import {extractExternallyIssuedCertificateFields,- linkRenewedCertificate,- lockRenewalOriginalCertificate+ linkRenewedCertificate} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import {@@ -133,10 +132,7 @@ type TADCSCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "findOne" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "findOne" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -567,11 +563,6 @@ export const ADCSCertificateAuthorityFns = ({const parsedFields = extractExternallyIssuedCertificateFields(certObj, customExtensions);await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -593,8 +584,8 @@ export const ADCSCertificateAuthorityFns = ({certificateId = cert.id;- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/aws-acm-public-ca/aws-acm-public-ca-certificate-authority-fns.ts b/backend/src/services/certificate-authority/aws-acm-public-ca/aws-acm-public-ca-certificate-authority-fns.tsindex 4cb4adf637..bf172feec5 100644--- a/backend/src/services/certificate-authority/aws-acm-public-ca/aws-acm-public-ca-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/aws-acm-public-ca/aws-acm-public-ca-certificate-authority-fns.ts@@ -28,8 +28,7 @@ import { TCertificateBodyDALFactory } from "@app/services/certificate/certificatimport { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";import {extractExternallyIssuedCertificateFields,- linkRenewedCertificate,- lockRenewalOriginalCertificate+ linkRenewedCertificate} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import {@@ -84,10 +83,7 @@ type TAwsAcmPublicCaCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "findOne" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "findOne" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -688,11 +684,6 @@ export const AwsAcmPublicCaCertificateAuthorityFns = ({let newCertId: string;await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -712,8 +703,8 @@ export const AwsAcmPublicCaCertificateAuthorityFns = ({newCertId = cert.id;- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/aws-pca/aws-pca-certificate-authority-fns.ts b/backend/src/services/certificate-authority/aws-pca/aws-pca-certificate-authority-fns.tsindex e79ee7bbfe..c6e4e28c97 100644--- a/backend/src/services/certificate-authority/aws-pca/aws-pca-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/aws-pca/aws-pca-certificate-authority-fns.ts@@ -31,8 +31,7 @@ import { TCertificateBodyDALFactory } from "@app/services/certificate/certificatimport { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";import {extractExternallyIssuedCertificateFields,- linkRenewedCertificate,- lockRenewalOriginalCertificate+ linkRenewedCertificate} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import {@@ -185,10 +184,7 @@ type TAwsPcaCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -833,11 +829,6 @@ export const AwsPcaCertificateAuthorityFns = ({const parsedFields = extractExternallyIssuedCertificateFields(certObj, customExtensions);await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -859,8 +850,8 @@ export const AwsPcaCertificateAuthorityFns = ({certificateId = cert.id;- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/azure-ad-cs/azure-ad-cs-certificate-authority-fns.ts b/backend/src/services/certificate-authority/azure-ad-cs/azure-ad-cs-certificate-authority-fns.tsindex 3aa60b2ccd..c1c729dd5e 100644--- a/backend/src/services/certificate-authority/azure-ad-cs/azure-ad-cs-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/azure-ad-cs/azure-ad-cs-certificate-authority-fns.ts@@ -20,7 +20,6 @@ import { TCertificateDALFactory } from "@app/services/certificate/certificate-daimport {extractExternallyIssuedCertificateFields,linkRenewedCertificate,- lockRenewalOriginalCertificate,splitPemChain} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";@@ -114,10 +113,7 @@ type TAzureAdCsCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -1425,11 +1421,6 @@ export const AzureAdCsCertificateAuthorityFns = ({const parsedFields = extractExternallyIssuedCertificateFields(certObj);await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -1451,8 +1442,8 @@ export const AzureAdCsCertificateAuthorityFns = ({certificateId = cert.id;- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/certificate-authority-service.ts b/backend/src/services/certificate-authority/certificate-authority-service.tsindex 03da770625..f53f45bfdb 100644--- a/backend/src/services/certificate-authority/certificate-authority-service.ts+++ b/backend/src/services/certificate-authority/certificate-authority-service.ts@@ -149,10 +149,7 @@ type TCertificateAuthorityServiceFactoryDep = {projectDAL: Pick<TProjectDALFactory, "findProjectBySlug" | "findOne" | "updateById" | "findById" | "transaction">;telemetryService: Pick<TTelemetryServiceFactory, "sendPostHogEvents">;permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "findOne" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "findOne" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -1510,7 +1507,6 @@ export const certificateAuthorityServiceFactory = ({ca.externalCa.type === CaType.GODADDY? await processGoDaddyPendingValidationRequest({- certificateDAL,certificateAuthorityDAL,appConnectionDAL,kmsService,@@ -1527,7 +1523,6 @@ export const certificateAuthorityServiceFactory = ({): await processDigiCertPendingValidationRequest({- certificateDAL,certificateAuthorityDAL,appConnectionDAL,kmsService,diff --git a/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-fns.ts b/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-fns.tsindex f2f8ba0fc4..1282580d82 100644--- a/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-fns.ts@@ -16,8 +16,7 @@ import { TCertificateBodyDALFactory } from "@app/services/certificate/certificatimport { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";import {extractExternallyIssuedCertificateFields,- linkRenewedCertificate,- lockRenewalOriginalCertificate+ linkRenewedCertificate} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import { CertKeyAlgorithm, CertStatus, CrlReason, TAltNameType } from "@app/services/certificate/certificate-types";@@ -63,10 +62,7 @@ type TDigiCertCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById" | "findOne"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById" | "findOne">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -527,11 +523,6 @@ export const DigiCertCertificateAuthorityFns = ({});const createdCertificateId = await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -555,8 +546,8 @@ export const DigiCertCertificateAuthorityFns = ({tx);- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-processor.ts b/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-processor.tsindex bc356903ba..350684998f 100644--- a/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-processor.ts+++ b/backend/src/services/certificate-authority/digicert/digicert-certificate-authority-processor.ts@@ -14,11 +14,9 @@ import { TKmsServiceFactory } from "@app/services/kms/kms-service";import { TProjectDALFactory } from "@app/services/project/project-dal";import { TTelemetryServiceFactory } from "@app/services/telemetry/telemetry-service";-import { TCertificateDALFactory } from "../../certificate/certificate-dal";import { CertificateIssuanceOperation, CertificateRequestStatus } from "../../certificate-common/certificate-constants";import { reportCertificateIssued } from "../../certificate-common/certificate-telemetry-fns";import { TCertificateRequestDALFactory } from "../../certificate-request/certificate-request-dal";-import { failRenewalIfOriginalDeleted } from "../../certificate-request/certificate-request-fns";import {TAttachCertificateToRequestDTO,TUpdateCertificateRequestStatusDTO@@ -62,7 +60,6 @@ export type TDigiCertOrderMetadata = {};export type TProcessDigiCertRequestDeps = {- certificateDAL: Pick<TCertificateDALFactory, "findById">;certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findByIdWithAssociatedCa">;appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;@@ -153,18 +150,6 @@ export const processDigiCertPendingValidationRequest = async (return { status: CertificateRequestStatus.FAILED, orderStatus: "timeout", reason: "timeout" };}- const abandonedRenewal =- parsed.digicert.isRenewal && parsed.digicert.originalCertificateId- ? await failRenewalIfOriginalDeleted({- certificateDAL: deps.certificateDAL,- certificateRequestService: deps.certificateRequestService,- certificateRequestId: request.id,- originalCertificateId: parsed.digicert.originalCertificateId,- upstreamOrderReference: `DigiCert order ${parsed.digicert.orderId}`- })- : null;- if (abandonedRenewal) return abandonedRenewal;-const client = await getOrCreateClient(request, deps, clientCache);const orderInfo = await client.getOrder(parsed.digicert.orderId);diff --git a/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-fns.ts b/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-fns.tsindex e605218fa0..6c5a0aefcc 100644--- a/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-fns.ts@@ -19,8 +19,7 @@ import { TCertificateBodyDALFactory } from "@app/services/certificate/certificatimport { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";import {extractExternallyIssuedCertificateFields,- linkRenewedCertificate,- lockRenewalOriginalCertificate+ linkRenewedCertificate} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import { CertKeyAlgorithm, CertStatus, CrlReason } from "@app/services/certificate/certificate-types";@@ -54,10 +53,7 @@ type TGoDaddyCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById" | "findOne"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById" | "findOne">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<@@ -558,11 +554,6 @@ export const GoDaddyCertificateAuthorityFns = ({});const createdCertificateId = await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -586,8 +577,8 @@ export const GoDaddyCertificateAuthorityFns = ({tx);- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-processor.ts b/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-processor.tsindex 9c746af99a..fde6510be1 100644--- a/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-processor.ts+++ b/backend/src/services/certificate-authority/godaddy/godaddy-certificate-authority-processor.ts@@ -15,11 +15,9 @@ import { TKmsServiceFactory } from "@app/services/kms/kms-service";import { TProjectDALFactory } from "@app/services/project/project-dal";import { TTelemetryServiceFactory } from "@app/services/telemetry/telemetry-service";-import { TCertificateDALFactory } from "../../certificate/certificate-dal";import { CertificateIssuanceOperation, CertificateRequestStatus } from "../../certificate-common/certificate-constants";import { reportCertificateIssued } from "../../certificate-common/certificate-telemetry-fns";import { TCertificateRequestDALFactory } from "../../certificate-request/certificate-request-dal";-import { failRenewalIfOriginalDeleted } from "../../certificate-request/certificate-request-fns";import {TAttachCertificateToRequestDTO,TUpdateCertificateRequestStatusDTO@@ -62,7 +60,6 @@ export type TGoDaddyCertificateRequestServiceDep = {};export type TProcessGoDaddyRequestDeps = {- certificateDAL: Pick<TCertificateDALFactory, "findById">;certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findByIdWithAssociatedCa">;appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;@@ -156,18 +153,6 @@ export const processGoDaddyPendingValidationRequest = async (return { status: CertificateRequestStatus.FAILED, orderStatus: "timeout", reason: "timeout" };}- const abandonedRenewal =- parsed.godaddy.isRenewal && parsed.godaddy.originalCertificateId- ? await failRenewalIfOriginalDeleted({- certificateDAL: deps.certificateDAL,- certificateRequestService: deps.certificateRequestService,- certificateRequestId: request.id,- originalCertificateId: parsed.godaddy.originalCertificateId,- upstreamOrderReference: `GoDaddy certificate ${parsed.godaddy.certificateId}`- })- : null;- if (abandonedRenewal) return abandonedRenewal;-const client = await getOrCreateClient(request, deps, clientCache);const certificateInfo = await client.getCertificate(parsed.godaddy.certificateId);diff --git a/backend/src/services/certificate-authority/venafi-tpp/venafi-tpp-certificate-authority-fns.ts b/backend/src/services/certificate-authority/venafi-tpp/venafi-tpp-certificate-authority-fns.tsindex 9cb4cbf75e..e56558b857 100644--- a/backend/src/services/certificate-authority/venafi-tpp/venafi-tpp-certificate-authority-fns.ts+++ b/backend/src/services/certificate-authority/venafi-tpp/venafi-tpp-certificate-authority-fns.ts@@ -26,7 +26,6 @@ import { TCertificateDALFactory } from "@app/services/certificate/certificate-daimport {extractExternallyIssuedCertificateFields,linkRenewedCertificate,- lockRenewalOriginalCertificate,splitPemChain} from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";@@ -349,10 +348,7 @@ type TVenafiTppCertificateAuthorityFnsDeps = {"create" | "transaction" | "findByIdWithAssociatedCa" | "updateById" | "findWithAssociatedCa" | "findById">;externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "create" | "update">;- certificateDAL: Pick<- TCertificateDALFactory,- "create" | "findById" | "findByIdForUpdate" | "transaction" | "updateById"- >;+ certificateDAL: Pick<TCertificateDALFactory, "create" | "findById" | "transaction" | "updateById">;certificateBodyDAL: Pick<TCertificateBodyDALFactory, "create">;certificateSecretDAL: Pick<TCertificateSecretDALFactory, "create">;kmsService: Pick<TKmsServiceFactory, "encryptWithKmsKey" | "generateKmsKey" | "createCipherPairWithDataKey">;@@ -852,11 +848,6 @@ export const VenafiTppCertificateAuthorityFns = ({const parsedFields = extractExternallyIssuedCertificateFields(certObj);await certificateDAL.transaction(async (tx) => {- const lockedOriginalCertificate =- isRenewal && originalCertificateId- ? await lockRenewalOriginalCertificate(certificateDAL, originalCertificateId, tx, parsedFields.serialNumber)- : undefined;-const cert = await certificateDAL.create({...parsedFields,@@ -878,8 +869,8 @@ export const VenafiTppCertificateAuthorityFns = ({certificateId = cert.id;- if (lockedOriginalCertificate) {- await linkRenewedCertificate(certificateDAL, lockedOriginalCertificate, cert.id, tx);+ if (isRenewal && originalCertificateId) {+ await linkRenewedCertificate(certificateDAL, originalCertificateId, cert.id, tx);}await certificateBodyDAL.create(diff --git a/backend/src/services/certificate-request/certificate-request-fns.ts b/backend/src/services/certificate-request/certificate-request-fns.tsindex 390200f738..eea3c1d5ff 100644--- a/backend/src/services/certificate-request/certificate-request-fns.ts+++ b/backend/src/services/certificate-request/certificate-request-fns.ts@@ -5,8 +5,6 @@ import { InternalServerError } from "@app/lib/errors";import { logger } from "@app/lib/logger";import { ActorType } from "../auth/auth-type";-import { TCertificateDALFactory } from "../certificate/certificate-dal";-import { getCertificateDeletedMessage } from "../certificate/certificate-fns";import { TCertificateAuthorityDALFactory } from "../certificate-authority/certificate-authority-dal";import { CaType } from "../certificate-authority/certificate-authority-enums";import { caUsesExternalIssuanceQueue } from "../certificate-authority/certificate-authority-maps";@@ -19,7 +17,7 @@ import {import { TCertificateProfileDALFactory } from "../certificate-profile/certificate-profile-dal";import { EnrollmentType } from "../certificate-profile/certificate-profile-types";import { TCertificateRequestDALFactory } from "./certificate-request-dal";-import { CertificateRequestStatus, TUpdateCertificateRequestStatusDTO } from "./certificate-request-types";+import { CertificateRequestStatus } from "./certificate-request-types";type TCertificateRequestBookkeepingDAL = Pick<TCertificateRequestDALFactory,@@ -75,41 +73,6 @@ export const markPendingRequestFailed = async (}};-export const failRenewalIfOriginalDeleted = async ({- certificateDAL,- certificateRequestService,- certificateRequestId,- originalCertificateId,- upstreamOrderReference-}: {- certificateDAL: Pick<TCertificateDALFactory, "findById">;- certificateRequestService: {- updateCertificateRequestStatus: (args: TUpdateCertificateRequestStatusDTO) => Promise<unknown>;- };- certificateRequestId: string;- originalCertificateId: string;- upstreamOrderReference: string;-}) => {- const originalCertificate = await certificateDAL.findById(originalCertificateId);- if (!originalCertificate?.deletedAt) return null;-- await certificateRequestService.updateCertificateRequestStatus({- certificateRequestId,- status: CertificateRequestStatus.FAILED,- operation: CertificateIssuanceOperation.RENEW,- originalCertificateId,- errorMessage: `${getCertificateDeletedMessage({ ...originalCertificate, deletedAt: originalCertificate.deletedAt })} Cancel ${upstreamOrderReference} with the certificate authority if you no longer need it.`- });- logger.info(- `Renewal abandoned because the original certificate was deleted [certificateRequestId=${certificateRequestId}] [originalCertificateId=${originalCertificateId}]`- );- return {- status: CertificateRequestStatus.FAILED as const,- orderStatus: "original-deleted",- reason: "original certificate deleted"- };-};-export type TRecordCertificateRequestFailureDeps = Omit<TRecordCertificateIssuanceFailureDeps,"certificateAuthorityDAL"diff --git a/backend/src/services/certificate-v3/certificate-renewal-service.ts b/backend/src/services/certificate-v3/certificate-renewal-service.tsindex 313887e648..e540ce67a5 100644--- a/backend/src/services/certificate-v3/certificate-renewal-service.ts+++ b/backend/src/services/certificate-v3/certificate-renewal-service.ts@@ -20,7 +20,7 @@ import {} from "@app/services/certificate/certificate-alert-events";import { TCertificateBodyDALFactory } from "@app/services/certificate/certificate-body-dal";import { TCertificateDALFactory, TOriginatingCertificateRequest } from "@app/services/certificate/certificate-dal";-import { assertCertificateNotDeleted, lockRenewalOriginalCertificate } from "@app/services/certificate/certificate-fns";+import { assertCertificateNotDeleted } from "@app/services/certificate/certificate-fns";import { TCertificateSecretDALFactory } from "@app/services/certificate/certificate-secret-dal";import { CertKeyAlgorithm, CertSignatureAlgorithm, CertStatus } from "@app/services/certificate/certificate-types";import {@@ -267,8 +267,6 @@ export const certificateRenewalServiceFactory = ({},tx: Knex) => {- await lockRenewalOriginalCertificate(certificateDAL, originalCert.id, tx);-const renewalUpdate: {profileId?: string | null;renewedFromCertificateId?: string;diff --git a/backend/src/services/certificate/certificate-dal.ts b/backend/src/services/certificate/certificate-dal.tsindex 6169b5c4a3..d23c64de6b 100644--- a/backend/src/services/certificate/certificate-dal.ts+++ b/backend/src/services/certificate/certificate-dal.ts@@ -187,7 +187,6 @@ export const certificateDALFactory = (db: TDbClient) => {notBeforeTo?: Date;applicationId?: string;applicationIds?: string[];- includeDeleted?: boolean;};type TSyncEligibilityFilterParams = Omit<TInventoryFilterParams, "status">;@@ -240,7 +239,7 @@ export const certificateDALFactory = (db: TDbClient) => {});}- if (!filters.status && !filters.includeDeleted) {+ if (!filters.status) {q = q.whereNull(`${TableName.Certificate}.deletedAt`);}@@ -933,7 +932,6 @@ export const certificateDALFactory = (db: TDbClient) => {notBeforeFrom,notBeforeTo,applicationIds,- includeDeleted,...regularFilters} = filter;@@ -965,8 +963,7 @@ export const certificateDALFactory = (db: TDbClient) => {notAfterTo,notBeforeFrom,notBeforeTo,- applicationIds,- includeDeleted+ applicationIds},true) as typeof query;diff --git a/backend/src/services/certificate/certificate-fns.test.ts b/backend/src/services/certificate/certificate-fns.test.tsindex 2c3d22cfce..f80cad717c 100644--- a/backend/src/services/certificate/certificate-fns.test.ts+++ b/backend/src/services/certificate/certificate-fns.test.ts@@ -16,8 +16,6 @@ import {extractCertificateFields,extractExternallyIssuedCertificateFields,getCertificateDisplayName,- linkRenewedCertificate,- lockRenewalOriginalCertificate,normalizePemText,normalizeThumbprint,parseCertificateBody,@@ -373,38 +371,6 @@ describe("deleted certificate guards", () => {});});-describe("renewal link", () => {- const tx = {} as Parameters<typeof linkRenewedCertificate>[3];-- it("points the locked original at its successor and carries the order over", async () => {- const dal = { updateById: vi.fn().mockResolvedValue({}) };-- await linkRenewedCertificate(dal, { id: "cert-old", orderId: "order-1" }, "cert-new", tx);-- expect(dal.updateById).toHaveBeenCalledWith("cert-new", { orderId: "order-1" }, tx);- expect(dal.updateById).toHaveBeenCalledWith("cert-old", { renewedByCertificateId: "cert-new" }, tx);- });-- it("refuses to lock a certificate deleted while the renewal was in flight", async () => {- const dal = {- findByIdForUpdate: vi.fn().mockResolvedValue({- id: "cert-old",- commonName: "web.example.com",- serialNumber: "01",- deletedAt: new Date("2026-10-20T14:38:27.000Z")- })- };-- await expect(lockRenewalOriginalCertificate(dal, "cert-old", tx)).rejects.toThrow(- "Certificate 'web.example.com' was deleted on 2026-10-20T14:38:27.000Z and can no longer be renewed or changed."- );- expect(dal.findByIdForUpdate).toHaveBeenCalledWith("cert-old", tx);- await expect(lockRenewalOriginalCertificate(dal, "cert-old", tx, "7f02")).rejects.toThrow(- "The certificate authority already issued the renewed certificate with serial number '7f02'."- );- });-});-describe("normalizePemText", () => {const { privateKey } = generateKeyPairSync("rsa", { modulusLength: 2048 });const pkcs8Pem = privateKey.export({ type: "pkcs8", format: "pem" }).toString().trim();diff --git a/backend/src/services/certificate/certificate-fns.ts b/backend/src/services/certificate/certificate-fns.tsindex e92f49293d..308bc2087f 100644--- a/backend/src/services/certificate/certificate-fns.ts+++ b/backend/src/services/certificate/certificate-fns.ts@@ -586,38 +586,19 @@ export const assertCertificateNotDeleted = (certificate: TDeletableCertificate,});};-export const lockRenewalOriginalCertificate = async (- certificateDAL: Pick<TCertificateDALFactory, "findByIdForUpdate">,- originalCertificateId: string,- tx: Knex,- issuedSerialNumber?: string-) => {- const originalCertificate = await certificateDAL.findByIdForUpdate(originalCertificateId, tx);- if (originalCertificate?.deletedAt) {- const deletedMessage = getCertificateDeletedMessage({- ...originalCertificate,- deletedAt: originalCertificate.deletedAt- });- throw new BadRequestError({- message: issuedSerialNumber- ? `${deletedMessage} The certificate authority already issued the renewed certificate with serial number '${issuedSerialNumber}'. Revoke it at the certificate authority if you don't need it.`- : deletedMessage- });- }- return originalCertificate;-};-export const linkRenewedCertificate = async (- certificateDAL: Pick<TCertificateDALFactory, "updateById">,- lockedOriginalCertificate: Pick<TCertificates, "id" | "orderId">,+ certificateDAL: Pick<TCertificateDALFactory, "findById" | "updateById">,+ originalCertificateId: string,renewedCertificateId: string,- tx: Knex+ tx?: Knex) => {- if (lockedOriginalCertificate.orderId) {- await certificateDAL.updateById(renewedCertificateId, { orderId: lockedOriginalCertificate.orderId }, tx);+ const originalCertificate = await certificateDAL.findById(originalCertificateId, tx);++ if (originalCertificate?.orderId) {+ await certificateDAL.updateById(renewedCertificateId, { orderId: originalCertificate.orderId }, tx);}- await certificateDAL.updateById(lockedOriginalCertificate.id, { renewedByCertificateId: renewedCertificateId }, tx);+ await certificateDAL.updateById(originalCertificateId, { renewedByCertificateId: renewedCertificateId }, tx);};type TRestorableImportData = {diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.tsindex c024c6adda..bccf3e83b6 100644--- a/backend/src/services/project/project-service.ts+++ b/backend/src/services/project/project-service.ts@@ -1406,7 +1406,6 @@ export const projectServiceFactory = ({notBeforeTo,applicationId,applicationIds,- includeDeleted,sortBy,sortOrder,actorId,@@ -1478,8 +1477,7 @@ export const projectServiceFactory = ({...(notBeforeFrom && { notBeforeFrom }),...(notBeforeTo && { notBeforeTo }),...(applicationId && { applicationId }),- ...(applicationIds && applicationIds.length > 0 && { applicationIds }),- ...(includeDeleted && { includeDeleted })+ ...(applicationIds && applicationIds.length > 0 && { applicationIds })};const permissionFilters =allowedByResource || !projectPermissiondiff --git a/backend/src/services/project/project-types.ts b/backend/src/services/project/project-types.tsindex e2a9d3be2b..7aed061308 100644--- a/backend/src/services/project/project-types.ts+++ b/backend/src/services/project/project-types.ts@@ -163,7 +163,6 @@ export type TListProjectCertsDTO = {notBeforeTo?: Date;applicationId?: string;applicationIds?: string[];- includeDeleted?: boolean;sortBy?: string;sortOrder?: "asc" | "desc";} & Omit<TProjectPermission, "projectId">;diff --git a/docs/documentation/platform/pki/monitoring/certificate-inventory.mdx b/docs/documentation/platform/pki/monitoring/certificate-inventory.mdxindex c04b02d5c2..698fea77fa 100644--- a/docs/documentation/platform/pki/monitoring/certificate-inventory.mdx+++ b/docs/documentation/platform/pki/monitoring/certificate-inventory.mdx@@ -69,7 +69,7 @@ Infisical reopens the last view you used in this browser.| View | Shows || --- | --- |-| **All Certificates** | Every certificate, including deleted certificates |+| **All Certificates** | Every certificate except deleted ones || **Expiring in 7 days** | Active certificates that expire in the next 7 days || **Expiring in 30 days** | Active certificates that expire in the next 30 days || **Renewed** | Certificates that a [renewal](/documentation/platform/pki/applications/certificate-renewal) replaced with a new certificate |diff --git a/frontend/src/hooks/api/certificates/mutations.tsx b/frontend/src/hooks/api/certificates/mutations.tsxindex a9dc888c4e..4e9d7ced51 100644--- a/frontend/src/hooks/api/certificates/mutations.tsx+++ b/frontend/src/hooks/api/certificates/mutations.tsx@@ -4,6 +4,7 @@ import { apiRequest } from "@app/config/request";import { certificateProfileKeys } from "../certificateProfiles/queries";import { pkiSubscriberKeys } from "../pkiSubscriber/queries";+import { pkiSyncKeys } from "../pkiSyncs/queries";import { projectKeys } from "../projects";import { certKeys } from "./queries";import {@@ -52,6 +53,7 @@ export const useDeleteCert = () => {queryClient.invalidateQueries({queryKey: ["cert-dashboard-stats"]});+ queryClient.invalidateQueries({ queryKey: pkiSyncKeys.all });}});};diff --git a/frontend/src/hooks/api/projects/queries.tsx b/frontend/src/hooks/api/projects/queries.tsxindex a34b628696..7e9447673c 100644--- a/frontend/src/hooks/api/projects/queries.tsx+++ b/frontend/src/hooks/api/projects/queries.tsx@@ -634,7 +634,6 @@ export const useListWorkspaceCertificates = ({notBeforeTo,applicationId,applicationIds,- includeDeleted,sortBy,sortOrder}: {@@ -663,7 +662,6 @@ export const useListWorkspaceCertificates = ({notBeforeTo?: Date;applicationId?: string;applicationIds?: string[];- includeDeleted?: boolean;sortBy?: string;sortOrder?: "asc" | "desc";}) => {@@ -694,7 +692,6 @@ export const useListWorkspaceCertificates = ({notBeforeTo,applicationId,applicationIds,- includeDeleted,sortBy,sortOrder}),@@ -728,7 +725,6 @@ export const useListWorkspaceCertificates = ({...(notBeforeTo && { notBeforeTo: notBeforeTo.toISOString() }),...(applicationId && { applicationId }),...(applicationIds && applicationIds.length > 0 && { applicationIds }),- ...(includeDeleted && { includeDeleted }),...(sortBy && { sortBy }),...(sortOrder && { sortOrder })}diff --git a/frontend/src/hooks/api/projects/query-keys.tsx b/frontend/src/hooks/api/projects/query-keys.tsxindex d4fc1acf58..d72f0058b3 100644--- a/frontend/src/hooks/api/projects/query-keys.tsx+++ b/frontend/src/hooks/api/projects/query-keys.tsx@@ -92,7 +92,6 @@ export const projectKeys = {notBeforeTo,applicationId,applicationIds,- includeDeleted,sortBy,sortOrder}: {@@ -121,7 +120,6 @@ export const projectKeys = {notBeforeTo?: Date;applicationId?: string;applicationIds?: string[];- includeDeleted?: boolean;sortBy?: string;sortOrder?: "asc" | "desc";}) =>@@ -152,7 +150,6 @@ export const projectKeys = {notBeforeTo,applicationId,applicationIds,- includeDeleted,sortBy,sortOrder}diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsxindex accd10a75b..669e18bcb5 100644--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx@@ -61,6 +61,7 @@ import { CertificateRenewalModal } from "../CertificatesPage/components/Certificimport { CertificateRevocationModal } from "../CertificatesPage/components/CertificateRevocationModal";import {canRevokeAfterDeletion,+ DELETED_CERTIFICATE_NO_ACTIONS,getCertificateDeletionWarning,isExpiringWithinOneDay,isManagedCertificate,@@ -341,7 +342,7 @@ const Page = () => {</Button></span></TooltipTrigger>- <TooltipContent>No actions are available for a deleted certificate.</TooltipContent>+ <TooltipContent>{DELETED_CERTIFICATE_NO_ACTIONS}</TooltipContent></Tooltip>) : (<DropdownMenu>diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsxindex 4075d582a7..799f005285 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx@@ -96,12 +96,12 @@ import { ActiveFilterChips } from "./ActiveFilterChips";import { AssignCertificateToApplicationModal } from "./AssignCertificateToApplicationModal";import {canRevokeAfterDeletion,+ DELETED_CERTIFICATE_NO_ACTIONS,getCertificateDisplayStatus,getCertSourceLabel,getCertValidUntilBadgeDetails,isExpiringWithinOneDay,isManagedCertificate,- liveCertificateStatusFilter,RENEWAL_UNAVAILABLE_NO_PROFILE} from "./CertificatesTable.utils";import { ColumnVisibilityToggle, getDefaultVisibleColumns } from "./ColumnVisibilityToggle";@@ -181,27 +181,6 @@ const SortIcon = ({return <Icon className="ml-1 inline-block size-3" />;};-const getFiltersForSystemViewId = (viewId: string | undefined): FilterRule[] => {- if (viewId === "system-pqc") {- return [- { id: "sv-pqc", field: "keyAlgorithm", operator: "in", value: [...PQC_KEY_ALGORITHMS] },- liveCertificateStatusFilter("sv-pqc-status")- ];- }- if (viewId === "system-non-pqc") {- return [- {- id: "sv-non-pqc",- field: "keyAlgorithm",- operator: "in",- value: [...NON_PQC_KEY_ALGORITHMS]- },- liveCertificateStatusFilter("sv-non-pqc-status")- ];- }- return [];-};-export const CertificatesTable = ({handlePopUpOpen,externalFilter,@@ -244,6 +223,25 @@ export const CertificatesTable = ({));+ const getFiltersForSystemViewId = (viewId: string | undefined): FilterRule[] => {+ if (viewId === "system-pqc") {+ return [+ { id: "sv-pqc", field: "keyAlgorithm", operator: "in", value: [...PQC_KEY_ALGORITHMS] }+ ];+ }+ if (viewId === "system-non-pqc") {+ return [+ {+ id: "sv-non-pqc",+ field: "keyAlgorithm",+ operator: "in",+ value: [...NON_PQC_KEY_ALGORITHMS]+ }+ ];+ }+ return [];+ };+const [appliedFilters, setAppliedFilters] = useState<FilterRule[]>(() => {if (dashboardFilters?.length) return dashboardFilters;return getFiltersForSystemViewId(dashboardViewId);@@ -410,7 +408,6 @@ export const CertificatesTable = ({metadataFilter: filterSearchParams.metadata,applicationId,applicationIds: filterSearchParams.applicationIds,- includeDeleted: true,sortBy,sortOrder});@@ -543,8 +540,24 @@ export const CertificatesTable = ({setAppliedFilters([{ id: "sv-status", field: "status", operator: "in", value: [CertStatus.DELETED] }]);- } else if (viewId === "system-pqc" || viewId === "system-non-pqc") {- setAppliedFilters(getFiltersForSystemViewId(viewId));+ } else if (viewId === "system-pqc") {+ setAppliedFilters([+ {+ id: "sv-pqc",+ field: "keyAlgorithm",+ operator: "in",+ value: [...PQC_KEY_ALGORITHMS]+ }+ ]);+ } else if (viewId === "system-non-pqc") {+ setAppliedFilters([+ {+ id: "sv-non-pqc",+ field: "keyAlgorithm",+ operator: "in",+ value: [...NON_PQC_KEY_ALGORITHMS]+ }+ ]);} else {const customFilters = filters as TInventoryViewFilters;const rules: FilterRule[] = [];@@ -988,15 +1001,13 @@ export const CertificatesTable = ({)}{visibleColumns.has("status") && (<TableCell>- <div className="flex items-center gap-1">- <Badge variant={displayStatus.variant}>{displayStatus.label}</Badge>- {isDeleted && isRevoked && <Badge variant="danger">Revoked</Badge>}- </div>+ <Badge variant={displayStatus.variant}>{displayStatus.label}</Badge></TableCell>)}{visibleColumns.has("health") && (<TableCell>- {isDeleted && <EmptyCell />}+ {isDeleted && isRevoked && <Badge variant="danger">Revoked</Badge>}+ {isDeleted && !isRevoked && <EmptyCell />}{!isDeleted && isRevoked && <Badge variant="danger">Critical</Badge>}{!isDeleted && !isRevoked && <Badge variant={variant}>{label}</Badge>}</TableCell>@@ -1118,16 +1129,23 @@ export const CertificatesTable = ({})()}</div><DropdownMenu>- <DropdownMenuTrigger asChild>- <IconButton- variant="ghost"- size="xs"- isDisabled={isDeleted && !canOfferRevoke}- onClick={(e) => e.stopPropagation()}- >- <MoreHorizontalIcon />- </IconButton>- </DropdownMenuTrigger>+ <Tooltip open={isDeleted && !canOfferRevoke ? undefined : false}>+ <TooltipTrigger asChild>+ <span>+ <DropdownMenuTrigger asChild>+ <IconButton+ variant="ghost"+ size="xs"+ isDisabled={isDeleted && !canOfferRevoke}+ onClick={(e) => e.stopPropagation()}+ >+ <MoreHorizontalIcon />+ </IconButton>+ </DropdownMenuTrigger>+ </span>+ </TooltipTrigger>+ <TooltipContent>{DELETED_CERTIFICATE_NO_ACTIONS}</TooltipContent>+ </Tooltip><DropdownMenuContent align="end" sideOffset={2}>{!isDeleted && (<DropdownMenuItemdiff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.utils.ts b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.utils.tsindex 64acad6daa..ec0262f517 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.utils.ts+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.utils.ts@@ -19,6 +19,8 @@ export const getCertSourceLabel = (source: TCertificateSource): string => {}};+export const DELETED_CERTIFICATE_NO_ACTIONS = "No actions are available for a deleted certificate.";+export const RENEWAL_UNAVAILABLE_NO_PROFILE ="Renewal is unavailable because the certificate profile this certificate was issued from no longer exists.";@@ -37,20 +39,6 @@ type TCertificateStatusSource = {deletedAt?: string | null;};-export const LIVE_CERTIFICATE_STATUSES = [- CertStatus.ACTIVE,- CertStatus.RENEWED,- CertStatus.EXPIRED,- CertStatus.REVOKED-];--export const liveCertificateStatusFilter = (id: string) => ({- id,- field: "status" as const,- operator: "in" as const,- value: [...LIVE_CERTIFICATE_STATUSES]-});-export const getCertificateDisplayStatus = (certificate: TCertificateStatusSource) => {if (certificate.deletedAt) {return { status: CertStatus.DELETED, label: "Deleted", variant: "neutral" as const };diff --git a/frontend/src/pages/cert-manager/DashboardPage/components/KpiCards.tsx b/frontend/src/pages/cert-manager/DashboardPage/components/KpiCards.tsxindex e207277d20..d541f94dec 100644--- a/frontend/src/pages/cert-manager/DashboardPage/components/KpiCards.tsx+++ b/frontend/src/pages/cert-manager/DashboardPage/components/KpiCards.tsx@@ -2,7 +2,6 @@ import { AlertTriangle, FileCheck, FileClock, FileKey, FileX } from "lucide-reacimport { Badge, Card, CardContent } from "@app/components/v3";import type { TDashboardStats } from "@app/hooks/api/certificates";-import { LIVE_CERTIFICATE_STATUSES } from "@app/pages/cert-manager/CertificatesPage/components/CertificatesTable.utils";import { formatShare } from "./chart-theme";@@ -19,7 +18,7 @@ const cards = [icon: FileKey,iconClass: "text-org",iconBg: "bg-org/10 border-org/20",- filters: { filterStatus: LIVE_CERTIFICATE_STATUSES.join(",") } as Record<string, string>+ filters: {} as Record<string, string>},{key: "active" as const,diff --git a/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsx b/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsxindex 49f0fa7d50..b7acb86a63 100644--- a/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsx+++ b/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsx@@ -12,7 +12,6 @@ import {import { ProjectType } from "@app/hooks/api/projects/types";import { CertManagerAdminOnly } from "@app/pages/cert-manager/components/CertManagerAdminOnly";-import { liveCertificateStatusFilter } from "../CertificatesPage/components/CertificatesTable.utils";import type { FilterRule } from "../CertificatesPage/components/inventory-types";import { CertificatesTab } from "../PoliciesPage/components/CertificatesTab";@@ -31,7 +30,7 @@ export const InventoryPage = () => {id: "dash-status",field: "status",operator: "in",- value: searchParams.filterStatus.split(",")+ value: [searchParams.filterStatus]});}if (searchParams.filterEnrollmentType) {@@ -80,9 +79,6 @@ export const InventoryPage = () => {value: afterDate.toISOString().split("T")[0]});}- if (filters.length > 0 && !filters.some((filter) => filter.field === "status")) {- filters.push(liveCertificateStatusFilter("dash-status"));- }return filters;}, [searchParams]);