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
fix names
x032205ae70ebc40097
diff --git a/backend/src/ee/routes/v1/project-template-router.ts b/backend/src/ee/routes/v1/project-template-router.tsindex 4ea363fc67..3f5c58e9cf 100644--- a/backend/src/ee/routes/v1/project-template-router.ts+++ b/backend/src/ee/routes/v1/project-template-router.ts@@ -52,6 +52,7 @@ const SanitizedProjectTemplateSchema = ProjectTemplatesSchema.extend({identities: z.object({identityId: z.string().uuid(),+ identityName: z.string(),roles: z.string().array()}).array()diff --git a/backend/src/ee/services/project-template/project-template-service.ts b/backend/src/ee/services/project-template/project-template-service.tsindex 4fc546ec17..0475c7f66d 100644--- a/backend/src/ee/services/project-template/project-template-service.ts+++ b/backend/src/ee/services/project-template/project-template-service.ts@@ -105,6 +105,7 @@ export const projectTemplateServiceFactory = ({): TProjectTemplateOrgManagedIdentity[] => {return memberships.map((m) => ({identityId: m.identityId,+ identityName: m.identityName,roles: m.roles}));};diff --git a/backend/src/ee/services/project-template/project-template-types.ts b/backend/src/ee/services/project-template/project-template-types.tsindex e956f6a8d2..c7addfd776 100644--- a/backend/src/ee/services/project-template/project-template-types.ts+++ b/backend/src/ee/services/project-template/project-template-types.ts@@ -25,6 +25,7 @@ export type TProjectTemplateGroup = {export type TProjectTemplateOrgManagedIdentity = {identityId: string;+ identityName: string;roles: string[]; // role slugs};diff --git a/frontend/src/hooks/api/projectTemplates/types.ts b/frontend/src/hooks/api/projectTemplates/types.tsindex 48f5e36377..ba7b02843d 100644--- a/frontend/src/hooks/api/projectTemplates/types.ts+++ b/frontend/src/hooks/api/projectTemplates/types.ts@@ -14,6 +14,7 @@ export type TProjectTemplateGroup = {export type TProjectTemplateIdentity = {identityId: string;+ identityName: string;roles: string[]; // role slugs};diff --git a/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/EditProjectTemplateSection/components/ProjectTemplateIdentitiesSection.tsx b/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/EditProjectTemplateSection/components/ProjectTemplateIdentitiesSection.tsxindex d22c718c1c..80bda2b447 100644--- a/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/EditProjectTemplateSection/components/ProjectTemplateIdentitiesSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/ProjectTemplatesTab/components/EditProjectTemplateSection/components/ProjectTemplateIdentitiesSection.tsx@@ -1,4 +1,4 @@-import { useEffect, useMemo, useRef, useState } from "react";+import { useMemo, useState } from "react";import { Controller, useFieldArray, useForm } from "react-hook-form";import { faPlus, faSave, faServer, faTrash } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";@@ -46,6 +46,7 @@ const formSchema = z.object({identities: z.object({identityId: z.string().uuid(),+ identityName: z.string(),roles: z.array(z.string()).min(1, "At least one role is required")}).array(),@@ -102,11 +103,9 @@ export const ProjectTemplateIdentitiesSection = ({ projectTemplate }: Props) =>AddIdentityType.CreateNew);- // Search state for the identity dropdown (server-side search)const [identitySearchInput, setIdentitySearchInput] = useState("");const [debouncedIdentitySearch] = useDebounce(identitySearchInput, 300);- // Fetch identities for the dropdown with server-side searchconst { data: searchedIdentitiesResponse, isPending: isSearchingIdentities } =useSearchOrgIdentityMemberships({limit: 100,@@ -116,25 +115,6 @@ export const ProjectTemplateIdentitiesSection = ({ projectTemplate }: Props) =>? searchedIdentitiesResponse.identities.map((v) => v.identity): [];- // Fetch identities for name resolution in the table (separate unbounded query)- const { data: orgIdentitiesResponse } = useSearchOrgIdentityMemberships({- limit: 100,- search: {}- });- const orgIdentities = orgIdentitiesResponse- ? orgIdentitiesResponse.identities.map((v) => v.identity)- : [];-- // Track names of identities that have been added to the template,- // so we can display their names even if they fall outside the fetched page- const knownIdentityNamesRef = useRef<Map<string, string>>(new Map());-- useEffect(() => {- [...searchedIdentities, ...orgIdentities].forEach((identity) => {- knownIdentityNamesRef.current.set(identity.id, identity.name);- });- }, [searchedIdentities, orgIdentities]);-const {control,handleSubmit,@@ -219,15 +199,6 @@ export const ProjectTemplateIdentitiesSection = ({ projectTemplate }: Props) =>}));}, [searchedIdentities, currentIdentities]);- const getIdentityName = (identityId: string) => {- // First check the cached names map (includes results from search queries)- const cachedName = knownIdentityNamesRef.current.get(identityId);- if (cachedName) return cachedName;- // Fallback to the org identities list- const identity = orgIdentities.find((i) => i.id === identityId);- return identity?.name || identityId;- };-// Add org identity modal formconst {control: addOrgIdentityControl,@@ -248,6 +219,7 @@ export const ProjectTemplateIdentitiesSection = ({ projectTemplate }: Props) =>const handleAddOrgIdentity = (form: TAddOrgIdentityForm) => {appendIdentity({identityId: form.selectedIdentity.id,+ identityName: form.selectedIdentity.name,roles: form.roles.map((r) => r.slug)});resetAddOrgIdentityForm();@@ -296,7 +268,7 @@ export const ProjectTemplateIdentitiesSection = ({ projectTemplate }: Props) =>index,id: identity.id,identityId: identity.identityId,- name: getIdentityName(identity.identityId),+ name: identity.identityName,roles: currentIdentities[index]?.roles || []}));@@ -309,7 +281,7 @@ export const ProjectTemplateIdentitiesSection = ({ projectTemplate }: Props) =>}));return [...projectManaged, ...orgManaged];- }, [identities, projectManagedIdentities, currentIdentities, orgIdentities, watch]);+ }, [identities, projectManagedIdentities, currentIdentities, watch]);return (<>