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
misc: removed folder logic completely
Sheen Capadngane8cb3efb9edc
diff --git a/backend/src/db/migrations/20260206151238_add-uniqueness-constraints-for-pam.ts b/backend/src/db/migrations/20260206151238_add-uniqueness-constraints-for-pam.tsindex 83101fb7ae..6e9a4df340 100644--- a/backend/src/db/migrations/20260206151238_add-uniqueness-constraints-for-pam.ts+++ b/backend/src/db/migrations/20260206151238_add-uniqueness-constraints-for-pam.ts@@ -7,6 +7,11 @@ const RESOURCE_CONSTRAINT_NAME = "pam_resources_name_project_id_unique";const ACCOUNT_CONSTRAINT_NAME = "pam_accounts_name_resource_id_unique";export async function up(knex: Knex): Promise<void> {+ // Delete all existing PAM access approval policies because we're moving away from FOLDERS+ if (await knex.schema.hasTable(TableName.ApprovalPolicies)) {+ await knex(TableName.ApprovalPolicies).where("type", "pam-access").del();+ }+// 1. Add unique constraint for resource names within a projectif (await knex.schema.hasTable(TableName.PamResource)) {const hasName = await knex.schema.hasColumn(TableName.PamResource, "name");diff --git a/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts b/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.tsindex 4cb9f52b2f..4f70db3dde 100644--- a/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts+++ b/backend/src/ee/routes/v1/pam-account-routers/pam-account-router.ts@@ -159,39 +159,27 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {},schema: {description: "Access PAM account",- body: z- .object({- accountPath: z.string().trim().optional(),- resourceName: z.string().trim().optional(),- accountName: z.string().trim().optional(),- projectId: z.string().uuid(),- mfaSessionId: z.string().optional(),- duration: z- .string()- .min(1)- .transform((val, ctx) => {- const parsedMs = ms(val);-- if (typeof parsedMs !== "number" || parsedMs <= 0) {- ctx.addIssue({- code: z.ZodIssueCode.custom,- message: "Invalid duration format. Must be a positive duration (e.g., '1h', '30m', '2d')."- });- return z.NEVER;- }- return parsedMs;- })- })- .refine(- (data) => {- const hasResourceAndAccount = data.resourceName && data.accountName;- const hasAccountPath = data.accountPath;- return hasResourceAndAccount || hasAccountPath;- },- {- message: "Either (resourceName and accountName) or accountPath must be provided"- }- ),+ body: z.object({+ resourceName: z.string().trim(),+ accountName: z.string().trim(),+ projectId: z.string().uuid(),+ mfaSessionId: z.string().optional(),+ duration: z+ .string()+ .min(1)+ .transform((val, ctx) => {+ const parsedMs = ms(val);++ if (typeof parsedMs !== "number" || parsedMs <= 0) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ message: "Invalid duration format. Must be a positive duration (e.g., '1h', '30m', '2d')."+ });+ return z.NEVER;+ }+ return parsedMs;+ })+ }),response: {200: z.discriminatedUnion("resourceType", [// Gateway-based resources (Postgres, MySQL, Redis, SSH)@@ -223,7 +211,6 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {actorIp: req.realIp,actorName: `${req.auth.user.firstName ?? ""} ${req.auth.user.lastName ?? ""}`.trim(),actorUserAgent: req.auditLogInfo.userAgent ?? "",- accountPath: req.body.accountPath,resourceName: req.body.resourceName,accountName: req.body.accountName,projectId: req.body.projectId,@@ -241,7 +228,6 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {type: EventType.PAM_ACCOUNT_ACCESS,metadata: {accountId: response.account.id,- accountPath: req.body.accountPath,resourceName: req.body.resourceName,accountName: response.account.name,duration: req.body.duration ? new Date(req.body.duration).toISOString() : undefineddiff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex aa624b37f9..7721edab87 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -4254,8 +4254,7 @@ interface PamAccountAccessEvent {type: EventType.PAM_ACCOUNT_ACCESS;metadata: {accountId: string;- accountPath?: string;- resourceName?: string;+ resourceName: string;accountName: string;duration?: string;};diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.tsindex 6af7b8da7c..c76bacf271 100644--- a/backend/src/ee/services/pam-account/pam-account-service.ts+++ b/backend/src/ee/services/pam-account/pam-account-service.ts@@ -1,5 +1,3 @@-import path from "node:path";-import { ForbiddenError, subject } from "@casl/ability";import { ActionProjectType, OrganizationActionScope, TPamAccounts, TPamFolders, TPamResources } from "@app/db/schemas";@@ -610,7 +608,6 @@ export const pamAccountServiceFactory = ({const access = async ({- accountPath,resourceName: inputResourceName,accountName: inputAccountName,projectId,@@ -623,78 +620,22 @@ export const pamAccountServiceFactory = ({}: TAccessAccountDTO,actor: OrgServiceActor) => {- let account;- let resource;- let folderPath = "/";-- // New approach: Use resourceName + accountName to find the account directly- if (inputResourceName && inputAccountName) {- // Find resource by name- resource = await pamResourceDAL.findOne({ projectId, name: inputResourceName });- if (!resource) {- throw new NotFoundError({ message: `Resource with name '${inputResourceName}' not found` });- }-- // Find account by name within the resource- account = await pamAccountDAL.findOne({- projectId,- resourceId: resource.id,- name: inputAccountName- });-- if (!account) {- throw new NotFoundError({- message: `Account with name '${inputAccountName}' not found for resource '${inputResourceName}'`- });- }-- // Get folder path if account has a folder- if (account.folderId) {- folderPath = await getFullPamFolderPath({- pamFolderDAL,- folderId: account.folderId,- projectId- });- }+ // Find resource by name+ const resource = await pamResourceDAL.findOne({ projectId, name: inputResourceName });+ if (!resource) {+ throw new NotFoundError({ message: `Resource with name '${inputResourceName}' not found` });}- // Legacy approach: Use accountPath to find the account- else if (accountPath) {- const pathSegments: string[] = accountPath.split("/").filter(Boolean);- if (pathSegments.length === 0) {- throw new BadRequestError({ message: "Invalid accountPath. Path must contain at least the account name." });- }-- const accountName: string = pathSegments[pathSegments.length - 1] ?? "";- const folderPathSegments: string[] = pathSegments.slice(0, -1);- folderPath = folderPathSegments.length > 0 ? `/${folderPathSegments.join("/")}` : "/";-- let folderId: string | null = null;- if (folderPath !== "/") {- const folder = await pamFolderDAL.findByPath(projectId, folderPath);- if (!folder) {- throw new NotFoundError({ message: `Folder at path '${folderPath}' not found` });- }- folderId = folder.id;- }-- account = await pamAccountDAL.findOne({- projectId,- folderId,- name: accountName- });-- if (!account) {- throw new NotFoundError({- message: `Account with name '${accountName}' not found at path '${accountPath}'`- });- }+ // Find account by name within the resource+ const account = await pamAccountDAL.findOne({+ projectId,+ resourceId: resource.id,+ name: inputAccountName+ });- resource = await pamResourceDAL.findById(account.resourceId);- if (!resource) throw new NotFoundError({ message: `Resource with ID '${account.resourceId}' not found` });- } else {- throw new BadRequestError({- message: "Either (resourceName and accountName) or accountPath must be provided"+ if (!account) {+ throw new NotFoundError({+ message: `Account with name '${inputAccountName}' not found for resource '${inputResourceName}'`});}@@ -702,7 +643,6 @@ export const pamAccountServiceFactory = ({const inputs = {resourceId: resource.id,- accountPath: path.join(folderPath, account.name),resourceName: resource.name,accountName: account.name};@@ -738,8 +678,7 @@ export const pamAccountServiceFactory = ({ProjectPermissionPamAccountActions.Access,subject(ProjectPermissionSub.PamAccounts, {resourceName: resource.name,- accountName: account.name,- accountPath: folderPath+ accountName: account.name}));}@@ -948,7 +887,7 @@ export const pamAccountServiceFactory = ({username: credentials.username,database: connectionCredentials.database,accountName: account.name,- accountPath: folderPath+ resourceName: resource.name};}break;@@ -963,7 +902,7 @@ export const pamAccountServiceFactory = ({metadata = {username: credentials.username,accountName: account.name,- accountPath: folderPath+ resourceName: resource.name};}break;@@ -983,8 +922,7 @@ export const pamAccountServiceFactory = ({case PamResource.Kubernetes:metadata = {resourceName: resource.name,- accountName: account.name,- accountPath+ accountName: account.name};break;default:diff --git a/backend/src/ee/services/pam-account/pam-account-types.ts b/backend/src/ee/services/pam-account/pam-account-types.tsindex 205c918886..4f79ee6c83 100644--- a/backend/src/ee/services/pam-account/pam-account-types.ts+++ b/backend/src/ee/services/pam-account/pam-account-types.ts@@ -16,9 +16,8 @@ export type TUpdateAccountDTO = Partial<Omit<TCreateAccountDTO, "folderId" | "re};export type TAccessAccountDTO = {- accountPath?: string;- resourceName?: string;- accountName?: string;+ resourceName: string;+ accountName: string;projectId: string;actorEmail: string;actorIp: string;diff --git a/backend/src/ee/services/permission/project-permission.ts b/backend/src/ee/services/permission/project-permission.tsindex 604e655eaf..3a43dd1aea 100644--- a/backend/src/ee/services/permission/project-permission.ts+++ b/backend/src/ee/services/permission/project-permission.ts@@ -413,7 +413,6 @@ export type McpEndpointSubjectFields = {export type PamAccountSubjectFields = {resourceName: string;accountName: string;- accountPath: string;};export type ProjectPermissionSet =@@ -585,27 +584,7 @@ const SECRET_PATH_PERMISSION_OPERATOR_SCHEMA = z.union([}).partial()]);-const PAM_ACCOUNT_PATH_MISSING_SLASH_ERR_MSG = "Invalid Secret Path; it must start with a '/'";-const PAM_ACCOUNT_PATH_PERMISSION_OPERATOR_SCHEMA = z.union([- z.string().refine((val) => val.startsWith("/"), SECRET_PATH_MISSING_SLASH_ERR_MSG),- z- .object({- [PermissionConditionOperators.$EQ]: PermissionConditionSchema[PermissionConditionOperators.$EQ].refine(- (val) => val.startsWith("/"),- PAM_ACCOUNT_PATH_MISSING_SLASH_ERR_MSG- ),- [PermissionConditionOperators.$NEQ]: PermissionConditionSchema[PermissionConditionOperators.$NEQ].refine(- (val) => val.startsWith("/"),- PAM_ACCOUNT_PATH_MISSING_SLASH_ERR_MSG- ),- [PermissionConditionOperators.$IN]: PermissionConditionSchema[PermissionConditionOperators.$IN].refine(- (val) => val.every((el) => el.startsWith("/")),- PAM_ACCOUNT_PATH_MISSING_SLASH_ERR_MSG- ),- [PermissionConditionOperators.$GLOB]: PermissionConditionSchema[PermissionConditionOperators.$GLOB]- })- .partial()-]);+// akhilmhdh: don't modify this for v2// if you want to update create a new schemaconst SecretConditionV1Schema = z@@ -933,8 +912,7 @@ const PamAccountConditionSchema = z[PermissionConditionOperators.$GLOB]: PermissionConditionSchema[PermissionConditionOperators.$GLOB]}).partial()- ]),- accountPath: PAM_ACCOUNT_PATH_PERMISSION_OPERATOR_SCHEMA+ ])}).partial();diff --git a/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts b/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.tsindex ae3dd5587b..4016c38f26 100644--- a/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts+++ b/backend/src/services/approval-policy/pam-access/pam-access-policy-factory.ts@@ -38,13 +38,6 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<let bestMatch: { policy: TPamAccessPolicy; wildcardCount: number; patternLength: number } | null = null;- let normalizedAccountPath: string | undefined;- if (inputs.accountPath) {- normalizedAccountPath = inputs.accountPath.startsWith("/") ? inputs.accountPath.slice(1) : inputs.accountPath;- } else {- normalizedAccountPath = undefined;- }-for (const policy of policies) {const p = policy as TPamAccessPolicy;for (const c of p.conditions.conditions) {@@ -52,19 +45,16 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<let totalWildcards = 0;let totalPatternLength = 0;- // Check new resource/account name based matchingconst hasResourceNames = c.resourceNames && c.resourceNames.length > 0;const hasAccountNames = c.accountNames && c.accountNames.length > 0;if (hasResourceNames || hasAccountNames) {- // New matching logic: resourceNames AND/OR accountNameslet resourceMatches = true;let accountMatches = true;if (hasResourceNames && inputs.resourceName) {resourceMatches = matchesAnyPattern(inputs.resourceName, c.resourceNames!);if (resourceMatches) {- // Find the best matching pattern for specificity calculationfor (const pattern of c.resourceNames!) {if (picomatch(pattern)(inputs.resourceName)) {const spec = calculateSpecificity(pattern);@@ -75,14 +65,12 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<}}} else if (hasResourceNames && !inputs.resourceName) {- // Resource names required but not provided in inputsresourceMatches = false;}if (hasAccountNames && inputs.accountName) {accountMatches = matchesAnyPattern(inputs.accountName, c.accountNames!);if (accountMatches) {- // Find the best matching pattern for specificity calculationfor (const pattern of c.accountNames!) {if (picomatch(pattern)(inputs.accountName)) {const spec = calculateSpecificity(pattern);@@ -93,30 +81,13 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<}}} else if (hasAccountNames && !inputs.accountName) {- // Account names required but not provided in inputsaccountMatches = false;}conditionMatches = resourceMatches && accountMatches;}- // Legacy matching: accountPaths (for backwards compatibility)- const hasAccountPaths = c.accountPaths && c.accountPaths.length > 0;- if (hasAccountPaths && !conditionMatches && normalizedAccountPath) {- for (const pathPattern of c.accountPaths!) {- const normalizedPathPattern = pathPattern.startsWith("/") ? pathPattern.slice(1) : pathPattern;- if (picomatch(normalizedPathPattern)(normalizedAccountPath)) {- const spec = calculateSpecificity(pathPattern);- totalWildcards = spec.wildcardCount;- totalPatternLength = spec.length;- conditionMatches = true;- break;- }- }- }-if (conditionMatches) {- // Use specificity to determine the best match (fewer wildcards = more specific)if (!bestMatch ||totalWildcards < bestMatch.wildcardCount ||@@ -145,18 +116,10 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<revokedAt: null});- let normalizedAccountPath: string | undefined;- if (inputs.accountPath) {- normalizedAccountPath = inputs.accountPath.startsWith("/") ? inputs.accountPath.slice(1) : inputs.accountPath;- } else {- normalizedAccountPath = undefined;- }-// TODO(andrey): Move some of this check to be part of SQL queryreturn grants.some((grant) => {const grantAttributes = grant.attributes as TPamAccessPolicyInputs;- // Check new-style matching (resourceName and/or accountName)if (inputs.resourceName || inputs.accountName) {let resourceMatches = true;let accountMatches = true;@@ -178,17 +141,6 @@ export const pamAccessPolicyFactory: TApprovalResourceFactory<}}- // Legacy matching: accountPath- if (normalizedAccountPath && grantAttributes.accountPath) {- const normalizedGrantPath = grantAttributes.accountPath.startsWith("/")- ? grantAttributes.accountPath.slice(1)- : grantAttributes.accountPath;- const isMatch = picomatch(normalizedGrantPath);- if (isMatch(normalizedAccountPath) && (!grant.expiresAt || grant.expiresAt > new Date())) {- return true;- }- }-return false;});};diff --git a/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts b/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.tsindex b180c7f0b4..e5147f1336 100644--- a/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts+++ b/backend/src/services/approval-policy/pam-access/pam-access-policy-schemas.ts@@ -14,23 +14,10 @@ import {// Inputsexport const PamAccessPolicyInputsSchema = z.object({- accountPath: z.string().optional(),resourceName: z.string().optional(),accountName: z.string().optional()});-const accountPathGlob = z.string().refine(- (el) => {- try {- picomatch.parse([el]);- return true;- } catch {- return false;- }- },- { message: "Invalid glob pattern" }-);-// Conditionsconst resourceNameGlob = z.string().refine((el) => {@@ -58,9 +45,6 @@ const accountNameGlob = z.string().refine(export const PamAccessPolicyConditionsSchema = z.object({- // Deprecated: use resourceNames and accountNames instead- accountPaths: accountPathGlob.array().optional(),- // New fields for matchingresourceNames: resourceNameGlob.array().optional(),accountNames: accountNameGlob.array().optional()})@@ -68,29 +52,18 @@ export const PamAccessPolicyConditionsSchema = zconst MutatePamAccessPolicyConditionsSchema = z.object({- // Deprecated: use resourceNames and accountNames instead (kept for backwards compatibility)- accountPaths: accountPathGlob- .refine((el) => el.startsWith("/"), {- message: "Path must start with /"- })- .refine((el) => !el.endsWith("/"), {- message: "Path cannot end with /"- })- .array()- .optional(),resourceNames: resourceNameGlob.array().optional(),accountNames: accountNameGlob.array().optional()}).refine((data) => {// At least one condition type must be provided- const hasAccountPaths = data.accountPaths && data.accountPaths.length > 0;const hasResourceNames = data.resourceNames && data.resourceNames.length > 0;const hasAccountNames = data.accountNames && data.accountNames.length > 0;- return hasAccountPaths || hasResourceNames || hasAccountNames;+ return hasResourceNames || hasAccountNames;},{- message: "At least one condition type must be provided (resourceNames, accountNames, or accountPaths)"+ message: "At least one condition type must be provided (resourceNames or accountNames)"}).array();@@ -115,7 +88,6 @@ export const PamAccessPolicyConstraintsSchema = z.object({// Request Data - Base schema for stored data (used by grants, etc.)export const PamAccessPolicyRequestDataSchema = z.object({- accountPath: accountPathGlob.optional(),accessDuration: DurationSchema,resourceName: resourceNameGlob.optional(),accountName: accountNameGlob.optional()@@ -124,14 +96,6 @@ export const PamAccessPolicyRequestDataSchema = z.object({// Schema with validation for creating requestsconst CreatePamAccessPolicyRequestDataSchema = z.object({- accountPath: accountPathGlob- .refine((el) => el.startsWith("/"), {- message: "Path must start with /"- })- .refine((el) => !el.endsWith("/"), {- message: "Path cannot end with /"- })- .optional(),accessDuration: DurationSchema,resourceName: resourceNameGlob.optional(),accountName: accountNameGlob.optional()@@ -139,13 +103,12 @@ const CreatePamAccessPolicyRequestDataSchema = z.refine((data) => {// At least one identifier must be provided- const hasAccountPath = Boolean(data.accountPath);const hasResourceName = Boolean(data.resourceName);const hasAccountName = Boolean(data.accountName);- return hasAccountPath || hasResourceName || hasAccountName;+ return hasResourceName || hasAccountName;},{- message: "At least one identifier must be provided (accountPath, resourceName, or accountName)"+ message: "At least one identifier must be provided (resourceName or accountName)"});diff --git a/frontend/src/context/ProjectPermissionContext/types.ts b/frontend/src/context/ProjectPermissionContext/types.tsindex ebeba369db..0121cdd2e2 100644--- a/frontend/src/context/ProjectPermissionContext/types.ts+++ b/frontend/src/context/ProjectPermissionContext/types.ts@@ -463,7 +463,6 @@ export type CertificatePolicySubjectFields = {export type PamAccountSubjectFields = {resourceName: string;accountName: string;- accountPath: string;};export type McpEndpointSubjectFields = {diff --git a/frontend/src/hooks/api/approvalGrants/types.ts b/frontend/src/hooks/api/approvalGrants/types.tsindex 4ddda97199..466e0b7ae1 100644--- a/frontend/src/hooks/api/approvalGrants/types.ts+++ b/frontend/src/hooks/api/approvalGrants/types.ts@@ -8,7 +8,6 @@ export enum ApprovalGrantStatus {// PAM Access Grant Attributesexport type PamAccessGrantAttributes = {- accountPath?: string;accessDuration: string;resourceName?: string;accountName?: string;diff --git a/frontend/src/hooks/api/approvalPolicies/types.ts b/frontend/src/hooks/api/approvalPolicies/types.tsindex 26acc942f5..4926e21614 100644--- a/frontend/src/hooks/api/approvalPolicies/types.ts+++ b/frontend/src/hooks/api/approvalPolicies/types.ts@@ -19,9 +19,6 @@ export type ApprovalPolicyStep = {};export type PamAccessPolicyConditions = {- // Deprecated: use resourceNames and accountNames instead- accountPaths?: string[];- // New fields for matchingresourceNames?: string[];accountNames?: string[];}[];@@ -99,9 +96,7 @@ export type TDeleteApprovalPolicyDTO = {export type TCheckPolicyMatchDTO = {policyType: ApprovalPolicyType;projectId: string;- inputs:- | { accountPath?: string; resourceName?: string; accountName?: string }- | { profileName: string };+ inputs: { resourceName: string; accountName: string } | { profileName: string };};export type TCheckPolicyMatchResult = {diff --git a/frontend/src/hooks/api/approvalRequests/types.ts b/frontend/src/hooks/api/approvalRequests/types.tsindex a5db1b6feb..74460076f1 100644--- a/frontend/src/hooks/api/approvalRequests/types.ts+++ b/frontend/src/hooks/api/approvalRequests/types.ts@@ -50,7 +50,6 @@ export type ApprovalRequestStep = {};export type PamAccessRequestData = {- accountPath?: string;accessDuration: string;resourceName?: string;accountName?: string;diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsxindex ce92de0fe8..9223050d01 100644--- a/frontend/src/hooks/api/pam/mutations.tsx+++ b/frontend/src/hooks/api/pam/mutations.tsx@@ -122,7 +122,8 @@ export const useDeletePamAccount = () => {export type TAccessPamAccountDTO = {accountId: string;- accountPath: string;+ resourceName: string;+ accountName: string;projectId: string;duration: string;};@@ -143,12 +144,19 @@ export type TAccessPamAccountResponse = {export const useAccessPamAccount = () => {return useMutation({- mutationFn: async ({ accountId, accountPath, projectId, duration }: TAccessPamAccountDTO) => {+ mutationFn: async ({+ accountId,+ resourceName,+ accountName,+ projectId,+ duration+ }: TAccessPamAccountDTO) => {const { data } = await apiRequest.post<TAccessPamAccountResponse>("/api/v1/pam/accounts/access",{accountId,- accountPath,+ resourceName,+ accountName,projectId,duration}diff --git a/frontend/src/pages/pam/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx b/frontend/src/pages/pam/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsxindex 62279a508b..e6c4a34f44 100644--- a/frontend/src/pages/pam/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx+++ b/frontend/src/pages/pam/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx@@ -108,7 +108,7 @@ const PageContent = () => {const data = request.requestData.requestData as PamAccessRequestData;const target = data.resourceName? `${data.resourceName}${data.accountName ? ` / ${data.accountName}` : ""}`- : data.accountPath || "account";+ : "account";return `Request to access ${target} for ${data.accessDuration} by ${request.requesterName || "Unknown"}`;})()}>diff --git a/frontend/src/pages/pam/ApprovalRequestDetailPage/components/RequestDetailsSection.tsx b/frontend/src/pages/pam/ApprovalRequestDetailPage/components/RequestDetailsSection.tsxindex 1b73ca9ed4..baf91f5f83 100644--- a/frontend/src/pages/pam/ApprovalRequestDetailPage/components/RequestDetailsSection.tsx+++ b/frontend/src/pages/pam/ApprovalRequestDetailPage/components/RequestDetailsSection.tsx@@ -28,7 +28,7 @@ const getStatusBadgeColor = (status: ApprovalRequestStatus) => {};export const RequestDetailsSection = ({ request }: Props) => {- const { accountPath, accessDuration, resourceName, accountName } = request.requestData+ const { accessDuration, resourceName, accountName } = request.requestData.requestData as PamAccessRequestData;return (@@ -51,9 +51,6 @@ export const RequestDetailsSection = ({ request }: Props) => {<GenericFieldLabel label="Resource Name">{resourceName}</GenericFieldLabel>)}{accountName && <GenericFieldLabel label="Account Name">{accountName}</GenericFieldLabel>}- {accountPath && !resourceName && !accountName && (- <GenericFieldLabel label="Account Path">{accountPath}</GenericFieldLabel>- )}<GenericFieldLabel label="Access Duration">{accessDuration}</GenericFieldLabel>{request.justification && (<GenericFieldLabel label="Justification">diff --git a/frontend/src/pages/pam/ApprovalsPage/components/ApprovalRequestTab/ApprovalRequestTab.tsx b/frontend/src/pages/pam/ApprovalsPage/components/ApprovalRequestTab/ApprovalRequestTab.tsxindex bbbd656819..258d49e684 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/ApprovalRequestTab/ApprovalRequestTab.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/ApprovalRequestTab/ApprovalRequestTab.tsx@@ -124,7 +124,6 @@ export const ApprovalRequestTab = () => {request.requesterName?.toLowerCase().includes(searchLower) ||request.requesterEmail?.toLowerCase().includes(searchLower) ||request.justification?.toLowerCase().includes(searchLower) ||- data.accountPath?.toLowerCase().includes(searchLower) ||data.resourceName?.toLowerCase().includes(searchLower) ||data.accountName?.toLowerCase().includes(searchLower));@@ -290,8 +289,8 @@ export const ApprovalRequestTab = () => {{!isRequestsLoading &&paginatedRequests.map((request) => {const needsApproval = checkIfUserNeedsToApprove(request, userId, userGroups);- const { accountPath, accessDuration, resourceName, accountName } = request- .requestData.requestData as PamAccessRequestData;+ const { accessDuration, resourceName, accountName } = request.requestData+ .requestData as PamAccessRequestData;return (<Tr@@ -319,11 +318,6 @@ export const ApprovalRequestTab = () => {<span className="text-mineshaft-400">Account:</span> {accountName}</div>)}- {accountPath && !resourceName && !accountName && (- <div className="text-sm text-mineshaft-200">- <span className="text-mineshaft-400">Path:</span> {accountPath}- </div>- )}</div></Td><Td>diff --git a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PoliciesTable.tsx b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PoliciesTable.tsxindex 6d76e7f0e6..12eeb57337 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PoliciesTable.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PoliciesTable.tsx@@ -215,8 +215,6 @@ export const PoliciesTable = ({ handlePopUpOpen }: Props) => {condition.resourceNames && condition.resourceNames.length > 0;const hasAccountNames =condition.accountNames && condition.accountNames.length > 0;- const hasAccountPaths =- condition.accountPaths && condition.accountPaths.length > 0;return (<Fragment key={`${policy.id}--${index + 1}`}>@@ -246,16 +244,6 @@ export const PoliciesTable = ({ handlePopUpOpen }: Props) => {</p></div>)}- {hasAccountPaths && (- <div>- <span className="text-sm font-medium text-mineshaft-300">- Account Paths:- </span>- <p className="text-sm text-mineshaft-100">- {condition.accountPaths!.join(", ")}- </p>- </div>- )}</div></div>{index < policy.conditions.conditions.length - 1 && (diff --git a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicyModal.tsx b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicyModal.tsxindex 9cc21c0490..b748f2290f 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicyModal.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicyModal.tsx@@ -1,4 +1,4 @@-import { useEffect, useMemo, useState } from "react";+import { useEffect, useState } from "react";import { FormProvider, useForm } from "react-hook-form";import { Tab } from "@headlessui/react";import { zodResolver } from "@hookform/resolvers/zod";@@ -42,13 +42,6 @@ export const PolicyModal = ({ popUp, handlePopUpToggle }: Props) => {const [selectedStepIndex, setSelectedStepIndex] = useState(0);- // Check if the existing policy has legacy accountPaths defined- const hasLegacyAccountPaths = useMemo(() => {- if (!policyData?.policy) return false;- const conditions = policyData.policy.conditions.conditions as PamAccessPolicyConditions;- return conditions.some((c) => c.accountPaths && c.accountPaths.length > 0);- }, [policyData]);-const formMethods = useForm<TPolicyForm>({resolver: zodResolver(PolicyFormSchema),defaultValues: {@@ -84,7 +77,6 @@ export const PolicyModal = ({ popUp, handlePopUpToggle }: Props) => {name: policyData.policy.name,maxRequestTtl: policyData.policy.maxRequestTtl,conditions: conditions.map((c) => ({- accountPaths: c.accountPaths || [],resourceNames: c.resourceNames || [],accountNames: c.accountNames || []})),@@ -226,16 +218,13 @@ export const PolicyModal = ({ popUp, handlePopUpToggle }: Props) => {</Tab.List><Tab.Panels><Tab.Panel>- <PolicyDetailsStep- isEditing={Boolean(policyData?.policyId)}- hasLegacyAccountPaths={hasLegacyAccountPaths}- />+ <PolicyDetailsStep /></Tab.Panel><Tab.Panel><PolicyApprovalSteps /></Tab.Panel><Tab.Panel>- <PolicyReviewStep hasLegacyAccountPaths={hasLegacyAccountPaths} />+ <PolicyReviewStep /></Tab.Panel></Tab.Panels></Tab.Group>diff --git a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySchema.tsx b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySchema.tsxindex 2e9e81ab44..9d22cd8a35 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySchema.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySchema.tsx@@ -3,7 +3,6 @@ import { z } from "zod";import { ApprovalStepsSchema } from "@app/components/approvals";-// 30 to 7 daysconst DurationSchema = (min = 30,max = 604800,@@ -12,8 +11,6 @@ const DurationSchema = (z.string().refine((val) => {const duration = ms(val) / 1000;-- // 30 seconds to 7 daysreturn duration >= min && duration <= max;},{ message: msg }@@ -28,35 +25,18 @@ export const PolicyFormSchema = z.object({).nullish(),conditions: z.object({- // Deprecated: use resourceNames and accountNames instead (kept for backwards compatibility during editing)- accountPaths: z- .string()- .array()- .refine((val) => val.every((path) => path.length > 0), {- message: "All account paths must be non-empty"- })- .refine((val) => val.every((path) => path.startsWith("/")), {- message: "All account paths must start with /"- })- .refine((val) => val.every((path) => !path.endsWith("/")), {- message: "All account paths cannot end with /"- })- .optional(),- // New fields for matching (independent criteria, AND logic when both defined)resourceNames: z.string().array().optional(),accountNames: z.string().array().optional()}).refine((data) => {// At least one condition type must be provided- const hasAccountPaths = data.accountPaths && data.accountPaths.length > 0;const hasResourceNames = data.resourceNames && data.resourceNames.length > 0;const hasAccountNames = data.accountNames && data.accountNames.length > 0;- return hasAccountPaths || hasResourceNames || hasAccountNames;+ return hasResourceNames || hasAccountNames;},{- message:- "At least one condition type must be provided (Resource Names, Account Names, or Account Paths)"+ message: "At least one condition type must be provided (Resource Names or Account Names)"}).array()diff --git a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyDetailsStep.tsx b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyDetailsStep.tsxindex b58ad32a9e..6ea9ef9fab 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyDetailsStep.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyDetailsStep.tsx@@ -5,17 +5,9 @@ import { FormControl, Input } from "@app/components/v2";import { TPolicyForm } from "../PolicySchema";-type Props = {- isEditing?: boolean;- hasLegacyAccountPaths?: boolean;-};--export const PolicyDetailsStep = ({ isEditing, hasLegacyAccountPaths }: Props) => {+export const PolicyDetailsStep = () => {const { control, formState } = useFormContext<TPolicyForm>();- // Show account paths only if editing an existing policy that already has account paths- const showAccountPaths = isEditing && hasLegacyAccountPaths;-return (<div className="flex flex-col gap-4"><div className="flex w-full gap-4">@@ -59,7 +51,7 @@ export const PolicyDetailsStep = ({ isEditing, hasLegacyAccountPaths }: Props) =className="mb-0"label="Resource Names"isError={Boolean(error)}- errorText={error?.message ?? formState.errors.conditions?.[0]?.message}+ errorText={error?.message ?? (formState.errors.conditions as any)?.[0]?.message}helperText="Match accounts on resources with these names (supports glob patterns)"><Input@@ -96,30 +88,6 @@ export const PolicyDetailsStep = ({ isEditing, hasLegacyAccountPaths }: Props) =</FormControl>)}/>- {showAccountPaths && (- <Controller- control={control}- name="conditions.0.accountPaths"- render={({ field: pathField, fieldState: { error } }) => (- <FormControl- className="mb-0"- label="Account Paths (Legacy)"- isError={Boolean(error)}- errorText={error?.message}- helperText="Deprecated: This field is kept for backwards compatibility. Consider migrating to Resource Names or Account Names"- >- <Input- value={pathField.value?.join(",") ?? ""}- onChange={(e) => {- const { value } = e.target;- pathField.onChange(value ? value.split(",").map((path) => path.trim()) : []);- }}- placeholder="e.g., /admin/**, /users/john, /**"- />- </FormControl>- )}- />- )}</div>);};diff --git a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyReviewStep.tsx b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyReviewStep.tsxindex f9e0bf3206..ac605876e4 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyReviewStep.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/PolicyTab/components/PolicySteps/PolicyReviewStep.tsx@@ -16,19 +16,21 @@ const ReviewField = ({ label, value }: { label: string; value: string | number }</div>);-type Props = {- hasLegacyAccountPaths?: boolean;-};--export const PolicyReviewStep = ({ hasLegacyAccountPaths }: Props) => {- const { watch } = useFormContext<TPolicyForm>();+export const PolicyReviewStep = () => {+ const { getValues } = useFormContext<TPolicyForm>();const { currentProject } = useProject();const projectId = currentProject?.id || "";const { data: members = [] } = useGetWorkspaceUsers(projectId);const { data: groups = [] } = useListWorkspaceGroups(projectId);- const { name, conditions, constraints, steps } = watch();+ const name = getValues("name");+ const conditions = getValues("conditions") as {+ resourceNames?: string[];+ accountNames?: string[];+ }[];+ const constraints = getValues("constraints");+ const steps = getValues("steps");const getApproverLabel = (approverId: string, approverType: ApproverType) => {if (approverType === ApproverType.User) {@@ -47,7 +49,6 @@ export const PolicyReviewStep = ({ hasLegacyAccountPaths }: Props) => {const resourceNames = conditions[0]?.resourceNames || [];const accountNames = conditions[0]?.accountNames || [];- const accountPaths = conditions[0]?.accountPaths || [];return (<div className="space-y-6">@@ -64,12 +65,9 @@ export const PolicyReviewStep = ({ hasLegacyAccountPaths }: Props) => {{accountNames.length > 0 && (<ReviewField label="Account Names" value={accountNames.join(", ")} />)}- {resourceNames.length === 0 && accountNames.length === 0 && !hasLegacyAccountPaths && (+ {resourceNames.length === 0 && accountNames.length === 0 && (<ReviewField label="Conditions" value="Not set" />)}- {hasLegacyAccountPaths && accountPaths.length > 0 && (- <ReviewField label="Account Paths (Legacy)" value={accountPaths.join(", ")} />- )}</div></div>diff --git a/frontend/src/pages/pam/ApprovalsPage/components/RequestGrantTab/RequestGrantTab.tsx b/frontend/src/pages/pam/ApprovalsPage/components/RequestGrantTab/RequestGrantTab.tsxindex 471fc19797..5fbb59a095 100644--- a/frontend/src/pages/pam/ApprovalsPage/components/RequestGrantTab/RequestGrantTab.tsx+++ b/frontend/src/pages/pam/ApprovalsPage/components/RequestGrantTab/RequestGrantTab.tsx@@ -121,7 +121,6 @@ export const RequestGrantTab = () => {if (grant.type !== ApprovalPolicyType.PamAccess) return false;const searchLower = search.toLowerCase();return (- grant.attributes.accountPath?.toLowerCase().includes(searchLower) ||grant.attributes.resourceName?.toLowerCase().includes(searchLower) ||grant.attributes.accountName?.toLowerCase().includes(searchLower) ||grant.id.toLowerCase().includes(searchLower)@@ -310,14 +309,6 @@ export const RequestGrantTab = () => {{grant.attributes.accountName}</div>)}- {grant.attributes.accountPath &&- !grant.attributes.resourceName &&- !grant.attributes.accountName && (- <div className="text-sm text-mineshaft-200">- <span className="text-mineshaft-400">Path:</span>{" "}- {grant.attributes.accountPath}- </div>- )}</div></Td><Td>diff --git a/frontend/src/pages/pam/PamAccountByIDPage/PamAccountByIDPage.tsx b/frontend/src/pages/pam/PamAccountByIDPage/PamAccountByIDPage.tsxindex 1cbd677766..68a6383c22 100644--- a/frontend/src/pages/pam/PamAccountByIDPage/PamAccountByIDPage.tsx+++ b/frontend/src/pages/pam/PamAccountByIDPage/PamAccountByIDPage.tsx@@ -97,13 +97,10 @@ const PageContent = () => {};const handleAccess = async () => {- const fullAccountPath = `/${account.name}`;-const { requiresApproval } = await checkPolicyMatch({policyType: ApprovalPolicyType.PamAccess,projectId: projectId!,inputs: {- accountPath: fullAccountPath,resourceName: account.resource.name,accountName: account.name}@@ -111,7 +108,6 @@ const PageContent = () => {if (requiresApproval) {handlePopUpOpen("requestAccount", {- accountPath: fullAccountPath,resourceName: account.resource.name,accountName: account.name,accountAccessed: true@@ -120,9 +116,9 @@ const PageContent = () => {}if (account.resource.resourceType === PamResourceType.AwsIam) {- accessAwsIam(account, fullAccountPath);+ accessAwsIam(account);} else {- handlePopUpOpen("accessAccount", { account, accountPath: undefined });+ handlePopUpOpen("accessAccount", { account });}};@@ -238,7 +234,6 @@ const PageContent = () => {<PamRequestAccountAccessModalisOpen={popUp.requestAccount.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("requestAccount", isOpen)}- accountPath={popUp.requestAccount.data?.accountPath}resourceName={popUp.requestAccount.data?.resourceName}accountName={popUp.requestAccount.data?.accountName}accountAccessed={popUp.requestAccount.data?.accountAccessed}diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountCard.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountCard.tsxindex 25f224adff..d4211cf99a 100644--- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountCard.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountCard.tsx@@ -24,10 +24,9 @@ type Props = {onAccess: (resource: TPamAccount) => void;onUpdate: (resource: TPamAccount) => void;onDelete: (resource: TPamAccount) => void;- accountPath?: string;};-export const PamAccountCard = ({ account, onAccess, accountPath, onUpdate, onDelete }: Props) => {+export const PamAccountCard = ({ account, onAccess, onUpdate, onDelete }: Props) => {const { id, name, description, resource } = account;const { image, name: resourceTypeName } = PAM_RESOURCE_TYPE_MAP[account.resource.resourceType];@@ -117,11 +116,7 @@ export const PamAccountCard = ({ account, onAccess, accountPath, onUpdate, onDel</div></div>- <p- className={`${accountPath ? "text-mineshaft-300" : "text-mineshaft-400"} truncate text-xs leading-4`}- >- {resourceTypeName} - {accountPath || "root"}- </p>+ <p className="truncate text-xs leading-4 text-mineshaft-300">{resourceTypeName}</p></div></div><Badge variant="neutral" className="mt-3.5">diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsxindex e3a1b92fdc..5f54e3c844 100644--- a/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx@@ -21,7 +21,6 @@ import { ApprovalPolicyType } from "@app/hooks/api/approvalPolicies";import { useCreateApprovalRequest } from "@app/hooks/api/approvalRequests/mutations";type Props = {- accountPath?: string;resourceName?: string;accountName?: string;accountAccessed?: boolean;@@ -30,15 +29,6 @@ type Props = {};const formSchema = z.object({- accountPath: z- .string()- .refine((el) => !el || el.startsWith("/"), {- message: "Path must start with /"- })- .refine((el) => !el || !el.endsWith("/"), {- message: "Path cannot end with /"- })- .optional(),accessDuration: z.string().min(1, "Access duration is required")@@ -58,13 +48,7 @@ const formSchema = z.object({type FormData = z.infer<typeof formSchema>;-const Content = ({- onOpenChange,- accountPath,- resourceName,- accountName,- accountAccessed-}: Props) => {+const Content = ({ onOpenChange, resourceName, accountName, accountAccessed }: Props) => {const { projectId } = useProject();const { mutateAsync: createApprovalRequest, isPending: isSubmitting } =useCreateApprovalRequest();@@ -73,7 +57,6 @@ const Content = ({resolver: zodResolver(formSchema),mode: "onChange",defaultValues: {- accountPath,accessDuration: "4h",justification: ""}@@ -93,7 +76,6 @@ const Content = ({justification: formData.justification || null,requestData: {accessDuration: formData.accessDuration,- ...(formData.accountPath && { accountPath: formData.accountPath }),...(resourceName && { resourceName }),...(accountName && { accountName })}@@ -114,8 +96,6 @@ const Content = ({}};- const showAccountDetails = accountAccessed && resourceName && accountName;-return (<form onSubmit={handleSubmit(onSubmit)}>{accountAccessed && (@@ -127,7 +107,7 @@ const Content = ({</UnstableAlertDescription></UnstableAlert>)}- {showAccountDetails ? (+ {resourceName && accountName && (<div className="mb-4 rounded-md border border-mineshaft-600 bg-mineshaft-700/50 p-3"><div className="grid grid-cols-2 gap-4"><div>@@ -140,22 +120,6 @@ const Content = ({</div></div></div>- ) : (- <Controller- name="accountPath"- control={control}- render={({ field, fieldState: { error } }) => (- <FormControl- isRequired- helperText="Account path including the account name. Supports glob patterns (e.g., /folder/**, /*/account-name)"- errorText={error?.message}- isError={Boolean(error?.message)}- label="Account Path"- >- <Input autoFocus placeholder="/folder/account-name" {...field} />- </FormControl>- )}- />)}<Controllername="accessDuration"@@ -206,16 +170,15 @@ const Content = ({};export const PamRequestAccountAccessModal = (props: Props) => {- const { isOpen, onOpenChange, accountAccessed, resourceName, accountName } = props;-- const subTitle =- accountAccessed && resourceName && accountName- ? "Request access to a protected account"- : "Request access to an account path";+ const { isOpen, onOpenChange } = props;return (<Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent className="max-w-2xl pb-2" title="Request Account Access" subTitle={subTitle}>+ <ModalContent+ className="max-w-2xl pb-2"+ title="Request Account Access"+ subTitle="Request access to a protected account"+ ><Content {...props} /></ModalContent></Modal>diff --git a/frontend/src/pages/pam/PamAccountsPage/components/useAccessAwsIamAccount.tsx b/frontend/src/pages/pam/PamAccountsPage/components/useAccessAwsIamAccount.tsxindex f2cce369b3..4d9cd9b642 100644--- a/frontend/src/pages/pam/PamAccountsPage/components/useAccessAwsIamAccount.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/components/useAccessAwsIamAccount.tsx@@ -8,7 +8,7 @@ export const useAccessAwsIamAccount = () => {const accessPamAccount = useAccessPamAccount();const [loadingAccountId, setLoadingAccountId] = useState<string | null>(null);- const accessAwsIam = async (account: TPamAccount, accountPath: string) => {+ const accessAwsIam = async (account: TPamAccount) => {if (account.resource.resourceType !== PamResourceType.AwsIam) {return false;}@@ -18,7 +18,8 @@ export const useAccessAwsIamAccount = () => {try {const response = await accessPamAccount.mutateAsync({accountId: account.id,- accountPath,+ resourceName: account.resource.name,+ accountName: account.name,projectId: account.projectId,duration: `${(account.credentials as TAwsIamCredentials).defaultSessionDuration}s`});diff --git a/frontend/src/pages/pam/PamResourceByIDPage/components/PamResourceAccountsSection.tsx b/frontend/src/pages/pam/PamResourceByIDPage/components/PamResourceAccountsSection.tsxindex a9a0219942..92bf0ce898 100644--- a/frontend/src/pages/pam/PamResourceByIDPage/components/PamResourceAccountsSection.tsx+++ b/frontend/src/pages/pam/PamResourceByIDPage/components/PamResourceAccountsSection.tsx@@ -75,7 +75,6 @@ export const PamResourceAccountsSection = ({ resource }: Props) => {});const accounts = accountsData?.accounts || [];- const folderPaths = accountsData?.folderPaths || {};const [copiedAccountId, setCopiedAccountId] = useToggle(false);@@ -108,17 +107,10 @@ export const PamResourceAccountsSection = ({ resource }: Props) => {};const accessAccount = async (account: TPamAccount) => {- let fullAccountPath = `/${account.name}`;- const folderPath = account.folderId ? folderPaths[account.folderId] : undefined;- if (folderPath) {- fullAccountPath = `${folderPath}/${account.name}`;- }-const { requiresApproval } = await checkPolicyMatch({policyType: ApprovalPolicyType.PamAccess,projectId: projectId!,inputs: {- accountPath: fullAccountPath,resourceName: resource.name,accountName: account.name}@@ -126,7 +118,6 @@ export const PamResourceAccountsSection = ({ resource }: Props) => {if (requiresApproval) {handlePopUpOpen("requestAccount", {- accountPath: fullAccountPath,resourceName: resource.name,accountName: account.name,accountAccessed: true@@ -135,9 +126,9 @@ export const PamResourceAccountsSection = ({ resource }: Props) => {}if (account.resource.resourceType === PamResourceType.AwsIam) {- accessAwsIam(account, fullAccountPath);+ accessAwsIam(account);} else {- handlePopUpOpen("accessAccount", { account, accountPath: folderPath });+ handlePopUpOpen("accessAccount", { account });}};@@ -372,7 +363,6 @@ export const PamResourceAccountsSection = ({ resource }: Props) => {<PamRequestAccountAccessModalisOpen={popUp.requestAccount.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("requestAccount", isOpen)}- accountPath={popUp.requestAccount.data?.accountPath}resourceName={popUp.requestAccount.data?.resourceName}accountName={popUp.requestAccount.data?.accountName}accountAccessed={popUp.requestAccount.data?.accountAccessed}diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/PamAccountPermissionConditions.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/PamAccountPermissionConditions.tsxindex a6da9bfe55..9a6317691a 100644--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/PamAccountPermissionConditions.tsx+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/PamAccountPermissionConditions.tsx@@ -1,10 +1,6 @@-import { useMemo } from "react";-import { useFormContext } from "react-hook-form";-import { ProjectPermissionSub } from "@app/context/ProjectPermissionContext/types";import { ConditionsFields } from "./ConditionsFields";-import { TFormSchema } from "./ProjectRoleModifySection.utils";type Props = {position?: number;@@ -12,38 +8,15 @@ type Props = {};export const PamAccountPermissionConditions = ({ position = 0, isDisabled }: Props) => {- const { watch } = useFormContext<TFormSchema>();-- // Check if any existing condition uses accountPath- const conditions = watch(- `permissions.${ProjectPermissionSub.PamAccounts}.${position}.conditions` as const- ) as Array<{ lhs: string; operator: string; rhs: string }> | undefined;-- const hasAccountPathCondition = useMemo(() => {- if (!conditions || !Array.isArray(conditions)) return false;- return conditions.some((condition) => condition?.lhs === "accountPath");- }, [conditions]);-- // Build select options - only include accountPath if it's already being used- const selectOptions = useMemo(() => {- const options: [{ value: string; label: string }, ...{ value: string; label: string }[]] = [- { value: "resourceName", label: "Resource Name" },- { value: "accountName", label: "Account Name" }- ];-- if (hasAccountPathCondition) {- options.push({ value: "accountPath", label: "Account Path (Legacy)" });- }-- return options;- }, [hasAccountPathCondition]);-return (<ConditionsFieldsisDisabled={isDisabled}subject={ProjectPermissionSub.PamAccounts}position={position}- selectOptions={selectOptions}+ selectOptions={[+ { value: "resourceName", label: "Resource Name" },+ { value: "accountName", label: "Account Name" }+ ]}/>);};