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
chore: addressed comments
Sheen Capadngan7ca7b1587123
diff --git a/backend/src/ee/routes/v2/gateway-router.ts b/backend/src/ee/routes/v2/gateway-router.tsindex 262268d6a9..f72ec9b3f4 100644--- a/backend/src/ee/routes/v2/gateway-router.ts+++ b/backend/src/ee/routes/v2/gateway-router.ts@@ -95,7 +95,8 @@ export const registerGatewayV2Router = async (server: FastifyZodProvider) => {identity: z.object({name: z.string(),id: z.string()- })+ }),+ connectedResourcesCount: z.number()}).array()}},@@ -233,7 +234,8 @@ export const registerGatewayV2Router = async (server: FastifyZodProvider) => {id: z.string(),name: z.string(),projectId: z.string(),- projectName: z.string()+ projectName: z.string(),+ discoveryType: z.string()})),kubernetesAuths: z.array(diff --git a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-dal.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-dal.tsindex e48869fa6c..c56ea86451 100644--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-dal.ts+++ b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-dal.ts@@ -23,5 +23,14 @@ export const aiMcpServerDALFactory = (db: TDbClient) => {return docs;};- return { ...aiMcpServerOrm, findByGatewayId };+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.AiMcpServer)+ .where(`${TableName.AiMcpServer}.gatewayId`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };++ return { ...aiMcpServerOrm, findByGatewayId, countByGatewayId };};diff --git a/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.ts b/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.tsindex 26ff3a1fda..7dcc6836e8 100644--- a/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.ts+++ b/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.ts@@ -46,6 +46,7 @@ export interface TDynamicSecretDALFactory extends Omit<TOrmify<TableName.DynamicenvironmentSlug: string;}>>;+ countByGatewayId: (gatewayId: string, tx?: Knex) => Promise<number>;}export const dynamicSecretDALFactory = (db: TDbClient): TDynamicSecretDALFactory => {@@ -213,5 +214,14 @@ export const dynamicSecretDALFactory = (db: TDbClient): TDynamicSecretDALFactoryreturn docs;};- return { ...orm, listDynamicSecretsByFolderIds, findOne, findWithMetadata, findByGatewayId };+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.DynamicSecret)+ .where(`${TableName.DynamicSecret}.gatewayV2Id`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };++ return { ...orm, listDynamicSecretsByFolderIds, findOne, findWithMetadata, findByGatewayId, countByGatewayId };};diff --git a/backend/src/ee/services/gateway-v2/gateway-v2-service.ts b/backend/src/ee/services/gateway-v2/gateway-v2-service.tsindex 2c8ef40f46..cfc4def763 100644--- a/backend/src/ee/services/gateway-v2/gateway-v2-service.ts+++ b/backend/src/ee/services/gateway-v2/gateway-v2-service.ts@@ -54,13 +54,13 @@ type TGatewayV2ServiceFactoryDep = {orgDAL: Pick<TOrgDALFactory, "findOrgMembersByRole">;notificationService: Pick<TNotificationServiceFactory, "createUserNotifications">;smtpService: Pick<TSmtpService, "sendMail">;- appConnectionDAL: Pick<TAppConnectionDALFactory, "findByGatewayId">;- dynamicSecretDAL: Pick<TDynamicSecretDALFactory, "findByGatewayId">;- pamResourceDAL: Pick<TPamResourceDALFactory, "findByGatewayId">;- pamDiscoverySourceDAL: Pick<TPamDiscoverySourceDALFactory, "findByGatewayId">;- identityKubernetesAuthDAL: Pick<TIdentityKubernetesAuthDALFactory, "findByGatewayId">;- aiMcpServerDAL: Pick<TAiMcpServerDALFactory, "findByGatewayId">;- pkiDiscoveryConfigDAL: Pick<TPkiDiscoveryConfigDALFactory, "findByGatewayId">;+ appConnectionDAL: Pick<TAppConnectionDALFactory, "findByGatewayId" | "countByGatewayId">;+ dynamicSecretDAL: Pick<TDynamicSecretDALFactory, "findByGatewayId" | "countByGatewayId">;+ pamResourceDAL: Pick<TPamResourceDALFactory, "findByGatewayId" | "countByGatewayId">;+ pamDiscoverySourceDAL: Pick<TPamDiscoverySourceDALFactory, "findByGatewayId" | "countByGatewayId">;+ identityKubernetesAuthDAL: Pick<TIdentityKubernetesAuthDALFactory, "findByGatewayId" | "countByGatewayId">;+ aiMcpServerDAL: Pick<TAiMcpServerDALFactory, "findByGatewayId" | "countByGatewayId">;+ pkiDiscoveryConfigDAL: Pick<TPkiDiscoveryConfigDALFactory, "findByGatewayId" | "countByGatewayId">;};export type TGatewayV2ServiceFactory = ReturnType<typeof gatewayV2ServiceFactory>;@@ -287,7 +287,60 @@ export const gatewayV2ServiceFactory = ({orgId: orgPermission.orgId});- return gateways;+ if (gateways.length === 0) {+ return [];+ }++ const gatewayIds = gateways.map((g) => g.id);++ const [+ appConnectionsCounts,+ dynamicSecretsCounts,+ pamResourcesCounts,+ pamDiscoverySourcesCounts,+ kubernetesAuthsCounts,+ mcpServersCounts,+ pkiDiscoveryConfigsCounts+ ] = await Promise.all([+ Promise.all(gatewayIds.map((id) => appConnectionDAL.countByGatewayId(id).then((count) => ({ id, count })))),+ Promise.all(gatewayIds.map((id) => dynamicSecretDAL.countByGatewayId(id).then((count) => ({ id, count })))),+ Promise.all(gatewayIds.map((id) => pamResourceDAL.countByGatewayId(id).then((count) => ({ id, count })))),+ Promise.all(gatewayIds.map((id) => pamDiscoverySourceDAL.countByGatewayId(id).then((count) => ({ id, count })))),+ Promise.all(+ gatewayIds.map((id) => identityKubernetesAuthDAL.countByGatewayId(id).then((count) => ({ id, count })))+ ),+ Promise.all(gatewayIds.map((id) => aiMcpServerDAL.countByGatewayId(id).then((count) => ({ id, count })))),+ Promise.all(gatewayIds.map((id) => pkiDiscoveryConfigDAL.countByGatewayId(id).then((count) => ({ id, count }))))+ ]);++ const countMap = new Map<string, number>();++ for (const { id, count } of appConnectionsCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }+ for (const { id, count } of dynamicSecretsCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }+ for (const { id, count } of pamResourcesCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }+ for (const { id, count } of pamDiscoverySourcesCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }+ for (const { id, count } of kubernetesAuthsCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }+ for (const { id, count } of mcpServersCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }+ for (const { id, count } of pkiDiscoveryConfigsCounts) {+ countMap.set(id, (countMap.get(id) ?? 0) + count);+ }++ return gateways.map((gateway) => ({+ ...gateway,+ connectedResourcesCount: countMap.get(gateway.id) ?? 0+ }));};const getPlatformConnectionDetailsByGatewayId = async ({diff --git a/backend/src/ee/services/gateway-v2/gateway-v2-types.ts b/backend/src/ee/services/gateway-v2/gateway-v2-types.tsindex b31354680e..9766049402 100644--- a/backend/src/ee/services/gateway-v2/gateway-v2-types.ts+++ b/backend/src/ee/services/gateway-v2/gateway-v2-types.ts@@ -52,6 +52,7 @@ export type TGatewayConnectedPamDiscoverySource = {export type TGatewayConnectedKubernetesAuth = {id: string;identityId: string;+ identityName: string;};export type TGatewayConnectedMcpServer = {diff --git a/backend/src/ee/services/pam-discovery/pam-discovery-source-dal.ts b/backend/src/ee/services/pam-discovery/pam-discovery-source-dal.tsindex 188d5ee637..351aa07133 100644--- a/backend/src/ee/services/pam-discovery/pam-discovery-source-dal.ts+++ b/backend/src/ee/services/pam-discovery/pam-discovery-source-dal.ts@@ -121,16 +121,27 @@ export const pamDiscoverySourceDALFactory = (db: TDbClient) => {db.ref("id").withSchema(TableName.PamDiscoverySource),db.ref("name").withSchema(TableName.PamDiscoverySource),db.ref("projectId").withSchema(TableName.PamDiscoverySource),+ db.ref("discoveryType").withSchema(TableName.PamDiscoverySource),db.ref("name").withSchema(TableName.Project).as("projectName"));return docs;};+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.PamDiscoverySource)+ .where(`${TableName.PamDiscoverySource}.gatewayId`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };+return {...orm,findByProjectId,findDueForScan,- findByGatewayId+ findByGatewayId,+ countByGatewayId};};diff --git a/backend/src/ee/services/pam-resource/pam-resource-dal.ts b/backend/src/ee/services/pam-resource/pam-resource-dal.tsindex cecd19cf60..6a35aff50c 100644--- a/backend/src/ee/services/pam-resource/pam-resource-dal.ts+++ b/backend/src/ee/services/pam-resource/pam-resource-dal.ts@@ -163,5 +163,22 @@ export const pamResourceDALFactory = (db: TDbClient) => {return docs;};- return { ...orm, findById, findByProjectId, findMetadataByResourceIds, findByAdServerResourceId, findByGatewayId };+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.PamResource)+ .where(`${TableName.PamResource}.gatewayId`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };++ return {+ ...orm,+ findById,+ findByProjectId,+ findMetadataByResourceIds,+ findByAdServerResourceId,+ findByGatewayId,+ countByGatewayId+ };};diff --git a/backend/src/ee/services/pki-discovery/pki-discovery-config-dal.ts b/backend/src/ee/services/pki-discovery/pki-discovery-config-dal.tsindex f4fc179246..acd6bd2aa7 100644--- a/backend/src/ee/services/pki-discovery/pki-discovery-config-dal.ts+++ b/backend/src/ee/services/pki-discovery/pki-discovery-config-dal.ts@@ -163,6 +163,15 @@ export const pkiDiscoveryConfigDALFactory = (db: TDbClient) => {return docs;};+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.PkiDiscoveryConfig)+ .where(`${TableName.PkiDiscoveryConfig}.gatewayId`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };+return {...pkiDiscoveryConfigOrm,findByProjectId,@@ -171,6 +180,7 @@ export const pkiDiscoveryConfigDALFactory = (db: TDbClient) => {findByIdWithInstallationCounts,findByName,claimScanSlot,- findByGatewayId+ findByGatewayId,+ countByGatewayId};};diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex a0ccefaf5a..7b959043b9 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -2786,7 +2786,6 @@ export const registerRoutes = async (const pamDiscoverySourceDependenciesDAL = pamDiscoverySourceDependenciesDALFactory(db);const pamAccountDependenciesDAL = pamAccountDependenciesDALFactory(db);const pamResourceRotationRulesDAL = pamResourceRotationRulesDALFactory(db);- const aiMcpServerDAL = aiMcpServerDALFactory(db);const aiMcpServerToolDAL = aiMcpServerToolDALFactory(db);const aiMcpServerUserCredentialDAL = aiMcpServerUserCredentialDALFactory(db);diff --git a/backend/src/services/app-connection/app-connection-dal.ts b/backend/src/services/app-connection/app-connection-dal.tsindex 0411f4980a..67f3955a71 100644--- a/backend/src/services/app-connection/app-connection-dal.ts+++ b/backend/src/services/app-connection/app-connection-dal.ts@@ -169,5 +169,14 @@ export const appConnectionDALFactory = (db: TDbClient) => {return docs;};- return { ...appConnectionOrm, findAppConnectionUsageById, findWithProjectDetails, findByGatewayId };+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.AppConnection)+ .where(`${TableName.AppConnection}.gatewayId`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };++ return { ...appConnectionOrm, findAppConnectionUsageById, findWithProjectDetails, findByGatewayId, countByGatewayId };};diff --git a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-dal.ts b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-dal.tsindex 9bf3394fe4..f1ba2e1dff 100644--- a/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-dal.ts+++ b/backend/src/services/identity-kubernetes-auth/identity-kubernetes-auth-dal.ts@@ -22,5 +22,14 @@ export const identityKubernetesAuthDALFactory = (db: TDbClient) => {return docs;};- return { ...kubernetesAuthOrm, findByGatewayId };+ const countByGatewayId = async (gatewayId: string, tx?: Knex) => {+ const result = await (tx || db.replicaNode())(TableName.IdentityKubernetesAuth)+ .where(`${TableName.IdentityKubernetesAuth}.gatewayV2Id`, gatewayId)+ .count("id")+ .first();++ return parseInt(String(result?.count || "0"), 10);+ };++ return { ...kubernetesAuthOrm, findByGatewayId, countByGatewayId };};diff --git a/frontend/src/hooks/api/gateways-v2/types.ts b/frontend/src/hooks/api/gateways-v2/types.tsindex c2cd6c79f4..33d13345aa 100644--- a/frontend/src/hooks/api/gateways-v2/types.ts+++ b/frontend/src/hooks/api/gateways-v2/types.ts@@ -11,6 +11,7 @@ export type TGatewayV2 = {updatedAt: string;heartbeat: string;lastHealthCheckStatus: GatewayHealthCheckStatus | null;+ connectedResourcesCount: number;identity: {name: string;id: string;@@ -47,6 +48,7 @@ export type TGatewayConnectedPamDiscoverySource = {name: string;projectId: string;projectName: string;+ discoveryType: string;};export type TGatewayConnectedKubernetesAuth = {diff --git a/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsx b/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsxindex 79fd118d2a..e63dc7e328 100644--- a/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsx@@ -1,4 +1,4 @@-import { useMemo } from "react";+import { useMemo, useState } from "react";import { faExclamationTriangle, faXmark } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useQuery } from "@tanstack/react-query";@@ -12,12 +12,14 @@ import {OrgPermissionSubjects,OrgRelayPermissionActions} from "@app/context/OrgPermissionContext/types";-import { useToggle } from "@app/hooks";import { gatewaysQueryKeys } from "@app/hooks/api/gateways/queries";+import { GatewayHealthCheckStatus } from "@app/hooks/api/gateways-v2/types";import { relayQueryKeys } from "@app/hooks/api/relays/queries";import { TRelay } from "@app/hooks/api/relays/types";const ONE_HOUR_MS = 60 * 60 * 1000;+const ONE_DAY_MS = 24 * ONE_HOUR_MS;+const DISMISS_STORAGE_KEY = "network-health-banner-dismissed-at";const isHeartbeatStale = (heartbeat?: string | null): boolean => {if (!heartbeat) return true;@@ -25,8 +27,15 @@ const isHeartbeatStale = (heartbeat?: string | null): boolean => {return heartbeatDate.getTime() < Date.now() - ONE_HOUR_MS;};+const wasDismissedWithinLastDay = (): boolean => {+ const dismissedAt = localStorage.getItem(DISMISS_STORAGE_KEY);+ if (!dismissedAt) return false;+ const dismissedTime = parseInt(dismissedAt, 10);+ return Date.now() - dismissedTime < ONE_DAY_MS;+};+export const NetworkHealthBanner = () => {- const [isDismissed, setIsDismissed] = useToggle(false);+ const [isDismissed, setIsDismissed] = useState(() => wasDismissedWithinLastDay());const { currentOrg } = useOrganization();const { permission } = useOrgPermission();@@ -53,7 +62,16 @@ export const NetworkHealthBanner = () => {});const unreachableGateways = useMemo(- () => gateways?.filter((g) => isHeartbeatStale(g.heartbeat)).length ?? 0,+ () =>+ gateways?.filter((g) => {+ if (+ "lastHealthCheckStatus" in g &&+ g.lastHealthCheckStatus === GatewayHealthCheckStatus.Failed+ ) {+ return true;+ }+ return isHeartbeatStale(g.heartbeat);+ }).length ?? 0,[gateways]);@@ -90,7 +108,10 @@ export const NetworkHealthBanner = () => {className="ml-auto p-0 text-red-200 hover:text-red-100"ariaLabel="Dismiss banner"variant="plain"- onClick={() => setIsDismissed.on()}+ onClick={() => {+ localStorage.setItem(DISMISS_STORAGE_KEY, Date.now().toString());+ setIsDismissed(true);+ }}><FontAwesomeIcon icon={faXmark} /></IconButton>diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsxindex 94707f419b..7c1a5e5d59 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx@@ -46,11 +46,7 @@ import {import { withPermission } from "@app/hoc";import { usePopUp } from "@app/hooks";import { gatewaysQueryKeys, useDeleteGatewayById } from "@app/hooks/api/gateways";-import {- useDeleteGatewayV2ById,- useGetGatewayConnectedResources,- useTriggerGatewayV2Heartbeat-} from "@app/hooks/api/gateways-v2";+import { useDeleteGatewayV2ById, useTriggerGatewayV2Heartbeat } from "@app/hooks/api/gateways-v2";import { GatewayHealthCheckStatus } from "@app/hooks/api/gateways-v2/types";import { EditGatewayDetailsModal } from "./components/EditGatewayDetailsModal";@@ -82,33 +78,17 @@ const GatewayHealthStatus = ({};type GatewayConnectedCellProps = {- gatewayId: string;isV1: boolean;+ connectedResourcesCount: number;onClick: () => void;};-const GatewayConnectedCell = ({ gatewayId, isV1, onClick }: GatewayConnectedCellProps) => {- const { data: resources, isPending } = useGetGatewayConnectedResources(isV1 ? "" : gatewayId);-- if (isV1) {- return <span className="text-mineshaft-400">—</span>;- }-- if (isPending) {- return <span className="text-mineshaft-400">...</span>;- }-- const totalCount = resources- ? resources.appConnections.length +- resources.dynamicSecrets.length +- resources.pamResources.length +- resources.pamDiscoverySources.length +- resources.kubernetesAuths.length +- resources.mcpServers.length +- resources.pkiDiscoveryConfigs.length- : 0;-- if (totalCount === 0) {+const GatewayConnectedCell = ({+ isV1,+ connectedResourcesCount,+ onClick+}: GatewayConnectedCellProps) => {+ if (isV1 || connectedResourcesCount === 0) {return <span className="text-mineshaft-400">—</span>;}@@ -119,7 +99,7 @@ const GatewayConnectedCell = ({ gatewayId, isV1, onClick }: GatewayConnectedCellclassName="flex cursor-pointer items-center gap-1.5 text-mineshaft-200 underline decoration-mineshaft-400 underline-offset-2 hover:text-mineshaft-100 hover:decoration-mineshaft-300"><span>- {totalCount} resource{totalCount !== 1 ? "s" : ""}+ {connectedResourcesCount} resource{connectedResourcesCount !== 1 ? "s" : ""}</span></button>);@@ -243,8 +223,10 @@ export const GatewayTab = withPermission(</Td><Td><GatewayConnectedCell- gatewayId={el.id}isV1={el.isV1}+ connectedResourcesCount={+ "connectedResourcesCount" in el ? el.connectedResourcesCount : 0+ }onClick={() => {setSelectedGateway({ id: el.id, name: el.name });handlePopUpOpen("connectedResources");diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsxindex db8aa37bc6..dfd3fbdf06 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsx@@ -192,8 +192,13 @@ export const GatewayConnectedResourcesDrawer = ({key={res.id}name={res.name}subtitle={`${res.resourceType} · ${res.projectName}`}- to="/organizations/$orgId/projects/pam/$projectId/resources/"- params={{ orgId: currentOrg.id, projectId: res.projectId }}+ to="/organizations/$orgId/projects/pam/$projectId/resources/$resourceType/$resourceId"+ params={{+ orgId: currentOrg.id,+ projectId: res.projectId,+ resourceType: res.resourceType,+ resourceId: res.id+ }}isLast={idx === (resources?.pamResources.length ?? 0) - 1}/>))}@@ -212,9 +217,14 @@ export const GatewayConnectedResourcesDrawer = ({<ResourceRowkey={source.id}name={source.name}- subtitle={source.projectName}- to="/organizations/$orgId/projects/pam/$projectId/discovery/"- params={{ orgId: currentOrg.id, projectId: source.projectId }}+ subtitle={`${source.discoveryType} · ${source.projectName}`}+ to="/organizations/$orgId/projects/pam/$projectId/discovery/$discoveryType/$discoverySourceId"+ params={{+ orgId: currentOrg.id,+ projectId: source.projectId,+ discoveryType: source.discoveryType,+ discoverySourceId: source.id+ }}isLast={idx === (resources?.pamDiscoverySources.length ?? 0) - 1}/>))}