Skip to content

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

UI improvements

Carlos Monastyrskicfe49554dc32
diff --git a/backend/src/db/schemas/models.ts b/backend/src/db/schemas/models.ts
index 286e398d2e..f03c029cea 100644
--- a/backend/src/db/schemas/models.ts
+++ b/backend/src/db/schemas/models.ts
@@ -331,9 +331,7 @@ export enum OrgMembershipRole {
Admin = "admin",
Member = "member",
NoAccess = "no-access",
- Custom = "custom",
- CertManagerAdmin = "cert-manager-admin",
- CertManagerMember = "cert-manager-member"
+ Custom = "custom"
}
export enum OrgMembershipStatus {
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index 305240f2bd..7392adf663 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -622,6 +622,8 @@ export enum EventType {
CREATE_PROJECT_ROLE = "create-project-role",
UPDATE_PROJECT_ROLE = "update-project-role",
DELETE_PROJECT_ROLE = "delete-project-role",
+ LIST_PROJECT_ROLES = "list-project-roles",
+ GET_PROJECT_ROLE = "get-project-role",
CREATE_ORG_ROLE = "create-org-role",
UPDATE_ORG_ROLE = "update-org-role",
@@ -5206,6 +5208,21 @@ interface ProjectRoleDeleteEvent {
};
}
+interface ProjectRoleListEvent {
+ type: EventType.LIST_PROJECT_ROLES;
+ metadata: {
+ projectId: string;
+ };
+}
+
+interface ProjectRoleGetEvent {
+ type: EventType.GET_PROJECT_ROLE;
+ metadata: {
+ projectId: string;
+ slug: string;
+ };
+}
+
interface OrgRoleCreateEvent {
type: EventType.CREATE_ORG_ROLE;
metadata: {
@@ -7159,6 +7176,8 @@ export type Event =
| ProjectRoleCreateEvent
| ProjectRoleUpdateEvent
| ProjectRoleDeleteEvent
+ | ProjectRoleListEvent
+ | ProjectRoleGetEvent
| OrgRoleCreateEvent
| OrgRoleUpdateEvent
| OrgRoleDeleteEvent
diff --git a/backend/src/ee/services/permission/org-permission.ts b/backend/src/ee/services/permission/org-permission.ts
index 62625103a0..9af1a3d82e 100644
--- a/backend/src/ee/services/permission/org-permission.ts
+++ b/backend/src/ee/services/permission/org-permission.ts
@@ -621,33 +621,3 @@ const buildNoAccessPermission = () => {
};
export const orgNoAccessPermissions = buildNoAccessPermission();
-
-const buildCertManagerAdminPermission = () => {
- const { can, rules } = new AbilityBuilder<MongoAbility<OrgPermissionSet>>(createMongoAbility);
-
- can(OrgPermissionActions.Read, OrgPermissionSubjects.Member);
- can(OrgPermissionGroupActions.Read, OrgPermissionSubjects.Groups);
- can(OrgPermissionActions.Read, OrgPermissionSubjects.Role);
- can(OrgPermissionActions.Read, OrgPermissionSubjects.Settings);
- can(OrgPermissionAuditLogsActions.Read, OrgPermissionSubjects.AuditLogs);
- can(OrgPermissionIdentityActions.Read, OrgPermissionSubjects.Identity);
- can(OrgPermissionAppConnectionActions.Read, OrgPermissionSubjects.AppConnections);
- can(OrgPermissionAppConnectionActions.Connect, OrgPermissionSubjects.AppConnections);
-
- can(OrgPermissionCertManagerActions.Read, OrgPermissionSubjects.CertManager);
- can(OrgPermissionCertManagerActions.ManageInstance, OrgPermissionSubjects.CertManager);
- can(OrgPermissionCertManagerActions.ManageSettings, OrgPermissionSubjects.CertManager);
-
- return rules;
-};
-export const orgCertManagerAdminPermissions = buildCertManagerAdminPermission();
-
-const buildCertManagerMemberPermission = () => {
- const { can, rules } = new AbilityBuilder<MongoAbility<OrgPermissionSet>>(createMongoAbility);
- can(OrgPermissionActions.Read, OrgPermissionSubjects.Member);
- can(OrgPermissionGroupActions.Read, OrgPermissionSubjects.Groups);
- can(OrgPermissionAuditLogsActions.Read, OrgPermissionSubjects.AuditLogs);
- can(OrgPermissionCertManagerActions.Read, OrgPermissionSubjects.CertManager);
- return rules;
-};
-export const orgCertManagerMemberPermissions = buildCertManagerMemberPermission();
diff --git a/backend/src/ee/services/permission/permission-service.ts b/backend/src/ee/services/permission/permission-service.ts
index ec8508bfec..7990dfc9af 100644
--- a/backend/src/ee/services/permission/permission-service.ts
+++ b/backend/src/ee/services/permission/permission-service.ts
@@ -43,8 +43,6 @@ import { TUserDALFactory } from "@app/services/user/user-dal";
import {
orgAdminPermissions,
- orgCertManagerAdminPermissions,
- orgCertManagerMemberPermissions,
orgMemberPermissions,
orgNoAccessPermissions,
OrgPermissionSet,
@@ -71,10 +69,6 @@ const buildOrgPermissionRules = (orgUserRoles: TBuildOrgPermissionDTO) => {
return orgMemberPermissions;
case OrgMembershipRole.NoAccess:
return orgNoAccessPermissions;
- case OrgMembershipRole.CertManagerAdmin:
- return orgCertManagerAdminPermissions;
- case OrgMembershipRole.CertManagerMember:
- return orgCertManagerMemberPermissions;
case OrgMembershipRole.Custom:
return unpackRules<RawRuleOf<MongoAbility<OrgPermissionSet>>>(
permissions as PackRule<RawRuleOf<MongoAbility<OrgPermissionSet>>>[]
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.ts
index fc9bb8ab4a..b4862b8b29 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
@@ -1,6 +1,7 @@
import { z } from "zod";
import { AccessScope, ProjectMembershipRole, ProjectRolesSchema } from "@app/db/schemas";
+import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { BadRequestError } from "@app/lib/errors";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
@@ -33,6 +34,14 @@ export const registerCertManagerAccessRolesRouter = async (server: FastifyZodPro
scopeData: { scope: AccessScope.Project, orgId: req.permission.orgId, projectId },
data: {}
});
+ await server.services.auditLog.createAuditLog({
+ ...req.auditLogInfo,
+ projectId,
+ event: {
+ type: EventType.LIST_PROJECT_ROLES,
+ metadata: { projectId }
+ }
+ });
return {
roles: roles.filter((el) => CERT_MANAGER_ROLE_SLUGS.has(el.slug as ProjectMembershipRole))
};
@@ -56,6 +65,14 @@ export const registerCertManagerAccessRolesRouter = async (server: FastifyZodPro
scopeData: { scope: AccessScope.Project, orgId: req.permission.orgId, projectId },
selector: { slug: req.params.roleSlug }
});
+ await server.services.auditLog.createAuditLog({
+ ...req.auditLogInfo,
+ projectId,
+ event: {
+ type: EventType.GET_PROJECT_ROLE,
+ metadata: { projectId, slug: req.params.roleSlug }
+ }
+ });
return { role };
}
});
diff --git a/backend/src/server/routes/v1/certificate-policy-router.ts b/backend/src/server/routes/v1/certificate-policy-router.ts
index 4c9b178e98..03a5c8fe26 100644
--- a/backend/src/server/routes/v1/certificate-policy-router.ts
+++ b/backend/src/server/routes/v1/certificate-policy-router.ts
@@ -308,6 +308,9 @@ export const registerCertificatePolicyRouter = async (server: FastifyZodProvider
params: z.object({
id: z.string().uuid()
}),
+ querystring: z.object({
+ applicationId: z.string().uuid().optional()
+ }),
response: {
200: z.object({
certificatePolicy: certificatePolicyResponseSchema
@@ -321,7 +324,8 @@ export const registerCertificatePolicyRouter = async (server: FastifyZodProvider
actorId: req.permission.id,
actorAuthMethod: req.permission.authMethod!,
actorOrgId: req.permission.orgId,
- policyId: req.params.id
+ policyId: req.params.id,
+ applicationId: req.query.applicationId
});
await server.services.auditLog.createAuditLog({
diff --git a/backend/src/server/routes/v1/certificate-profiles-router.ts b/backend/src/server/routes/v1/certificate-profiles-router.ts
index 1e76a9b49c..e81e255a64 100644
--- a/backend/src/server/routes/v1/certificate-profiles-router.ts
+++ b/backend/src/server/routes/v1/certificate-profiles-router.ts
@@ -277,6 +277,7 @@ export const registerCertificateProfilesRouter = async (
enrollmentType: z.nativeEnum(EnrollmentType).optional(),
issuerType: z.nativeEnum(IssuerType).optional(),
caId: z.string().uuid().optional(),
+ applicationId: z.string().uuid().optional(),
projectId: z.string().uuid().optional().describe(openApiHidden())
}),
response: {
diff --git a/backend/src/services/certificate-policy/certificate-policy-service.test.ts b/backend/src/services/certificate-policy/certificate-policy-service.test.ts
index b9d5aa06c6..e687cc3cf0 100644
--- a/backend/src/services/certificate-policy/certificate-policy-service.test.ts
+++ b/backend/src/services/certificate-policy/certificate-policy-service.test.ts
@@ -131,6 +131,9 @@ describe("CertificatePolicyService", () => {
const mockPermissionService = {
getProjectPermission: vi.fn().mockResolvedValue({
permission: mockPermission
+ }),
+ getResourcePermission: vi.fn().mockResolvedValue({
+ permission: mockPermission
})
};
diff --git a/backend/src/services/certificate-policy/certificate-policy-service.ts b/backend/src/services/certificate-policy/certificate-policy-service.ts
index fbb277ee3f..d6ec733a02 100644
--- a/backend/src/services/certificate-policy/certificate-policy-service.ts
+++ b/backend/src/services/certificate-policy/certificate-policy-service.ts
@@ -2,12 +2,16 @@ import { ForbiddenError, subject } from "@casl/ability";
import slugify from "@sindresorhus/slugify";
import RE2 from "re2";
-import { ActionProjectType } from "@app/db/schemas";
+import { ActionProjectType, ResourceType } from "@app/db/schemas";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
ProjectPermissionCertificatePolicyActions,
ProjectPermissionSub
} from "@app/ee/services/permission/project-permission";
+import {
+ ResourcePermissionApplicationActions,
+ ResourcePermissionSub
+} from "@app/ee/services/permission/resource-permission";
import { getProcessedPermissionRules } from "@app/lib/casl/permission-filter-utils";
import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
import { alphaNumericNanoId } from "@app/lib/nanoid";
@@ -25,7 +29,7 @@ import {
type TCertificatePolicyServiceFactoryDep = {
certificatePolicyDAL: TCertificatePolicyDALFactory;
- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;
+ permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "getResourcePermission">;
};
export const certificatePolicyServiceFactory = ({
@@ -802,6 +806,7 @@ export const certificatePolicyServiceFactory = ({
actorAuthMethod,
actorOrgId,
policyId,
+ applicationId,
internal = false
}: {
actor?: ActorType;
@@ -809,6 +814,7 @@ export const certificatePolicyServiceFactory = ({
actorAuthMethod?: ActorAuthMethod;
actorOrgId?: string;
policyId: string;
+ applicationId?: string;
internal?: boolean;
}): Promise<TCertificatePolicy> => {
const template = await certificatePolicyDAL.findById(policyId);
@@ -820,21 +826,39 @@ export const certificatePolicyServiceFactory = ({
if (!actor || !actorId || !actorOrgId) {
throw new BadRequestError({ message: "Actor is required" });
}
- const { permission } = await permissionService.getProjectPermission({
- actor,
- actorId,
- projectId: template.projectId,
- actorAuthMethod: actorAuthMethod || null,
- actorOrgId,
- actionProjectType: ActionProjectType.CertificateManager
- });
- ForbiddenError.from(permission).throwUnlessCan(
- ProjectPermissionCertificatePolicyActions.Read,
- subject(ProjectPermissionSub.CertificatePolicies, {
- name: template.name
- })
- );
+ if (applicationId && (actor === ActorType.USER || actor === ActorType.IDENTITY)) {
+ const { permission } = await permissionService.getResourcePermission({
+ actor,
+ actorId,
+ projectId: template.projectId,
+ resourceType: ResourceType.CertificateApplication,
+ resourceId: applicationId,
+ actorAuthMethod: actorAuthMethod || null,
+ actorOrgId
+ });
+
+ ForbiddenError.from(permission).throwUnlessCan(
+ ResourcePermissionApplicationActions.Read,
+ ResourcePermissionSub.Application
+ );
+ } else {
+ const { permission } = await permissionService.getProjectPermission({
+ actor,
+ actorId,
+ projectId: template.projectId,
+ actorAuthMethod: actorAuthMethod || null,
+ actorOrgId,
+ actionProjectType: ActionProjectType.CertificateManager
+ });
+
+ ForbiddenError.from(permission).throwUnlessCan(
+ ProjectPermissionCertificatePolicyActions.Read,
+ subject(ProjectPermissionSub.CertificatePolicies, {
+ name: template.name
+ })
+ );
+ }
}
return template;
diff --git a/backend/src/services/certificate-profile/certificate-profile-dal.ts b/backend/src/services/certificate-profile/certificate-profile-dal.ts
index 2276483277..b008ca1d97 100644
--- a/backend/src/services/certificate-profile/certificate-profile-dal.ts
+++ b/backend/src/services/certificate-profile/certificate-profile-dal.ts
@@ -347,18 +347,23 @@ export const certificateProfileDALFactory = (db: TDbClient) => {
enrollmentType?: EnrollmentType;
issuerType?: IssuerType;
caId?: string;
+ profileIds?: string[];
} = {},
processedRules?: ProcessedPermissionRules,
tx?: Knex
): Promise<TCertificateProfile[] | TCertificateProfileWithConfigs[]> => {
try {
- const { offset = 0, limit = 20, search, enrollmentType, issuerType, caId } = options;
+ const { offset = 0, limit = 20, search, enrollmentType, issuerType, caId, profileIds } = options;
let baseQuery = (tx || db)(TableName.PkiCertificateProfile).where(
`${TableName.PkiCertificateProfile}.projectId`,
projectId
);
+ if (profileIds) {
+ baseQuery = baseQuery.whereIn(`${TableName.PkiCertificateProfile}.id`, profileIds);
+ }
+
if (search) {
baseQuery = baseQuery.where((builder) => {
void builder.where((qb) => {
@@ -557,15 +562,20 @@ export const certificateProfileDALFactory = (db: TDbClient) => {
enrollmentType?: EnrollmentType;
issuerType?: IssuerType;
caId?: string;
+ profileIds?: string[];
} = {},
processedRules?: ProcessedPermissionRules,
tx?: Knex
): Promise<number> => {
try {
- const { search, enrollmentType, issuerType, caId } = options;
+ const { search, enrollmentType, issuerType, caId, profileIds } = options;
let query = (tx || db)(TableName.PkiCertificateProfile).where({ projectId });
+ if (profileIds) {
+ query = query.whereIn("id", profileIds);
+ }
+
if (search) {
query = query.where((builder) => {
void builder.where((qb) => {
diff --git a/backend/src/services/certificate-profile/certificate-profile-service.test.ts b/backend/src/services/certificate-profile/certificate-profile-service.test.ts
index 3404a47217..aa4f06c6f5 100644
--- a/backend/src/services/certificate-profile/certificate-profile-service.test.ts
+++ b/backend/src/services/certificate-profile/certificate-profile-service.test.ts
@@ -184,8 +184,14 @@ describe("CertificateProfileService", () => {
throwUnlessCan: vi.fn(),
rules: []
}
+ }),
+ getResourcePermission: vi.fn().mockResolvedValue({
+ permission: {
+ throwUnlessCan: vi.fn(),
+ rules: []
+ }
})
- } as unknown as Pick<TPermissionServiceFactory, "getProjectPermission">;
+ } as unknown as Pick<TPermissionServiceFactory, "getProjectPermission" | "getResourcePermission">;
const mockKmsService = {
encryptWithKmsKey: vi
diff --git a/backend/src/services/certificate-profile/certificate-profile-service.ts b/backend/src/services/certificate-profile/certificate-profile-service.ts
index b08fae6980..5a1b22cff3 100644
--- a/backend/src/services/certificate-profile/certificate-profile-service.ts
+++ b/backend/src/services/certificate-profile/certificate-profile-service.ts
@@ -1,13 +1,17 @@
import { ForbiddenError, subject } from "@casl/ability";
import * as x509 from "@peculiar/x509";
-import { ActionProjectType } from "@app/db/schemas";
+import { ActionProjectType, ResourceType } from "@app/db/schemas";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
import {
ProjectPermissionCertificateActions,
ProjectPermissionCertificateProfileActions,
ProjectPermissionSub
} from "@app/ee/services/permission/project-permission";
+import {
+ ResourcePermissionApplicationActions,
+ ResourcePermissionSub
+} from "@app/ee/services/permission/resource-permission";
import { buildUrl } from "@app/ee/services/pki-acme/pki-acme-fns";
import { ScepChallengeType } from "@app/ee/services/pki-scep/challenge";
import { TScepDynamicChallengeDALFactory } from "@app/ee/services/pki-scep/pki-scep-dynamic-challenge-dal";
@@ -263,11 +267,14 @@ type TCertificateProfileServiceFactoryDep = {
certificateSecretDAL: Pick<TCertificateSecretDALFactory, "findOne">;
certificateAuthorityDAL: Pick<TCertificateAuthorityDALFactory, "findById">;
externalCertificateAuthorityDAL: Pick<TExternalCertificateAuthorityDALFactory, "findById" | "findOne">;
- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;
+ permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "getResourcePermission">;
kmsService: Pick<TKmsServiceFactory, "generateKmsKey" | "encryptWithKmsKey" | "decryptWithKmsKey">;
projectDAL: Pick<TProjectDALFactory, "findProjectBySlug" | "findOne" | "updateById" | "findById" | "transaction">;
resourceMetadataDAL: Pick<TResourceMetadataDALFactory, "find">;
- pkiApplicationProfileDAL?: Pick<TPkiApplicationProfileDALFactory, "findOneByApplicationAndProfile">;
+ pkiApplicationProfileDAL?: Pick<
+ TPkiApplicationProfileDALFactory,
+ "findOneByApplicationAndProfile" | "findByApplicationId"
+ >;
};
export type TCertificateProfileServiceFactory = ReturnType<typeof certificateProfileServiceFactory>;
@@ -968,7 +975,8 @@ export const certificateProfileServiceFactory = ({
search,
enrollmentType,
issuerType,
- caId
+ caId,
+ applicationId
}: {
actor: ActorType;
actorId: string;
@@ -981,28 +989,53 @@ export const certificateProfileServiceFactory = ({
enrollmentType?: EnrollmentType;
issuerType?: IssuerType;
caId?: string;
+ applicationId?: string;
}): Promise<{
profiles: TCertificateProfileWithConfigs[];
totalCount: number;
}> => {
- const { permission } = await permissionService.getProjectPermission({
- actor,
- actorId,
- projectId,
- actorAuthMethod,
- actorOrgId,
- actionProjectType: ActionProjectType.CertificateManager
- });
- ForbiddenError.from(permission).throwUnlessCan(
- ProjectPermissionCertificateProfileActions.Read,
- ProjectPermissionSub.CertificateProfiles
- );
+ let processedRules: ReturnType<typeof getProcessedPermissionRules> | undefined;
+ let attachedProfileIds: string[] | undefined;
+ if (applicationId && pkiApplicationProfileDAL && (actor === ActorType.USER || actor === ActorType.IDENTITY)) {
+ const { permission } = await permissionService.getResourcePermission({
+ actor,
+ actorId,
+ projectId,
+ resourceType: ResourceType.CertificateApplication,
+ resourceId: applicationId,
+ actorAuthMethod,
+ actorOrgId
+ });
+ ForbiddenError.from(permission).throwUnlessCan(
+ ResourcePermissionApplicationActions.Read,
+ ResourcePermissionSub.Application
+ );
+ const attached = await pkiApplicationProfileDAL.findByApplicationId(applicationId);
+ attachedProfileIds = attached.map((p) => p.profileId);
+ } else {
+ const { permission } = await permissionService.getProjectPermission({
+ actor,
+ actorId,
+ projectId,
+ actorAuthMethod,
+ actorOrgId,
+ actionProjectType: ActionProjectType.CertificateManager
+ });
+ ForbiddenError.from(permission).throwUnlessCan(
+ ProjectPermissionCertificateProfileActions.Read,
+ ProjectPermissionSub.CertificateProfiles
+ );
- const processedRules = getProcessedPermissionRules(
- permission,
- ProjectPermissionCertificateProfileActions.Read,
- ProjectPermissionSub.CertificateProfiles
- );
+ processedRules = getProcessedPermissionRules(
+ permission,
+ ProjectPermissionCertificateProfileActions.Read,
+ ProjectPermissionSub.CertificateProfiles
+ );
+ }
+
+ if (attachedProfileIds && attachedProfileIds.length === 0) {
+ return { profiles: [], totalCount: 0 };
+ }
const profiles = await certificateProfileDAL.findByProjectId(
projectId,
@@ -1012,7 +1045,8 @@ export const certificateProfileServiceFactory = ({
search,
enrollmentType,
issuerType,
- caId
+ caId,
+ profileIds: attachedProfileIds
},
processedRules
);
@@ -1023,7 +1057,8 @@ export const certificateProfileServiceFactory = ({
search,
enrollmentType,
issuerType,
- caId
+ caId,
+ profileIds: attachedProfileIds
},
processedRules
);
diff --git a/backend/src/services/role/org/org-role-factory.ts b/backend/src/services/role/org/org-role-factory.ts
index 6af08ac969..f91dabccbd 100644
--- a/backend/src/services/role/org/org-role-factory.ts
+++ b/backend/src/services/role/org/org-role-factory.ts
@@ -3,8 +3,6 @@ import { ForbiddenError } from "@casl/ability";
import { AccessScope, OrganizationActionScope } from "@app/db/schemas";
import {
orgAdminPermissions,
- orgCertManagerAdminPermissions,
- orgCertManagerMemberPermissions,
orgMemberPermissions,
orgNoAccessPermissions,
OrgPermissionActions,
@@ -150,26 +148,6 @@ export const newOrgRoleFactory = ({
permissions: orgNoAccessPermissions,
createdAt: new Date(),
updatedAt: new Date()
- },
- {
- id: "b10d49a9-09a9-4443-916a-4246f9ff2c73", // dummy user for zod validation in response
- name: "Cert Manager Admin",
- slug: "cert-manager-admin",
- orgId: scopeField.value,
- description: "Full administrative access over the Cert Manager product",
- permissions: orgCertManagerAdminPermissions,
- createdAt: new Date(),
- updatedAt: new Date()
- },
- {
- id: "b10d49a9-09a9-4443-916a-4246f9ff2c74", // dummy user for zod validation in response
- name: "Cert Manager Member",
- slug: "cert-manager-member",
- orgId: scopeField.value,
- description: "Read-only access to the Cert Manager product",
- permissions: orgCertManagerMemberPermissions,
- createdAt: new Date(),
- updatedAt: new Date()
}
];
};
diff --git a/frontend/src/hooks/api/auditLogs/constants.tsx b/frontend/src/hooks/api/auditLogs/constants.tsx
index 0b52822318..93bdb7f68c 100644
--- a/frontend/src/hooks/api/auditLogs/constants.tsx
+++ b/frontend/src/hooks/api/auditLogs/constants.tsx
@@ -285,6 +285,8 @@ export const eventToNameMap: { [K in EventType]: string } = {
[EventType.CREATE_PROJECT_ROLE]: "Create Project Role",
[EventType.UPDATE_PROJECT_ROLE]: "Update Project Role",
[EventType.DELETE_PROJECT_ROLE]: "Delete Project Role",
+ [EventType.LIST_PROJECT_ROLES]: "List Project Roles",
+ [EventType.GET_PROJECT_ROLE]: "Get Project Role",
[EventType.CREATE_ORG_ROLE]: "Create Org Role",
[EventType.UPDATE_ORG_ROLE]: "Update Org Role",
@@ -458,6 +460,8 @@ const sharedProjectEvents = [
EventType.CREATE_PROJECT_ROLE,
EventType.UPDATE_PROJECT_ROLE,
EventType.DELETE_PROJECT_ROLE,
+ EventType.LIST_PROJECT_ROLES,
+ EventType.GET_PROJECT_ROLE,
EventType.APPROVAL_POLICY_CREATE,
EventType.APPROVAL_POLICY_UPDATE,
EventType.APPROVAL_POLICY_DELETE,
diff --git a/frontend/src/hooks/api/auditLogs/enums.tsx b/frontend/src/hooks/api/auditLogs/enums.tsx
index 619da195ad..a1e348ac54 100644
--- a/frontend/src/hooks/api/auditLogs/enums.tsx
+++ b/frontend/src/hooks/api/auditLogs/enums.tsx
@@ -277,6 +277,8 @@ export enum EventType {
CREATE_PROJECT_ROLE = "create-project-role",
UPDATE_PROJECT_ROLE = "update-project-role",
DELETE_PROJECT_ROLE = "delete-project-role",
+ LIST_PROJECT_ROLES = "list-project-roles",
+ GET_PROJECT_ROLE = "get-project-role",
CREATE_ORG_ROLE = "create-org-role",
UPDATE_ORG_ROLE = "update-org-role",
diff --git a/frontend/src/hooks/api/certificatePolicies/queries.tsx b/frontend/src/hooks/api/certificatePolicies/queries.tsx
index 6af5756eca..10ac28159d 100644
--- a/frontend/src/hooks/api/certificatePolicies/queries.tsx
+++ b/frontend/src/hooks/api/certificatePolicies/queries.tsx
@@ -10,7 +10,10 @@ import {
export const certificatePolicyKeys = {
listPolicies: (el: { limit?: number; offset?: number } = {}) => ["list-certificate-policies", el],
- getPolicyById: (id: string) => ["certificate-policy", id]
+ getPolicyById: (id: string, applicationId?: string) =>
+ applicationId
+ ? (["certificate-policy", id, { applicationId }] as const)
+ : (["certificate-policy", id] as const)
};
export const useListCertificatePolicies = ({
@@ -34,13 +37,18 @@ export const useListCertificatePolicies = ({
});
};
-export const useGetCertificatePolicyById = ({ policyId }: TGetCertificatePolicyByIdDTO) => {
+export const useGetCertificatePolicyById = ({
+ policyId,
+ applicationId
+}: TGetCertificatePolicyByIdDTO) => {
return useQuery({
- queryKey: certificatePolicyKeys.getPolicyById(policyId),
+ queryKey: certificatePolicyKeys.getPolicyById(policyId, applicationId),
queryFn: async () => {
const { data } = await apiRequest.get<{
certificatePolicy: TCertificatePolicy;
- }>(`/api/v1/cert-manager/certificate-policies/${policyId}`);
+ }>(`/api/v1/cert-manager/certificate-policies/${policyId}`, {
+ params: applicationId ? { applicationId } : undefined
+ });
return data.certificatePolicy;
},
enabled: Boolean(policyId)
diff --git a/frontend/src/hooks/api/certificatePolicies/types.ts b/frontend/src/hooks/api/certificatePolicies/types.ts
index f4e56c0ece..aed6932228 100644
--- a/frontend/src/hooks/api/certificatePolicies/types.ts
+++ b/frontend/src/hooks/api/certificatePolicies/types.ts
@@ -112,4 +112,5 @@ export type TListCertificatePoliciesDTO = {
export type TGetCertificatePolicyByIdDTO = {
policyId: string;
+ applicationId?: string;
};
diff --git a/frontend/src/hooks/api/certificateProfiles/queries.tsx b/frontend/src/hooks/api/certificateProfiles/queries.tsx
index 9b5e4d771f..50f53dec30 100644
--- a/frontend/src/hooks/api/certificateProfiles/queries.tsx
+++ b/frontend/src/hooks/api/certificateProfiles/queries.tsx
@@ -22,6 +22,7 @@ export const certificateProfileKeys = {
includeConfigs?: boolean;
enrollmentType?: string;
expiringDays?: number;
+ applicationId?: string;
}) => ["certificate-profiles", "list", params],
getById: (profileId: string) => ["certificate-profiles", "get-by-id", profileId],
getBySlug: (slug: string) => ["certificate-profiles", "get-by-slug", slug],
@@ -49,7 +50,8 @@ export const useListCertificateProfiles = ({
offset = 0,
search,
includeConfigs = false,
- enrollmentType
+ enrollmentType,
+ applicationId
}: TListCertificateProfilesDTO) => {
return useQuery({
queryKey: certificateProfileKeys.list({
@@ -57,7 +59,8 @@ export const useListCertificateProfiles = ({
offset,
search,
includeConfigs,
- enrollmentType
+ enrollmentType,
+ applicationId
}),
queryFn: async () => {
const { data } = await apiRequest.get<{
@@ -69,7 +72,8 @@ export const useListCertificateProfiles = ({
offset,
search,
includeConfigs,
- enrollmentType
+ enrollmentType,
+ applicationId
}
});
return data;
diff --git a/frontend/src/hooks/api/certificateProfiles/types.ts b/frontend/src/hooks/api/certificateProfiles/types.ts
index 66c3faee85..e585444577 100644
--- a/frontend/src/hooks/api/certificateProfiles/types.ts
+++ b/frontend/src/hooks/api/certificateProfiles/types.ts
@@ -176,6 +176,7 @@ export type TListCertificateProfilesDTO = {
enrollmentType?: EnrollmentType;
issuerType?: IssuerType;
caId?: string;
+ applicationId?: string;
};
export type TGetCertificateProfileByIdDTO = {
diff --git a/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx b/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx
index 43d2626e3f..9d333dc2b2 100644
--- a/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx
+++ b/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx
@@ -1,28 +1,37 @@
import { faWarning } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { useParams } from "@tanstack/react-router";
+import { Link, useParams } from "@tanstack/react-router";
+import { useOrganization } from "@app/context";
import { useCertManagerInstanceState } from "@app/hooks/api/certManagerInstance";
export const CertManagerInstanceBanner = () => {
const params = useParams({ strict: false }) as { projectId?: string };
const { projectId } = params;
+ const { currentOrg } = useOrganization();
const { data, isPending } = useCertManagerInstanceState();
if (isPending || !data || !data.isMultiInstance) return null;
const activeProject = data.projects.find((p) => p.id === data.activeProjectId);
- const otherCount = Math.max(0, data.projects.length - 1);
const isViewingActive = activeProject?.id === projectId;
const message = isViewingActive
- ? `Your organization has ${otherCount} other Certificate Manager ${otherCount === 1 ? "project" : "projects"}, consolidate to a single project, multi-project Certificate Manager will be deprecated soon.`
- : `Legacy Certificate Manager instance (active is ${activeProject?.name ?? "not set"}) — consolidate to a single instance, multi-project Certificate Manager will be deprecated soon.`;
+ ? "Multi-project Certificate Manager is being deprecated. Pick one project to keep and remove the rest."
+ : `This project is being retired. The active Certificate Manager project is "${activeProject?.name ?? "not set"}".`;
return (
- <div className="flex w-full items-center border-b border-yellow/50 bg-yellow/30 px-4 py-2 text-sm text-yellow-200">
- <FontAwesomeIcon icon={faWarning} className="mr-2.5 text-base text-yellow" />
+ <div className="flex w-full flex-wrap items-center gap-x-2 border-b border-yellow/50 bg-yellow/30 px-4 py-2 text-sm text-yellow-200">
+ <FontAwesomeIcon icon={faWarning} className="text-base text-yellow" />
<span>{message}</span>
+ <Link
+ to="/organizations/$orgId/settings"
+ params={{ orgId: currentOrg.id }}
+ search={{ selectedTab: "product-settings" }}
+ className="underline underline-offset-2 hover:text-yellow"
+ >
+ Click here to manage projects.
+ </Link>
</div>
);
};
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index 14d484a382..c6b10dafbe 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -430,6 +430,14 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
.map((p) => ({ value: p.id, label: p.slug })),
[profileList, attachedIds]
);
+ const totalProfileCount = profileList?.certificateProfiles?.length ?? 0;
+ let attachDisabledReason: string | null = null;
+ if (availableProfiles.length === 0) {
+ attachDisabledReason =
+ totalProfileCount === 0
+ ? "No certificate profiles exist yet. Create one in Certificate Manager → Policies first."
+ : "All certificate profiles in this project are already attached.";
+ }
const handleAttach = async () => {
if (profilesToAttach.length === 0) return;
@@ -470,22 +478,34 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
<div className="space-y-4">
<Card>
<CardHeader>
- <CardTitle>Enrollment Methods</CardTitle>
+ <CardTitle>Certificate Profiles</CardTitle>
<CardDescription>
- Define which profiles this Application uses and how certificates are requested from each
- one.
+ Attach the profiles this Application can issue from, then configure an enrollment method
+ (API, EST, ACME, or SCEP) on each profile.
</CardDescription>
{canManageProfileAttachments ? (
<CardAction>
- <Button
- size="sm"
- variant="project"
- onClick={() => setIsAttachOpen(true)}
- isDisabled={availableProfiles.length === 0}
- >
- <PlusIcon />
- Attach Profile
- </Button>
+ {attachDisabledReason ? (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- focusable wrapper required so the tooltip surfaces on keyboard focus despite the inner button being disabled */}
+ <span tabIndex={0}>
+ <Button size="sm" variant="project" isDisabled>
+ <PlusIcon />
+ Attach Profile
+ </Button>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent side="left" className="max-w-xs">
+ {attachDisabledReason}
+ </TooltipContent>
+ </Tooltip>
+ ) : (
+ <Button size="sm" variant="project" onClick={() => setIsAttachOpen(true)}>
+ <PlusIcon />
+ Attach Profile
+ </Button>
+ )}
</CardAction>
) : null}
</CardHeader>
@@ -494,16 +514,20 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
<Empty className="border">
<EmptyHeader>
<EmptyTitle>No profiles attached</EmptyTitle>
- <EmptyDescription>Attach a profile to enable issuance.</EmptyDescription>
+ <EmptyDescription>
+ Attach a certificate profile, then configure how this Application enrolls against
+ it.
+ </EmptyDescription>
</EmptyHeader>
</Empty>
) : (
- <Table>
+ <Table className="table-fixed">
<TableHeader>
<TableRow>
- <TableHead>Profile</TableHead>
- <TableHead>Methods</TableHead>
- <TableHead className="w-5" />
+ <TableHead className="w-[40%]">Profile</TableHead>
+ <TableHead className="w-[25%]">Enrollment Methods</TableHead>
+ <TableHead className="w-[25%]">Enrollment</TableHead>
+ <TableHead className="w-[10%] text-right">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
@@ -511,12 +535,12 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
const methods = methodBadges(p);
return (
<TableRow key={p.profileId}>
- <TableCell isTruncatable className="font-mono">
+ <TableCell isTruncatable className="font-mono" title={p.profileSlug}>
{p.profileSlug}
</TableCell>
<TableCell>
{methods.length === 0 ? (
- <span className="text-xs text-accent">None</span>
+ <span className="text-xs text-accent">Not configured</span>
) : (
<div className="flex flex-wrap gap-1.5">
{methods.map((m) => (
@@ -528,6 +552,16 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
)}
</TableCell>
<TableCell>
+ <Button
+ size="sm"
+ variant="outline"
+ onClick={() => setProfileToConfigure(p)}
+ >
+ <SettingsIcon />
+ {methods.length === 0 ? "Configure enrollment" : "Edit enrollment"}
+ </Button>
+ </TableCell>
+ <TableCell className="text-right">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton variant="ghost" size="xs">
@@ -535,10 +569,6 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
</IconButton>
</DropdownMenuTrigger>
<DropdownMenuContent className="min-w-44" align="end" sideOffset={2}>
- <DropdownMenuItem onClick={() => setProfileToConfigure(p)}>
- <SettingsIcon />
- Configure method
- </DropdownMenuItem>
{p.apiConfigId ? (
<DropdownMenuItem
onClick={() => {
diff --git a/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx b/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx
index cb08e582cc..c9936a2ff7 100644
--- a/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateRequestsPage/components/CertificateRequestsSection.tsx
@@ -21,14 +21,25 @@ import {
TBody,
Th,
THead,
+ Tooltip,
Tr
} from "@app/components/v2";
+import {
+ ProjectPermissionCertificateActions,
+ ProjectPermissionSub,
+ useProjectPermission
+} from "@app/context";
import { useDebounce, usePopUp } from "@app/hooks";
import { useListCertificateProfiles } from "@app/hooks/api/certificateProfiles";
import {
TListCertificateRequestsParams,
useListCertificateRequests
} from "@app/hooks/api/certificates";
+import {
+ PkiApplicationResourceActions,
+ PkiApplicationResourceSub,
+ useGetPkiApplicationPermissions
+} from "@app/hooks/api/pkiApplications";
import { CertificateIssuanceModal } from "../../CertificatesPage/components/CertificateIssuanceModal";
import {
@@ -78,9 +89,24 @@ export const CertificateRequestsSection = ({
}, [debouncedSearch]);
const { data: profilesData } = useListCertificateProfiles({
- limit: 100
+ limit: 100,
+ applicationId
});
+ const { permission: projectPermission } = useProjectPermission();
+ const { data: appPermissionData } = useGetPkiApplicationPermissions(applicationId ?? "");
+ const canRequestCertificate = applicationId
+ ? Boolean(
+ appPermissionData?.permission?.can(
+ PkiApplicationResourceActions.Create,
+ PkiApplicationResourceSub.Certificates
+ )
+ )
+ : projectPermission.can(
+ ProjectPermissionCertificateActions.Create,
+ ProjectPermissionSub.Certificates
+ );
+
const profileIds = useMemo(() => {
return appliedProfileIds.length > 0 ? appliedProfileIds : undefined;
}, [appliedProfileIds]);
@@ -190,14 +216,26 @@ export const CertificateRequestsSection = ({
</div>
</div>
<div className="flex gap-2">
- <Button
- colorSchema="primary"
- type="submit"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- onClick={() => handlePopUpOpen("issueCertificate")}
+ <Tooltip
+ content={
+ canRequestCertificate
+ ? undefined
+ : "You don't have permission to request certificates here."
+ }
+ position="left"
>
- Request
- </Button>
+ <span>
+ <Button
+ colorSchema="primary"
+ type="submit"
+ leftIcon={<FontAwesomeIcon icon={faPlus} />}
+ onClick={() => handlePopUpOpen("issueCertificate")}
+ isDisabled={!canRequestCertificate}
+ >
+ Request
+ </Button>
+ </span>
+ </Tooltip>
</div>
</div>
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx
index d62d946078..a62a2b862c 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal.tsx
@@ -155,7 +155,8 @@ export const CertificateIssuanceModal = ({
const { data: profilesData } = useListCertificateProfiles({
enrollmentType: EnrollmentType.API,
- includeConfigs: true
+ includeConfigs: true,
+ applicationId
});
const { data: appProfiles } = useListPkiApplicationProfiles(applicationId ?? "");
@@ -208,7 +209,8 @@ export const CertificateIssuanceModal = ({
);
const { data: policyData } = useGetCertificatePolicyById({
- policyId: actualSelectedProfile?.certificatePolicyId || ""
+ policyId: actualSelectedProfile?.certificatePolicyId || "",
+ applicationId
});
const {
diff --git a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
index c6b657e8d7..fe6ddd5129 100644
--- a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
+++ b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
@@ -3,7 +3,7 @@ import { useNavigate } from "@tanstack/react-router";
import { createNotification } from "@app/components/notifications";
import { RequestProjectAccessModal } from "@app/components/projects/RequestProjectAccessModal";
-import { Button, Lottie, Modal, ModalClose, ModalContent } from "@app/components/v2";
+import { Lottie } from "@app/components/v2";
import {
Card,
CardContent,
@@ -44,7 +44,6 @@ export const ProjectCategoryOverview = () => {
const { data: certManagerInstance } = useCertManagerInstanceState();
const orgAdminAccessProject = useOrgAdminAccessProject();
- const [isJoinAdminOpen, setIsJoinAdminOpen] = useState(false);
const [isRequestAccessOpen, setIsRequestAccessOpen] = useState(false);
const projectCountsByType = useMemo(
@@ -78,21 +77,7 @@ export const ProjectCategoryOverview = () => {
});
};
- const handleJoinAsAdmin = async () => {
- if (!certManagerActiveProjectId) return;
- try {
- await orgAdminAccessProject.mutateAsync({ projectId: certManagerActiveProjectId });
- setIsJoinAdminOpen(false);
- navigateToCertManager(certManagerActiveProjectId);
- } catch (err) {
- createNotification({
- type: "error",
- text: err instanceof Error ? err.message : "Failed to join the Certificate Manager project."
- });
- }
- };
-
- const handleTileClick = (type: ProjectType) => {
+ const handleTileClick = async (type: ProjectType) => {
const orgId = currentOrg?.id || "";
if (type === ProjectType.CertificateManager) {
@@ -101,13 +86,21 @@ export const ProjectCategoryOverview = () => {
navigateToCertManager(certManagerActiveProjectId);
return;
}
- if (
- permission.can(
- OrgPermissionAdminConsoleAction.AccessAllProjects,
- OrgPermissionSubjects.AdminConsole
- )
- ) {
- setIsJoinAdminOpen(true);
+ const isOrgAdmin = permission.can(
+ OrgPermissionAdminConsoleAction.AccessAllProjects,
+ OrgPermissionSubjects.AdminConsole
+ );
+ if (isOrgAdmin) {
+ try {
+ await orgAdminAccessProject.mutateAsync({ projectId: certManagerActiveProjectId });
+ navigateToCertManager(certManagerActiveProjectId);
+ } catch (err) {
+ createNotification({
+ type: "error",
+ text:
+ err instanceof Error ? err.message : "Failed to join the Certificate Manager project."
+ });
+ }
} else {
setIsRequestAccessOpen(true);
}
@@ -187,29 +180,6 @@ export const ProjectCategoryOverview = () => {
})}
</div>
- <Modal isOpen={isJoinAdminOpen} onOpenChange={setIsJoinAdminOpen}>
- <ModalContent
- title="Join Certificate Manager"
- subTitle="You are not a member of Certificate Manager. Click Continue to join as an admin."
- >
- <div className="mt-4 flex items-center">
- <Button
- className="mr-4"
- size="sm"
- onClick={handleJoinAsAdmin}
- isLoading={orgAdminAccessProject.isPending}
- >
- Continue
- </Button>
- <ModalClose asChild>
- <Button colorSchema="secondary" variant="plain">
- Cancel
- </Button>
- </ModalClose>
- </div>
- </ModalContent>
- </Modal>
-
<RequestProjectAccessModal
isOpen={isRequestAccessOpen}
onOpenChange={setIsRequestAccessOpen}
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx
index f62d4afea6..48dfbe6332 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx
@@ -17,11 +17,6 @@ import {
AlertTitle,
Badge,
Button,
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
Dialog,
DialogContent,
DialogDescription,
@@ -90,8 +85,13 @@ export const OrgCertManagerTab = () => {
if (isPending) {
return (
- <div className="h-32">
- <PageLoader lottieClassName="w-16" />
+ <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
+ <div className="mb-6">
+ <h2 className="text-xl font-medium text-mineshaft-100">Certificate Manager</h2>
+ </div>
+ <div className="h-32">
+ <PageLoader lottieClassName="w-16" />
+ </div>
</div>
);
}
@@ -131,7 +131,10 @@ export const OrgCertManagerTab = () => {
};
return (
- <>
+ <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
+ <div className="mb-6">
+ <h2 className="text-xl font-medium text-mineshaft-100">Certificate Manager</h2>
+ </div>
{isMultiInstance && (
<Alert variant="warning" className="mb-4">
<TriangleAlertIcon />
@@ -142,70 +145,56 @@ export const OrgCertManagerTab = () => {
</AlertDescription>
</Alert>
)}
- <Card>
- <CardHeader>
- <CardTitle>Certificate Manager</CardTitle>
- <CardDescription>
- Manage the Certificate Manager projects in this organization. The active project is the
- one the product launches into and the one API requests without a projectId resolve to.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead className="w-full">Project</TableHead>
- <TableHead className="whitespace-nowrap">Status</TableHead>
- <TableHead className="w-5" />
- </TableRow>
- </TableHeader>
- <TableBody>
- {instances.map((instance) => (
- <TableRow key={instance.id}>
- <TableCell className="w-full">
- <div className="flex items-center gap-x-2">
- <BoxIcon className="size-4 shrink-0 text-project" />
- <span className="font-mono">{instance.name}</span>
- <span className="font-mono text-xs text-accent">{instance.slug}</span>
- </div>
- </TableCell>
- <TableCell className="whitespace-nowrap">
- {instance.isActive ? <Badge variant="success">Active</Badge> : null}
- </TableCell>
- <TableCell>
- {canManage && !instance.isActive ? (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton
- variant="ghost"
- size="xs"
- aria-label={`Manage ${instance.name}`}
- >
- <MoreHorizontalIcon />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
- <DropdownMenuItem onClick={() => setPendingActive(instance)}>
- <StarIcon />
- Set as active
- </DropdownMenuItem>
- <DropdownMenuItem
- variant="danger"
- onClick={() => setPendingDelete(instance)}
- >
- <Trash2Icon />
- Delete project
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- ) : null}
- </TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- </CardContent>
- </Card>
+ <p className="mb-4 text-sm text-mineshaft-400">
+ The active project is the one the product launches into and the one API requests without a
+ projectId resolve to.
+ </p>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead className="w-full">Project</TableHead>
+ <TableHead className="whitespace-nowrap">Status</TableHead>
+ <TableHead className="w-5" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {instances.map((instance) => (
+ <TableRow key={instance.id}>
+ <TableCell className="w-full">
+ <div className="flex items-center gap-x-2">
+ <BoxIcon className="size-4 shrink-0 text-project" />
+ <span className="font-mono">{instance.name}</span>
+ <span className="font-mono text-xs text-accent">{instance.slug}</span>
+ </div>
+ </TableCell>
+ <TableCell className="whitespace-nowrap">
+ {instance.isActive ? <Badge variant="success">Active</Badge> : null}
+ </TableCell>
+ <TableCell>
+ {canManage && !instance.isActive ? (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs" aria-label={`Manage ${instance.name}`}>
+ <MoreHorizontalIcon />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
+ <DropdownMenuItem onClick={() => setPendingActive(instance)}>
+ <StarIcon />
+ Set as active
+ </DropdownMenuItem>
+ <DropdownMenuItem variant="danger" onClick={() => setPendingDelete(instance)}>
+ <Trash2Icon />
+ Delete project
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ ) : null}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
<Dialog
open={Boolean(pendingActive)}
@@ -277,6 +266,6 @@ export const OrgCertManagerTab = () => {
onDeleteApproved={handleConfirmDelete}
buttonText="Delete project"
/>
- </>
+ </div>
);
};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/OrgProductSettingsTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/OrgProductSettingsTab.tsx
index 96c426683b..8637752645 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/OrgProductSettingsTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/OrgProductSettingsTab.tsx
@@ -6,6 +6,7 @@ import { Switch } from "@app/components/v2";
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { useUpdateOrg } from "@app/hooks/api/organization/queries";
+import { OrgCertManagerTab } from "../OrgCertManagerTab";
import { HoneyTokenSection } from "./HoneyTokenSection";
export const OrgProductSettingsTab = () => {
@@ -38,32 +39,35 @@ export const OrgProductSettingsTab = () => {
};
return (
- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
- <div className="mb-6">
- <h2 className="text-xl font-medium text-mineshaft-100">Secrets Management</h2>
- </div>
- <div className="flex items-center justify-between">
- <div>
- <h3 className="mb-2 text-lg font-medium text-mineshaft-100">
- Unique Secret Sync Destination Policy
- </h3>
- <p className="text-sm text-mineshaft-400">
- When enabled, ensures each destination can only be used by one secret sync
- configuration, preventing potential conflicts or overwrites.
- </p>
+ <>
+ <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
+ <div className="mb-6">
+ <h2 className="text-xl font-medium text-mineshaft-100">Secrets Management</h2>
+ </div>
+ <div className="flex items-center justify-between">
+ <div>
+ <h3 className="mb-2 text-lg font-medium text-mineshaft-100">
+ Unique Secret Sync Destination Policy
+ </h3>
+ <p className="text-sm text-mineshaft-400">
+ When enabled, ensures each destination can only be used by one secret sync
+ configuration, preventing potential conflicts or overwrites.
+ </p>
+ </div>
+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
+ {(isAllowed) => (
+ <Switch
+ id="blockDuplicateSecretSyncDestinations"
+ isDisabled={!isAllowed || isLoading}
+ isChecked={currentOrg?.blockDuplicateSecretSyncDestinations ?? false}
+ onCheckedChange={(state) => handleToggle(state as boolean)}
+ />
+ )}
+ </OrgPermissionCan>
</div>
- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
- {(isAllowed) => (
- <Switch
- id="blockDuplicateSecretSyncDestinations"
- isDisabled={!isAllowed || isLoading}
- isChecked={currentOrg?.blockDuplicateSecretSyncDestinations ?? false}
- onCheckedChange={(state) => handleToggle(state as boolean)}
- />
- )}
- </OrgPermissionCan>
+ <HoneyTokenSection />
</div>
- <HoneyTokenSection />
- </div>
+ <OrgCertManagerTab />
+ </>
);
};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
index 9884289a20..bdf79ee996 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
@@ -4,12 +4,10 @@ import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { TabPanel, Tabs } from "@app/components/v2";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useSubscription } from "@app/context";
-import { useCertManagerInstanceState } from "@app/hooks/api/certManagerInstance";
import { usePopUp } from "@app/hooks/usePopUp";
import { AuditLogStreamsTab } from "../AuditLogStreamTab";
import { ExternalMigrationsTab } from "../ExternalMigrationsTab";
-import { OrgCertManagerTab } from "../OrgCertManagerTab";
import { OrgEncryptionTab } from "../OrgEncryptionTab";
import { OrgGeneralTab } from "../OrgGeneralTab";
import { OrgProductSettingsTab } from "../OrgProductSettingsTab";
@@ -27,11 +25,8 @@ export const OrgTabGroup = () => {
const navigate = useNavigate();
const { currentOrg, isSubOrganization } = useOrganization();
const { subscription } = useSubscription();
- const { data: certManagerInstance } = useCertManagerInstanceState();
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
- const hasMultipleCertManagerInstances = (certManagerInstance?.projects.length ?? 0) >= 2;
-
const tabs = [
{ name: "General", key: "tab-org-general", component: OrgGeneralTab },
{
@@ -78,12 +73,6 @@ export const OrgTabGroup = () => {
key: "product-settings",
component: OrgProductSettingsTab
},
- {
- name: "Certificate Manager",
- key: "cert-manager",
- component: OrgCertManagerTab,
- isHidden: !hasMultipleCertManagerInstances
- },
{
name: "Sub Organizations",
key: "tab-sub-organizations",