Skip to content

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

UI improvements

Carlos Monastyrski0dae619e9550
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 b4862b8b29..2c5afff354 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
@@ -13,6 +13,16 @@ const CERT_MANAGER_ROLE_SLUGS = new Set([ProjectMembershipRole.Admin, ProjectMem
const CERT_MANAGER_CUSTOM_ROLE_ERROR =
"Certificate Manager does not support custom roles. Use the built-in Admin or Member role.";
+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"
+};
+
+const overrideDescription = <T extends { slug: string; description?: string | null }>(role: T): T => ({
+ ...role,
+ description: CERT_MANAGER_ROLE_DESCRIPTIONS[role.slug] ?? role.description
+});
+
export const registerCertManagerAccessRolesRouter = async (server: FastifyZodProvider) => {
server.route({
method: "GET",
@@ -43,7 +53,9 @@ export const registerCertManagerAccessRolesRouter = async (server: FastifyZodPro
}
});
return {
- roles: roles.filter((el) => CERT_MANAGER_ROLE_SLUGS.has(el.slug as ProjectMembershipRole))
+ roles: roles
+ .filter((el) => CERT_MANAGER_ROLE_SLUGS.has(el.slug as ProjectMembershipRole))
+ .map(overrideDescription)
};
}
});
@@ -73,7 +85,7 @@ export const registerCertManagerAccessRolesRouter = async (server: FastifyZodPro
metadata: { projectId, slug: req.params.roleSlug }
}
});
- return { role };
+ return { role: overrideDescription(role) };
}
});
diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.ts
index c08a39ab0b..709a8ed3dc 100644
--- a/backend/src/services/project/project-service.ts
+++ b/backend/src/services/project/project-service.ts
@@ -2441,6 +2441,12 @@ export const projectServiceFactory = ({
const callbackPath = `/organizations/${project.orgId}/projects/${projectTypeUrl}/${project.id}/access-management?selectedTab=members&requesterEmail=${userDetails.email}`;
+ const productLabel = project.type === ProjectType.CertificateManager ? "Certificate Manager" : null;
+ const notificationTitle = productLabel ? `${productLabel} Access Request` : "Project Access Request";
+ const notificationBody = productLabel
+ ? `**${userDetails.firstName} ${userDetails.lastName}** (${userDetails.email}) has requested access to **${productLabel}**.`
+ : `**${userDetails.firstName} ${userDetails.lastName}** (${userDetails.email}) has requested access to the project **${project.name}**.`;
+
await notificationService.createUserNotifications(
projectMembers
.filter((member) => member.roles.some((role) => role.role === ProjectMembershipRole.Admin))
@@ -2448,8 +2454,8 @@ export const projectServiceFactory = ({
userId: member.userId,
orgId: project.orgId,
type: NotificationType.PROJECT_ACCESS_REQUEST,
- title: "Project Access Request",
- body: `**${userDetails.firstName} ${userDetails.lastName}** (${userDetails.email}) has requested access to the project **${project.name}**.`,
+ title: notificationTitle,
+ body: notificationBody,
link: callbackPath
}))
);
@@ -2457,14 +2463,15 @@ export const projectServiceFactory = ({
await smtpService.sendMail({
template: SmtpTemplates.ProjectAccessRequest,
recipients: filteredProjectMembers,
- subjectLine: "Project Access Request",
+ subjectLine: notificationTitle,
substitutions: {
requesterName: `${userDetails.firstName} ${userDetails.lastName}`,
requesterEmail: userDetails.email,
projectName: project?.name,
orgName: org?.name,
note: comment,
- callback_url: `${appCfg.SITE_URL}${callbackPath}`
+ callback_url: `${appCfg.SITE_URL}${callbackPath}`,
+ ...(productLabel ? { productLabel } : {})
}
});
};
diff --git a/backend/src/services/smtp/emails/ProjectAccessRequestTemplate.tsx b/backend/src/services/smtp/emails/ProjectAccessRequestTemplate.tsx
index 28eb20cbdf..d5b182cfc2 100644
--- a/backend/src/services/smtp/emails/ProjectAccessRequestTemplate.tsx
+++ b/backend/src/services/smtp/emails/ProjectAccessRequestTemplate.tsx
@@ -12,6 +12,7 @@ interface ProjectAccessRequestTemplateProps extends Omit<BaseEmailWrapperProps,
orgName: string;
note: string;
callback_url: string;
+ productLabel?: string;
}
export const ProjectAccessRequestTemplate = ({
@@ -21,21 +22,38 @@ export const ProjectAccessRequestTemplate = ({
requesterEmail,
orgName,
note,
- callback_url
+ callback_url,
+ productLabel
}: ProjectAccessRequestTemplateProps) => {
+ const title = productLabel ? `${productLabel} Access Request` : "Project Access Request";
+ const preview = productLabel
+ ? `A user has requested access to ${productLabel}.`
+ : "A user has requested access to an Infisical project.";
return (
- <BaseEmailWrapper
- title="Project Access Request"
- preview="A user has requested access to an Infisical project."
- siteUrl={siteUrl}
- >
+ <BaseEmailWrapper title={title} preview={preview} siteUrl={siteUrl}>
<Heading className="text-black text-[18px] leading-[28px] text-center font-normal p-0 mx-0">
- A user has requested access to the project <strong>{projectName}</strong>
+ {productLabel ? (
+ <>
+ A user has requested access to <strong>{productLabel}</strong>
+ </>
+ ) : (
+ <>
+ A user has requested access to the project <strong>{projectName}</strong>
+ </>
+ )}
</Heading>
<Section className="px-[24px] mb-[28px] mt-[36px] pt-[12px] pb-[8px] border border-solid border-gray-200 rounded-md bg-gray-50">
<Text className="text-black text-[14px] leading-[24px]">
<strong>{requesterName}</strong> (<BaseLink href={`mailto:${requesterEmail}`}>{requesterEmail}</BaseLink>) has
- requested access to the project <strong>{projectName}</strong> in the organization <strong>{orgName}</strong>.
+ requested access to{" "}
+ {productLabel ? (
+ <strong>{productLabel}</strong>
+ ) : (
+ <>
+ the project <strong>{projectName}</strong>
+ </>
+ )}{" "}
+ in the organization <strong>{orgName}</strong>.
</Text>
<Text className="text-[14px] text-slate-700 leading-[24px]">
<strong className="text-black">User note:</strong> "{note}"
diff --git a/frontend/src/components/projects/RequestProjectAccessModal.tsx b/frontend/src/components/projects/RequestProjectAccessModal.tsx
index c39d216500..92d2ece9c4 100644
--- a/frontend/src/components/projects/RequestProjectAccessModal.tsx
+++ b/frontend/src/components/projects/RequestProjectAccessModal.tsx
@@ -26,8 +26,8 @@ const Content = ({ projectId, onComplete }: ContentProps) => {
onSuccess: () => {
createNotification({
type: "success",
- title: "Project Access Request Sent",
- text: "Project admins will receive an email of your request"
+ title: "Access Request Sent",
+ text: "Admins will receive an email of your request"
});
onComplete();
}
diff --git a/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx b/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx
index 9d333dc2b2..f00a7fc8ab 100644
--- a/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx
+++ b/frontend/src/layouts/PkiManagerLayout/components/CertManagerInstanceBanner.tsx
@@ -17,7 +17,7 @@ export const CertManagerInstanceBanner = () => {
const isViewingActive = activeProject?.id === projectId;
const message = isViewingActive
- ? "Multi-project Certificate Manager is being deprecated. Pick one project to keep and remove the rest."
+ ? "Certificate Manager now supports one project per organization. Select the project you want to keep and migrate the rest."
: `This project is being retired. The active Certificate Manager project is "${activeProject?.name ?? "not set"}".`;
return (
@@ -30,7 +30,7 @@ export const CertManagerInstanceBanner = () => {
search={{ selectedTab: "product-settings" }}
className="underline underline-offset-2 hover:text-yellow"
>
- Click here to manage projects.
+ Click here.
</Link>
</div>
);
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx
index 46e7715396..6e8bc7dd3a 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx
@@ -196,7 +196,7 @@ export const ApplicationMembersTab = ({ members, applicationId }: Props) => {
<DeleteActionModal
isOpen={popUp.removeMember.isOpen}
title="Remove member?"
- subTitle="The member loses access to this Application immediately. They keep their other project memberships."
+ subTitle="The member loses access to this Application immediately. Their access to other Applications is unchanged."
onChange={(o) => handlePopUpToggle("removeMember", o)}
deleteKey="confirm"
onDeleteApproved={async () => {
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index c6b10dafbe..cce50fa951 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -6,13 +6,11 @@ import { formatDistance } from "date-fns";
import {
CircleStopIcon,
EyeIcon,
- FilePlusIcon,
InfoIcon,
MoreHorizontalIcon,
PencilIcon,
PlayIcon,
PlusIcon,
- SettingsIcon,
Trash2Icon
} from "lucide-react";
@@ -83,7 +81,6 @@ import {
useDetachPkiApplicationProfile
} from "@app/hooks/api/pkiApplications";
import { PolicyModal } from "@app/pages/cert-manager/ApprovalsPage/components/PolicyTab/components/PolicyModal";
-import { CertificateIssuanceModal } from "@app/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal";
import { CreatePkiAlertV2Modal } from "@app/views/PkiAlertsV2Page/components/CreatePkiAlertV2Modal";
import { ViewPkiAlertV2Modal } from "@app/views/PkiAlertsV2Page/components/ViewPkiAlertV2Modal";
import {
@@ -361,12 +358,6 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
"policy",
"deletePolicy"
] as const);
- const {
- popUp: issuePopUp,
- handlePopUpOpen: handleIssuePopUpOpen,
- handlePopUpToggle: handleIssuePopUpToggle
- } = usePopUp(["issueCertificate"] as const);
- const [profileToIssue, setProfileToIssue] = useState<TPkiApplicationProfile | null>(null);
const deletePolicy = useDeleteApprovalPolicy();
const { data: alertsData, isLoading: isAlertsLoading } = useGetPkiAlertsV2({
@@ -521,66 +512,55 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
</EmptyHeader>
</Empty>
) : (
- <Table className="table-fixed">
+ <Table>
<TableHeader>
<TableRow>
- <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>
+ <TableHead className="w-1/2">Profile</TableHead>
+ <TableHead className="w-1/2">Enrollment Methods</TableHead>
+ <TableHead className="w-5" />
</TableRow>
</TableHeader>
<TableBody>
{profiles.map((p) => {
const methods = methodBadges(p);
+ const hasMethods = methods.length > 0;
return (
<TableRow key={p.profileId}>
- <TableCell isTruncatable className="font-mono" title={p.profileSlug}>
- {p.profileSlug}
- </TableCell>
- <TableCell>
- {methods.length === 0 ? (
- <span className="text-xs text-accent">Not configured</span>
- ) : (
- <div className="flex flex-wrap gap-1.5">
- {methods.map((m) => (
- <Badge key={m} variant="neutral">
- {m}
- </Badge>
- ))}
- </div>
- )}
- </TableCell>
+ <TableCell className="font-mono">{p.profileSlug}</TableCell>
<TableCell>
- <Button
- size="sm"
- variant="outline"
+ <button
+ type="button"
onClick={() => setProfileToConfigure(p)}
+ className="group -mx-2 inline-flex items-center gap-2 rounded-sm px-2 py-1 text-left transition-colors hover:bg-mineshaft-700/50"
+ aria-label={
+ hasMethods
+ ? `Edit enrollment for ${p.profileSlug}`
+ : `Configure enrollment for ${p.profileSlug}`
+ }
>
- <SettingsIcon />
- {methods.length === 0 ? "Configure enrollment" : "Edit enrollment"}
- </Button>
+ {hasMethods ? (
+ <div className="flex flex-wrap gap-1.5">
+ {methods.map((m) => (
+ <Badge key={m} variant="neutral">
+ {m}
+ </Badge>
+ ))}
+ </div>
+ ) : (
+ <span className="text-xs text-accent">Configure</span>
+ )}
+ <PencilIcon className="size-3 shrink-0 text-accent opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100" />
+ </button>
</TableCell>
<TableCell className="text-right">
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton variant="ghost" size="xs">
- <MoreHorizontalIcon />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent className="min-w-44" align="end" sideOffset={2}>
- {p.apiConfigId ? (
- <DropdownMenuItem
- onClick={() => {
- setProfileToIssue(p);
- handleIssuePopUpOpen("issueCertificate");
- }}
- >
- <FilePlusIcon />
- Request Certificate
- </DropdownMenuItem>
- ) : null}
- {canManageProfileAttachments ? (
+ {canManageProfileAttachments ? (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs">
+ <MoreHorizontalIcon />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="min-w-44" align="end" sideOffset={2}>
<DropdownMenuItem
variant="danger"
onClick={() => setProfileToDetach(p)}
@@ -588,9 +568,9 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
<Trash2Icon />
Detach Profile
</DropdownMenuItem>
- ) : null}
- </DropdownMenuContent>
- </DropdownMenu>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ ) : null}
</TableCell>
</TableRow>
);
@@ -774,16 +754,6 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
applicationId={application.id}
profile={profileToConfigure}
/>
-
- <CertificateIssuanceModal
- popUp={issuePopUp}
- handlePopUpToggle={(name, state) => {
- handleIssuePopUpToggle(name, state);
- if (state === false) setProfileToIssue(null);
- }}
- profileId={profileToIssue?.profileId}
- applicationId={application.id}
- />
</div>
);
};
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
index 5981e3007a..5597d3f625 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
@@ -848,7 +848,7 @@ const METHOD_LABELS: Record<EnrollmentMethod, string> = {
const METHOD_DESCRIPTIONS: Record<EnrollmentMethod, string> = {
api: "Clients call the Infisical API directly to request certificates.",
est: "Clients use the EST protocol (RFC 7030) over HTTPS.",
- acme: "Clients use the ACME protocol (RFC 8555) — same flow as Let's Encrypt.",
+ acme: "Clients use the ACME protocol (RFC 8555) over HTTPS.",
scep: "Network devices use the SCEP protocol over HTTPS."
};
diff --git a/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx b/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx
index 962f913332..f7d0475b15 100644
--- a/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react";
+import { useEffect, useMemo } from "react";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
@@ -14,14 +14,20 @@ import {
DialogTitle,
Field,
FieldContent,
+ FieldDescription,
FieldError,
FieldLabel,
+ FilterableSelect,
Input,
TextArea
} from "@app/components/v3";
+import { useListCertificateProfiles } from "@app/hooks/api/certificateProfiles";
import {
TPkiApplication,
+ useAttachPkiApplicationProfiles,
useCreatePkiApplication,
+ useDetachPkiApplicationProfile,
+ useListPkiApplicationProfiles,
useUpdatePkiApplication
} from "@app/hooks/api/pkiApplications";
import { UsePopUpState } from "@app/hooks/usePopUp";
@@ -35,7 +41,8 @@ const schema = z.object({
.min(1, "Name is required")
.max(64)
.regex(SLUG_REGEX, "Name must contain only lowercase letters, numbers, and hyphens"),
- description: z.string().trim().max(256).optional()
+ description: z.string().trim().max(256).optional(),
+ profileIds: z.array(z.object({ value: z.string(), label: z.string() })).optional()
});
type FormData = z.infer<typeof schema>;
@@ -49,6 +56,25 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {
const editing = (popUp?.application?.data as TPkiApplication | undefined) ?? null;
const create = useCreatePkiApplication();
const update = useUpdatePkiApplication();
+ const attachProfiles = useAttachPkiApplicationProfiles();
+ const detachProfile = useDetachPkiApplicationProfile();
+
+ const { data: profilesData } = useListCertificateProfiles({ limit: 100 });
+ const { data: attachedProfiles } = useListPkiApplicationProfiles(editing?.id ?? "");
+
+ const profileOptions = useMemo(
+ () =>
+ (profilesData?.certificateProfiles ?? []).map((p) => ({
+ value: p.id,
+ label: p.slug
+ })),
+ [profilesData]
+ );
+
+ const initialAttachedOptions = useMemo(() => {
+ if (!editing) return [];
+ return (attachedProfiles ?? []).map((p) => ({ value: p.profileId, label: p.profileSlug }));
+ }, [editing, attachedProfiles]);
const {
control,
@@ -57,33 +83,55 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {
formState: { isSubmitting }
} = useForm<FormData>({
resolver: zodResolver(schema),
- defaultValues: { name: "", description: "" }
+ defaultValues: { name: "", description: "", profileIds: [] }
});
useEffect(() => {
if (editing) {
reset({
name: editing.name,
- description: editing.description ?? ""
+ description: editing.description ?? "",
+ profileIds: initialAttachedOptions
});
} else {
- reset({ name: "", description: "" });
+ reset({ name: "", description: "", profileIds: [] });
}
- }, [editing, reset]);
+ }, [editing, reset, initialAttachedOptions]);
const onSubmit = async (data: FormData) => {
try {
+ const selectedIds = (data.profileIds ?? []).map((p) => p.value);
if (editing) {
await update.mutateAsync({
applicationId: editing.id,
name: data.name,
description: data.description?.length ? data.description : null
});
+
+ const currentIds = new Set(initialAttachedOptions.map((p) => p.value));
+ const nextIds = new Set(selectedIds);
+ const toAttach = selectedIds.filter((id) => !currentIds.has(id));
+ const toDetach = [...currentIds].filter((id) => !nextIds.has(id));
+
+ if (toAttach.length > 0) {
+ await attachProfiles.mutateAsync({
+ applicationId: editing.id,
+ profileIds: toAttach
+ });
+ }
+ // Detach mutations are independent — fire them in parallel.
+ await Promise.all(
+ toDetach.map((profileId) =>
+ detachProfile.mutateAsync({ applicationId: editing.id, profileId })
+ )
+ );
+
createNotification({ type: "success", text: "Application updated" });
} else {
await create.mutateAsync({
name: data.name,
- description: data.description
+ description: data.description,
+ profileIds: selectedIds
});
createNotification({ type: "success", text: "Application created" });
}
@@ -104,8 +152,8 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {
<DialogTitle>{editing ? "Edit Application" : "Create Application"}</DialogTitle>
<DialogDescription>
{editing
- ? "Update the Application's metadata. Changing the name will invalidate any deep links."
- : "Group the profiles, members, and approval policies for one workload, like a service, environment, or team, so issuance and access are managed together."}
+ ? "Update the Application's metadata and attached profiles. 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."}
</DialogDescription>
</DialogHeader>
@@ -139,6 +187,32 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {
</Field>
)}
/>
+ <Controller
+ control={control}
+ name="profileIds"
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Certificate Profiles</FieldLabel>
+ <FieldContent>
+ <FilterableSelect
+ isMulti
+ value={field.value ?? []}
+ onChange={(val) =>
+ field.onChange((val ?? []) as { value: string; label: string }[])
+ }
+ options={profileOptions}
+ placeholder="Select profiles to attach..."
+ />
+ </FieldContent>
+ <FieldDescription>
+ {editing
+ ? "Profiles this Application can issue from. Add or remove to update its attachments."
+ : "Optionally attach existing profiles now. You can change this later."}
+ </FieldDescription>
+ {error ? <FieldError>{error.message}</FieldError> : null}
+ </Field>
+ )}
+ />
<DialogFooter>
<Button
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx
index 48dfbe6332..3d69ec8c28 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgCertManagerTab/OrgCertManagerTab.tsx
@@ -1,13 +1,6 @@
import { useEffect, useState } from "react";
import { useQueryClient } from "@tanstack/react-query";
-import {
- ArrowRightIcon,
- BoxIcon,
- MoreHorizontalIcon,
- StarIcon,
- Trash2Icon,
- TriangleAlertIcon
-} from "lucide-react";
+import { BoxIcon, MoreHorizontalIcon, StarIcon, Trash2Icon, TriangleAlertIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { DeleteActionModal } from "@app/components/v2";
@@ -28,11 +21,6 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
IconButton,
- Item,
- ItemContent,
- ItemDescription,
- ItemMedia,
- ItemTitle,
PageLoader,
Table,
TableBody,
@@ -97,8 +85,6 @@ export const OrgCertManagerTab = () => {
}
if (instances.length <= 1) return null;
- const active = instances.find((i) => i.isActive);
-
const handleConfirmActive = async () => {
if (!pendingActive) return;
try {
@@ -206,44 +192,21 @@ export const OrgCertManagerTab = () => {
<DialogHeader>
<DialogTitle>Confirm change</DialogTitle>
<DialogDescription>
- This changes the default Certificate Manager project for the entire organization.
+ This changes the default Certificate Manager for the entire organization.
</DialogDescription>
</DialogHeader>
<Alert variant="warning">
<TriangleAlertIcon />
<AlertDescription>
- Every member in the organization will start landing on this project, and API requests
- without a projectId will resolve to it.
+ <p>
+ <span className="font-semibold">{pendingActive?.name ?? ""}</span> will become the
+ default for your organization. All members and integrations will resolve to this
+ instance going forward.
+ </p>
</AlertDescription>
</Alert>
- <div className="flex items-center gap-3 rounded-md border border-border bg-card px-3 py-3">
- <Item variant="default" size="xs" className="flex-1 border-transparent p-0">
- <ItemMedia>
- <BoxIcon className="size-4 text-project" />
- </ItemMedia>
- <ItemContent>
- <ItemTitle>{active?.name ?? "—"}</ItemTitle>
- {active?.slug ? (
- <ItemDescription className="font-mono">{active.slug}</ItemDescription>
- ) : null}
- </ItemContent>
- </Item>
- <ArrowRightIcon className="size-4 shrink-0 text-mineshaft-400" aria-hidden />
- <Item variant="default" size="xs" className="flex-1 border-transparent p-0">
- <ItemMedia>
- <BoxIcon className="size-4 text-project" />
- </ItemMedia>
- <ItemContent>
- <ItemTitle>{pendingActive?.name ?? "—"}</ItemTitle>
- {pendingActive?.slug ? (
- <ItemDescription className="font-mono">{pendingActive.slug}</ItemDescription>
- ) : null}
- </ItemContent>
- </Item>
- </div>
-
<DialogFooter>
<Button variant="ghost" onClick={() => setPendingActive(null)}>
Cancel
diff --git a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx
index a4743f1ebc..dbd29acc5a 100644
--- a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx
+++ b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/IdentityTab.tsx
@@ -667,12 +667,14 @@ export const IdentityTab = withProjectPermission(
</TooltipTrigger>
<TooltipContent side="right" align="start" className="max-w-sm">
<p className="mb-2 text-mineshaft-300">
- You can add machine identities to your project in one of two ways:
+ You can add machine identities to your{" "}
+ {isCertManager ? "Certificate Manager" : "project"} in one of two ways:
</p>
<ul className="ml-3.5 flex list-disc flex-col gap-y-4">
<li className="text-mineshaft-200">
<strong className="font-medium text-mineshaft-100">Create New</strong> -
- Create a dedicated machine identity managed at the project-level.
+ Create a dedicated machine identity managed at the{" "}
+ {isCertManager ? "Certificate Manager-level" : "project-level"}.
<p className="mt-2">
This method is recommended for autonomous teams that need to manage machine
identity authentication.
diff --git a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx
index b51de6b080..b2e5194d01 100644
--- a/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx
+++ b/frontend/src/pages/project/AccessControlPage/components/IdentityTab/components/ProjectIdentityModal.tsx
@@ -16,16 +16,20 @@ import {
ModalClose,
Switch
} from "@app/components/v2";
-import { useProject } from "@app/context";
+import { useOrganization, 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";
const schema = z.object({
@@ -52,15 +56,27 @@ 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);
+ // Roles list is sourced product-aware (cert-manager filters to Admin + Member server-side).
const { data: roles } = useGetProjectRoles(currentProject.id, currentProject.type);
+ // For cert-manager, default to Member instead of No Access (No Access is filtered out server-side).
+ const defaultRole = isCertManager
+ ? { slug: ProjectMembershipRole.Member, name: "Member" }
+ : { slug: ProjectMembershipRole.NoAccess, name: "No Access" };
const { mutateAsync: createMutateAsync } = useCreateProjectIdentity();
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,
@@ -73,7 +89,7 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {
name: identity?.name ?? "",
hasDeleteProtection: identity?.hasDeleteProtection ?? false,
metadata: identity?.metadata ?? [],
- role: isUpdate ? undefined : { slug: ProjectMembershipRole.NoAccess, name: "No Access" }
+ role: isUpdate ? undefined : defaultRole
}
});
@@ -96,22 +112,40 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {
onClose();
} else {
- // create
-
- const { id: createdId } = await createMutateAsync({
- name,
- projectId: currentProject.id,
- hasDeleteProtection,
- metadata
- });
-
- if (role) {
- await updateMembershipMutateAsync({
- roles: [{ role: role.slug }],
+ // 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({
identityId: createdId,
projectId: currentProject.id,
- projectType: currentProject.type
+ projectType: currentProject.type,
+ role: role?.slug
+ });
+ } else {
+ const created = await createMutateAsync({
+ name,
+ projectId: currentProject.id,
+ hasDeleteProtection,
+ metadata
});
+ createdId = created.id;
+
+ if (role) {
+ await updateMembershipMutateAsync({
+ roles: [{ role: role.slug }],
+ identityId: createdId,
+ projectId: currentProject.id,
+ projectType: currentProject.type
+ });
+ }
}
await addMutateAsync({
@@ -139,7 +173,7 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {
}
createNotification({
- text: `Successfully ${isUpdate ? "updated" : "created"} project machine identity`,
+ text: `Successfully ${isUpdate ? "updated" : "created"} machine identity`,
type: "success"
});
@@ -149,7 +183,7 @@ export const ProjectIdentityModal = ({ onClose, identity }: ContentProps) => {
const error = err as any;
const text =
error?.response?.data?.message ??
- `Failed to ${isUpdate ? "update" : "create"} project machine identity`;
+ `Failed to ${isUpdate ? "update" : "create"} machine identity`;
createNotification({
text,
diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
index 98ae22850a..001f9266f4 100644
--- a/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
+++ b/frontend/src/pages/project/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
@@ -333,9 +333,11 @@ const Page = () => {
identityMembershipDetails={identityMembershipDetails}
isMembershipDetailsLoading={isMembershipDetailsLoading}
/>
- <IdentityProjectAdditionalPrivilegeSection
- identityMembershipDetails={identityMembershipDetails}
- />
+ {!isCertManager && (
+ <IdentityProjectAdditionalPrivilegeSection
+ identityMembershipDetails={identityMembershipDetails}
+ />
+ )}
</div>
</div>
<DeleteActionModal
diff --git a/frontend/src/pages/project/MemberDetailsByIDPage/MemberDetailsByIDPage.tsx b/frontend/src/pages/project/MemberDetailsByIDPage/MemberDetailsByIDPage.tsx
index 9eb5537d40..29c7615fd5 100644
--- a/frontend/src/pages/project/MemberDetailsByIDPage/MemberDetailsByIDPage.tsx
+++ b/frontend/src/pages/project/MemberDetailsByIDPage/MemberDetailsByIDPage.tsx
@@ -166,10 +166,14 @@ export const Page = () => {
{isOwnProjectMembershipDetails ? (
<Tooltip
side="right"
- content="You cannot modify your own membership. Ask a project admin to make changes to your membership."
+ content={
+ isCertManager
+ ? "You cannot modify your own membership. Ask a Certificate Manager admin to make changes to your membership."
+ : "You cannot modify your own membership. Ask a project admin to make changes to your membership."
+ }
>
<Badge variant="info" className="ml-2">
- <InfoIcon /> Your project membership
+ <InfoIcon /> {isCertManager ? "Your membership" : "Your project membership"}
</Badge>
</Tooltip>
) : (
@@ -248,7 +252,9 @@ export const Page = () => {
})
}
/>
- <MemberProjectAdditionalPrivilegeSection membershipDetails={membershipDetails} />
+ {!isCertManager && (
+ <MemberProjectAdditionalPrivilegeSection membershipDetails={membershipDetails} />
+ )}
</div>
</div>
<DeleteActionModal