Skip to content

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

fix(pam): lint autofix for identity membership files

bernie-gd94992efa91c
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 68f0c0e1be..f8809a65aa 100644
--- a/backend/src/ee/services/pam-membership/pam-membership-service.ts
+++ b/backend/src/ee/services/pam-membership/pam-membership-service.ts
@@ -10,9 +10,9 @@ import {
} from "@app/ee/services/permission/resource-permission";
import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
import { ms } from "@app/lib/ms";
+import { TIdentityDALFactory } from "@app/services/identity/identity-dal";
import { TMembershipDALFactory } from "@app/services/membership/membership-dal";
import { TMembershipRoleDALFactory } from "@app/services/membership/membership-role-dal";
-import { TIdentityDALFactory } from "@app/services/identity/identity-dal";
import { TUserDALFactory } from "@app/services/user/user-dal";
import { PamProductRole, PamResourceRole } from "../pam/pam-enums";
@@ -196,7 +196,10 @@ export const pamMembershipServiceFactory = ({
return { column, id, kind };
};
- const validateProductMember = async (projectId: string, dto: { userId?: string; groupId?: string; identityId?: string }) => {
+ const validateProductMember = async (
+ projectId: string,
+ dto: { userId?: string; groupId?: string; identityId?: string }
+ ) => {
const { column, id } = resolveActorColumn(dto);
const memberships = await membershipDAL.find({
scope: AccessScope.Project,
diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsx
index 8ac2647442..acd5f5034b 100644
--- a/frontend/src/hooks/api/pam/mutations.tsx
+++ b/frontend/src/hooks/api/pam/mutations.tsx
@@ -390,10 +390,9 @@ export const useAddPamProductIdentityMember = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async ({ identityId, role }: TAddPamProductIdentityMemberDTO) => {
- const { data } = await apiRequest.post(
- `/api/v1/pam/memberships/identities/${identityId}`,
- { role }
- );
+ const { data } = await apiRequest.post(`/api/v1/pam/memberships/identities/${identityId}`, {
+ role
+ });
return data;
},
onSuccess: () => {
@@ -406,10 +405,9 @@ export const useUpdatePamProductIdentityMember = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async ({ identityId, role }: TUpdatePamProductIdentityMemberDTO) => {
- const { data } = await apiRequest.patch(
- `/api/v1/pam/memberships/identities/${identityId}`,
- { role }
- );
+ const { data } = await apiRequest.patch(`/api/v1/pam/memberships/identities/${identityId}`, {
+ role
+ });
return data;
},
onSuccess: () => {
@@ -422,9 +420,7 @@ export const useRemovePamProductIdentityMember = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async ({ identityId }: TRemovePamProductIdentityMemberDTO) => {
- const { data } = await apiRequest.delete(
- `/api/v1/pam/memberships/identities/${identityId}`
- );
+ const { data } = await apiRequest.delete(`/api/v1/pam/memberships/identities/${identityId}`);
return data;
},
onSuccess: () => {
diff --git a/frontend/src/pages/pam/PamAccessControlPage/components/AddIdentityModal.tsx b/frontend/src/pages/pam/PamAccessControlPage/components/AddIdentityModal.tsx
index e095e87371..aa8628c86c 100644
--- a/frontend/src/pages/pam/PamAccessControlPage/components/AddIdentityModal.tsx
+++ b/frontend/src/pages/pam/PamAccessControlPage/components/AddIdentityModal.tsx
@@ -17,11 +17,8 @@ import {
} from "@app/components/v3";
import { useOrganization } from "@app/context";
import { useGetIdentityMembershipOrgs } from "@app/hooks/api";
-import {
- useAddPamProductIdentityMember,
- useListPamProductIdentities
-} from "@app/hooks/api/pam";
import { IdentityMembershipOrg } from "@app/hooks/api/identities/types";
+import { useAddPamProductIdentityMember, useListPamProductIdentities } from "@app/hooks/api/pam";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
import { ProductRoleOptionList } from "./ProductRoleOptionList";
diff --git a/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx b/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx
index 5ce041af6a..4409b3e813 100644
--- a/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx
+++ b/frontend/src/pages/pam/PamAccessControlPage/components/IdentitiesTab.tsx
@@ -1,6 +1,13 @@
import { useMemo, useState } from "react";
import { format } from "date-fns";
-import { BotIcon, MoreHorizontalIcon, PencilIcon, Plus, SearchIcon, Trash2Icon } from "lucide-react";
+import {
+ BotIcon,
+ MoreHorizontalIcon,
+ PencilIcon,
+ Plus,
+ SearchIcon,
+ Trash2Icon
+} from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
@@ -31,17 +38,10 @@ import {
TableHeader,
TableRow
} from "@app/components/v3";
-import {
- ProjectPermissionActions,
- ProjectPermissionSub,
- useOrganization
-} from "@app/context";
+import { ProjectPermissionActions, ProjectPermissionSub, useOrganization } from "@app/context";
import { formatProjectRoleName } from "@app/helpers/roles";
import { useGetIdentityMembershipOrgs } from "@app/hooks/api";
-import {
- useListPamProductIdentities,
- useRemovePamProductIdentityMember
-} from "@app/hooks/api/pam";
+import { useListPamProductIdentities, useRemovePamProductIdentityMember } from "@app/hooks/api/pam";
import { TPamMember } from "@app/hooks/api/pam/types";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
@@ -65,11 +65,9 @@ export const IdentitiesTab = () => {
const identityNameMap = useMemo(() => {
const map = new Map<string, string>();
- if (orgIdentitiesData?.identityMemberships) {
- for (const m of orgIdentitiesData.identityMemberships) {
- map.set(m.identity.id, m.identity.name);
- }
- }
+ orgIdentitiesData?.identityMemberships?.forEach((m) => {
+ map.set(m.identity.id, m.identity.name);
+ });
return map;
}, [orgIdentitiesData]);
@@ -187,9 +185,7 @@ export const IdentitiesTab = () => {
</button>
</TableCell>
<TableCell className="text-sm text-muted">
- {member.createdAt
- ? format(new Date(member.createdAt), "MMM d, yyyy")
- : "—"}
+ {member.createdAt ? format(new Date(member.createdAt), "MMM d, yyyy") : "—"}
</TableCell>
<TableCell>
<DropdownMenu>