From 51907e2c652662df1f7296155aa05a984454e966 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 7 Jan 2026 01:15:13 +0530 Subject: [PATCH] feat: removed feature flag for ai and pam --- .../ai-mcp-endpoint-service.ts | 12 +- .../ai-mcp-server/ai-mcp-server-service.ts | 12 +- .../src/ee/services/license/license-fns.ts | 4 +- .../src/ee/services/license/license-types.ts | 2 - .../pam-account/pam-account-service.ts | 31 --- .../services/pam-folder/pam-folder-service.ts | 22 +- .../pam-resource/pam-resource-service.ts | 17 -- .../pam-session/pam-session-service.ts | 10 - .../ee/services/permission/default-roles.ts | 2 +- backend/src/server/routes/index.ts | 12 +- frontend/src/hooks/api/subscriptions/types.ts | 2 - frontend/src/layouts/AILayout/AILayout.tsx | 165 ++++++------ frontend/src/layouts/PamLayout/PamLayout.tsx | 235 ++++++++---------- .../MCPEndpointsTab/MCPEndpointsTab.tsx | 24 +- .../MCPServersTab/MCPServersTab.tsx | 20 +- .../PamRequestAccountAccessModal.tsx | 2 +- .../components/ResourceTypeSelect.tsx | 10 - 17 files changed, 186 insertions(+), 396 deletions(-) diff --git a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service.ts b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service.ts index 76fba74164..9d695a7640 100644 --- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service.ts +++ b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service.ts @@ -27,7 +27,6 @@ import { AiMcpServerCredentialMode } from "../ai-mcp-server/ai-mcp-server-enum"; import { TAiMcpServerServiceFactory } from "../ai-mcp-server/ai-mcp-server-service"; import { TAiMcpServerToolDALFactory } from "../ai-mcp-server/ai-mcp-server-tool-dal"; import { TAiMcpServerUserCredentialDALFactory } from "../ai-mcp-server/ai-mcp-server-user-credential-dal"; -import { TLicenseServiceFactory } from "../license/license-service"; import { TPermissionServiceFactory } from "../permission/permission-service-types"; import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "../permission/project-permission"; import { TAiMcpEndpointDALFactory } from "./ai-mcp-endpoint-dal"; @@ -73,7 +72,6 @@ type TAiMcpEndpointServiceFactoryDep = { authTokenService: Pick; userDAL: TUserDALFactory; permissionService: Pick; - licenseService: Pick; }; // OAuth schemas for parsing cached data @@ -130,8 +128,7 @@ export const aiMcpEndpointServiceFactory = ({ keyStore, authTokenService, userDAL, - permissionService, - licenseService + permissionService }: TAiMcpEndpointServiceFactoryDep) => { const interactWithMcp = async ({ endpointId, @@ -375,13 +372,6 @@ export const aiMcpEndpointServiceFactory = ({ actorAuthMethod, actorOrgId }: TCreateAiMcpEndpointDTO) => { - const orgLicensePlan = await licenseService.getPlan(actorOrgId); - if (!orgLicensePlan.ai) { - throw new BadRequestError({ - message: "AI operation failed due to organization plan restrictions." - }); - } - const { permission } = await permissionService.getProjectPermission({ actor, actorId, diff --git a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-service.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-service.ts index aec2cc034a..8217513793 100644 --- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-service.ts +++ b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-service.ts @@ -20,7 +20,6 @@ import { ActorType, AuthMethod } from "@app/services/auth/auth-type"; import { TKmsServiceFactory } from "@app/services/kms/kms-service"; import { KmsDataKey } from "@app/services/kms/kms-types"; -import { TLicenseServiceFactory } from "../license/license-service"; import { TPermissionServiceFactory } from "../permission/permission-service-types"; import { ProjectPermissionActions, ProjectPermissionSub } from "../permission/project-permission"; import { TAiMcpServerDALFactory } from "./ai-mcp-server-dal"; @@ -53,7 +52,6 @@ type TAiMcpServerServiceFactoryDep = { kmsService: Pick; keyStore: Pick; permissionService: Pick; - licenseService: Pick; }; export type TAiMcpServerServiceFactory = ReturnType; @@ -152,8 +150,7 @@ export const aiMcpServerServiceFactory = ({ aiMcpServerUserCredentialDAL, kmsService, keyStore, - permissionService, - licenseService + permissionService }: TAiMcpServerServiceFactoryDep) => { /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-redundant-type-constituents */ const fetchMcpTools = async (serverUrl: string, accessToken: string): Promise => { @@ -549,13 +546,6 @@ export const aiMcpServerServiceFactory = ({ actorAuthMethod, actorOrgId }: TCreateAiMcpServerDTO) => { - const orgLicensePlan = await licenseService.getPlan(actorOrgId); - if (!orgLicensePlan.ai) { - throw new BadRequestError({ - message: "AI operation failed due to organization plan restrictions." - }); - } - const { permission } = await permissionService.getProjectPermission({ actor, actorId, diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts index 799a78d335..4612e09ffa 100644 --- a/backend/src/ee/services/license/license-fns.ts +++ b/backend/src/ee/services/license/license-fns.ts @@ -112,9 +112,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({ fips: false, eventSubscriptions: false, machineIdentityAuthTemplates: false, - pkiLegacyTemplates: false, - pam: false, - ai: false + pkiLegacyTemplates: false }); export const setupLicenseRequestWithStore = ( diff --git a/backend/src/ee/services/license/license-types.ts b/backend/src/ee/services/license/license-types.ts index d4392e9467..823d9e6d52 100644 --- a/backend/src/ee/services/license/license-types.ts +++ b/backend/src/ee/services/license/license-types.ts @@ -92,8 +92,6 @@ export type TFeatureSet = { pkiLegacyTemplates: false; fips: false; eventSubscriptions: false; - pam: false; - ai: false; }; export type TOrgPlansTableDTO = { diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.ts index 7ddb83ccb0..bf2fecde58 100644 --- a/backend/src/ee/services/pam-account/pam-account-service.ts +++ b/backend/src/ee/services/pam-account/pam-account-service.ts @@ -52,7 +52,6 @@ import { TUserDALFactory } from "@app/services/user/user-dal"; import { EventType, TAuditLogServiceFactory } from "../audit-log/audit-log-types"; import { TGatewayV2ServiceFactory } from "../gateway-v2/gateway-v2-service"; -import { TLicenseServiceFactory } from "../license/license-service"; import { TPamFolderDALFactory } from "../pam-folder/pam-folder-dal"; import { getFullPamFolderPath } from "../pam-folder/pam-folder-fns"; import { TPamResourceDALFactory } from "../pam-resource/pam-resource-dal"; @@ -77,7 +76,6 @@ type TPamAccountServiceFactoryDep = { projectDAL: TProjectDALFactory; orgDAL: TOrgDALFactory; permissionService: Pick; - licenseService: Pick; kmsService: Pick; gatewayV2Service: Pick< TGatewayV2ServiceFactory, @@ -106,7 +104,6 @@ export const pamAccountServiceFactory = ({ orgDAL, userDAL, permissionService, - licenseService, kmsService, gatewayV2Service, auditLogService, @@ -127,13 +124,6 @@ export const pamAccountServiceFactory = ({ }: TCreateAccountDTO, actor: OrgServiceActor ) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - if (rotationEnabled && (rotationIntervalSeconds === undefined || rotationIntervalSeconds === null)) { throw new BadRequestError({ message: "Rotation interval must be defined when rotation is enabled." @@ -247,13 +237,6 @@ export const pamAccountServiceFactory = ({ }: TUpdateAccountDTO, actor: OrgServiceActor ) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - const account = await pamAccountDAL.findById(accountId); if (!account) throw new NotFoundError({ message: `Account with ID '${accountId}' not found` }); @@ -590,13 +573,6 @@ export const pamAccountServiceFactory = ({ }: TAccessAccountDTO, actor: OrgServiceActor ) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - 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." }); @@ -924,13 +900,6 @@ export const pamAccountServiceFactory = ({ }; const getSessionCredentials = async (sessionId: string, actor: OrgServiceActor) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - // To be hit by gateways only if (actor.type !== ActorType.IDENTITY) { throw new ForbiddenRequestError({ message: "Only gateways can perform this action" }); diff --git a/backend/src/ee/services/pam-folder/pam-folder-service.ts b/backend/src/ee/services/pam-folder/pam-folder-service.ts index d7fb41f129..2f6b81bc48 100644 --- a/backend/src/ee/services/pam-folder/pam-folder-service.ts +++ b/backend/src/ee/services/pam-folder/pam-folder-service.ts @@ -7,31 +7,18 @@ import { DatabaseErrorCode } from "@app/lib/error-codes"; import { BadRequestError, DatabaseError, NotFoundError } from "@app/lib/errors"; import { OrgServiceActor } from "@app/lib/types"; -import { TLicenseServiceFactory } from "../license/license-service"; import { TPamFolderDALFactory } from "./pam-folder-dal"; import { TCreateFolderDTO, TUpdateFolderDTO } from "./pam-folder-types"; type TPamFolderServiceFactoryDep = { pamFolderDAL: TPamFolderDALFactory; permissionService: Pick; - licenseService: Pick; }; export type TPamFolderServiceFactory = ReturnType; -export const pamFolderServiceFactory = ({ - pamFolderDAL, - permissionService, - licenseService -}: TPamFolderServiceFactoryDep) => { +export const pamFolderServiceFactory = ({ pamFolderDAL, permissionService }: TPamFolderServiceFactoryDep) => { const createFolder = async ({ name, description, parentId, projectId }: TCreateFolderDTO, actor: OrgServiceActor) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - const { permission } = await permissionService.getProjectPermission({ actor: actor.type, actorAuthMethod: actor.authMethod, @@ -72,13 +59,6 @@ export const pamFolderServiceFactory = ({ }; const updateFolder = async ({ id, name, description }: TUpdateFolderDTO, actor: OrgServiceActor) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - const folder = await pamFolderDAL.findById(id); if (!folder) throw new NotFoundError({ message: `Folder with ID '${id}' not found` }); diff --git a/backend/src/ee/services/pam-resource/pam-resource-service.ts b/backend/src/ee/services/pam-resource/pam-resource-service.ts index 77b263cce5..e6d0e314fc 100644 --- a/backend/src/ee/services/pam-resource/pam-resource-service.ts +++ b/backend/src/ee/services/pam-resource/pam-resource-service.ts @@ -12,7 +12,6 @@ import { OrgServiceActor } from "@app/lib/types"; import { TKmsServiceFactory } from "@app/services/kms/kms-service"; import { TGatewayV2ServiceFactory } from "../gateway-v2/gateway-v2-service"; -import { TLicenseServiceFactory } from "../license/license-service"; import { decryptAccountCredentials, encryptAccountCredentials } from "../pam-account/pam-account-fns"; import { TPamResourceDALFactory } from "./pam-resource-dal"; import { PamResource } from "./pam-resource-enums"; @@ -31,7 +30,6 @@ import { TSSHResourceMetadata } from "./ssh/ssh-resource-types"; type TPamResourceServiceFactoryDep = { pamResourceDAL: TPamResourceDALFactory; permissionService: Pick; - licenseService: Pick; kmsService: Pick; gatewayV2Service: Pick< TGatewayV2ServiceFactory, @@ -44,7 +42,6 @@ export type TPamResourceServiceFactory = ReturnType { @@ -76,13 +73,6 @@ export const pamResourceServiceFactory = ({ { resourceType, connectionDetails, gatewayId, name, projectId, rotationAccountCredentials }: TCreateResourceDTO, actor: OrgServiceActor ) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - const { permission } = await permissionService.getProjectPermission({ actor: actor.type, actorAuthMethod: actor.authMethod, @@ -137,13 +127,6 @@ export const pamResourceServiceFactory = ({ { connectionDetails, resourceId, name, rotationAccountCredentials }: TUpdateResourceDTO, actor: OrgServiceActor ) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - const resource = await pamResourceDAL.findById(resourceId); if (!resource) throw new NotFoundError({ message: `Resource with ID '${resourceId}' not found` }); diff --git a/backend/src/ee/services/pam-session/pam-session-service.ts b/backend/src/ee/services/pam-session/pam-session-service.ts index bdb82e6502..518794c4ab 100644 --- a/backend/src/ee/services/pam-session/pam-session-service.ts +++ b/backend/src/ee/services/pam-session/pam-session-service.ts @@ -9,7 +9,6 @@ import { TKmsServiceFactory } from "@app/services/kms/kms-service"; import { KmsDataKey } from "@app/services/kms/kms-types"; import { TProjectDALFactory } from "@app/services/project/project-dal"; -import { TLicenseServiceFactory } from "../license/license-service"; import { OrgPermissionGatewayActions, OrgPermissionSubjects } from "../permission/org-permission"; import { ProjectPermissionPamSessionActions, ProjectPermissionSub } from "../permission/project-permission"; import { TPamSessionDALFactory } from "./pam-session-dal"; @@ -21,7 +20,6 @@ type TPamSessionServiceFactoryDep = { pamSessionDAL: TPamSessionDALFactory; projectDAL: TProjectDALFactory; permissionService: Pick; - licenseService: Pick; kmsService: Pick; }; @@ -31,7 +29,6 @@ export const pamSessionServiceFactory = ({ pamSessionDAL, projectDAL, permissionService, - licenseService, kmsService }: TPamSessionServiceFactoryDep) => { // Helper to check and update expired sessions when viewing session details (redundancy for scheduled job) @@ -111,13 +108,6 @@ export const pamSessionServiceFactory = ({ }; const updateLogsById = async ({ sessionId, logs }: TUpdateSessionLogsDTO, actor: OrgServiceActor) => { - const orgLicensePlan = await licenseService.getPlan(actor.orgId); - if (!orgLicensePlan.pam) { - throw new BadRequestError({ - message: "PAM operation failed due to organization plan restrictions." - }); - } - // To be hit by gateways only if (actor.type !== ActorType.IDENTITY) { throw new ForbiddenRequestError({ message: "Only gateways can perform this action" }); diff --git a/backend/src/ee/services/permission/default-roles.ts b/backend/src/ee/services/permission/default-roles.ts index e4dade13bd..781757fcad 100644 --- a/backend/src/ee/services/permission/default-roles.ts +++ b/backend/src/ee/services/permission/default-roles.ts @@ -15,6 +15,7 @@ import { ProjectPermissionGroupActions, ProjectPermissionIdentityActions, ProjectPermissionKmipActions, + ProjectPermissionMcpEndpointActions, ProjectPermissionMemberActions, ProjectPermissionPamAccountActions, ProjectPermissionPamSessionActions, @@ -28,7 +29,6 @@ import { ProjectPermissionSecretScanningDataSourceActions, ProjectPermissionSecretScanningFindingActions, ProjectPermissionSecretSyncActions, - ProjectPermissionMcpEndpointActions, ProjectPermissionSet, ProjectPermissionSshHostActions, ProjectPermissionSub diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts index b86b3ba627..d4a4802a78 100644 --- a/backend/src/server/routes/index.ts +++ b/backend/src/server/routes/index.ts @@ -2450,14 +2450,12 @@ export const registerRoutes = async ( const pamFolderService = pamFolderServiceFactory({ pamFolderDAL, - permissionService, - licenseService + permissionService }); const pamResourceService = pamResourceServiceFactory({ pamResourceDAL, permissionService, - licenseService, kmsService, gatewayV2Service }); @@ -2479,7 +2477,6 @@ export const registerRoutes = async ( pamAccountDAL, gatewayV2Service, kmsService, - licenseService, pamFolderDAL, pamResourceDAL, pamSessionDAL, @@ -2505,7 +2502,6 @@ export const registerRoutes = async ( pamSessionDAL, projectDAL, permissionService, - licenseService, kmsService }); @@ -2515,8 +2511,7 @@ export const registerRoutes = async ( aiMcpServerUserCredentialDAL, kmsService, keyStore, - permissionService, - licenseService + permissionService }); const aiMcpActivityLogService = aiMcpActivityLogServiceFactory({ @@ -2537,8 +2532,7 @@ export const registerRoutes = async ( authTokenService: tokenService, aiMcpActivityLogService, userDAL, - permissionService, - licenseService + permissionService }); const migrationService = externalMigrationServiceFactory({ diff --git a/frontend/src/hooks/api/subscriptions/types.ts b/frontend/src/hooks/api/subscriptions/types.ts index 96f4aeb9d7..3a34576a4f 100644 --- a/frontend/src/hooks/api/subscriptions/types.ts +++ b/frontend/src/hooks/api/subscriptions/types.ts @@ -62,6 +62,4 @@ export type SubscriptionPlan = { cardDeclinedReason?: string; cardDeclinedDays?: number; machineIdentityAuthTemplates: boolean; - pam: boolean; - ai: boolean; }; diff --git a/frontend/src/layouts/AILayout/AILayout.tsx b/frontend/src/layouts/AILayout/AILayout.tsx index 5ec778bd92..58f2972b90 100644 --- a/frontend/src/layouts/AILayout/AILayout.tsx +++ b/frontend/src/layouts/AILayout/AILayout.tsx @@ -1,112 +1,87 @@ -import { useEffect } from "react"; import { Link, Outlet, useLocation } from "@tanstack/react-router"; import { motion } from "framer-motion"; -import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { Tab, TabList, Tabs } from "@app/components/v2"; -import { useOrganization, useProject, useProjectPermission, useSubscription } from "@app/context"; -import { usePopUp } from "@app/hooks"; +import { useOrganization, useProject, useProjectPermission } from "@app/context"; import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner"; export const AILayout = () => { const { currentOrg } = useOrganization(); const { currentProject } = useProject(); - const { subscription } = useSubscription(); const { assumedPrivilegeDetails } = useProjectPermission(); const location = useLocation(); - const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"]); - - useEffect(() => { - if (subscription && !subscription.ai) { - handlePopUpOpen("upgradePlan", { - description: - "Your current plan does not provide access to Infisical AI. To unlock this feature, please upgrade to Infisical Enterprise plan.", - isEnterpriseFeature: true - }); - } - }, [subscription]); return ( - <> -
-
- - - -
- {assumedPrivilegeDetails && } -
- -
+
+
+ + +
- { - handlePopUpToggle("upgradePlan", isOpen); - }} - text={popUp.upgradePlan.data?.description} - isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature} - /> - + {assumedPrivilegeDetails && } +
+ +
+
); }; diff --git a/frontend/src/layouts/PamLayout/PamLayout.tsx b/frontend/src/layouts/PamLayout/PamLayout.tsx index 743c02f7ba..ba74e5312e 100644 --- a/frontend/src/layouts/PamLayout/PamLayout.tsx +++ b/frontend/src/layouts/PamLayout/PamLayout.tsx @@ -1,147 +1,122 @@ -import { useEffect } from "react"; import { Link, Outlet, useLocation } from "@tanstack/react-router"; import { motion } from "framer-motion"; -import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { Tab, TabList, Tabs } from "@app/components/v2"; -import { useOrganization, useProject, useProjectPermission, useSubscription } from "@app/context"; -import { usePopUp } from "@app/hooks"; +import { useOrganization, useProject, useProjectPermission } from "@app/context"; import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner"; export const PamLayout = () => { const { currentProject } = useProject(); const { currentOrg } = useOrganization(); - const { subscription } = useSubscription(); const { assumedPrivilegeDetails } = useProjectPermission(); const location = useLocation(); - const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"]); - - useEffect(() => { - if (subscription && !subscription.pam) { - handlePopUpOpen("upgradePlan", { - description: - "Your current plan does not provide access to Infisical PAM. To unlock this feature, please upgrade to Infisical Enterprise plan.", - isEnterpriseFeature: true - }); - } - }, [subscription]); return ( - <> -
-
- - - -
- {assumedPrivilegeDetails && } -
- -
+
+
+ + +
- { - handlePopUpToggle("upgradePlan", isOpen); - }} - text={popUp.upgradePlan.data?.description} - isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature} - /> - + {assumedPrivilegeDetails && } +
+ +
+
); }; diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsx b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsx index 6baa357d17..abcfeeb7a6 100644 --- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsx +++ b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsx @@ -2,16 +2,10 @@ import { useState } from "react"; import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { createNotification } from "@app/components/notifications"; import { ProjectPermissionCan } from "@app/components/permissions"; import { Button, DeleteActionModal } from "@app/components/v2"; -import { - ProjectPermissionMcpEndpointActions, - ProjectPermissionSub, - useSubscription -} from "@app/context"; -import { usePopUp } from "@app/hooks"; +import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context"; import { TAiMcpEndpoint, useDeleteAiMcpEndpoint } from "@app/hooks/api"; import { AddMCPEndpointModal } from "./AddMCPEndpointModal"; @@ -24,18 +18,9 @@ export const MCPEndpointsTab = () => { const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [selectedEndpoint, setSelectedEndpoint] = useState(null); - const { subscription } = useSubscription(); - const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"]); const deleteEndpoint = useDeleteAiMcpEndpoint(); const handleCreateEndpoint = () => { - if (subscription && !subscription.ai) { - handlePopUpOpen("upgradePlan", { - text: "Your current plan does not include access to Infisical AI. To unlock this feature, please upgrade to Infisical Enterprise plan.", - isEnterpriseFeature: true - }); - return; - } setIsCreateModalOpen(true); }; @@ -130,13 +115,6 @@ export const MCPEndpointsTab = () => { onDeleteApproved={handleDeleteConfirm} /> )} - - handlePopUpToggle("upgradePlan", isOpen)} - text={popUp.upgradePlan.data?.text} - isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature} - />
); }; diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsx index 43c82875c0..3692b17a61 100644 --- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsx +++ b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsx @@ -2,12 +2,10 @@ import { useState } from "react"; import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { createNotification } from "@app/components/notifications"; import { ProjectPermissionCan } from "@app/components/permissions"; import { Button, DeleteActionModal } from "@app/components/v2"; -import { ProjectPermissionActions, ProjectPermissionSub, useSubscription } from "@app/context"; -import { usePopUp } from "@app/hooks"; +import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context"; import { TAiMcpServer, useDeleteAiMcpServer } from "@app/hooks/api"; import { AddMCPServerModal } from "./AddMCPServerModal"; @@ -20,18 +18,9 @@ export const MCPServersTab = () => { const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [selectedServer, setSelectedServer] = useState(null); - const { subscription } = useSubscription(); - const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"]); const deleteServer = useDeleteAiMcpServer(); const handleAddServer = () => { - if (subscription && !subscription.ai) { - handlePopUpOpen("upgradePlan", { - text: "Your current plan does not include access to Infisical AI. To unlock this feature, please upgrade to Infisical Enterprise plan.", - isEnterpriseFeature: true - }); - return; - } setIsAddModalOpen(true); }; @@ -123,13 +112,6 @@ export const MCPServersTab = () => { onDeleteApproved={handleDeleteConfirm} /> )} - - handlePopUpToggle("upgradePlan", isOpen)} - text={popUp.upgradePlan.data?.text} - isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature} - />
); }; diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx index f50df38f9a..6cd87ea721 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamRequestAccountAccessModal.tsx @@ -15,10 +15,10 @@ import { ModalContent, TextArea } from "@app/components/v2"; +import { UnstableAlert, UnstableAlertDescription, UnstableAlertTitle } from "@app/components/v3"; import { useProject } from "@app/context"; import { ApprovalPolicyType } from "@app/hooks/api/approvalPolicies"; import { useCreateApprovalRequest } from "@app/hooks/api/approvalRequests/mutations"; -import { UnstableAlert, UnstableAlertDescription, UnstableAlertTitle } from "@app/components/v3"; type Props = { accountPath?: string; diff --git a/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx b/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx index ffba498be9..7331ec6271 100644 --- a/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx +++ b/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx @@ -4,7 +4,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { EmptyState, Input, Pagination, Spinner, Tooltip } from "@app/components/v2"; -import { useSubscription } from "@app/context"; import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks"; import { PAM_RESOURCE_TYPE_MAP, @@ -18,7 +17,6 @@ type Props = { export const ResourceTypeSelect = ({ onSelect }: Props) => { const { isPending, data: resourceOptions } = useListPamResourceOptions(); - const { subscription } = useSubscription(); const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const); const appendedResourceOptions = useMemo(() => { @@ -66,14 +64,6 @@ export const ResourceTypeSelect = ({ onSelect }: Props) => { }); const handleResourceSelect = (resource: PamResourceType) => { - if (!subscription.pam) { - handlePopUpOpen("upgradePlan", { - text: "Your current plan does not include access to Infisical PAM. To unlock this feature, please upgrade to Infisical Enterprise plan.", - isEnterpriseFeature: true - }); - return; - } - // We temporarily show a special license modal for these because we will have to write some code to complete the integration if ( resource === PamResourceType.RDP ||