Skip to content

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

chore(pam): condense comments to one line

bernie-g45ba473df3ff
diff --git a/backend/src/ee/services/pam-membership/pam-membership-service.ts b/backend/src/ee/services/pam-membership/pam-membership-service.ts
index 61934a0240..7f2bc00ea4 100644
--- a/backend/src/ee/services/pam-membership/pam-membership-service.ts
+++ b/backend/src/ee/services/pam-membership/pam-membership-service.ts
@@ -302,9 +302,7 @@ export const pamMembershipServiceFactory = ({
const membershipRole = await membershipRoleDAL.create({ membershipId: membership.id, role }, tx);
- // The Members tab's "Add Member" UI actually adds users via the generic project-membership
- // endpoint (whose factory already clears this), not this one. This covers direct API callers
- // of this PAM-specific endpoint so their pending request doesn't linger either.
+ // For direct API callers; the UI's Add Member flow uses the generic endpoint, which already clears this.
if (kind === PamMemberKind.User) {
await projectAccessRequestDAL.delete({ projectId, requesterUserId: id }, tx);
}
diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.ts
index e357a38471..6286e0821f 100644
--- a/backend/src/services/project/project-service.ts
+++ b/backend/src/services/project/project-service.ts
@@ -217,8 +217,7 @@ type TProjectServiceFactoryDep = {
export type TProjectServiceFactory = ReturnType<typeof projectServiceFactory>;
-// Used by requestProjectAccess to build the admin-facing callback link/notification copy.
-// Types not listed here fall back to the raw project type/name.
+// Cosmetic overrides for requestProjectAccess; unlisted types fall back to the raw type/name.
const PROJECT_ACCESS_REQUEST_URL_SLUGS: Partial<Record<ProjectType, string>> = {
[ProjectType.SecretManager]: "secret-management",
[ProjectType.CertificateManager]: "cert-manager"
diff --git a/frontend/src/hooks/api/pam/queries.tsx b/frontend/src/hooks/api/pam/queries.tsx
index e66060f11b..0457f28a29 100644
--- a/frontend/src/hooks/api/pam/queries.tsx
+++ b/frontend/src/hooks/api/pam/queries.tsx
@@ -50,8 +50,7 @@ export const fetchPamProjectId = async () => {
return data.projectId;
};
-// Shared by any imperative (non-hook) call site that needs the org's PAM project id — skips the
-// network round-trip when the caller already has it cached (e.g. from the org context).
+// For imperative (non-hook) callers; skips the fetch when the id is already cached.
export const resolvePamProjectId = async (cachedPamProjectId?: string | null) =>
cachedPamProjectId ?? fetchPamProjectId();
diff --git a/frontend/src/lib/fn/requesterStatus.ts b/frontend/src/lib/fn/requesterStatus.ts
index 1a21126f34..04e8a8fe58 100644
--- a/frontend/src/lib/fn/requesterStatus.ts
+++ b/frontend/src/lib/fn/requesterStatus.ts
@@ -6,9 +6,7 @@ export type TRequesterStatus = {
userId?: string;
};
-// Shared by the "add member" modals (generic and PAM) to resolve the `?requesterEmail=` deep link
-// from a project-access-request email into a display label and pre-fill target.
-// `memberUsernames` accepts a Set or Map since call sites already build one or the other.
+// Resolves the ?requesterEmail= deep link into a display label and pre-fill target.
export const getRequesterStatus = (
requesterEmail: string | undefined,
orgUsers: OrgUser[] | undefined,
diff --git a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
index 3d19a83cbe..5a20c20474 100644
--- a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
+++ b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
@@ -243,8 +243,7 @@ export const ProjectCategoryOverview = () => {
};
const enterPamProject = async () => {
- // PAM is a per-org singleton with no dedicated "instance" concept; resolving it here also
- // lazily bootstraps the project for orgs that don't have one yet (safe for any org member).
+ // Also lazily bootstraps the PAM project for orgs that don't have one yet.
let pamProjectId: string;
try {
pamProjectId = await resolvePamProjectId(currentOrg?.pamProjectId);
diff --git a/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx b/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx
index 018408770c..eeb156eaff 100644
--- a/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx
+++ b/frontend/src/pages/public/ErrorPage/components/ProjectAccessError.tsx
@@ -15,12 +15,8 @@ type ProjectAccessErrorProps = {
projectId?: string;
};
-// PAM is a per-org singleton with no $projectId route param, unlike other product routes, so this
-// screen can't read the project id off the route the normal way when it fires for a PAM page. Its
-// beforeLoad throws from a parent route's error boundary (TanStack attributes a beforeLoad failure
-// to the nearest already-matched ancestor, not the failing route itself), so a PAM-specific
-// errorComponent on the PAM route never runs either. Derive the org id from the URL instead.
-// Keep in sync with the PAM route path declared in `frontend/src/pages/pam/layout.tsx`.
+// PAM has no $projectId route param, and TanStack attributes beforeLoad failures to the nearest
+// matched ancestor rather than the failing route, so derive the org id from the URL. Keep in sync with pam/layout.tsx.
const getPamOrgIdFromPath = () =>
window.location.pathname.match(/\/organizations\/([^/]+)\/pam(\/|$)/)?.[1];