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
UI improvements
Carlos Monastyrskiec2ee043cee0
diff --git a/backend/src/server/plugins/block-cert-manager-project-access.ts b/backend/src/server/plugins/block-cert-manager-project-access.tsindex 74ec1bc2b2..225026a5d0 100644--- a/backend/src/server/plugins/block-cert-manager-project-access.ts+++ b/backend/src/server/plugins/block-cert-manager-project-access.ts@@ -4,7 +4,7 @@ import RE2 from "re2";import { ForbiddenRequestError } from "@app/lib/errors";-const ACCESS_PATH_RE = new RE2("/(memberships|identities|identity-memberships|groups|roles)(/|$|\\?)");+const ACCESS_PATH_RE = new RE2("/(memberships|identity-memberships|groups|roles)(/|$|\\?)");const PROJECT_ROUTE_PREFIX_RE = new RE2("^/api/v[12]/(projects|workspace)/");export const blockCertManagerProjectAccess: FastifyPluginAsync = fp(async (server) => {diff --git a/backend/src/server/routes/v1/cert-manager-access-routers/groups-router.ts b/backend/src/server/routes/v1/cert-manager-access-routers/groups-router.tsindex 67fd0f1698..05efb84658 100644--- a/backend/src/server/routes/v1/cert-manager-access-routers/groups-router.ts+++ b/backend/src/server/routes/v1/cert-manager-access-routers/groups-router.ts@@ -217,6 +217,11 @@ export const registerCertManagerAccessGroupsRouter = async (server: FastifyZodPr},handler: async (req) => {const projectId = req.internalCertManagerProjectId;+ await server.services.pkiApplicationMembership.removeActorFromApplicationMemberships({+ projectId,+ actorKind: "group",+ actorId: req.params.groupId+ });const { membership: groupMembership } = await server.services.membershipGroup.deleteMembership({permission: req.permission,selector: { groupId: req.params.groupId },diff --git a/backend/src/server/routes/v1/cert-manager-access-routers/identities-router.ts b/backend/src/server/routes/v1/cert-manager-access-routers/identities-router.tsindex ea56e3ee02..ee5003c105 100644--- a/backend/src/server/routes/v1/cert-manager-access-routers/identities-router.ts+++ b/backend/src/server/routes/v1/cert-manager-access-routers/identities-router.ts@@ -114,7 +114,13 @@ export const registerCertManagerAccessIdentitiesRouter = async (server: FastifyZroles: z.array(MembershipRoleSchema),lastLoginAuthMethod: z.string().nullable().optional(),lastLoginTime: z.date().nullable().optional(),- identity: IdentitiesSchema.pick({ name: true, id: true, orgId: true }).extend({+ identity: IdentitiesSchema.pick({+ name: true,+ id: true,+ orgId: true,+ projectId: true,+ hasDeleteProtection: true+ }).extend({authMethods: z.array(z.string()),metadata: z.object({@@ -242,6 +248,11 @@ export const registerCertManagerAccessIdentitiesRouter = async (server: FastifyZ},handler: async (req) => {const projectId = req.internalCertManagerProjectId;+ await server.services.pkiApplicationMembership.removeActorFromApplicationMemberships({+ projectId,+ actorKind: "identity",+ actorId: req.params.identityId+ });const { membership } = await server.services.membershipIdentity.deleteMembership({permission: req.permission,scopeData: { scope: AccessScope.Project, orgId: req.permission.orgId, projectId },diff --git a/backend/src/server/routes/v1/cert-manager-access-routers/roles-router.ts b/backend/src/server/routes/v1/cert-manager-access-routers/roles-router.tsindex 2c5afff354..3715f17fc7 100644--- a/backend/src/server/routes/v1/cert-manager-access-routers/roles-router.ts+++ b/backend/src/server/routes/v1/cert-manager-access-routers/roles-router.ts@@ -15,7 +15,7 @@ const CERT_MANAGER_CUSTOM_ROLE_ERROR =const CERT_MANAGER_ROLE_DESCRIPTIONS: Record<string, string> = {[ProjectMembershipRole.Admin]: "Full administrative access over Certificate Manager",- [ProjectMembershipRole.Member]: "Limited read/write role in Certificate Manager"+ [ProjectMembershipRole.Member]: "Access scoped to the Applications and Code Signers they've been added to"};const overrideDescription = <T extends { slug: string; description?: string | null }>(role: T): T => ({diff --git a/backend/src/server/routes/v1/cert-manager-access-routers/users-router.ts b/backend/src/server/routes/v1/cert-manager-access-routers/users-router.tsindex 89f834edb7..cb599599eb 100644--- a/backend/src/server/routes/v1/cert-manager-access-routers/users-router.ts+++ b/backend/src/server/routes/v1/cert-manager-access-routers/users-router.ts@@ -216,6 +216,11 @@ export const registerCertManagerAccessUsersRouter = async (server: FastifyZodProonRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {const projectId = req.internalCertManagerProjectId;+ await server.services.pkiApplicationMembership.removeUsersFromApplicationMemberships({+ projectId,+ emails: req.body.emails,+ usernames: req.body.usernames+ });const memberships = await server.services.projectMembership.deleteProjectMemberships({actorId: req.permission.id,actor: req.permission.type,@@ -256,6 +261,11 @@ export const registerCertManagerAccessUsersRouter = async (server: FastifyZodProhandler: async (req) => {const projectId = req.internalCertManagerProjectId;const { userId } = req.params;+ await server.services.pkiApplicationMembership.removeActorFromApplicationMemberships({+ projectId,+ actorKind: "user",+ actorId: userId+ });const { membership } = await server.services.membershipUser.deleteMembership({permission: req.permission,scopeData: { scope: AccessScope.Project, orgId: req.permission.orgId, projectId },diff --git a/backend/src/services/approval-policy/approval-policy-dal.ts b/backend/src/services/approval-policy/approval-policy-dal.tsindex 4a6e5a2733..4e5e3ba625 100644--- a/backend/src/services/approval-policy/approval-policy-dal.ts+++ b/backend/src/services/approval-policy/approval-policy-dal.ts@@ -1,3 +1,5 @@+import { Knex } from "knex";+import { TDbClient } from "@app/db";import { TableName } from "@app/db/schemas";import { DatabaseError } from "@app/lib/errors";@@ -198,11 +200,81 @@ export const approvalPolicyDALFactory = (db: TDbClient) => {}};+ const deleteStepApproversBySubject = async (+ args: {+ projectId: string;+ scopeType?: string;+ scopeId?: string;+ userId?: string;+ groupId?: string;+ },+ tx?: Knex+ ): Promise<{ id: string; name: string }[]> => {+ try {+ if (!args.userId && !args.groupId) return [];++ const conn = tx || db;++ const policiesToTouchQuery = conn(TableName.ApprovalPolicies)+ .where(`${TableName.ApprovalPolicies}.projectId`, args.projectId)+ .innerJoin(+ TableName.ApprovalPolicySteps,+ `${TableName.ApprovalPolicySteps}.policyId`,+ `${TableName.ApprovalPolicies}.id`+ )+ .innerJoin(+ TableName.ApprovalPolicyStepApprovers,+ `${TableName.ApprovalPolicyStepApprovers}.policyStepId`,+ `${TableName.ApprovalPolicySteps}.id`+ );++ if (typeof args.scopeType === "string") {+ void policiesToTouchQuery.where(`${TableName.ApprovalPolicies}.scopeType`, args.scopeType);+ if (typeof args.scopeId === "string") {+ void policiesToTouchQuery.where(`${TableName.ApprovalPolicies}.scopeId`, args.scopeId);+ }+ }++ if (args.userId) {+ void policiesToTouchQuery.where(`${TableName.ApprovalPolicyStepApprovers}.userId`, args.userId);+ } else if (args.groupId) {+ void policiesToTouchQuery.where(`${TableName.ApprovalPolicyStepApprovers}.groupId`, args.groupId);+ }++ const affectedPolicies = (await policiesToTouchQuery+ .distinct(`${TableName.ApprovalPolicies}.id`, `${TableName.ApprovalPolicies}.name`)+ .select<{ id: string; name: string }[]>()) as { id: string; name: string }[];++ if (affectedPolicies.length === 0) return [];++ const affectedPolicyIds = affectedPolicies.map((p) => p.id);++ const stepIds = (+ await conn(TableName.ApprovalPolicySteps).whereIn("policyId", affectedPolicyIds).select<{ id: string }[]>("id")+ ).map((s) => s.id);++ if (stepIds.length === 0) return affectedPolicies;++ const deleteQuery = conn(TableName.ApprovalPolicyStepApprovers).whereIn("policyStepId", stepIds);+ if (args.userId) {+ void deleteQuery.andWhere("userId", args.userId);+ } else if (args.groupId) {+ void deleteQuery.andWhere("groupId", args.groupId);+ }+ await deleteQuery.delete();++ return affectedPolicies;+ } catch (error) {+ throw new DatabaseError({ error, name: "Delete step approvers by subject" });+ }+ };+return {...orm,findStepsByPolicyId,findByProjectId,- findPoliciesWhereSubjectIsApprover+ findPoliciesWhereSubjectIsApprover,+ deleteStepApproversBySubject};};diff --git a/backend/src/services/approval-policy/approval-policy-service.ts b/backend/src/services/approval-policy/approval-policy-service.tsindex d16fe9963b..1243a7f272 100644--- a/backend/src/services/approval-policy/approval-policy-service.ts+++ b/backend/src/services/approval-policy/approval-policy-service.ts@@ -307,18 +307,13 @@ export const approvalPolicyServiceFactory = ({) => {const { projectId, scopeType: dbScopeType, scopeId: dbScopeId } = await $resolveScope(scope, inputScopeId);- const { hasRole } = await permissionService.getProjectPermission({- actor: actor.type,- actorAuthMethod: actor.authMethod,- actorId: actor.id,- actorOrgId: actor.orgId,+ await $assertCanManagePolicy(projectId,- actionProjectType: ActionProjectType.Any- });-- if (!hasRole(ProjectMembershipRole.Admin)) {- throw new ForbiddenRequestError({ message: "User has insufficient privileges" });- }+ dbScopeType,+ dbScopeId,+ actor,+ ResourcePermissionApprovalPolicyActions.Read+ );const policies = await approvalPolicyDAL.findByProjectId(policyType, projectId, {scopeType: dbScopeType,diff --git a/backend/src/services/certificate-common/certificate-issuance-utils.ts b/backend/src/services/certificate-common/certificate-issuance-utils.tsindex 311e98bcba..d2d2995504 100644--- a/backend/src/services/certificate-common/certificate-issuance-utils.ts+++ b/backend/src/services/certificate-common/certificate-issuance-utils.ts@@ -157,7 +157,7 @@ export const validateAlgorithmCompatibility = (if (compatibleAlgorithms.length === 0) {throw new BadRequestError({- message: `Template signature algorithms (${template.algorithms?.signature?.join(", ") || "none"}) are not compatible with CA key algorithm (${caKeyAlgorithm})`+ message: `Signature algorithms (${template.algorithms?.signature?.join(", ") || "none"}) are not compatible with CA key algorithm (${caKeyAlgorithm})`});}};diff --git a/backend/src/services/membership/membership-dal.ts b/backend/src/services/membership/membership-dal.tsindex a5c55a5ec7..e277c10ffd 100644--- a/backend/src/services/membership/membership-dal.ts+++ b/backend/src/services/membership/membership-dal.ts@@ -54,5 +54,22 @@ export const membershipDALFactory = (db: TDbClient) => {}};- return { ...orm, findResourceMembershipsForActor };+ const findResourceMembershipsForGroup = async (+ { projectId, resourceType, groupId }: { projectId: string; resourceType: string; groupId: string },+ tx?: Knex+ ): Promise<TMemberships[]> => {+ try {+ const conn = tx || db.replicaNode();+ return (await conn(TableName.Membership)+ .where(`${TableName.Membership}.scope`, RESOURCE_SCOPE)+ .where(`${TableName.Membership}.scopeProjectId`, projectId)+ .where(`${TableName.Membership}.scopeResourceType`, resourceType)+ .where(`${TableName.Membership}.actorGroupId`, groupId)+ .select(`${TableName.Membership}.*`)) as TMemberships[];+ } catch (error) {+ throw new DatabaseError({ error, name: "Find resource memberships for group" });+ }+ };++ return { ...orm, findResourceMembershipsForActor, findResourceMembershipsForGroup };};diff --git a/backend/src/services/pki-application/pki-application-membership-service.ts b/backend/src/services/pki-application/pki-application-membership-service.tsindex 2bc3c019dc..f950ed2565 100644--- a/backend/src/services/pki-application/pki-application-membership-service.ts+++ b/backend/src/services/pki-application/pki-application-membership-service.ts@@ -16,6 +16,7 @@ import {ResourcePermissionSub} from "@app/ee/services/permission/resource-permission";import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";+import { ActorType } from "@app/services/auth/auth-type";import { TApprovalPolicyDALFactory } from "../approval-policy/approval-policy-dal";import { ApprovalPolicyScope } from "../approval-policy/approval-policy-enums";@@ -36,14 +37,27 @@ import {} from "./pki-application-types";type TPkiApplicationMembershipServiceFactoryDep = {- pkiApplicationDAL: Pick<TPkiApplicationDALFactory, "findById">;- membershipDAL: Pick<TMembershipDALFactory, "create" | "findById" | "find" | "deleteById" | "transaction">;+ pkiApplicationDAL: Pick<TPkiApplicationDALFactory, "findById" | "find">;+ membershipDAL: Pick<+ TMembershipDALFactory,+ | "create"+ | "findById"+ | "find"+ | "delete"+ | "deleteById"+ | "transaction"+ | "findResourceMembershipsForActor"+ | "findResourceMembershipsForGroup"+ >;membershipRoleDAL: Pick<TMembershipRoleDALFactory, "create" | "find" | "delete" | "update">;permissionService: Pick<TPermissionServiceFactory, "getResourcePermission" | "getProjectPermission">;userDAL: Pick<TUserDALFactory, "find">;identityDAL: Pick<TIdentityDALFactory, "find">;groupDAL: Pick<TGroupDALFactory, "find">;- approvalPolicyDAL: Pick<TApprovalPolicyDALFactory, "findPoliciesWhereSubjectIsApprover">;+ approvalPolicyDAL: Pick<+ TApprovalPolicyDALFactory,+ "findPoliciesWhereSubjectIsApprover" | "deleteStepApproversBySubject"+ >;};export type TPkiApplicationMembershipServiceFactory = ReturnType<typeof pkiApplicationMembershipServiceFactory>;@@ -493,23 +507,19 @@ export const pkiApplicationMembershipServiceFactory = ({const membership = await $findMembershipByMember(applicationId, projectId, kind, memberId);const details = await $buildMemberDetails(membership);- if (kind !== ApplicationMemberKind.Identity) {- const blocking = await approvalPolicyDAL.findPoliciesWhereSubjectIsApprover({- projectId,- scopeType: ApprovalPolicyScope.PkiApplication,- scopeId: applicationId,- userId: kind === ApplicationMemberKind.User ? (membership.actorUserId ?? undefined) : undefined,- groupId: kind === ApplicationMemberKind.Group ? (membership.actorGroupId ?? undefined) : undefined- });- if (blocking.length > 0) {- const policyNames = blocking.map((p) => p.name).join(", ");- throw new BadRequestError({- message: `Cannot remove this ${kind} from the application, they are listed as an approver on the following approval ${blocking.length === 1 ? "policy" : "policies"}: ${policyNames}. Remove them from the policy first.`- });- }- }-await membershipDAL.transaction(async (tx) => {+ if (kind !== ApplicationMemberKind.Identity) {+ await approvalPolicyDAL.deleteStepApproversBySubject(+ {+ projectId,+ scopeType: ApprovalPolicyScope.PkiApplication,+ scopeId: applicationId,+ userId: kind === ApplicationMemberKind.User ? (membership.actorUserId ?? undefined) : undefined,+ groupId: kind === ApplicationMemberKind.Group ? (membership.actorGroupId ?? undefined) : undefined+ },+ tx+ );+ }await membershipRoleDAL.delete({ membershipId: membership.id }, tx);await membershipDAL.deleteById(membership.id, tx);});@@ -611,5 +621,150 @@ export const pkiApplicationMembershipServiceFactory = ({return { memberships, skipped, unresolved };};- return { addMember, addUserMembers, listMembers, updateMemberRole, removeMember };+ const listApplicationsForActor = async ({+ projectId,+ actorKind,+ actorId+ }: {+ projectId: string;+ actorKind: "user" | "identity" | "group";+ actorId: string;+ }): Promise<Array<{ id: string; name: string }>> => {+ const memberships =+ actorKind === "group"+ ? await membershipDAL.findResourceMembershipsForGroup({+ projectId,+ resourceType: ResourceType.CertificateApplication,+ groupId: actorId+ })+ : await membershipDAL.findResourceMembershipsForActor({+ projectId,+ resourceType: ResourceType.CertificateApplication,+ actorType: actorKind === "user" ? ActorType.USER : ActorType.IDENTITY,+ actorId+ });++ if (!memberships.length) return [];++ const applicationIds = Array.from(+ new Set(memberships.map((m) => m.scopeResourceId).filter((id): id is string => Boolean(id)))+ );+ if (!applicationIds.length) return [];++ const applications = await pkiApplicationDAL.find({ $in: { id: applicationIds } });+ return applications.map((app) => ({ id: app.id, name: app.name }));+ };++ const removeActorFromApplicationMemberships = async ({+ projectId,+ actorKind,+ actorId+ }: {+ projectId: string;+ actorKind: "user" | "identity" | "group";+ actorId: string;+ }): Promise<{+ applications: Array<{ id: string; name: string }>;+ approvalPolicies: Array<{ id: string; name: string }>;+ }> => {+ const memberships =+ actorKind === "group"+ ? await membershipDAL.findResourceMembershipsForGroup({+ projectId,+ resourceType: ResourceType.CertificateApplication,+ groupId: actorId+ })+ : await membershipDAL.findResourceMembershipsForActor({+ projectId,+ resourceType: ResourceType.CertificateApplication,+ actorType: actorKind === "user" ? ActorType.USER : ActorType.IDENTITY,+ actorId+ });++ const directMemberships =+ actorKind === "group"+ ? memberships+ : memberships.filter((m) => (actorKind === "user" ? m.actorUserId === actorId : m.actorIdentityId === actorId));++ const applicationIds = Array.from(+ new Set(directMemberships.map((m) => m.scopeResourceId).filter((id): id is string => Boolean(id)))+ );+ const applications = applicationIds.length ? await pkiApplicationDAL.find({ $in: { id: applicationIds } }) : [];+ const applicationsTouched = applications.map((app) => ({ id: app.id, name: app.name }));++ let approvalPoliciesTouched: Array<{ id: string; name: string }> = [];++ await membershipDAL.transaction(async (tx) => {+ if (actorKind !== "identity" && applicationIds.length > 0) {+ for (const applicationId of applicationIds) {+ // eslint-disable-next-line no-await-in-loop+ const affected = await approvalPolicyDAL.deleteStepApproversBySubject(+ {+ projectId,+ scopeType: ApprovalPolicyScope.PkiApplication,+ scopeId: applicationId,+ userId: actorKind === "user" ? actorId : undefined,+ groupId: actorKind === "group" ? actorId : undefined+ },+ tx+ );+ approvalPoliciesTouched = approvalPoliciesTouched.concat(affected);+ }+ const seen = new Set<string>();+ approvalPoliciesTouched = approvalPoliciesTouched.filter((p) => {+ if (seen.has(p.id)) return false;+ seen.add(p.id);+ return true;+ });+ }++ if (directMemberships.length > 0) {+ const membershipIds = directMemberships.map((m) => m.id);+ await membershipRoleDAL.delete({ $in: { membershipId: membershipIds } }, tx);+ await membershipDAL.delete({ $in: { id: membershipIds } }, tx);+ }+ });++ return { applications: applicationsTouched, approvalPolicies: approvalPoliciesTouched };+ };++ const removeUsersFromApplicationMemberships = async ({+ projectId,+ emails,+ usernames+ }: {+ projectId: string;+ emails: string[];+ usernames: string[];+ }): Promise<void> => {+ if (!emails.length && !usernames.length) return;++ const users = await userDAL.find({+ $in: {+ ...(emails.length ? { email: emails } : {}),+ ...(usernames.length ? { username: usernames } : {})+ }+ });+ if (!users.length) return;++ for (const user of users) {+ // eslint-disable-next-line no-await-in-loop+ await removeActorFromApplicationMemberships({+ projectId,+ actorKind: "user",+ actorId: user.id+ });+ }+ };++ return {+ addMember,+ addUserMembers,+ listMembers,+ updateMemberRole,+ removeMember,+ listApplicationsForActor,+ removeActorFromApplicationMemberships,+ removeUsersFromApplicationMemberships+ };};diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsxindex 05f96b9fef..28af2e4b1e 100644--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx@@ -27,7 +27,6 @@ import { useGetPkiAlertsV2 } from "@app/hooks/api/pkiAlertsV2";import { useListPkiSyncs } from "@app/hooks/api/pkiSyncs";import { ProjectNavList } from "./ProjectNavLink";-import { CERT_DISCOVERY_SUBMENU, CERT_MANAGER_ACCESS_CONTROL_SUBMENU } from "./submenus";import type { NavItem, Submenu } from "./types";export const CertManagerNav = ({@@ -92,8 +91,7 @@ export const CertManagerNav = ({label: "Discovery",icon: Search,pathSuffix: "discovery",- activeMatch: /\/discovery/,- submenu: CERT_DISCOVERY_SUBMENU+ activeMatch: /\/discovery/},{label: "Approval Requests",@@ -139,8 +137,7 @@ export const CertManagerNav = ({label: "Access Control",icon: Shield,pathSuffix: "access-management",- activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,- submenu: CERT_MANAGER_ACCESS_CONTROL_SUBMENU+ activeMatch: /\/access-management|\/groups\/|\/identities\/|\/members\/|\/roles\//},{ label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },{diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsxindex aeb1c9f21f..ac5e777ab1 100644--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx@@ -18,9 +18,7 @@ import { SshNav } from "./SshNav";import {CERT_APPROVALS_SUBMENU,CERT_CERTIFICATES_SUBMENU,- CERT_DISCOVERY_SUBMENU,CERT_INTEGRATIONS_SUBMENU,- CERT_MANAGER_ACCESS_CONTROL_SUBMENU,INTEGRATIONS_SUBMENU,MCP_SUBMENU,PAM_APPROVALS_SUBMENU,@@ -81,15 +79,14 @@ export const ProjectNav = () => {const isOnMcpOverview = currentProject.type === ProjectType.AI && pathname.includes("/overview");const isCertManager = currentProject.type === ProjectType.CertificateManager;const isOnCertPolicies = isCertManager && pathname.includes("/policies");- const isOnCertDiscovery = isCertManager && pathname.includes("/discovery");const isOnCertApprovals = isCertManager && pathname.includes("/approvals");const getInitialProjectSubmenu = (): Submenu | null => {if (isLegacyView || hasApplicationContext || isFromRootRequests) return null;+ if (isCertManager && (isOnAccessControl || pathname.includes("/discovery"))) return null;if (isOnAccessControl) {if (currentProject.type === ProjectType.SecretManager)return SECRET_MANAGER_ACCESS_CONTROL_SUBMENU;- if (isCertManager) return CERT_MANAGER_ACCESS_CONTROL_SUBMENU;return PROJECT_ACCESS_CONTROL_SUBMENU;}if (isOnIntegrations && currentProject.type === ProjectType.SecretManager)@@ -102,7 +99,6 @@ export const ProjectNav = () => {if (isOnProjectSettings && currentProject.type === ProjectType.PAM) return PAM_SETTINGS_SUBMENU;if (isOnMcpOverview) return MCP_SUBMENU;if (isOnCertPolicies) return CERT_CERTIFICATES_SUBMENU;- if (isOnCertDiscovery) return CERT_DISCOVERY_SUBMENU;if (isOnCertApprovals) return CERT_APPROVALS_SUBMENU;if (currentProject.type === ProjectType.PAM && pathname.includes("/approvals"))return PAM_APPROVALS_SUBMENU;diff --git a/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx b/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsxindex d32ec859a8..f7db773103 100644--- a/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx+++ b/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx@@ -49,7 +49,7 @@ export const PkiAlertsSection = () => {isOpen={popUp.deletePkiAlert.isOpen}title={`Are you sure you want to remove the alert ${(popUp?.deletePkiAlert?.data as { name: string })?.name || ""- } from the project?`}+ }?`}onChange={(isOpen) => handlePopUpToggle("deletePkiAlert", isOpen)}deleteKey="confirm"onDeleteApproved={() =>diff --git a/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx b/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsxindex c61a6444d1..af9b0f24bb 100644--- a/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx+++ b/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx@@ -63,7 +63,7 @@ export const PkiCollectionSection = () => {isOpen={popUp.deletePkiCollection.isOpen}title={`Are you sure you want to remove the alert ${(popUp?.deletePkiCollection?.data as { name: string })?.name || ""- } from the project?`}+ }?`}onChange={(isOpen) => handlePopUpToggle("deletePkiCollection", isOpen)}deleteKey="confirm"onDeleteApproved={() =>diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsxindex 9d09362884..603247ceb2 100644--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx@@ -265,7 +265,7 @@ export const ApplicationDetailsByIDPage = () => {<DeleteActionModalisOpen={isDeleteOpen}title={`Delete ${application.name}?`}- subTitle="This unattaches all Profiles, app-scoped syncs/alerts, and revokes app-only memberships. Issued certificates remain in the project but lose their Application tag."+ subTitle="This unattaches all Profiles, app-scoped syncs/alerts, and revokes app-only memberships. Issued certificates remain in Certificate Manager but lose their Application tag."onChange={(open) => setIsDeleteOpen(open)}deleteKey="confirm"onDeleteApproved={handleDelete}diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsxindex b9095422a6..a26035aaeb 100644--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx@@ -51,17 +51,17 @@ const APP_ROLES: AppRoleOption[] = [{slug: "admin",name: "Admin",- description: "Full management of this application and its members."+ description: "Manage members, profiles, and approval policies for this application."},{slug: "operator",name: "Operator",- description: "Issue certificates and submit approval requests."+ description: "Issue certificates and submit approval requests for this application."},{slug: "auditor",name: "Auditor",- description: "Read-only access to this application."+ description: "View certificates, members, and activity on this application."}];diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsxindex eef50016a1..8e6986327e 100644--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx@@ -142,7 +142,7 @@ const ApplicationPoliciesTable = ({<EmptyHeader><EmptyTitle>No approval policies</EmptyTitle><EmptyDescription>- Create a policy to gate certificate operations on this Application.+ Create one to require approval before certificates are issued for this Application.</EmptyDescription></EmptyHeader></Empty>@@ -485,7 +485,7 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {first.</span>) : (- "All certificate profiles in this project are already attached."+ "All certificate profiles are already attached.");}@@ -530,8 +530,8 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {<CardHeader><CardTitle>Certificate Profiles</CardTitle><CardDescription>- Configure how this Application enrolls against each attached profile (API, EST, ACME, or- SCEP).+ For each profile, configure how this application will issue certificates via API, EST,+ ACME, or SCEP.</CardDescription>{canManageProfileAttachments ? (<CardAction>@@ -652,7 +652,7 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {<CardHeader><CardTitle>Approval Policies</CardTitle><CardDescription>- Approval workflows that gate certificate operations against this Application.+ Require approval before certificates are issued for this Application.</CardDescription><CardAction><Button@@ -680,7 +680,7 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {<CardHeader><CardTitle>Alerting</CardTitle><CardDescription>- Alert rules for certificate events scoped to {application.name}.+ Get notified about certificate events scoped to {application.name}.</CardDescription><CardAction><Buttondiff --git a/frontend/src/pages/cert-manager/ApplicationsPage/ApplicationsPage.tsx b/frontend/src/pages/cert-manager/ApplicationsPage/ApplicationsPage.tsxindex e9723bf291..b63d8b2598 100644--- a/frontend/src/pages/cert-manager/ApplicationsPage/ApplicationsPage.tsx+++ b/frontend/src/pages/cert-manager/ApplicationsPage/ApplicationsPage.tsx@@ -10,7 +10,6 @@ import {CardAction,CardContent,CardHeader,- CardTitle,DropdownMenu,DropdownMenuContent,DropdownMenuItem,@@ -59,9 +58,9 @@ export const ApplicationsPage = () => {return (<Empty className="border"><EmptyHeader>- <EmptyTitle>No applications yet</EmptyTitle>+ <EmptyTitle>No existing applications</EmptyTitle><EmptyDescription>- Create an Application to attach Profiles and grant access to a team.+ Create an application to issue certificates for a workload</EmptyDescription></EmptyHeader></Empty>@@ -158,14 +157,13 @@ export const ApplicationsPage = () => {scope={ProjectType.CertificateManager}icon={ResourceIcon}title="Applications"- description="Issue certificates, configure enrollment, and manage lifecycle automation for your services."+ description="Issue certificates and manage lifecycle automation for your services."/><Card><CardHeader>- <CardTitle>Applications</CardTitle>{canCreateApplication ? (- <CardAction>+ <CardAction className="ml-auto"><Button variant="project" onClick={() => handlePopUpOpen("application")}><PlusIcon />Create Applicationdiff --git a/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx b/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsxindex 8316fb8fbd..1f4e9419c0 100644--- a/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx+++ b/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx@@ -127,7 +127,7 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {<DialogDescription>{editing? "Update this Application's name and description. Changing the name will invalidate any deep links."- : "A logical grouping for a service or workload that needs certificates. Each Application has its own members, profiles, and policies."}+ : "A logical grouping for a service or workload that needs certificates."}</DialogDescription></DialogHeader>@@ -141,6 +141,7 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {<FieldContent><Input {...field} placeholder="my-service" /></FieldContent>+ <FieldDescription>Lowercase letters, numbers, and hyphens.</FieldDescription>{error ? <FieldError>{error.message}</FieldError> : null}</Field>)}@@ -179,9 +180,9 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {placeholder="Select profiles to attach..."/></FieldContent>- {!profilesLoading && !profileOptions.length && (- <FieldDescription className="text-yellow-500">- No certificate profiles available.{" "}+ <FieldDescription>+ Select the profiles this application can issue certificates from.{" "}+ {!profilesLoading && !profileOptions.length && (<Linkto="/organizations/$orgId/projects/cert-manager/$projectId/settings"params={{ orgId: orgId ?? "", projectId: projectId ?? "" }}@@ -190,8 +191,8 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {>Create one in Settings</Link>- </FieldDescription>- )}+ )}+ </FieldDescription>{error ? <FieldError>{error.message}</FieldError> : null}</Field>)}diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsxindex f8bb1abdc5..c41eba6436 100644--- a/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx+++ b/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx@@ -24,7 +24,7 @@ export const ApprovalsPage = () => {<PageHeaderscope={currentProject.type}title="Certificate Approvals"- description="Manage approval workflows, update policy settings, and monitor request statuses."+ description="Define who must approve certificate operations and track every request from submission to resolution."/><div>{activeTab === "requests" && <RequestsTab />}diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsxindex 0ae3731460..ee335b5dc0 100644--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx@@ -80,11 +80,12 @@ const Page = () => {handlePopUpClose("deleteCa");navigate({- to: "/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities",+ to: "/organizations/$orgId/projects/cert-manager/$projectId/settings",params: {orgId: currentOrg.id,projectId- }+ },+ search: { selectedTab: "certificate-authorities" }});};@@ -101,11 +102,12 @@ const Page = () => {isAllowed ? (<div className="mx-auto mb-6 w-full max-w-8xl"><Link- to="/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities"+ to="/organizations/$orgId/projects/cert-manager/$projectId/settings"params={{orgId: currentOrg.id,projectId}}+ search={{ selectedTab: "certificate-authorities" }}className="mb-4 flex items-center gap-x-2 text-sm text-mineshaft-400"><FontAwesomeIcon icon={faChevronLeft} />@@ -176,7 +178,7 @@ const Page = () => {isOpen={popUp.deleteCa.isOpen}title={`Are you sure you want to remove the CA ${(popUp?.deleteCa?.data as { dn: string })?.dn || ""- } from the project?`}+ }?`}subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}deleteKey="confirm"diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/CertificateAuthoritiesPage.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/CertificateAuthoritiesPage.tsxindex 6d83f232f1..7ded7c5656 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/CertificateAuthoritiesPage.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/CertificateAuthoritiesPage.tsx@@ -20,7 +20,7 @@ export const CertificateAuthoritiesPage = () => {<PageHeaderscope={ProjectType.CertificateManager}title="Certificate Authorities"- description="Manage certificate authorities for issuing and signing certificates"+ description="Define the trust anchors that sign certificates in this project — internal CAs you operate, plus external CAs you connect to."/><ProjectPermissionCanrenderGuardBannerdiff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsxindex 660aadd836..448b51866e 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx@@ -1,10 +1,18 @@-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { PlusIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { DocumentationLinkBadge } from "@app/components/v3";+import { DeleteActionModal } from "@app/components/v2";+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ DocumentationLinkBadge+} from "@app/components/v3";import {ProjectPermissionCertificateAuthorityActions,ProjectPermissionSub,@@ -58,38 +66,45 @@ export const CaSection = () => {};return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex justify-between">- <div className="flex items-center gap-x-2">- <p className="text-xl font-medium text-mineshaft-100">Internal Certificate Authorities</p>+ <Card className="mb-6">+ <CardHeader>+ <CardTitle>+ Internal Certificate Authorities<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/private-ca" />- </div>- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Create}- a={ProjectPermissionSub.CertificateAuthorities}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="submit"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handlePopUpOpen("ca")}- isDisabled={!isAllowed}- >- Create CA- </Button>- )}- </ProjectPermissionCan>- </div>+ </CardTitle>+ <CardDescription>+ Private CAs you run inside Infisical. They can issue certificates directly to+ applications, or sign other CAs to build a layered setup.+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Create}+ a={ProjectPermissionSub.CertificateAuthorities}+ >+ {(isAllowed) => (+ <Button+ variant="project"+ onClick={() => handlePopUpOpen("ca")}+ isDisabled={!isAllowed}+ >+ <PlusIcon />+ Create CA+ </Button>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <CaTable handlePopUpOpen={handlePopUpOpen} />+ </CardContent><CaModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} /><CaInstallCertModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} /><CaCertModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <CaTable handlePopUpOpen={handlePopUpOpen} /><DeleteActionModalisOpen={popUp.deleteCa.isOpen}title={`Are you sure you want to remove the CA ${(popUp?.deleteCa?.data as { dn: string })?.dn || ""- } from the project?`}+ }?`}subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}deleteKey="confirm"@@ -101,7 +116,7 @@ export const CaSection = () => {(popUp?.caStatus?.data as { status: string })?.status === CaStatus.ACTIVE? "enable": "disable"- } the CA ${(popUp?.caStatus?.data as { dn: string })?.dn || ""} from the project?`}+ } the CA ${(popUp?.caStatus?.data as { dn: string })?.dn || ""}?`}subTitle={(popUp?.caStatus?.data as { status: string })?.status === CaStatus.ACTIVE? "This action will allow the CA to start issuing certificates again."@@ -114,6 +129,6 @@ export const CaSection = () => {onUpdateCaStatus(popUp?.caStatus?.data as { caId: string; status: CaStatus })}/>- </div>+ </Card>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsxindex 52e3d4a40c..d6ca5b5a7e 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx@@ -11,18 +11,21 @@ import {DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr+ Tooltip} from "@app/components/v2";-import { Badge } from "@app/components/v3";+import {+ Badge,+ Empty,+ EmptyHeader,+ EmptyTitle,+ Skeleton,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import {ProjectPermissionCertificateAuthorityActions,ProjectPermissionSub,@@ -59,199 +62,201 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {const { data, isPending } = useListCasByTypeAndProjectId(CaType.INTERNAL);const cas = data as TInternalCertificateAuthority[];+ if (isPending) {+ return (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ );+ }++ if (!cas || cas.length === 0) {+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>No existing internal certificate authorities</EmptyTitle>+ </EmptyHeader>+ </Empty>+ );+ }+return (- <div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Status</Th>- <Th>Type</Th>- <Th>Valid Until</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={3} innerKey="project-cas" />}- {!isPending &&- cas &&- cas.length > 0 &&- cas.map((ca) => {- const canReadCa = permission.can(- ProjectPermissionCertificateAuthorityActions.Read,- subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })- );+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Status</TableHead>+ <TableHead>Type</TableHead>+ <TableHead>Valid Until</TableHead>+ <TableHead />+ </TableRow>+ </TableHeader>+ <TableBody>+ {cas.map((ca) => {+ const canReadCa = permission.can(+ ProjectPermissionCertificateAuthorityActions.Read,+ subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })+ );- return (- <Tr- className={twMerge(- "h-10 transition-colors duration-100",- canReadCa && "cursor-pointer hover:bg-mineshaft-700",- !canReadCa && "cursor-not-allowed opacity-60"+ return (+ <TableRow+ className={twMerge(!canReadCa && "cursor-not-allowed opacity-60")}+ key={`ca-${ca.id}`}+ onClick={() =>+ canReadCa &&+ navigate({+ to: "/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId",+ params: {+ orgId: currentOrg.id,+ projectId: currentProject.id,+ caId: ca.id+ }+ })+ }+ >+ <TableCell>{ca.name}</TableCell>+ <TableCell>+ <Badge variant={getCaStatusBadgeVariant(ca.status)}>+ {caStatusToNameMap[ca.status]}+ </Badge>+ </TableCell>+ <TableCell>{caTypeToNameMap[ca.configuration.type]}</TableCell>+ <TableCell>+ <div className="flex items-center">+ <p>+ {ca.configuration.notAfter+ ? format(new Date(ca.configuration.notAfter), "yyyy-MM-dd")+ : "-"}+ </p>+ </div>+ </TableCell>+ <TableCell className="flex justify-end">+ <DropdownMenu>+ <DropdownMenuTrigger asChild className="rounded-lg">+ <div className="hover:text-primary-400 data-[state=open]:text-primary-400">+ <Tooltip content="More options">+ <FontAwesomeIcon size="lg" icon={faEllipsis} />+ </Tooltip>+ </div>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="p-1">+ {ca.status === CaStatus.PENDING_CERTIFICATE && (+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Create}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"+ )}+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("installCaCert", {+ caId: ca.id+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faCertificate} />}+ >+ Install CA Certificate+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>)}- key={`ca-${ca.id}`}- onClick={() =>- canReadCa &&- navigate({- to: "/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId",- params: {- orgId: currentOrg.id,- projectId: currentProject.id,- caId: ca.id- }- })- }- >- <Td>{ca.name}</Td>- <Td>- <Badge variant={getCaStatusBadgeVariant(ca.status)}>- {caStatusToNameMap[ca.status]}- </Badge>- </Td>- <Td>{caTypeToNameMap[ca.configuration.type]}</Td>- <Td>- <div className="flex items-center">- <p>- {ca.configuration.notAfter- ? format(new Date(ca.configuration.notAfter), "yyyy-MM-dd")- : "-"}- </p>- </div>- </Td>- <Td className="flex justify-end">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- {ca.status === CaStatus.PENDING_CERTIFICATE && (- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Create}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed &&- "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("installCaCert", {- caId: ca.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faCertificate} />}- >- Install CA Certificate- </DropdownMenuItem>- )}- </ProjectPermissionCan>- )}- {ca.status !== CaStatus.PENDING_CERTIFICATE && (- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Read}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed &&- "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("caCert", {- caId: ca.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faCertificate} />}- >- View Certificate- </DropdownMenuItem>- )}- </ProjectPermissionCan>- )}- {(ca.status === CaStatus.ACTIVE || ca.status === CaStatus.DISABLED) && (- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Edit}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed &&- "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("caStatus", {- caId: ca.id,- status:- ca.status === CaStatus.ACTIVE- ? CaStatus.DISABLED- : CaStatus.ACTIVE- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faBan} />}- >- {`${ca.status === CaStatus.ACTIVE ? "Disable" : "Enable"} CA`}- </DropdownMenuItem>- )}- </ProjectPermissionCan>- )}- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Delete}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}+ {ca.status !== CaStatus.PENDING_CERTIFICATE && (+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Read}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"+ )}+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("caCert", {+ caId: ca.id+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faCertificate} />}>- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("deleteCa", {- caId: ca.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- >- Delete CA- </DropdownMenuItem>+ View Certificate+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ )}+ {(ca.status === CaStatus.ACTIVE || ca.status === CaStatus.DISABLED) && (+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Edit}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50")}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && data?.length === 0 && (- <EmptyState title="No certificate authorities have been created" icon={faCertificate} />- )}- </TableContainer>- </div>+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("caStatus", {+ caId: ca.id,+ status:+ ca.status === CaStatus.ACTIVE+ ? CaStatus.DISABLED+ : CaStatus.ACTIVE+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faBan} />}+ >+ {`${ca.status === CaStatus.ACTIVE ? "Disable" : "Enable"} CA`}+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ )}+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Delete}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"+ )}+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("deleteCa", {+ caId: ca.id+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faTrash} />}+ >+ Delete CA+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ );+ })}+ </TableBody>+ </Table>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsxindex e1a50de5ec..1cda292e5b 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx@@ -1,10 +1,18 @@-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { PlusIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { DocumentationLinkBadge } from "@app/components/v3";+import { DeleteActionModal } from "@app/components/v2";+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ DocumentationLinkBadge+} from "@app/components/v3";import {ProjectPermissionCertificateAuthorityActions,ProjectPermissionSub,@@ -62,35 +70,43 @@ export const ExternalCaSection = () => {};return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex justify-between">- <div className="flex items-center gap-x-2">- <p className="text-xl font-medium text-mineshaft-100">External Certificate Authorities</p>+ <Card className="mb-6">+ <CardHeader>+ <CardTitle>+ External Certificate Authorities<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/ca/external-ca" />- </div>- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Create}- a={ProjectPermissionSub.CertificateAuthorities}- >- {(isAllowed) => (- <Button- colorSchema="primary"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handlePopUpOpen("ca")}- isDisabled={!isAllowed}- >- Create CA- </Button>- )}- </ProjectPermissionCan>- </div>+ </CardTitle>+ <CardDescription>+ Third-party CAs connected to Infisical. Use them to issue certificates from providers you+ already have.+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Create}+ a={ProjectPermissionSub.CertificateAuthorities}+ >+ {(isAllowed) => (+ <Button+ variant="project"+ onClick={() => handlePopUpOpen("ca")}+ isDisabled={!isAllowed}+ >+ <PlusIcon />+ Create CA+ </Button>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <ExternalCaTable handlePopUpOpen={handlePopUpOpen} />+ </CardContent><ExternalCaModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <ExternalCaTable handlePopUpOpen={handlePopUpOpen} /><DeleteActionModalisOpen={popUp.deleteCa.isOpen}title={`Are you sure you want to remove the CA ${(popUp?.deleteCa?.data as { dn: string })?.dn || ""- } from the project?`}+ }?`}subTitle="This action will delete other CAs and certificates below it in your CA hierarchy."onChange={(isOpen) => handlePopUpToggle("deleteCa", isOpen)}deleteKey="confirm"@@ -107,7 +123,7 @@ export const ExternalCaSection = () => {(popUp?.caStatus?.data as { status: string })?.status === CaStatus.ACTIVE? "enable": "disable"- } the CA ${(popUp?.caStatus?.data as { dn: string })?.dn || ""} from the project?`}+ } the CA ${(popUp?.caStatus?.data as { dn: string })?.dn || ""}?`}subTitle={(popUp?.caStatus?.data as { status: string })?.status === CaStatus.ACTIVE? "This action will allow the CA to start issuing certificates again."@@ -122,6 +138,6 @@ export const ExternalCaSection = () => {)}/>- </div>+ </Card>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsxindex 5438d289d6..b1770cd890 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx@@ -1,11 +1,5 @@import { subject } from "@casl/ability";-import {- faBan,- faCertificate,- faEllipsis,- faPencil,- faTrash-} from "@fortawesome/free-solid-svg-icons";+import { faBan, faEllipsis, faPencil, faTrash } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { twMerge } from "tailwind-merge";@@ -15,18 +9,21 @@ import {DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr+ Tooltip} from "@app/components/v2";-import { Badge } from "@app/components/v3";+import {+ Badge,+ Empty,+ EmptyHeader,+ EmptyTitle,+ Skeleton,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import {ProjectPermissionCertificateAuthorityActions,ProjectPermissionSub,@@ -56,163 +53,164 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {const { permission } = useProjectPermission();const { data, isPending } = useListExternalCasByProjectId();+ if (isPending) {+ return (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ );+ }++ if (!data || data.length === 0) {+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>No existing external certificate authorities</EmptyTitle>+ </EmptyHeader>+ </Empty>+ );+ }+return (- <div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Type</Th>- <Th>Status</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={3} innerKey="project-cas" />}- {!isPending &&- data &&- data.length > 0 &&- data.map((ca) => {- const canEditCa = permission.can(- ProjectPermissionCertificateAuthorityActions.Edit,- subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })- );+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Type</TableHead>+ <TableHead>Status</TableHead>+ <TableHead />+ </TableRow>+ </TableHeader>+ <TableBody>+ {data.map((ca) => {+ const canEditCa = permission.can(+ ProjectPermissionCertificateAuthorityActions.Edit,+ subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })+ );- return (- <Tr- className={twMerge(- "h-10 transition-colors duration-100",- canEditCa && "cursor-pointer hover:bg-mineshaft-700",- !canEditCa && "cursor-not-allowed opacity-60"- )}- key={`ca-${ca.id}`}- onClick={() =>- canEditCa &&- handlePopUpOpen("ca", {- caId: ca.id,- name: ca.name,- type: ca.type- })- }- >- <Td>{ca.name}</Td>- <Td>{EXTERNAL_CA_TYPE_NAME_MAP[ca.type] || ca.type}</Td>- <Td>- <Badge variant={getCaStatusBadgeVariant(ca.status)}>- {caStatusToNameMap[ca.status]}- </Badge>- </Td>- <Td className="flex justify-end">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Edit}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("ca", {- caId: ca.id,- name: ca.name,- type: ca.type- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faPencil} />}- >- Edit CA- </DropdownMenuItem>- )}- </ProjectPermissionCan>- {(ca.status === CaStatus.ACTIVE || ca.status === CaStatus.DISABLED) && (- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Edit}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed &&- "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("caStatus", {- caId: ca.id,- type: ca.type,- status:- ca.status === CaStatus.ACTIVE- ? CaStatus.DISABLED- : CaStatus.ACTIVE- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faBan} />}- >- {`${ca.status === CaStatus.ACTIVE ? "Disable" : "Enable"} CA`}- </DropdownMenuItem>- )}- </ProjectPermissionCan>+ return (+ <TableRow+ className={twMerge(!canEditCa && "cursor-not-allowed opacity-60")}+ key={`ca-${ca.id}`}+ onClick={() =>+ canEditCa &&+ handlePopUpOpen("ca", {+ caId: ca.id,+ name: ca.name,+ type: ca.type+ })+ }+ >+ <TableCell>{ca.name}</TableCell>+ <TableCell>{EXTERNAL_CA_TYPE_NAME_MAP[ca.type] || ca.type}</TableCell>+ <TableCell>+ <Badge variant={getCaStatusBadgeVariant(ca.status)}>+ {caStatusToNameMap[ca.status]}+ </Badge>+ </TableCell>+ <TableCell className="flex justify-end">+ <DropdownMenu>+ <DropdownMenuTrigger asChild className="rounded-lg">+ <div className="hover:text-primary-400 data-[state=open]:text-primary-400">+ <Tooltip content="More options">+ <FontAwesomeIcon size="lg" icon={faEllipsis} />+ </Tooltip>+ </div>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="p-1">+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Edit}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50")}- <ProjectPermissionCan- I={ProjectPermissionCertificateAuthorityActions.Delete}- a={subject(ProjectPermissionSub.CertificateAuthorities, {- name: ca.name- })}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("deleteCa", {- caId: ca.id,- type: ca.type- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- >- Delete CA- </DropdownMenuItem>+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("ca", {+ caId: ca.id,+ name: ca.name,+ type: ca.type+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faPencil} />}+ >+ Edit CA+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ {(ca.status === CaStatus.ACTIVE || ca.status === CaStatus.DISABLED) && (+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Edit}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50")}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && data?.length === 0 && (- <EmptyState- title="No external certificate authorities have been created"- icon={faCertificate}- />- )}- </TableContainer>- </div>+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("caStatus", {+ caId: ca.id,+ type: ca.type,+ status:+ ca.status === CaStatus.ACTIVE+ ? CaStatus.DISABLED+ : CaStatus.ACTIVE+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faBan} />}+ >+ {`${ca.status === CaStatus.ACTIVE ? "Disable" : "Enable"} CA`}+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ )}+ <ProjectPermissionCan+ I={ProjectPermissionCertificateAuthorityActions.Delete}+ a={subject(ProjectPermissionSub.CertificateAuthorities, {+ name: ca.name+ })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ className={twMerge(+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"+ )}+ onClick={(e) => {+ e.stopPropagation();+ handlePopUpOpen("deleteCa", {+ caId: ca.id,+ type: ca.type+ });+ }}+ disabled={!isAllowed}+ icon={<FontAwesomeIcon icon={faTrash} />}+ >+ Delete CA+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ );+ })}+ </TableBody>+ </Table>);};diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsxindex c78b747fd4..8e685f0301 100644--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx@@ -215,7 +215,7 @@ const Page = () => {className="mb-4 flex w-fit items-center gap-x-1 text-sm text-mineshaft-400 transition duration-100 hover:text-mineshaft-400/80"><ChevronLeftIcon size={16} />- {fromApplication} Certificates+ Application Certificates</Link>) : (<Linkdiff --git a/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx b/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsxindex 86ca8076ad..81d6901eb4 100644--- a/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx+++ b/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx@@ -219,8 +219,8 @@ export const CertificateRequestsSection = ({<CardTitle>Certificate Requests</CardTitle><CardDescription>{applicationId- ? "View, filter, and manage certificate issuance requests against this application"- : "Track certificate issuance requests across this project."}+ ? "View, filter and manage certificate issuance requests against this application"+ : "Track certificate issuance requests across Certificate Manager."}</CardDescription><CardAction><Tooltip@@ -238,7 +238,7 @@ export const CertificateRequestsSection = ({disabled={!canRequestCertificate}><FontAwesomeIcon icon={faPlus} className="mr-1.5 size-3.5" />- Request+ Request Certificate</Button></span></Tooltip>@@ -454,6 +454,7 @@ export const CertificateRequestsSection = ({popUp={popUp}handlePopUpToggle={handlePopUpToggle}applicationId={applicationId}+ applicationName={applicationName}/></Card>);diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateImportModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateImportModal.tsxindex 35a91dec26..56c2530d16 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateImportModal.tsx+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateImportModal.tsx@@ -4,17 +4,8 @@ import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- Modal,- ModalContent,- Select,- SelectItem,- TextArea-} from "@app/components/v2";-import { useProject } from "@app/context";-import { useGetCert, useImportCertificate, useListWorkspacePkiCollections } from "@app/hooks/api";+import { Button, FormControl, Modal, ModalContent, TextArea } from "@app/components/v2";+import { useGetCert, useImportCertificate } from "@app/hooks/api";import { UsePopUpState } from "@app/hooks/usePopUp";import { CertificateContent } from "./CertificateContent";@@ -22,8 +13,7 @@ import { CertificateContent } from "./CertificateContent";const schema = z.object({certificatePem: z.string().trim().min(1, "Certificate PEM is required"),privateKeyPem: z.string().trim().min(1, "Private Key PEM is required"),- chainPem: z.string().trim().min(1, "Certificate Chain PEM is required"),- collectionId: z.string().optional()+ chainPem: z.string().trim().min(1, "Certificate Chain PEM is required")});export type FormData = z.infer<typeof schema>;@@ -46,15 +36,10 @@ type TCertificateDetails = {export const CertificateImportModal = ({ popUp, handlePopUpToggle, applicationId }: Props) => {const [certificateDetails, setCertificateDetails] = useState<TCertificateDetails | null>(null);- const { currentProject } = useProject();const { data: cert } = useGetCert((popUp?.certificateImport?.data as { serialNumber: string })?.serialNumber || "");- const { data } = useListWorkspacePkiCollections({- projectId: currentProject?.id || ""- });-const { mutateAsync: importCertificate } = useImportCertificate();const {@@ -66,17 +51,11 @@ export const CertificateImportModal = ({ popUp, handlePopUpToggle, applicationIdresolver: zodResolver(schema)});- const onFormSubmit = async ({- certificatePem,- privateKeyPem,- chainPem,- collectionId- }: FormData) => {+ const onFormSubmit = async ({ certificatePem, privateKeyPem, chainPem }: FormData) => {const { serialNumber, certificate, certificateChain, privateKey } = await importCertificate({certificatePem,privateKeyPem,chainPem,- pkiCollectionId: collectionId,applicationId});@@ -107,33 +86,6 @@ export const CertificateImportModal = ({ popUp, handlePopUpToggle, applicationId<ModalContent title={`${cert ? "View" : "Import"} Certificate`}>{!certificateDetails ? (<form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="collectionId"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Certificate Collection"- errorText={error?.message}- isError={Boolean(error)}- isOptional- className="mt-4"- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- isDisabled={Boolean(cert)}- >- {(data?.collections || []).map(({ id, name }) => (- <SelectItem value={id} key={`pki-collection-${id}`}>- {name}- </SelectItem>- ))}- </Select>- </FormControl>- )}- /><Controllercontrol={control}defaultValue=""diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsxindex 27c2a85988..5edf075b3b 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx@@ -135,13 +135,15 @@ type Props = {) => void;profileId?: string;applicationId?: string;+ applicationName?: string;};export const CertificateIssuanceModal = ({popUp,handlePopUpToggle,profileId,- applicationId+ applicationId,+ applicationName}: Props) => {const { currentProject } = useProject();const { currentOrg } = useOrganization();@@ -306,7 +308,8 @@ export const CertificateIssuanceModal = ({orgId: currentOrg.id,projectId: currentProject.id,certificateId: response.certificate.certificateId- }+ },+ ...(applicationName && { search: { fromApplication: applicationName } })});}} else if (@@ -582,7 +585,8 @@ export const CertificateIssuanceModal = ({{availableProfiles.length === 0 && applicationId ? (<div className="px-3 py-3 text-xs leading-snug whitespace-normal text-mineshaft-300">Only profiles with API enrollment configured on this Application are- listed here. Configure API enrollment under the Settings tab.+ listed here. Configure API enrollment under this Application's+ Settings tab.</div>) : (availableProfiles.map((profile) => (diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateTemplatesSection.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateTemplatesSection.tsxindex 0d575d164c..8a17981ea3 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateTemplatesSection.tsx+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateTemplatesSection.tsx@@ -84,7 +84,7 @@ export const CertificateTemplatesSection = ({ caId }: Props) => {isOpen={popUp.deleteCertificateTemplate.isOpen}title={`Are you sure you want to delete the certificate template ${(popUp?.deleteCertificateTemplate?.data as { name: string })?.name || ""- } from the project?`}+ }?`}onChange={(isOpen) => handlePopUpToggle("deleteCertificateTemplate", isOpen)}deleteKey="confirm"onDeleteApproved={() =>diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsxindex 48afc5aaea..6f72a7654b 100644--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx@@ -144,7 +144,7 @@ export const CertificatesSection = ({</CardTitle><CardDescription>{applicationId- ? "View, filter, and manage certificates issued through this Application."+ ? "Filter, view, and manage certificates across this application.": "View, filter, and manage all certificates."}</CardDescription>{applicationId && canImportIntoApplication && (@@ -206,7 +206,7 @@ export const CertificatesSection = ({isOpen={popUp.deleteCertificate.isOpen}title={`Are you sure you want to remove the certificate ${(popUp?.deleteCertificate?.data as { commonName: string })?.commonName || ""- } from the project?`}+ }?`}onChange={(isOpen) => handlePopUpToggle("deleteCertificate", isOpen)}deleteKey="confirm"onDeleteApproved={() =>diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsxindex 88102524ab..5fc7f75139 100644--- a/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsx+++ b/frontend/src/pages/cert-manager/CodeSigningPage/components/CreateSignerModal.tsx@@ -137,7 +137,7 @@ export const CreateSignerModal = ({ isOpen, onOpenChange, projectId }: Props) =>label="Certificate"isError={Boolean(error)}errorText={error?.message}- helperText="Only active code signing certificates in the project are shown"+ helperText="Only active code signing certificates in Certificate Manager are shown"><FilterableSelect<CertOption>isLoading={isCertsLoading}@@ -149,7 +149,7 @@ export const CreateSignerModal = ({ isOpen, onOpenChange, projectId }: Props) =>}}placeholder="Search by common name or SAN..."noOptionsMessage={() =>- "No active code signing certificates found in the project"+ "No active code signing certificates found in Certificate Manager"}maxMenuHeight={200}/>diff --git a/frontend/src/pages/cert-manager/DashboardPage/DashboardPage.tsx b/frontend/src/pages/cert-manager/DashboardPage/DashboardPage.tsxindex 190f7b3a5e..74b3dc0ce8 100644--- a/frontend/src/pages/cert-manager/DashboardPage/DashboardPage.tsx+++ b/frontend/src/pages/cert-manager/DashboardPage/DashboardPage.tsx@@ -68,7 +68,7 @@ export const DashboardPage = () => {<PageHeaderscope={ProjectType.CertificateManager}title="Certificate Dashboard"- description="At-a-glance view of your certificate estate."+ description="See the overall state of your certificates at a glance."/><CertManagerAdminOnly><ProjectPermissionCandiff --git a/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsxindex f603aa00e2..1ba9b20101 100644--- a/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryPage/DiscoveryPage.tsx@@ -1,9 +1,9 @@import { Helmet } from "react-helmet";import { useTranslation } from "react-i18next";-import { useSearch } from "@tanstack/react-router";+import { useNavigate, useParams, useSearch } from "@tanstack/react-router";import { ProjectPermissionCan } from "@app/components/permissions";-import { PageHeader } from "@app/components/v2";+import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";import { DocumentationLinkBadge } from "@app/components/v3";import {ProjectPermissionPkiCertificateInstallationActions,@@ -18,6 +18,8 @@ import { DiscoveryJobsTab, InstallationsTab } from "./components";export const DiscoveryPage = () => {const { t } = useTranslation();+ const navigate = useNavigate();+ const { orgId, projectId } = useParams({ strict: false });const { currentProject } = useProject();const { selectedTab } = useSearch({from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/"@@ -25,6 +27,14 @@ export const DiscoveryPage = () => {const activeTab = selectedTab || "jobs";+ const onTabChange = (value: string) => {+ navigate({+ to: "/organizations/$orgId/projects/cert-manager/$projectId/discovery",+ params: { orgId: orgId ?? "", projectId: projectId ?? "" },+ search: { selectedTab: value }+ });+ };+return (<div className="mx-auto flex h-full flex-col justify-between bg-bunker-800 text-white"><Helmet>@@ -44,24 +54,34 @@ export const DiscoveryPage = () => {description="Discover and track SSL/TLS certificates across your infrastructure."/><CertManagerAdminOnly>- {activeTab === "jobs" && (- <ProjectPermissionCan- renderGuardBanner- I={ProjectPermissionPkiDiscoveryActions.Read}- a={ProjectPermissionSub.PkiDiscovery}- >- <DiscoveryJobsTab projectId={currentProject?.id || ""} />- </ProjectPermissionCan>- )}- {activeTab === "installations" && (- <ProjectPermissionCan- renderGuardBanner- I={ProjectPermissionPkiCertificateInstallationActions.Read}- a={ProjectPermissionSub.PkiCertificateInstallations}- >- <InstallationsTab projectId={currentProject?.id || ""} />- </ProjectPermissionCan>- )}+ <Tabs value={activeTab} onValueChange={onTabChange}>+ <TabList>+ <Tab variant="project" value="jobs">+ Jobs+ </Tab>+ <Tab variant="project" value="installations">+ Installations+ </Tab>+ </TabList>+ <TabPanel value="jobs">+ <ProjectPermissionCan+ renderGuardBanner+ I={ProjectPermissionPkiDiscoveryActions.Read}+ a={ProjectPermissionSub.PkiDiscovery}+ >+ <DiscoveryJobsTab projectId={currentProject?.id || ""} />+ </ProjectPermissionCan>+ </TabPanel>+ <TabPanel value="installations">+ <ProjectPermissionCan+ renderGuardBanner+ I={ProjectPermissionPkiCertificateInstallationActions.Read}+ a={ProjectPermissionSub.PkiCertificateInstallations}+ >+ <InstallationsTab projectId={currentProject?.id || ""} />+ </ProjectPermissionCan>+ </TabPanel>+ </Tabs></CertManagerAdminOnly></div></div>diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsxindex 924f6352d6..c873cda678 100644--- a/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryPage/components/DiscoveryJobsTab.tsx@@ -1,37 +1,39 @@import { useEffect, useState } from "react";-import {- faEllipsis,- faMagnifyingGlass,- faPlus,- faSyncAlt-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate } from "@tanstack/react-router";import { format } from "date-fns";+import { MoreHorizontalIcon, PlusIcon, RefreshCwIcon, SearchIcon } from "lucide-react";import { ProjectPermissionCan } from "@app/components/permissions";+import { HoverCard, HoverCardContent, HoverCardTrigger, Tag } from "@app/components/v2";import {Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,DropdownMenu,DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- EmptyState,- HoverCard,- HoverCardContent,- HoverCardTrigger,- Input,+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,+ IconButton,+ InputGroup,+ InputGroupAddon,+ InputGroupInput,Pagination,+ Skeleton,Table,- TableContainer,- TableSkeleton,- Tag,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import {ProjectPermissionPkiDiscoveryActions,ProjectPermissionSub,@@ -151,165 +153,183 @@ export const DiscoveryJobsTab = ({ projectId }: Props) => {};return (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex items-start justify-between">- <div>- <h2 className="text-lg font-semibold">Discovery Jobs</h2>- <p className="text-sm text-mineshaft-400">- Configure and manage scans to discover certificates across your infrastructure.- </p>+ <Card>+ <CardHeader>+ <CardTitle>Discovery Jobs</CardTitle>+ <CardDescription>+ Configure scans to run on a schedule and find certificates on the domains and IP addresses+ you select.+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionPkiDiscoveryActions.Create}+ a={ProjectPermissionSub.PkiDiscovery}+ >+ {(isAllowed) => (+ <Button+ variant="project"+ onClick={() => handlePopUpOpen("createJob")}+ isDisabled={!isAllowed}+ >+ <PlusIcon />+ Add Job+ </Button>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <div className="mb-4">+ <InputGroup>+ <InputGroupAddon>+ <SearchIcon />+ </InputGroupAddon>+ <InputGroupInput+ value={searchFilter}+ onChange={(e) => setSearchFilter(e.target.value)}+ placeholder="Search by name, domain, or IP…"+ />+ </InputGroup></div>- <ProjectPermissionCan- I={ProjectPermissionPkiDiscoveryActions.Create}- a={ProjectPermissionSub.PkiDiscovery}- >- {(isAllowed) => (- <Button- colorSchema="primary"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handlePopUpOpen("createJob")}- isDisabled={!isAllowed}- >- Add Job- </Button>- )}- </ProjectPermissionCan>- </div>- <div className="mb-4">- <Input- value={searchFilter}- onChange={(e) => setSearchFilter(e.target.value)}- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}- placeholder="Search by name, domain, or IP..."- className="flex-1"- />- </div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Target</Th>- <Th>Ports</Th>- <Th>Status</Th>- <Th>Last Scan</Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={6} innerKey="discovery-jobs" />}- {!isPending && discoveries.length === 0 && (- <Tr>- <Td colSpan={6}>- <EmptyState title="No jobs found" />- </Td>- </Tr>- )}- {!isPending &&- discoveries.map((discovery) => (- <Tr- key={discovery.id}- className="cursor-pointer hover:bg-mineshaft-700"- onClick={() =>- navigate({- to: "/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId",- params: {- orgId: currentOrg.id,- projectId,- discoveryId: discovery.id- }- })- }- >- <Td>{discovery.name}</Td>- <Td className="max-w-[200px] truncate">{getTargetDisplay(discovery)}</Td>- <Td>{renderPortsBadges(discovery)}</Td>- <Td>- {getDiscoveryStatusBadge(- discovery.lastScanStatus,- discovery.isActive,- Boolean(discovery.lastScanMessage)- )}- </Td>- <Td>- {discovery.lastScannedAt- ? format(new Date(discovery.lastScannedAt), "MMM dd, yyyy HH:mm")- : "Never"}- </Td>- <Td onClick={(e) => e.stopPropagation()}>- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="plain" colorSchema="secondary" size="xs">- <FontAwesomeIcon icon={faEllipsis} />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <ProjectPermissionCan- I={ProjectPermissionPkiDiscoveryActions.RunScan}- a={ProjectPermissionSub.PkiDiscovery}- >- {(isAllowed) => (- <DropdownMenuItem- isDisabled={- !isAllowed ||- !discovery.isActive ||- discovery.lastScanStatus === PkiDiscoveryScanStatus.Running ||- discovery.lastScanStatus === PkiDiscoveryScanStatus.Pending- }- onClick={() => handleTriggerScan(discovery)}- >- <FontAwesomeIcon icon={faSyncAlt} className="mr-2" />- Run Scan- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionPkiDiscoveryActions.Edit}- a={ProjectPermissionSub.PkiDiscovery}- >- {(isAllowed) => (- <DropdownMenuItem- isDisabled={!isAllowed}- onClick={() => handlePopUpOpen("editJob", discovery)}- >- Edit- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionPkiDiscoveryActions.Delete}- a={ProjectPermissionSub.PkiDiscovery}- >- {(isAllowed) => (- <DropdownMenuItem- isDisabled={!isAllowed}- onClick={() => handlePopUpOpen("deleteJob", discovery)}- >- Delete- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- ))}- </TBody>- </Table>- </TableContainer>+ {/* eslint-disable-next-line no-nested-ternary */}+ {isPending ? (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ ) : discoveries.length === 0 ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>No discovery jobs defined</EmptyTitle>+ <EmptyDescription>+ Define a job to scan domains or IP ranges and surface the certificates running on+ them.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ ) : (+ <>+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Target</TableHead>+ <TableHead>Ports</TableHead>+ <TableHead>Status</TableHead>+ <TableHead>Last Scan</TableHead>+ <TableHead className="w-5" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {discoveries.map((discovery) => (+ <TableRow+ key={discovery.id}+ className="cursor-pointer"+ onClick={() =>+ navigate({+ to: "/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId",+ params: {+ orgId: currentOrg.id,+ projectId,+ discoveryId: discovery.id+ }+ })+ }+ >+ <TableCell>{discovery.name}</TableCell>+ <TableCell className="max-w-[200px] truncate">+ {getTargetDisplay(discovery)}+ </TableCell>+ <TableCell>{renderPortsBadges(discovery)}</TableCell>+ <TableCell>+ {getDiscoveryStatusBadge(+ discovery.lastScanStatus,+ discovery.isActive,+ Boolean(discovery.lastScanMessage)+ )}+ </TableCell>+ <TableCell>+ {discovery.lastScannedAt+ ? format(new Date(discovery.lastScannedAt), "MMM dd, yyyy HH:mm")+ : "Never"}+ </TableCell>+ <TableCell onClick={(e) => e.stopPropagation()}>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <IconButton variant="ghost" size="xs">+ <MoreHorizontalIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <ProjectPermissionCan+ I={ProjectPermissionPkiDiscoveryActions.RunScan}+ a={ProjectPermissionSub.PkiDiscovery}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={+ !isAllowed ||+ !discovery.isActive ||+ discovery.lastScanStatus === PkiDiscoveryScanStatus.Running ||+ discovery.lastScanStatus === PkiDiscoveryScanStatus.Pending+ }+ onClick={() => handleTriggerScan(discovery)}+ >+ <RefreshCwIcon />+ Run Scan+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ <ProjectPermissionCan+ I={ProjectPermissionPkiDiscoveryActions.Edit}+ a={ProjectPermissionSub.PkiDiscovery}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => handlePopUpOpen("editJob", discovery)}+ >+ Edit+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ <ProjectPermissionCan+ I={ProjectPermissionPkiDiscoveryActions.Delete}+ a={ProjectPermissionSub.PkiDiscovery}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => handlePopUpOpen("deleteJob", discovery)}+ >+ Delete+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>- {totalCount > PAGE_SIZE && (- <div className="mt-4 flex justify-end">- <Pagination- count={totalCount}- page={page}- perPage={PAGE_SIZE}- onChangePage={setPage}- onChangePerPage={() => {}}- />- </div>- )}+ {totalCount > PAGE_SIZE && (+ <div className="mt-4 flex justify-end">+ <Pagination+ count={totalCount}+ page={page}+ perPage={PAGE_SIZE}+ onChangePage={setPage}+ onChangePerPage={() => {}}+ />+ </div>+ )}+ </>+ )}+ </CardContent><DiscoveryJobModalisOpen={popUp.createJob.isOpen}@@ -330,6 +350,6 @@ export const DiscoveryJobsTab = ({ projectId }: Props) => {onConfirm={handleDelete}discoveryName={(popUp.deleteJob.data as TPkiDiscovery)?.name || ""}/>- </div>+ </Card>);};diff --git a/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsx b/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsxindex 5fc68184dd..61b5906a8f 100644--- a/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsx+++ b/frontend/src/pages/cert-manager/DiscoveryPage/components/InstallationsTab.tsx@@ -1,28 +1,36 @@import { useEffect, useState } from "react";-import { faEllipsis, faMagnifyingGlass } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate } from "@tanstack/react-router";import { format } from "date-fns";+import { MoreHorizontalIcon, SearchIcon } from "lucide-react";import { ProjectPermissionCan } from "@app/components/permissions";import {- Button,+ Card,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,DropdownMenu,DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- EmptyState,- Input,+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,+ IconButton,+ InputGroup,+ InputGroupAddon,+ InputGroupInput,Pagination,+ Skeleton,Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import {ProjectPermissionPkiCertificateInstallationActions,ProjectPermissionSub,@@ -81,125 +89,140 @@ export const InstallationsTab = ({ projectId }: Props) => {};return (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4">- <div>- <h2 className="text-lg font-semibold">Installations</h2>- <p className="text-sm text-mineshaft-400">- View and manage certificate installations identified by discovery scans.- </p>+ <Card>+ <CardHeader>+ <CardTitle>Installations</CardTitle>+ <CardDescription>+ Every place a certificate was found during a scan, identified by its host and port.+ </CardDescription>+ </CardHeader>+ <CardContent>+ <div className="mb-4">+ <InputGroup>+ <InputGroupAddon>+ <SearchIcon />+ </InputGroupAddon>+ <InputGroupInput+ value={searchFilter}+ onChange={(e) => setSearchFilter(e.target.value)}+ placeholder="Search by name, IP, or domain…"+ />+ </InputGroup></div>- </div>- <div className="mb-4">- <Input- value={searchFilter}- onChange={(e) => setSearchFilter(e.target.value)}- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}- placeholder="Search by name, IP, or domain..."- className="flex-1"- />- </div>-- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Certificate</Th>- <Th>Gateway</Th>- <Th>Certs</Th>- <Th>Last Seen</Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={6} innerKey="installations" />}- {!isPending && installations.length === 0 && (- <Tr>- <Td colSpan={6}>- <EmptyState title="No installations found" />- </Td>- </Tr>++ {/* eslint-disable-next-line no-nested-ternary */}+ {isPending ? (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ ) : installations.length === 0 ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>No installations found</EmptyTitle>+ <EmptyDescription>+ Run a discovery job to surface the certificates currently served across your+ infrastructure.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ ) : (+ <>+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Certificate</TableHead>+ <TableHead>Gateway</TableHead>+ <TableHead>Certs</TableHead>+ <TableHead>Last Seen</TableHead>+ <TableHead className="w-5" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {installations.map((installation) => (+ <TableRow+ key={installation.id}+ className="cursor-pointer"+ onClick={() =>+ navigate({+ to: "/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId",+ params: {+ orgId: currentOrg.id,+ projectId,+ installationId: installation.id+ }+ })+ }+ >+ <TableCell>{installation.name || getEndpoint(installation)}</TableCell>+ <TableCell>+ {installation.primaryCertName || <span className="text-accent">—</span>}+ </TableCell>+ <TableCell>{getGatewayLabel(installation) || "N/A"}</TableCell>+ <TableCell>+ {installation.certificatesCount ?? installation.certificates?.length ?? 0}+ </TableCell>+ <TableCell>+ {format(new Date(installation.lastSeenAt), "MMM dd, yyyy HH:mm")}+ </TableCell>+ <TableCell onClick={(e) => e.stopPropagation()}>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <IconButton variant="ghost" size="xs">+ <MoreHorizontalIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <ProjectPermissionCan+ I={ProjectPermissionPkiCertificateInstallationActions.Edit}+ a={ProjectPermissionSub.PkiCertificateInstallations}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => handlePopUpOpen("editInstallation", installation)}+ >+ Edit+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ <ProjectPermissionCan+ I={ProjectPermissionPkiCertificateInstallationActions.Delete}+ a={ProjectPermissionSub.PkiCertificateInstallations}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => handlePopUpOpen("deleteInstallation", installation)}+ >+ Delete+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>++ {totalCount > PAGE_SIZE && (+ <div className="mt-4 flex justify-end">+ <Pagination+ count={totalCount}+ page={page}+ perPage={PAGE_SIZE}+ onChangePage={setPage}+ onChangePerPage={() => {}}+ />+ </div>)}- {!isPending &&- installations.map((installation) => (- <Tr- key={installation.id}- className="cursor-pointer hover:bg-mineshaft-700"- onClick={() =>- navigate({- to: "/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId",- params: {- orgId: currentOrg.id,- projectId,- installationId: installation.id- }- })- }- >- <Td>{installation.name || getEndpoint(installation)}</Td>- <Td>- {installation.primaryCertName || <span className="text-mineshaft-400">-</span>}- </Td>- <Td>{getGatewayLabel(installation) || "N/A"}</Td>- <Td>- {installation.certificatesCount ?? installation.certificates?.length ?? 0}- </Td>- <Td>{format(new Date(installation.lastSeenAt), "MMM dd, yyyy HH:mm")}</Td>- <Td onClick={(e) => e.stopPropagation()}>- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="plain" colorSchema="secondary" size="xs">- <FontAwesomeIcon icon={faEllipsis} />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <ProjectPermissionCan- I={ProjectPermissionPkiCertificateInstallationActions.Edit}- a={ProjectPermissionSub.PkiCertificateInstallations}- >- {(isAllowed) => (- <DropdownMenuItem- isDisabled={!isAllowed}- onClick={() => handlePopUpOpen("editInstallation", installation)}- >- Edit- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionPkiCertificateInstallationActions.Delete}- a={ProjectPermissionSub.PkiCertificateInstallations}- >- {(isAllowed) => (- <DropdownMenuItem- isDisabled={!isAllowed}- onClick={() => handlePopUpOpen("deleteInstallation", installation)}- >- Delete- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- ))}- </TBody>- </Table>- </TableContainer>-- {totalCount > PAGE_SIZE && (- <div className="mt-4 flex justify-end">- <Pagination- count={totalCount}- page={page}- perPage={PAGE_SIZE}- onChangePage={setPage}- onChangePerPage={() => {}}- />- </div>- )}+ </>+ )}+ </CardContent><EditInstallationModalisOpen={popUp.editInstallation.isOpen}@@ -219,6 +242,6 @@ export const InstallationsTab = ({ projectId }: Props) => {"this installation"}/>- </div>+ </Card>);};diff --git a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsxindex 188d9fcb3c..a966839e3a 100644--- a/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx+++ b/frontend/src/pages/cert-manager/IntegrationsListPage/components/PkiSyncsTab/PkiSyncTable/PkiSyncRow.tsx@@ -140,7 +140,7 @@ export const PkiSyncRow = ({});}}className={twMerge(- "group h-10 transition-colors duration-100 hover:bg-mineshaft-700",+ "group h-14 transition-colors duration-100 hover:bg-mineshaft-700 [&>td]:py-2",syncStatus === PkiSyncStatus.Failed && "bg-red/5 hover:bg-red/10",isAllowed ? "cursor-pointer" : "cursor-not-allowed")}diff --git a/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsx b/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsxindex 5d024c30c8..bb21ab69b8 100644--- a/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsx+++ b/frontend/src/pages/cert-manager/InventoryPage/InventoryPage.tsx@@ -102,7 +102,7 @@ export const InventoryPage = () => {<PageHeaderscope={ProjectType.CertificateManager}title="Inventory"- description="All certificates across this Certificate Manager instance — filter, view, and inspect."+ description="Filter, view, and inspect all certificates across your infrastructure."/><CertManagerAdminOnly>{canReadCertificates ? (diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsxindex 0bc97c225f..9b7ce6341e 100644--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx@@ -1,11 +1,19 @@import { useState } from "react";-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { PlusIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { DocumentationLinkBadge } from "@app/components/v3";+import { DeleteActionModal } from "@app/components/v2";+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ DocumentationLinkBadge+} from "@app/components/v3";import {ProjectPermissionCertificatePolicyActions,ProjectPermissionSub@@ -24,10 +32,6 @@ export const CertificatePoliciesTab = () => {const deletePolicy = useDeleteCertificatePolicy();- const handleCreatePolicy = () => {- setIsCreateModalOpen(true);- };-const handleEditPolicy = (policy: TCertificatePolicy) => {setSelectedPolicy(policy);setIsEditModalOpen(true);@@ -53,38 +57,38 @@ export const CertificatePoliciesTab = () => {};return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex items-center justify-between">- <div>- <div className="flex items-center gap-x-2">- <h2 className="text-xl font-semibold text-mineshaft-100">Certificate Policies</h2>- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/certificates/policies" />- </div>- <p className="text-sm text-bunker-300">- Define certificate policies, validation rules, and attribute constraints for certificate- issuance- </p>- </div>-- <ProjectPermissionCan- I={ProjectPermissionCertificatePolicyActions.Create}- a={ProjectPermissionSub.CertificatePolicies}- >- {(isAllowed) => (- <Button- isDisabled={!isAllowed}- colorSchema="primary"- type="button"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={handleCreatePolicy}- >- Create Policy- </Button>- )}- </ProjectPermissionCan>- </div>-- <PolicyList onEditPolicy={handleEditPolicy} onDeletePolicy={handleDeletePolicy} />+ <Card>+ <CardHeader>+ <CardTitle>+ Certificate Policies+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/certificates/policies" />+ </CardTitle>+ <CardDescription>+ The rules applied when certificates are issued. Policies set things like which algorithms+ are allowed, how the certificate can be used, how long it stays valid, and what identity+ information it includes.+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionCertificatePolicyActions.Create}+ a={ProjectPermissionSub.CertificatePolicies}+ >+ {(isAllowed) => (+ <Button+ variant="project"+ isDisabled={!isAllowed}+ onClick={() => setIsCreateModalOpen(true)}+ >+ <PlusIcon />+ Create Policy+ </Button>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <PolicyList onEditPolicy={handleEditPolicy} onDeletePolicy={handleDeletePolicy} />+ </CardContent><CreatePolicyModalisOpen={isCreateModalOpen}@@ -117,6 +121,6 @@ export const CertificatePoliciesTab = () => {/></>)}- </div>+ </Card>);};diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsxindex fbc039028e..51bfad86fc 100644--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx@@ -17,17 +17,21 @@ import {DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr+ Tooltip} from "@app/components/v2";+import {+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,+ Skeleton,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import { useProject } from "@app/context";import {ProjectPermissionCertificatePolicyActions,@@ -71,116 +75,121 @@ export const PolicyList = ({ onEditPolicy, onDeletePolicy }: Props) => {return null;}- const formatDate = (dateString: string) => {- return new Date(dateString).toLocaleDateString();- };+ const formatDate = (dateString: string) => new Date(dateString).toLocaleDateString();- const hasPolicies = !isLoading && policies && policies.length > 0;+ if (isLoading) {+ return (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ );+ }++ if (!policies || policies.length === 0) {+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>No existing certificate policies</EmptyTitle>+ <EmptyDescription>+ Create a policy to set the rules your certificates must follow when issued.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ );+ }return (- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Created</Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isLoading && <TableSkeleton columns={3} innerKey="certificate-policies" />}- {!isLoading && (!policies || policies.length === 0) && (- <Tr>- <Td colSpan={3}>- <EmptyState title="No Certificate Policies" />- </Td>- </Tr>- )}- {hasPolicies &&- policies.map((policy) => (- <Tr- key={policy.id}- className="h-10 transition-colors duration-100 hover:bg-mineshaft-700"- >- <Td>- <div className="flex items-center gap-2">- <div className="text-mineshaft-300">{policy.name}</div>- {policy.description && (- <Tooltip content={policy.description}>- <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />- </Tooltip>- )}+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Created</TableHead>+ <TableHead className="w-5" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {policies.map((policy) => (+ <TableRow key={policy.id}>+ <TableCell>+ <div className="flex items-center gap-2">+ <div className="text-mineshaft-200">{policy.name}</div>+ {policy.description && (+ <Tooltip content={policy.description}>+ <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />+ </Tooltip>+ )}+ </div>+ </TableCell>+ <TableCell>+ <span className="text-sm text-accent">{formatDate(policy.createdAt)}</span>+ </TableCell>+ <TableCell className="text-right">+ <DropdownMenu>+ <DropdownMenuTrigger asChild className="rounded-lg">+ <div className="hover:text-primary-400 data-[state=open]:text-primary-400">+ <Tooltip content="More options">+ <FontAwesomeIcon size="lg" icon={faEllipsis} />+ </Tooltip></div>- </Td>- <Td>- <span className="text-sm text-bunker-300">{formatDate(policy.createdAt)}</span>- </Td>- <Td className="text-right">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- handleCopyId(policy.id);- }}- icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} />}- >- Copy Policy ID- </DropdownMenuItem>- <ProjectPermissionCan- I={ProjectPermissionCertificatePolicyActions.Edit}- a={subject(ProjectPermissionSub.CertificatePolicies, {- name: policy.name- })}- >- {(isAllowed) =>- isAllowed && (- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- onEditPolicy(policy);- }}- icon={<FontAwesomeIcon icon={faEdit} />}- >- Edit Policy- </DropdownMenuItem>- )- }- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionCertificatePolicyActions.Delete}- a={subject(ProjectPermissionSub.CertificatePolicies, {- name: policy.name- })}- >- {(isAllowed) =>- isAllowed && (- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- onDeletePolicy(policy);- }}- icon={<FontAwesomeIcon icon={faTrash} />}- >- Delete Policy- </DropdownMenuItem>- )- }- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- ))}- </TBody>- </Table>- </TableContainer>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start" className="p-1">+ <DropdownMenuItem+ onClick={(e) => {+ e.stopPropagation();+ handleCopyId(policy.id);+ }}+ icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} />}+ >+ Copy Policy ID+ </DropdownMenuItem>+ <ProjectPermissionCan+ I={ProjectPermissionCertificatePolicyActions.Edit}+ a={subject(ProjectPermissionSub.CertificatePolicies, {+ name: policy.name+ })}+ >+ {(isAllowed) =>+ isAllowed && (+ <DropdownMenuItem+ onClick={(e) => {+ e.stopPropagation();+ onEditPolicy(policy);+ }}+ icon={<FontAwesomeIcon icon={faEdit} />}+ >+ Edit Policy+ </DropdownMenuItem>+ )+ }+ </ProjectPermissionCan>+ <ProjectPermissionCan+ I={ProjectPermissionCertificatePolicyActions.Delete}+ a={subject(ProjectPermissionSub.CertificatePolicies, {+ name: policy.name+ })}+ >+ {(isAllowed) =>+ isAllowed && (+ <DropdownMenuItem+ onClick={(e) => {+ e.stopPropagation();+ onDeletePolicy(policy);+ }}+ icon={<FontAwesomeIcon icon={faTrash} />}+ >+ Delete Policy+ </DropdownMenuItem>+ )+ }+ </ProjectPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>+ ))}+ </TableBody>+ </Table>);};diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsxindex c0cd0a2416..86347f8053 100644--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CertificateProfilesTab.tsx@@ -1,12 +1,20 @@import { useState } from "react";-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { PlusIcon } from "lucide-react";import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";import { createNotification } from "@app/components/notifications";import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { DocumentationLinkBadge } from "@app/components/v3";+import { DeleteActionModal } from "@app/components/v2";+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ DocumentationLinkBadge+} from "@app/components/v3";import {ProjectPermissionCertificateProfileActions,ProjectPermissionSub@@ -31,10 +39,6 @@ export const CertificateProfilesTab = () => {const deleteProfile = useDeleteCertificateProfile();- const handleCreateProfile = () => {- setIsCreateModalOpen(true);- };-const handleEditProfile = (profile: TCertificateProfileWithDetails) => {setSelectedProfile(profile);setIsEditModalOpen(true);@@ -60,37 +64,37 @@ export const CertificateProfilesTab = () => {};return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex items-center justify-between">- <div>- <div className="flex items-center gap-x-2">- <h2 className="text-xl font-semibold text-mineshaft-100">Certificate Profiles</h2>- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/certificates/profiles" />- </div>- <p className="text-sm text-bunker-300">- Unified certificate issuance configurations combining CAs and certificate policies- </p>- </div>-- <ProjectPermissionCan- I={ProjectPermissionCertificateProfileActions.Create}- a={ProjectPermissionSub.CertificateProfiles}- >- {(isAllowed) => (- <Button- isDisabled={!isAllowed}- colorSchema="primary"- type="button"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={handleCreateProfile}- >- Create Profile- </Button>- )}- </ProjectPermissionCan>- </div>-- <ProfileList onEditProfile={handleEditProfile} onDeleteProfile={handleDeleteProfile} />+ <Card>+ <CardHeader>+ <CardTitle>+ Certificate Profiles+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pki/certificates/profiles" />+ </CardTitle>+ <CardDescription>+ Reusable presets for issuing certificates. Each profile combines a certificate authority+ (who signs the certificate) with a policy (the rules and settings applied).+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionCertificateProfileActions.Create}+ a={ProjectPermissionSub.CertificateProfiles}+ >+ {(isAllowed) => (+ <Button+ variant="project"+ isDisabled={!isAllowed}+ onClick={() => setIsCreateModalOpen(true)}+ >+ <PlusIcon />+ Create Profile+ </Button>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <ProfileList onEditProfile={handleEditProfile} onDeleteProfile={handleDeleteProfile} />+ </CardContent><CreateProfileModal isOpen={isCreateModalOpen} onClose={() => setIsCreateModalOpen(false)} /><UpgradePlanModal@@ -126,6 +130,6 @@ export const CertificateProfilesTab = () => {/></>)}- </div>+ </Card>);};diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsxindex 23564cbf6e..90e463780f 100644--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/CreateProfileModal.tsx@@ -1105,6 +1105,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }render={({ field: { onChange, ...field }, fieldState: { error } }) => (<FormControllabel="Issuer Type"+ tooltipText="Choose how certificates are signed. Certificate Authority issues from an existing CA in this project — the standard production path. Self-Signed produces standalone certificates with no CA chain — for tests or one-off identities only."isRequiredisError={Boolean(error)}errorText={error?.message}@@ -1239,6 +1240,7 @@ export const CreateProfileModal = ({ isOpen, onClose, profile, mode = "create" }render={({ field: { onChange, value }, fieldState: { error } }) => (<FormControllabel="Certificate Policy"+ tooltipText="The rules that govern certificates issued from this profile — allowed key/signature algorithms, key usages, TTL bounds, and subject constraints. Pick an existing policy or create a new one to enforce your organization's standards."isRequiredisError={Boolean(error)}errorText={error?.message}diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileList.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileList.tsxindex 6750ba450d..85c904904a 100644--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileList.tsx+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileList.tsx@@ -1,14 +1,15 @@import {- EmptyState,+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,+ Skeleton,Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";+ TableBody,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";import { useProject } from "@app/context";import {TCertificateProfileWithDetails,@@ -35,61 +36,57 @@ export const ProfileList = ({ onEditProfile, onDeleteProfile }: Props) => {if (!currentProject?.id) {return (- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Issuing CA</Th>- <Th>Certificate Policy</Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- <Tr>- <Td colSpan={4}>- <EmptyState title="No Project Selected" />- </Td>- </Tr>- </TBody>- </Table>- </TableContainer>+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>Certificate Manager is not set up</EmptyTitle>+ </EmptyHeader>+ </Empty>+ );+ }++ if (isLoading) {+ return (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ );+ }++ if (!profiles || profiles.length === 0) {+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>No existing certificate profiles</EmptyTitle>+ <EmptyDescription>+ Create your first profile to start issuing certificates on an Application.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>);}return (- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Issuing CA</Th>- <Th>Certificate Policy</Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isLoading && <TableSkeleton columns={4} innerKey="certificate-profiles" />}- {!isLoading && (!profiles || profiles.length === 0) && (- <Tr>- <Td colSpan={4}>- <EmptyState title="No Certificate Profiles" />- </Td>- </Tr>- )}- {!isLoading &&- profiles &&- profiles.length > 0 &&- profiles.map((profile) => (- <ProfileRow- key={profile.id}- profile={profile}- onEditProfile={onEditProfile}- onDeleteProfile={onDeleteProfile}- />- ))}- </TBody>- </Table>- </TableContainer>+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead>Name</TableHead>+ <TableHead>Issuing CA</TableHead>+ <TableHead>Certificate Policy</TableHead>+ <TableHead className="w-5" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {profiles.map((profile) => (+ <ProfileRow+ key={profile.id}+ profile={profile}+ onEditProfile={onEditProfile}+ onDeleteProfile={onDeleteProfile}+ />+ ))}+ </TableBody>+ </Table>);};diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsxindex d1d7edf15e..d48d2fa6e4 100644--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx@@ -18,10 +18,9 @@ import {DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- Td,- Tooltip,- Tr+ Tooltip} from "@app/components/v2";+import { TableCell, TableRow } from "@app/components/v3";import {ProjectPermissionCertificateProfileActions,ProjectPermissionSub@@ -60,8 +59,8 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =});return (- <Tr key={profile.id} className="h-10 transition-colors duration-100 hover:bg-mineshaft-700">- <Td>+ <TableRow key={profile.id}>+ <TableCell><div className="flex items-center gap-2"><div className="text-mineshaft-300">{profile.slug}</div>{profile.description && (@@ -70,8 +69,8 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =</Tooltip>)}</div>- </Td>- <Td className="text-start">+ </TableCell>+ <TableCell className="text-start"><span className="text-sm text-mineshaft-300">{profile.issuerType === IssuerType.SELF_SIGNED? "Self-signed"@@ -81,13 +80,13 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =caData?.configuration.commonName ||profile.caId}</span>- </Td>- <Td>+ </TableCell>+ <TableCell><span className="text-sm text-mineshaft-300">{policyData?.name || profile.certificatePolicyId}</span>- </Td>- <Td className="text-right">+ </TableCell>+ <TableCell className="text-right"><DropdownMenu><DropdownMenuTrigger asChild className="rounded-lg"><div className="hover:text-primary-400 data-[state=open]:text-primary-400">@@ -141,7 +140,7 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =</ProjectPermissionCan></DropdownMenuContent></DropdownMenu>- </Td>- </Tr>+ </TableCell>+ </TableRow>);};diff --git a/frontend/src/pages/cert-manager/RequestsPage/RequestsPage.tsx b/frontend/src/pages/cert-manager/RequestsPage/RequestsPage.tsxindex 8f73a93fb2..f9754bbc7a 100644--- a/frontend/src/pages/cert-manager/RequestsPage/RequestsPage.tsx+++ b/frontend/src/pages/cert-manager/RequestsPage/RequestsPage.tsx@@ -224,7 +224,7 @@ export const RequestsPage = () => {<PageHeaderscope={ProjectType.CertificateManager}title="Approval Requests"- description="Requests for certificate issuance and code signing across your Applications and Signers."+ description="Review pending requests for certificate issuance and code signing."/><Tabs@@ -251,7 +251,7 @@ export const RequestsPage = () => {<CardHeader><CardTitle>Application Requests</CardTitle><CardDescription>- Cert-request approval workflows triggered by an Application policy.+ Pending certificate-issuance requests from your Applications.</CardDescription></CardHeader><CardContent>@@ -344,7 +344,7 @@ export const RequestsPage = () => {return (<TableRowkey={r.id}- className="cursor-pointer"+ className="cursor-pointer [&>td]:py-3"onClick={() =>navigate({to: "/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId",@@ -409,7 +409,7 @@ export const RequestsPage = () => {<CardHeader><CardTitle>Signing Requests</CardTitle><CardDescription>- Code-signing approval workflows triggered by a Signer policy.+ Pending code-signing requests from your Signers.</CardDescription></CardHeader><CardContent>@@ -496,7 +496,7 @@ export const RequestsPage = () => {return (<TableRowkey={r.id}- className="cursor-pointer"+ className="cursor-pointer [&>td]:py-3"onClick={() =>navigate({to: "/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId",diff --git a/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx b/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsxindex a649ba7097..b49b6ec16d 100644--- a/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx+++ b/frontend/src/pages/cert-manager/SettingsPage/SettingsPage.tsx@@ -3,24 +3,23 @@ import { useNavigate, useParams, useSearch } from "@tanstack/react-router";import { ProjectPermissionCan } from "@app/components/permissions";import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";+import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";import {ProjectPermissionAppConnectionActions,ProjectPermissionCertificatePolicyActions,ProjectPermissionCertificateProfileActions} from "@app/context/ProjectPermissionContext/types";import { ProjectType } from "@app/hooks/api/projects/types";-import { AppConnectionsTable } from "@app/pages/organization/AppConnections/AppConnectionsPage/components";import { CaSection, ExternalCaSection } from "../CertificateAuthoritiesPage/components";import { CertificatePoliciesTab, CertificateProfilesTab } from "../PoliciesPage/components";+import { AppConnectionsTab } from "./components/AppConnectionsTab";import { CertificateCleanupTab } from "./components/CertificateCleanupTab";export const SettingsPage = () => {const { orgId, projectId } = useParams({ strict: false });const search = useSearch({ strict: false }) as { selectedTab?: string };const navigate = useNavigate();- const { currentProject } = useProject();const activeTab = search.selectedTab ?? "certificate-profiles";return (@@ -100,10 +99,7 @@ export const SettingsPage = () => {I={ProjectPermissionAppConnectionActions.Read}a={ProjectPermissionSub.AppConnections}>- <AppConnectionsTable- projectId={currentProject.id}- projectType={currentProject.type}- />+ <AppConnectionsTab /></ProjectPermissionCan></TabPanel>diff --git a/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/AppConnectionRow.tsx b/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/AppConnectionRow.tsxnew file mode 100644index 0000000000..3f5b77b80d--- /dev/null+++ b/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/AppConnectionRow.tsx@@ -0,0 +1,214 @@+import { useCallback } from "react";+import { subject } from "@casl/ability";+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import {+ AsteriskIcon,+ CheckIcon,+ CopyIcon,+ InfoIcon,+ MoreHorizontalIcon,+ PauseIcon,+ PencilIcon,+ PlayIcon,+ RotateCwIcon,+ ServerIcon,+ Trash2Icon+} from "lucide-react";++import { createNotification } from "@app/components/notifications";+import { ProjectPermissionCan } from "@app/components/permissions";+import { Tooltip } from "@app/components/v2";+import {+ Badge,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+ IconButton,+ TableCell,+ TableRow+} from "@app/components/v3";+import { ProjectPermissionSub } from "@app/context";+import { ProjectPermissionAppConnectionActions } from "@app/context/ProjectPermissionContext/types";+import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";+import { useToggle } from "@app/hooks";+import { TAppConnection } from "@app/hooks/api/appConnections";+import { CrededentialRotationStatusBadge } from "@app/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/shared/CrededentialRotationBadge";++type Props = {+ appConnection: TAppConnection;+ onDelete: (appConnection: TAppConnection) => void;+ onEditCredentials: (appConnection: TAppConnection) => void;+ onEditDetails: (appConnection: TAppConnection) => void;+ onRotateCredentials: (appConnection: TAppConnection) => void;+ onToggleAutoRotation: (appConnection: TAppConnection) => void;+};++export const AppConnectionRow = ({+ appConnection,+ onDelete,+ onEditCredentials,+ onEditDetails,+ onRotateCredentials,+ onToggleAutoRotation+}: Props) => {+ const {+ id,+ name,+ method,+ app,+ description,+ isPlatformManagedCredentials,+ isAutoRotationEnabled+ } = appConnection;++ const [isIdCopied, setIsIdCopied] = useToggle(false);++ const handleCopyId = useCallback(() => {+ setIsIdCopied.on();+ navigator.clipboard.writeText(id);+ createNotification({ text: "Connection ID copied to clipboard", type: "info" });+ setTimeout(() => setIsIdCopied.off(), 2000);+ }, [id, setIsIdCopied]);++ const methodDetails = getAppConnectionMethodDetails(method);+ const connectionDetails = APP_CONNECTION_MAP[app];++ return (+ <TableRow key={`app-connection-${id}`}>+ <TableCell>+ <div className="flex items-center gap-2">+ <div className="relative">+ <img+ alt={`${connectionDetails.name} integration`}+ src={`/images/integrations/${connectionDetails.image}`}+ className="mr-0.5 w-5"+ />+ {connectionDetails.icon && (+ <FontAwesomeIcon+ icon={connectionDetails.icon}+ size="xs"+ className="absolute -right-0.5 -bottom-0.5 text-primary-700"+ />+ )}+ </div>+ <span>{connectionDetails.name}</span>+ </div>+ </TableCell>+ <TableCell isTruncatable>+ <div className="flex items-center gap-1.5">+ <span className="truncate">{name}</span>+ {description && (+ <Tooltip content={description}>+ <InfoIcon className="text-accent" />+ </Tooltip>+ )}+ </div>+ </TableCell>+ <TableCell isTruncatable>+ <div className="flex items-center gap-1.5">+ <FontAwesomeIcon icon={methodDetails.icon} className="text-accent" />+ <span className="truncate">{methodDetails.name}</span>+ </div>+ </TableCell>+ <TableCell className="text-right">+ <div className="flex items-center justify-end gap-2">+ {isPlatformManagedCredentials && (+ <Tooltip side="left" content="This connection's credentials are managed by Infisical.">+ <div>+ <Badge variant="info">+ <ServerIcon />+ Platform Managed+ </Badge>+ </div>+ </Tooltip>+ )}+ {appConnection.rotation && (+ <CrededentialRotationStatusBadge appConnection={appConnection} />+ )}+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <IconButton variant="ghost" size="xs">+ <MoreHorizontalIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem onClick={() => handleCopyId()}>+ {isIdCopied ? <CheckIcon /> : <CopyIcon />}+ Copy Connection ID+ </DropdownMenuItem>+ <ProjectPermissionCan+ I={ProjectPermissionAppConnectionActions.Edit}+ a={subject(ProjectPermissionSub.AppConnections, { connectionId: id })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => onEditDetails(appConnection)}+ >+ <PencilIcon />+ Edit Details+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ <ProjectPermissionCan+ I={ProjectPermissionAppConnectionActions.Edit}+ a={subject(ProjectPermissionSub.AppConnections, { connectionId: id })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => onEditCredentials(appConnection)}+ >+ <AsteriskIcon />+ {isPlatformManagedCredentials ? "View" : "Edit"} Credentials+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ {appConnection.rotation && (+ <ProjectPermissionCan+ I={ProjectPermissionAppConnectionActions.Edit}+ a={subject(ProjectPermissionSub.AppConnections, { connectionId: id })}+ >+ {(isAllowed) => (+ <>+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => onRotateCredentials(appConnection)}+ >+ <RotateCwIcon />+ Rotate Credentials+ </DropdownMenuItem>+ <DropdownMenuItem+ isDisabled={!isAllowed}+ onClick={() => onToggleAutoRotation(appConnection)}+ >+ {isAutoRotationEnabled ? <PauseIcon /> : <PlayIcon />}+ {isAutoRotationEnabled ? "Disable" : "Enable"} Auto-Rotation+ </DropdownMenuItem>+ </>+ )}+ </ProjectPermissionCan>+ )}+ <ProjectPermissionCan+ I={ProjectPermissionAppConnectionActions.Delete}+ a={subject(ProjectPermissionSub.AppConnections, { connectionId: id })}+ >+ {(isAllowed) => (+ <DropdownMenuItem+ isDisabled={!isAllowed}+ variant="danger"+ onClick={() => onDelete(appConnection)}+ >+ <Trash2Icon />+ Delete Connection+ </DropdownMenuItem>+ )}+ </ProjectPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ </TableCell>+ </TableRow>+ );+};diff --git a/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/AppConnectionsTab.tsx b/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/AppConnectionsTab.tsxnew file mode 100644index 0000000000..d7ae5a3cad--- /dev/null+++ b/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/AppConnectionsTab.tsx@@ -0,0 +1,407 @@+import { useMemo, useState } from "react";+import { ArrowDownIcon, ArrowUpIcon, FilterIcon, PlusIcon, SearchIcon } from "lucide-react";+import { twMerge } from "tailwind-merge";++import { createNotification } from "@app/components/notifications";+import { ProjectPermissionCan } from "@app/components/permissions";+import {+ Button,+ Card,+ CardAction,+ CardContent,+ CardDescription,+ CardHeader,+ CardTitle,+ DocumentationLinkBadge,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuTrigger,+ Empty,+ EmptyDescription,+ EmptyHeader,+ EmptyTitle,+ IconButton,+ InputGroup,+ InputGroupAddon,+ InputGroupInput,+ Pagination,+ Skeleton,+ Table,+ TableBody,+ TableHead,+ TableHeader,+ TableRow+} from "@app/components/v3";+import { ProjectPermissionSub, useProject } from "@app/context";+import { ProjectPermissionAppConnectionActions } from "@app/context/ProjectPermissionContext/types";+import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";+import {+ getUserTablePreference,+ PreferenceKey,+ setUserTablePreference+} from "@app/helpers/userTablePreferences";+import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks";+import {+ TAppConnection,+ useListAppConnections,+ useRotateAppConnectionCredentials,+ useUpdateAppConnection+} from "@app/hooks/api/appConnections";+import { AppConnection } from "@app/hooks/api/appConnections/enums";+import { OrderByDirection } from "@app/hooks/api/generic/types";+import { AddAppConnectionModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components/AddAppConnectionModal";+import { DeleteAppConnectionModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components/DeleteAppConnectionModal";+import { EditAppConnectionCredentialsModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components/EditAppConnectionCredentialsModal";+import { EditAppConnectionDetailsModal } from "@app/pages/organization/AppConnections/AppConnectionsPage/components/EditAppConnectionDetailsModal";++import { AppConnectionRow } from "./AppConnectionRow";++enum AppConnectionsOrderBy {+ App = "app",+ Name = "name",+ Method = "method"+}++type AppConnectionFilters = {+ apps: AppConnection[];+};++export const AppConnectionsTab = () => {+ const { currentProject } = useProject();+ const projectId = currentProject.id;+ const projectType = currentProject.type;++ const { isPending, data: appConnections = [] } = useListAppConnections(projectId);+ const rotateCredentials = useRotateAppConnectionCredentials();+ const updateAppConnection = useUpdateAppConnection();++ const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([+ "addConnection",+ "deleteConnection",+ "editCredentials",+ "editDetails"+ ] as const);++ const [filters, setFilters] = useState<AppConnectionFilters>({ apps: [] });++ const {+ search,+ setSearch,+ setPage,+ page,+ perPage,+ setPerPage,+ offset,+ orderDirection,+ toggleOrderDirection,+ orderBy,+ setOrderDirection,+ setOrderBy+ } = usePagination<AppConnectionsOrderBy>(AppConnectionsOrderBy.App, {+ initPerPage: getUserTablePreference("appConnectionsTable", PreferenceKey.PerPage, 20)+ });++ const handlePerPageChange = (newPerPage: number) => {+ setPerPage(newPerPage);+ setUserTablePreference("appConnectionsTable", PreferenceKey.PerPage, newPerPage);+ };++ const filteredAppConnections = useMemo(+ () =>+ appConnections+ .filter((appConnection) => {+ const { app, method, name } = appConnection;++ if (filters.apps.length && !filters.apps.includes(app)) return false;++ const searchValue = search.trim().toLowerCase();+ return (+ APP_CONNECTION_MAP[app].name.toLowerCase().includes(searchValue) ||+ getAppConnectionMethodDetails(method).name.toLowerCase().includes(searchValue) ||+ name.toLowerCase().includes(searchValue)+ );+ })+ .sort((a, b) => {+ const [one, two] = orderDirection === OrderByDirection.ASC ? [a, b] : [b, a];++ switch (orderBy) {+ case AppConnectionsOrderBy.Name:+ return one.name.toLowerCase().localeCompare(two.name.toLowerCase());+ case AppConnectionsOrderBy.Method:+ return getAppConnectionMethodDetails(one.method)+ .name.toLowerCase()+ .localeCompare(getAppConnectionMethodDetails(two.method).name.toLowerCase());+ case AppConnectionsOrderBy.App:+ default:+ return APP_CONNECTION_MAP[one.app].name+ .toLowerCase()+ .localeCompare(APP_CONNECTION_MAP[two.app].name.toLowerCase());+ }+ }),+ [appConnections, orderDirection, search, orderBy, filters]+ );++ useResetPageHelper({ totalCount: filteredAppConnections.length, offset, setPage });++ const handleSort = (column: AppConnectionsOrderBy) => {+ if (column === orderBy) {+ toggleOrderDirection();+ return;+ }+ setOrderBy(column);+ setOrderDirection(OrderByDirection.ASC);+ };++ const sortIcon = (column: AppConnectionsOrderBy) => {+ if (orderBy !== column) return <ArrowDownIcon className="opacity-30" />;+ return orderDirection === OrderByDirection.DESC ? <ArrowUpIcon /> : <ArrowDownIcon />;+ };++ const isTableFiltered = Boolean(filters.apps.length);++ const handleDelete = (appConnection: TAppConnection) =>+ handlePopUpOpen("deleteConnection", appConnection);++ const handleEditCredentials = (appConnection: TAppConnection) =>+ handlePopUpOpen("editCredentials", appConnection);++ const handleEditDetails = (appConnection: TAppConnection) =>+ handlePopUpOpen("editDetails", appConnection);++ const handleRotateCredentials = (appConnection: TAppConnection) => {+ rotateCredentials.mutate(+ { connectionId: appConnection.id, app: appConnection.app, projectId },+ {+ onSuccess: () => {+ createNotification({+ text: "Credential rotation has been triggered",+ type: "success"+ });+ },+ onError: (error) => {+ createNotification({+ text: `Failed to trigger credential rotation: ${error.message}`,+ type: "error"+ });+ }+ }+ );+ };++ const handleToggleAutoRotation = (appConnection: TAppConnection) => {+ const enabling = !appConnection.isAutoRotationEnabled;+ updateAppConnection.mutate(+ {+ connectionId: appConnection.id,+ app: appConnection.app,+ isAutoRotationEnabled: enabling+ },+ {+ onSuccess: () => {+ createNotification({+ text: `Auto-rotation ${enabling ? "enabled" : "disabled"}`,+ type: "success"+ });+ }+ }+ );+ };++ const visibleConnections = filteredAppConnections.slice(offset, perPage * page);++ return (+ <Card>+ <CardHeader>+ <CardTitle>+ App Connections+ <DocumentationLinkBadge href="https://infisical.com/docs/integrations/app-connections/overview" />+ </CardTitle>+ <CardDescription>+ Connect third-party services that issue, sign, or distribute certificates managed by this+ project.+ </CardDescription>+ <CardAction>+ <ProjectPermissionCan+ I={ProjectPermissionAppConnectionActions.Create}+ a={ProjectPermissionSub.AppConnections}+ >+ {(isAllowed) => (+ <Button+ variant="project"+ isDisabled={!isAllowed}+ onClick={() => handlePopUpOpen("addConnection")}+ >+ <PlusIcon />+ Add Connection+ </Button>+ )}+ </ProjectPermissionCan>+ </CardAction>+ </CardHeader>+ <CardContent>+ <div className="mb-4 flex items-center gap-2">+ <InputGroup className="flex-1">+ <InputGroupAddon>+ <SearchIcon />+ </InputGroupAddon>+ <InputGroupInput+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ placeholder="Search connections..."+ />+ </InputGroup>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <IconButton+ aria-label="Filter Connections"+ variant={isTableFiltered ? "project" : "outline"}+ size="md"+ className={twMerge(isTableFiltered && "text-primary")}+ >+ <FilterIcon className="size-4" />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent+ align="end"+ className="max-h-[70vh] thin-scrollbar overflow-y-auto"+ >+ <DropdownMenuLabel>Filter by App</DropdownMenuLabel>+ {appConnections.length ? (+ [...new Set(appConnections.map(({ app }) => app))]+ .sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))+ .map((app) => {+ const isSelected = filters.apps.includes(app);+ return (+ <DropdownMenuItem+ key={app}+ onClick={(e) => {+ e.preventDefault();+ setFilters((prev) => ({+ ...prev,+ apps: isSelected+ ? prev.apps.filter((a) => a !== app)+ : [...prev.apps, app]+ }));+ }}+ >+ <div className="flex w-full items-center gap-2">+ <img+ alt={`${APP_CONNECTION_MAP[app].name} integration`}+ src={`/images/integrations/${APP_CONNECTION_MAP[app].image}`}+ className="h-4 w-4"+ />+ <span className="flex-1">{APP_CONNECTION_MAP[app].name}</span>+ {isSelected && <span className="text-primary">✓</span>}+ </div>+ </DropdownMenuItem>+ );+ })+ ) : (+ <DropdownMenuItem isDisabled>No Connections Configured</DropdownMenuItem>+ )}+ </DropdownMenuContent>+ </DropdownMenu>+ </div>++ {/* eslint-disable-next-line no-nested-ternary */}+ {isPending ? (+ <div className="space-y-2">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ </div>+ ) : visibleConnections.length === 0 ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyTitle>+ {appConnections.length+ ? "No connections match your filters"+ : "No App Connections have been configured"}+ </EmptyTitle>+ <EmptyDescription>+ Create a connection to a third-party service to issue or distribute certificates+ from this project.+ </EmptyDescription>+ </EmptyHeader>+ </Empty>+ ) : (+ <>+ <Table>+ <TableHeader>+ <TableRow>+ <TableHead+ className="w-1/4"+ onClick={() => handleSort(AppConnectionsOrderBy.App)}+ >+ App+ {sortIcon(AppConnectionsOrderBy.App)}+ </TableHead>+ <TableHead+ className="w-1/3"+ onClick={() => handleSort(AppConnectionsOrderBy.Name)}+ >+ Name+ {sortIcon(AppConnectionsOrderBy.Name)}+ </TableHead>+ <TableHead onClick={() => handleSort(AppConnectionsOrderBy.Method)}>+ Method+ {sortIcon(AppConnectionsOrderBy.Method)}+ </TableHead>+ <TableHead className="w-5" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {visibleConnections.map((connection) => (+ <AppConnectionRow+ appConnection={connection}+ key={connection.id}+ onDelete={handleDelete}+ onEditCredentials={handleEditCredentials}+ onEditDetails={handleEditDetails}+ onRotateCredentials={handleRotateCredentials}+ onToggleAutoRotation={handleToggleAutoRotation}+ />+ ))}+ </TableBody>+ </Table>+ {Boolean(filteredAppConnections.length) && (+ <div className="mt-4 flex justify-end">+ <Pagination+ count={filteredAppConnections.length}+ page={page}+ perPage={perPage}+ onChangePage={setPage}+ onChangePerPage={handlePerPageChange}+ />+ </div>+ )}+ </>+ )}+ </CardContent>++ <DeleteAppConnectionModal+ isOpen={popUp.deleteConnection.isOpen}+ onOpenChange={(isOpen) => handlePopUpToggle("deleteConnection", isOpen)}+ appConnection={popUp.deleteConnection.data}+ />+ <EditAppConnectionCredentialsModal+ isOpen={popUp.editCredentials.isOpen}+ onOpenChange={(isOpen) => handlePopUpToggle("editCredentials", isOpen)}+ appConnection={popUp.editCredentials.data}+ />+ <EditAppConnectionDetailsModal+ isOpen={popUp.editDetails.isOpen}+ onOpenChange={(isOpen) => handlePopUpToggle("editDetails", isOpen)}+ appConnection={popUp.editDetails.data}+ />+ <AddAppConnectionModal+ isOpen={popUp.addConnection.isOpen}+ onOpenChange={(isOpen) => handlePopUpToggle("addConnection", isOpen)}+ projectId={projectId}+ projectType={projectType}+ />+ </Card>+ );+};diff --git a/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/index.tsx b/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/index.tsxnew file mode 100644index 0000000000..79649edaff--- /dev/null+++ b/frontend/src/pages/cert-manager/SettingsPage/components/AppConnectionsTab/index.tsx@@ -0,0 +1 @@+export { AppConnectionsTab } from "./AppConnectionsTab";diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsxindex 4aef04127d..2bd596b6dc 100644--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx@@ -47,7 +47,7 @@ const CERT_MANAGER_ROLES = [{slug: "member",name: "Member",- description: "Limited read/write access in Certificate Manager"+ description: "Access scoped to the Applications and Code Signers they've been added to"}];diff --git a/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx b/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsxindex 7c26517bfb..dc8dd2dd10 100644--- a/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx+++ b/frontend/src/pages/project/AccessControlPage/AccessControlPage.tsx@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";import { Link, useNavigate, useSearch } from "@tanstack/react-router";import { InfoIcon } from "lucide-react";-import { PageHeader, TabPanel, Tabs } from "@app/components/v2";+import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";import { useOrganization, useProject } from "@app/context";import { getProjectBaseURL } from "@app/helpers/project";import { ProjectType } from "@app/hooks/api/projects/types";@@ -48,7 +48,7 @@ const Page = () => {title={isCertManager ? "Access Control" : "Project Access Control"}description={isCertManager- ? "Manage fine-grained access for users, groups, and machine identities."+ ? "Manage access for users, groups, and machine identities.": "Manage fine-grained access for users, groups, roles, and machine identities within your project resources."}>@@ -63,26 +63,24 @@ const Page = () => {control?</Link></PageHeader>- <Tabs orientation="vertical" value={selectedTab} onValueChange={updateSelectedTab}>- {/* <TabList>- <Tab variant="project" value={ProjectAccessControlTabs.Member}>- Users- </Tab>- <Tab variant="project" value={ProjectAccessControlTabs.Groups}>- Groups- </Tab>- <Tab variant="project" value={ProjectAccessControlTabs.Identities}>- Machine Identities- </Tab>- {isSecretManager && (- <Tab variant="project" value={ProjectAccessControlTabs.ServiceTokens}>- Service Tokens+ <Tabs+ orientation={isCertManager ? "horizontal" : "vertical"}+ value={selectedTab}+ onValueChange={updateSelectedTab}+ >+ {isCertManager && (+ <TabList>+ <Tab variant="project" value={ProjectAccessControlTabs.Member}>+ Users+ </Tab>+ <Tab variant="project" value={ProjectAccessControlTabs.Groups}>+ Groups</Tab>- )}- <Tab variant="project" value={ProjectAccessControlTabs.Roles}>- Roles- </Tab>- </TabList> */}+ <Tab variant="project" value={ProjectAccessControlTabs.Identities}>+ Machine Identities+ </Tab>+ </TabList>+ )}<TabPanel value={ProjectAccessControlTabs.Member}><MembersTab /></TabPanel>diff --git a/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupModal.tsx b/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupModal.tsxindex 3313a1f0dc..dd82e938e3 100644--- a/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupModal.tsx+++ b/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupModal.tsx@@ -145,10 +145,16 @@ const Content = ({ popUp, handlePopUpToggle }: Props) => {) : (<div className="flex flex-col space-y-4"><div className="text-sm">- All groups in your organization have already been added to this project.+ Every group in your organization is already added. To add another group, create one at the+ organization level first.</div>- <Link to={"/organizations/$orgId/access-management" as const} params={{ orgId }}>- <Button variant="outline_bg">Create a new group</Button>+ <Link+ to={"/organizations/$orgId/access-management" as const}+ params={{ orgId }}+ search={{ selectedTab: "groups" }}+ className="self-end"+ >+ <Button variant="outline_bg">Go to organization groups -></Button></Link></div>);diff --git a/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupsSection.tsx b/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupsSection.tsxindex 92546ac881..4fca58d74f 100644--- a/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupsSection.tsx+++ b/frontend/src/pages/project/AccessControlPage/components/GroupsTab/components/GroupsSection/GroupsSection.tsx@@ -75,11 +75,7 @@ export const GroupsSection = () => {{isCertManager ? "Groups" : `${productLabel} Groups`}<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/groups#user-groups" /></CardTitle>- <CardDescription>- {isCertManager- ? "Add and manage groups"- : `Add and manage ${productLabel.toLowerCase()} groups`}- </CardDescription>+ <CardDescription>{`Add and manage ${productLabel.toLowerCase()} groups`}</CardDescription><CardAction><ProjectPermissionCanI={ProjectPermissionActions.Create}diff --git a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsxindex 5edf424bfb..ae81e857cf 100644--- a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx+++ b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx@@ -233,9 +233,7 @@ export const IdentityTab = withProjectPermission(<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/identities/machine-identities" /></CardTitle><CardDescription>- {isCertManager- ? "Create and manage machine identities"- : `Create and manage ${productLabel.toLowerCase()} machine identities`}+ {`Create and manage ${productLabel.toLowerCase()} machine identities`}</CardDescription><CardAction><ProjectPermissionCandiff --git a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsxindex 8f2ef734ea..838732424d 100644--- a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx+++ b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx@@ -17,19 +17,16 @@ import {ModalClose,Switch} from "@app/components/v2";-import { useOrganization, useProject } from "@app/context";+import { useProject } from "@app/context";import { getProjectBaseURL } from "@app/helpers/project";-import { OrgMembershipRole } from "@app/helpers/roles";import {TProjectIdentity,useCreateProjectIdentity,- useCreateProjectIdentityMembership,useGetProjectRoles,useUpdateProjectIdentity,useUpdateProjectIdentityMembership} from "@app/hooks/api";import { useAddIdentityUniversalAuth } from "@app/hooks/api/identities";-import { useCreateOrgIdentity } from "@app/hooks/api/orgIdentity/mutations";import { ProjectType } from "@app/hooks/api/projects/types";import { ProjectMembershipRole } from "@app/hooks/api/roles/types";@@ -57,7 +54,6 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {const navigate = useNavigate();const { currentProject } = useProject();- const { currentOrg } = useOrganization();const isCertManager = currentProject.type === ProjectType.CertificateManager;const isUpdate = Boolean(identity);@@ -73,11 +69,6 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {const { mutateAsync: updateMutateAsync } = useUpdateProjectIdentity();const { mutateAsync: addMutateAsync } = useAddIdentityUniversalAuth();const { mutateAsync: updateMembershipMutateAsync } = useUpdateProjectIdentityMembership();- // Cert Manager can't create project-scoped identities — the project-level endpoint is blocked.- // Identities are org-scoped there, so we create the identity at the org level (No Access on the- // org by default), then assign it to Cert Manager with the chosen role.- const { mutateAsync: createOrgIdentityAsync } = useCreateOrgIdentity();- const { mutateAsync: assignToProjectAsync } = useCreateProjectIdentityMembership();const {control,@@ -113,40 +104,21 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {onClose();} else {- // create — branch on Cert Manager (no project-scoped identities) vs other products- let createdId: string;- if (isCertManager) {- const orgIdentity = await createOrgIdentityAsync({- name,- organizationId: currentOrg.id,- role: OrgMembershipRole.NoAccess,- hasDeleteProtection,- metadata- });- createdId = orgIdentity.id;- await assignToProjectAsync({+ const created = await createMutateAsync({+ name,+ projectId: currentProject.id,+ hasDeleteProtection,+ metadata+ });+ const createdId = created.id;++ if (role) {+ await updateMembershipMutateAsync({+ roles: [{ role: role.slug }],identityId: createdId,projectId: currentProject.id,- projectType: currentProject.type,- role: role?.slug- });- } else {- const created = await createMutateAsync({- name,- projectId: currentProject.id,- hasDeleteProtection,- metadata+ projectType: currentProject.type});- createdId = created.id;-- if (role) {- await updateMembershipMutateAsync({- roles: [{ role: role.slug }],- identityId: createdId,- projectId: currentProject.id,- projectType: currentProject.type- });- }}await addMutateAsync({diff --git a/frontend/src/pages/project/AccessControlPage/components/MembersTab/components/MembersSection.tsx b/frontend/src/pages/project/AccessControlPage/components/MembersTab/components/MembersSection.tsxindex eff96ad6a8..7dada3f9f8 100644--- a/frontend/src/pages/project/AccessControlPage/components/MembersTab/components/MembersSection.tsx+++ b/frontend/src/pages/project/AccessControlPage/components/MembersTab/components/MembersSection.tsx@@ -66,9 +66,7 @@ export const MembersSection = () => {<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/identities/user-identities" /></CardTitle><CardDescription>- {isCertManager- ? "Invite and manage users"- : `Invite and manage ${productLabel.toLowerCase()} users`}+ {`Invite and manage ${productLabel.toLowerCase()} users`}</CardDescription><CardAction><ProjectPermissionCandiff --git a/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx b/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsxindex 5ecfe8b8cc..005ebb3896 100644--- a/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx+++ b/frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx@@ -416,9 +416,10 @@ export const CreatePkiAlertV2FormSteps = ({render={({ field }) => (<div className="flex items-center justify-between"><div className="flex flex-col gap-1">- <span className="text-sm text-bunker-300">Daily Alerts</span>+ <span className="text-sm text-bunker-300">Repeat daily until expiry</span><p className="text-xs text-bunker-400">- Send notifications daily from the alert threshold until expiry+ Send a reminder every day from the alert threshold until the certificate+ expires.</p></div><Switch@@ -1000,7 +1001,7 @@ export const CreatePkiAlertV2FormSteps = ({</GenericFieldLabel>)}{watchedEventType === PkiAlertEventTypeV2.EXPIRATION && (- <GenericFieldLabel label="Daily Alerts">+ <GenericFieldLabel label="Repeat daily until expiry">{watch("notificationConfig.enableDailyNotification") ? "Enabled" : "Disabled"}</GenericFieldLabel>)}diff --git a/frontend/src/views/PkiAlertsV2Page/components/ViewPkiAlertV2Modal.tsx b/frontend/src/views/PkiAlertsV2Page/components/ViewPkiAlertV2Modal.tsxindex 72f0b5187d..c3e83f02dd 100644--- a/frontend/src/views/PkiAlertsV2Page/components/ViewPkiAlertV2Modal.tsx+++ b/frontend/src/views/PkiAlertsV2Page/components/ViewPkiAlertV2Modal.tsx@@ -4,16 +4,13 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { CertificateDisplayName } from "@app/components/utilities/certificateDisplayUtils";import {+ GenericFieldLabel,Modal,ModalContent,Pagination,Skeleton,- Tab,Table,TableContainer,- TabList,- TabPanel,- Tabs,TBody,Td,Th,@@ -45,8 +42,22 @@ interface Props {alertId?: string;}+const formatDate = (dateString: string) =>+ new Date(dateString).toLocaleString("en-US", {+ year: "numeric",+ month: "short",+ day: "numeric",+ hour: "2-digit",+ minute: "2-digit"+ });++const SectionHeader = ({ title }: { title: string }) => (+ <h3 className="border-b border-mineshaft-700 pb-2 text-sm font-semibold text-mineshaft-100">+ {title}+ </h3>+);+export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) => {- const [activeTab, setActiveTab] = useState("overview");const [certificatesPage, setCertificatesPage] = useState(1);const certificatesPerPage = 10;@@ -55,6 +66,9 @@ export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) =>{ enabled: !!alertId && isOpen });+ const showMatchingCertificates =+ alert?.eventType && alert.eventType !== PkiAlertEventTypeV2.ISSUANCE;+const { data: certificatesData, isLoading: isLoadingCertificates } =useGetPkiAlertV2MatchingCertificates({@@ -62,41 +76,21 @@ export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) =>limit: certificatesPerPage,offset: (certificatesPage - 1) * certificatesPerPage},- { enabled: !!alertId && isOpen }+ { enabled: !!alertId && isOpen && !!showMatchingCertificates });useEffect(() => {- if (isOpen && alertId) {- setActiveTab("overview");- setCertificatesPage(1);- }- }, [isOpen, alertId]);-- useEffect(() => {- if (!isOpen) {- setActiveTab("overview");- setCertificatesPage(1);- }+ if (!isOpen) setCertificatesPage(1);}, [isOpen]);- const formatDate = (dateString: string) => {- return new Date(dateString).toLocaleDateString("en-US", {- year: "numeric",- month: "short",- day: "numeric",- hour: "2-digit",- minute: "2-digit"- });- };-if (isLoadingAlert) {return (<Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent title="Certificate Alert Details" className="max-w-6xl">- <div className="space-y-6">- <Skeleton className="h-8 w-full" />- <Skeleton className="h-32 w-full" />- <Skeleton className="h-64 w-full" />+ <ModalContent title="Certificate Alert Details" className="max-w-3xl">+ <div className="space-y-4">+ <Skeleton className="h-6 w-1/3" />+ <Skeleton className="h-24 w-full" />+ <Skeleton className="h-40 w-full" /></div></ModalContent></Modal>@@ -106,8 +100,8 @@ export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) =>if (!alert) {return (<Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent title="Certificate Alert Details" className="max-w-6xl">- <div className="py-8 text-center text-gray-400">Alert not found</div>+ <ModalContent title="Certificate Alert Details" className="max-w-3xl">+ <p className="py-8 text-center text-sm text-mineshaft-400">Alert not found.</p></ModalContent></Modal>);@@ -115,218 +109,187 @@ export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) =>return (<Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent title="Certificate Alert Details" className="max-w-6xl">+ <ModalContent+ title="Certificate Alert Details"+ className={showMatchingCertificates ? "max-w-5xl" : "max-w-3xl"}+ ><div className="space-y-6">- <div className="flex items-center justify-between">- <h2 className="text-xl font-semibold text-gray-200">{alert.name}</h2>+ <div className="flex items-start justify-between gap-3">+ <div className="min-w-0">+ <p className="truncate text-base font-semibold text-mineshaft-100">{alert.name}</p>+ {alert.description && (+ <p className="mt-1 text-sm text-mineshaft-400">{alert.description}</p>+ )}+ </div><Badge variant={alert.enabled ? "success" : "neutral"}>{alert.enabled ? "Enabled" : "Disabled"}</Badge></div>- {alert.description && <p className="text-gray-300">{alert.description}</p>}-- <Tabs value={activeTab} onValueChange={setActiveTab}>- <TabList>- <Tab value="overview">Overview</Tab>- {alert.eventType !== PkiAlertEventTypeV2.ISSUANCE && (- <Tab value="certificates">Matching Certificates</Tab>+ <div className="space-y-3">+ <SectionHeader title="Basic Information" />+ <div className="grid grid-cols-1 gap-x-6 gap-y-4 md:grid-cols-2 lg:grid-cols-3">+ <GenericFieldLabel label="Event Type">+ {formatEventType(alert.eventType)}+ </GenericFieldLabel>+ {alert.eventType === PkiAlertEventTypeV2.EXPIRATION && (+ <>+ <GenericFieldLabel label="Alert Before">+ {formatAlertBefore(alert.alertBefore, undefined)}+ </GenericFieldLabel>+ <GenericFieldLabel label="Repeat daily until expiry">+ {alert.notificationConfig?.enableDailyNotification ? "Enabled" : "Disabled"}+ </GenericFieldLabel>+ </>)}- </TabList>-- <TabPanel value="overview">- <div className="space-y-6">- <div className="space-y-4">- <h3 className="text-lg font-medium text-gray-200">Basic Information</h3>- <div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">- <div>- <div className="mb-1 block text-sm font-medium text-gray-400">Event Type</div>- <span className="text-gray-300">{formatEventType(alert.eventType)}</span>- </div>-- {alert.eventType === PkiAlertEventTypeV2.EXPIRATION && (- <>- <div>- <div className="mb-1 block text-sm font-medium text-gray-400">- Alert Before- </div>- <span className="text-gray-300">- {formatAlertBefore(alert.alertBefore, "Not set")}- </span>- </div>+ <GenericFieldLabel label="Created">{formatDate(alert.createdAt)}</GenericFieldLabel>+ </div>+ </div>- <div>- <div className="mb-1 block text-sm font-medium text-gray-400">- Daily Alerts- </div>- <span className="text-gray-300">- {alert.notificationConfig?.enableDailyNotification- ? "Enabled"- : "Disabled"}- </span>- </div>- </>- )}+ <div className="space-y-3">+ <SectionHeader title="Filter Rules" />+ {(alert.filters || []).length === 0 ? (+ <p className="text-sm text-mineshaft-400/70 italic">No filter rules configured.</p>+ ) : (+ <ul className="space-y-1.5">+ {(alert.filters || []).map((filter) => {+ const field = filter.field.replace(/_/g, " ");+ const operator = filter.operator.replace(/_/g, " ");+ const value = Array.isArray(filter.value)+ ? filter.value.join(", ")+ : String(filter.value);+ return (+ <li+ key={`filter-${filter.field}-${filter.operator}-${String(filter.value)}`}+ className="text-sm text-mineshaft-100 capitalize"+ >+ {field} {operator} {value}+ </li>+ );+ })}+ </ul>+ )}+ </div>- <div>- <div className="mb-1 block text-sm font-medium text-gray-400">Created</div>- <span className="text-gray-300">{formatDate(alert.createdAt)}</span>+ <div className="space-y-3">+ <SectionHeader title="Notification Channels" />+ {(alert.channels || []).length === 0 ? (+ <p className="text-sm text-mineshaft-400/70 italic">+ No notification channels configured.+ </p>+ ) : (+ <div className="space-y-2">+ {(alert.channels || []).map((channel) => (+ <div+ key={channel.id}+ className="flex items-start gap-3 rounded-md border border-mineshaft-600 bg-mineshaft-800/40 p-3"+ >+ <FontAwesomeIcon+ icon={getChannelIcon(channel.channelType)}+ className="mt-0.5 shrink-0 text-mineshaft-400"+ />+ <div className="min-w-0 flex-1">+ <div className="flex items-center gap-2">+ <span className="text-sm font-medium text-mineshaft-100">+ {getChannelDisplayName(channel.channelType)}+ </span>+ {channel.channelType === PkiAlertChannelTypeV2.WEBHOOK &&+ (channel.config as TPkiAlertChannelConfigWebhookResponse)+ ?.hasSigningSecret && (+ <Tooltip content="Signed webhook">+ <FontAwesomeIcon+ icon={faKey}+ className="text-xs text-mineshaft-400"+ />+ </Tooltip>+ )}+ {!channel.enabled && <Badge variant="neutral">Disabled</Badge>}+ </div>+ {channel.channelType === PkiAlertChannelTypeV2.EMAIL &&+ (() => {+ const config = channel.config as TPkiAlertChannelConfigEmail;+ const recipients = config?.recipients || [];+ const count = recipients.length;+ if (count === 0) {+ return <p className="mt-1 text-xs text-mineshaft-400">No recipients</p>;+ }+ const displayed = recipients.slice(0, 3).join(", ");+ const text = count <= 3 ? displayed : `${displayed} +${count - 3} more`;+ return count > 3 ? (+ <Tooltip content={recipients.join(", ")}>+ <p className="mt-1 cursor-help text-xs text-mineshaft-400">{text}</p>+ </Tooltip>+ ) : (+ <p className="mt-1 text-xs text-mineshaft-400">{text}</p>+ );+ })()}+ {channel.channelType === PkiAlertChannelTypeV2.WEBHOOK && (+ <p className="mt-1 truncate text-xs text-mineshaft-400">+ {getWebhookHostname(+ (channel.config as TPkiAlertChannelConfigWebhookResponse).url+ )}+ </p>+ )}+ {channel.channelType === PkiAlertChannelTypeV2.SLACK && (+ <p className="mt-1 text-xs text-mineshaft-400">Slack webhook configured</p>+ )}+ {channel.channelType === PkiAlertChannelTypeV2.PAGERDUTY && (+ <p className="mt-1 text-xs text-mineshaft-400">+ PagerDuty integration configured+ </p>+ )}</div></div>- </div>-- <div className="space-y-3">- <h3 className="text-lg font-medium text-gray-200">Filter Rules</h3>- {(alert.filters || []).length === 0 ? (- <p className="text-gray-400">No filter rules configured</p>- ) : (- <div className="space-y-2">- {(alert.filters || []).map((filter) => {- const formatFilterText = () => {- const field = filter.field.replace(/_/g, " ");- const operator = filter.operator.replace(/_/g, " ");- const value = Array.isArray(filter.value)- ? filter.value.join(", ")- : String(filter.value);-- return `${field} ${operator} ${value}`;- };-- return (- <div- key={`filter-${filter.field}-${filter.operator}-${String(filter.value)}`}- >- <div className="text-sm text-gray-200 capitalize">- {formatFilterText()}- </div>- </div>- );- })}- </div>- )}- </div>-- <div className="space-y-3">- <h3 className="text-lg font-medium text-gray-200">Notification Channels</h3>- {(alert.channels || []).length > 0 ? (- <div className="space-y-3">- {(alert.channels || []).map((channel) => (- <div- key={channel.id}- className="flex items-start gap-3 rounded-md border border-mineshaft-600 p-3"- >- <FontAwesomeIcon- icon={getChannelIcon(channel.channelType)}- className="mt-1 shrink-0 text-mineshaft-400"- />- <div className="min-w-0 flex-1">- <div className="flex items-center gap-2">- <span className="font-medium text-mineshaft-100">- {getChannelDisplayName(channel.channelType)}- </span>- {channel.channelType === PkiAlertChannelTypeV2.WEBHOOK &&- (channel.config as TPkiAlertChannelConfigWebhookResponse)- ?.hasSigningSecret && (- <Tooltip content="Signed webhook">- <FontAwesomeIcon- icon={faKey}- className="text-xs text-mineshaft-400"- />- </Tooltip>- )}- {!channel.enabled && (- <Badge variant="neutral" className="text-xs">- Disabled- </Badge>- )}- </div>- {channel.channelType === PkiAlertChannelTypeV2.EMAIL && (- <div className="mt-1 text-sm text-mineshaft-400">- {(() => {- const config = channel.config as TPkiAlertChannelConfigEmail;- const recipients = config?.recipients || [];- const count = recipients.length;- if (count === 0) return "No recipients";- const displayEmails = recipients.slice(0, 3);- const displayText =- count <= 3- ? displayEmails.join(", ")- : `${displayEmails.join(", ")} +${count - 3} more`;-- if (count > 3) {- return (- <Tooltip content={recipients.join(", ")}>- <span className="cursor-help">{displayText}</span>- </Tooltip>- );- }- return displayText;- })()}- </div>- )}- {channel.channelType === PkiAlertChannelTypeV2.WEBHOOK && (- <div className="mt-1 truncate text-sm text-mineshaft-400">- {getWebhookHostname(- (channel.config as TPkiAlertChannelConfigWebhookResponse).url- )}- </div>- )}- {channel.channelType === PkiAlertChannelTypeV2.SLACK && (- <div className="mt-1 truncate text-sm text-mineshaft-400">- Slack webhook configured- </div>- )}- {channel.channelType === PkiAlertChannelTypeV2.PAGERDUTY && (- <div className="mt-1 truncate text-sm text-mineshaft-400">- PagerDuty integration configured- </div>- )}- </div>- </div>- ))}- </div>- ) : (- <p className="text-gray-400">No notification channels configured</p>- )}- </div>+ ))}</div>- </TabPanel>-- <TabPanel value="certificates">- <div className="space-y-4">- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-1/2">SAN / CN</Th>- <Th className="w-1/6">Status</Th>- <Th className="w-1/6">Not Before</Th>- <Th className="w-1/6">Not After</Th>- </Tr>- </THead>- <TBody>- {(() => {- if (isLoadingCertificates) {- return Array.from({ length: 5 }, (_, index) => (- <Tr key={`skeleton-row-${index}`}>- <Td>- <Skeleton className="h-4 w-32" />- </Td>- <Td>- <Skeleton className="h-4 w-16" />- </Td>- <Td>- <Skeleton className="h-4 w-24" />- </Td>- <Td>- <Skeleton className="h-4 w-24" />- </Td>- </Tr>- ));- }+ )}+ </div>- if (certificatesData?.certificates?.length) {- return certificatesData.certificates.map((cert) => (+ {showMatchingCertificates && (+ <div className="space-y-3">+ <SectionHeader title="Matching Certificates" />+ <TableContainer>+ <Table>+ <THead>+ <Tr>+ <Th className="w-1/2">SAN / CN</Th>+ <Th className="w-1/6">Status</Th>+ <Th className="w-1/6">Not Before</Th>+ <Th className="w-1/6">Not After</Th>+ </Tr>+ </THead>+ <TBody>+ {(() => {+ if (isLoadingCertificates) {+ return Array.from({ length: 5 }, (_, index) => (+ <Tr key={`skeleton-row-${index}`}>+ <Td>+ <Skeleton className="h-4 w-32" />+ </Td>+ <Td>+ <Skeleton className="h-4 w-16" />+ </Td>+ <Td>+ <Skeleton className="h-4 w-24" />+ </Td>+ <Td>+ <Skeleton className="h-4 w-24" />+ </Td>+ </Tr>+ ));+ }+ if (certificatesData?.certificates?.length) {+ return certificatesData.certificates.map((cert) => {+ const now = new Date();+ const isExpired = new Date(cert.notAfter) < now;+ // eslint-disable-next-line no-nested-ternary+ const statusVariant = isExpired+ ? "danger"+ : cert.status === "active"+ ? "success"+ : "neutral";+ const statusLabel = isExpired ? "Expired" : cert.status;+ return (<Tr key={cert.id} className="group h-10"><Td className="max-w-0"><div className="flex items-center gap-2">@@ -338,34 +301,12 @@ export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) =>maxLength={48}fallback="—"/>- {cert.enrollmentType === "ca" && (- <Badge variant="info" className="shrink-0 text-xs">- CA- </Badge>- )}+ {cert.enrollmentType === "ca" && <Badge variant="info">CA</Badge>}</div></Td><Td>- <Badge- variant={(() => {- const now = new Date();- const expirationDate = new Date(cert.notAfter);- const isExpired = expirationDate < now;-- if (isExpired) return "danger";- if (cert.status === "active") return "success";- return "neutral";- })()}- className="capitalize"- >- {(() => {- const now = new Date();- const expirationDate = new Date(cert.notAfter);- const isExpired = expirationDate < now;-- if (isExpired) return "Expired";- return cert.status;- })()}+ <Badge variant={statusVariant} className="capitalize">+ {statusLabel}</Badge></Td><Td>@@ -379,35 +320,33 @@ export const ViewPkiAlertV2Modal = ({ isOpen, onOpenChange, alertId }: Props) =>: "-"}</Td></Tr>- ));- }-- return (- <Tr>- <Td colSpan={4} className="py-8 text-center text-gray-400">- No certificates will match this alert's criteria in the future- </Td>- </Tr>- );- })()}- </TBody>- </Table>- </TableContainer>-- {(certificatesData?.total || 0) > 0 && (- <div className="flex justify-center">- <Pagination- count={certificatesData?.total || 0}- page={certificatesPage}- onChangePage={setCertificatesPage}- perPage={certificatesPerPage}- onChangePerPage={() => {}}- />- </div>- )}- </div>- </TabPanel>- </Tabs>+ );+ });+ }+ return (+ <Tr>+ <Td colSpan={4} className="py-6 text-center text-sm text-mineshaft-400">+ No certificates currently match this alert's criteria.+ </Td>+ </Tr>+ );+ })()}+ </TBody>+ </Table>+ </TableContainer>+ {(certificatesData?.total || 0) > certificatesPerPage && (+ <div className="flex justify-center">+ <Pagination+ count={certificatesData?.total || 0}+ page={certificatesPage}+ onChangePage={setCertificatesPage}+ perPage={certificatesPerPage}+ onChangePerPage={() => {}}+ />+ </div>+ )}+ </div>+ )}</div></ModalContent></Modal>