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: remove SSH and Agent Sentinel (AI MCP) products
Scott Wilson9cc61350c2ff
diff --git a/CLAUDE.md b/CLAUDE.mdindex a99e616430..3ff93db2d5 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -74,7 +74,7 @@ When writing or editing documentation in `docs/`, follow the [Documentation Styl### Auth & Permissions-Auth modes (JWT, IDENTITY_ACCESS_TOKEN, SCIM_TOKEN, MCP_JWT) are extracted in `backend/src/server/plugins/auth/`. Authorization uses CASL (`@casl/ability`) with project-level and org-level permission checks — see `backend/CLAUDE.md` for backend details and `frontend/CLAUDE.md` for frontend permission hooks/HOCs. Note: `API_KEY` and `SERVICE_TOKEN` auth modes are deprecated — do not use them in new code.+Auth modes (JWT, IDENTITY_ACCESS_TOKEN, SCIM_TOKEN) are extracted in `backend/src/server/plugins/auth/`. Authorization uses CASL (`@casl/ability`) with project-level and org-level permission checks — see `backend/CLAUDE.md` for backend details and `frontend/CLAUDE.md` for frontend permission hooks/HOCs. Note: `API_KEY` and `SERVICE_TOKEN` auth modes are deprecated — do not use them in new code.### Service Factory + Manual DI (Backend)diff --git a/backend-go/internal/ee/services/license/types.go b/backend-go/internal/ee/services/license/types.goindex 5d6ea38399..3143c79692 100644--- a/backend-go/internal/ee/services/license/types.go+++ b/backend-go/internal/ee/services/license/types.go@@ -96,7 +96,6 @@ type FeatureSet struct {ProjectTemplates bool `json:"projectTemplates"`KMIP bool `json:"kmip"`Gateway bool `json:"gateway"`- SSHHostGroups bool `json:"sshHostGroups"`SecretScanning bool `json:"secretScanning"`EnterpriseSecretSyncs bool `json:"enterpriseSecretSyncs"`EnterpriseCertificateSyncs bool `json:"enterpriseCertificateSyncs"`diff --git a/backend-go/internal/services/auth/apiauth/claims.go b/backend-go/internal/services/auth/apiauth/claims.goindex 57d22e6861..a4f4c31e6a 100644--- a/backend-go/internal/services/auth/apiauth/claims.go+++ b/backend-go/internal/services/auth/apiauth/claims.go@@ -24,7 +24,6 @@ type UnifiedJWTClaims struct {SubOrganizationID uuid.UUID `json:"subOrganizationId,omitempty"`IsMfaVerified bool `json:"isMfaVerified,omitempty"`MfaMethod string `json:"mfaMethod,omitempty"`- MCP bool `json:"mcp,omitempty"`// Identity JWT fieldsIdentityID uuid.UUID `json:"identityId,omitempty"`@@ -55,7 +54,6 @@ func (c *UnifiedJWTClaims) ToUserClaims() *UserJWTClaims {SubOrganizationID: c.SubOrganizationID,IsMfaVerified: c.IsMfaVerified,MfaMethod: c.MfaMethod,- MCP: c.MCP,}}@@ -110,7 +108,6 @@ type UserJWTClaims struct {SubOrganizationID uuid.UUID `json:"subOrganizationId,omitempty"`IsMfaVerified bool `json:"isMfaVerified,omitempty"`MfaMethod string `json:"mfaMethod,omitempty"`- MCP bool `json:"mcp,omitempty"`}// IdentityJWTClaims represents the JWT payload for machine identity access tokens.diff --git a/backend-go/internal/services/permission/permission.go b/backend-go/internal/services/permission/permission.goindex 71d122aa4d..feae3c26bd 100644--- a/backend-go/internal/services/permission/permission.go+++ b/backend-go/internal/services/permission/permission.go@@ -28,7 +28,6 @@ const (ActionProjectTypeSecretManager ActionProjectType = "secret-manager"ActionProjectTypeCertificateManager ActionProjectType = "certificate-manager"ActionProjectTypeKMS ActionProjectType = "kms"- ActionProjectTypeSSH ActionProjectType = "ssh"ActionProjectTypeSecretScanning ActionProjectType = "secret-scanning"ActionProjectTypeAny ActionProjectType = "any")diff --git a/backend-go/internal/services/permission/permission_test.go b/backend-go/internal/services/permission/permission_test.goindex 142db5d5f9..24cdff67a4 100644--- a/backend-go/internal/services/permission/permission_test.go+++ b/backend-go/internal/services/permission/permission_test.go@@ -218,20 +218,6 @@ func TestNoAccessRole_CannotDoAnything(t *testing.T) {// Specialized roles// =====================================================-func TestSshHostBootstrapperRole_OnlySshHostActions(t *testing.T) {- t.Parallel()- ability := loadAbilityFromRules(t, project.SshHostBootstrapPermissions, nil)-- sub := project.SshHostSubject{Hostname: "host1.example.com"}- assert.True(t, gocasl.Can(ability, project.SshHostActionCreate, sub))- assert.True(t, gocasl.Can(ability, project.SshHostActionIssueHostCert, sub))-- // Must not have any other access- assert.True(t, gocasl.Cannot(ability, project.SshHostActionRead, sub))- assert.True(t, gocasl.Cannot(ability, project.SshHostActionDelete, sub))- assert.True(t, gocasl.Cannot(ability, project.SecretActionDescribeAndReadValue, project.SecretSubject{}))-}-func TestCryptographicOperatorRole_OnlyCmekCryptoOps(t *testing.T) {t.Parallel()ability := loadAbilityFromRules(t, project.CryptographicOperatorPermissions, nil)diff --git a/backend-go/internal/services/permission/project/actions.go b/backend-go/internal/services/permission/project/actions.goindex 31dd9c4d81..8d1130d4b9 100644--- a/backend-go/internal/services/permission/project/actions.go+++ b/backend-go/internal/services/permission/project/actions.go@@ -10,7 +10,6 @@ const (RoleViewer = "viewer"RoleNoAccess = "no-access"RoleCustom = "custom"- RoleSshHostBootstrapper = "ssh-host-bootstrapper"RoleKmsCryptographicOperator = "cryptographic-operator")@@ -214,49 +213,6 @@ var (WebhooksActionDelete = gocasl.DefineAction[WebhooksSubject]("delete"))-// SSH actions--// SshCertificateAuthorities actions-var (- SshCaActionRead = gocasl.DefineAction[SshCertificateAuthoritiesSubject]("read")- SshCaActionCreate = gocasl.DefineAction[SshCertificateAuthoritiesSubject]("create")- SshCaActionEdit = gocasl.DefineAction[SshCertificateAuthoritiesSubject]("edit")- SshCaActionDelete = gocasl.DefineAction[SshCertificateAuthoritiesSubject]("delete")-)--// SshCertificates actions-var (- SshCertActionRead = gocasl.DefineAction[SshCertificatesSubject]("read")- SshCertActionCreate = gocasl.DefineAction[SshCertificatesSubject]("create")- SshCertActionEdit = gocasl.DefineAction[SshCertificatesSubject]("edit")- SshCertActionDelete = gocasl.DefineAction[SshCertificatesSubject]("delete")-)--// SshCertificateTemplates actions-var (- SshCertTemplateActionRead = gocasl.DefineAction[SshCertificateTemplatesSubject]("read")- SshCertTemplateActionCreate = gocasl.DefineAction[SshCertificateTemplatesSubject]("create")- SshCertTemplateActionEdit = gocasl.DefineAction[SshCertificateTemplatesSubject]("edit")- SshCertTemplateActionDelete = gocasl.DefineAction[SshCertificateTemplatesSubject]("delete")-)--// SshHost actions (ProjectPermissionSshHostActions)-var (- SshHostActionRead = gocasl.DefineAction[SshHostSubject]("read")- SshHostActionCreate = gocasl.DefineAction[SshHostSubject]("create")- SshHostActionEdit = gocasl.DefineAction[SshHostSubject]("edit")- SshHostActionDelete = gocasl.DefineAction[SshHostSubject]("delete")- SshHostActionIssueHostCert = gocasl.DefineAction[SshHostSubject]("issue-host-cert")-)--// SshHostGroups actions-var (- SshHostGroupsActionRead = gocasl.DefineAction[SshHostGroupsSubject]("read")- SshHostGroupsActionCreate = gocasl.DefineAction[SshHostGroupsSubject]("create")- SshHostGroupsActionEdit = gocasl.DefineAction[SshHostGroupsSubject]("edit")- SshHostGroupsActionDelete = gocasl.DefineAction[SshHostGroupsSubject]("delete")-)-// CertificateAuthority actions (ProjectPermissionCertificateAuthorityActions)var (CaActionRead = gocasl.DefineAction[CertificateAuthoritySubject]("read")@@ -417,31 +373,6 @@ var (AppConnectionActionRotateCredentials = gocasl.DefineAction[AppConnectionSubject]("rotate-credentials"))-// McpEndpoint actions (ProjectPermissionMcpEndpointActions)-var (- McpEndpointActionRead = gocasl.DefineAction[McpEndpointSubject]("read")- McpEndpointActionCreate = gocasl.DefineAction[McpEndpointSubject]("create")- McpEndpointActionEdit = gocasl.DefineAction[McpEndpointSubject]("edit")- McpEndpointActionDelete = gocasl.DefineAction[McpEndpointSubject]("delete")- McpEndpointActionConnect = gocasl.DefineAction[McpEndpointSubject]("connect")-)--// McpServers actions-var (- McpServersActionRead = gocasl.DefineAction[McpServersSubject]("read")- McpServersActionCreate = gocasl.DefineAction[McpServersSubject]("create")- McpServersActionEdit = gocasl.DefineAction[McpServersSubject]("edit")- McpServersActionDelete = gocasl.DefineAction[McpServersSubject]("delete")-)--// McpActivityLogs actions-var (- McpActivityLogsActionRead = gocasl.DefineAction[McpActivityLogsSubject]("read")- McpActivityLogsActionCreate = gocasl.DefineAction[McpActivityLogsSubject]("create")- McpActivityLogsActionEdit = gocasl.DefineAction[McpActivityLogsSubject]("edit")- McpActivityLogsActionDelete = gocasl.DefineAction[McpActivityLogsSubject]("delete")-)-// PamFolders actionsvar (PamFoldersActionRead = gocasl.DefineAction[PamFoldersSubject]("read")diff --git a/backend-go/internal/services/permission/project/default_roles.go b/backend-go/internal/services/permission/project/default_roles.goindex d2fe5fff2c..56cd636843 100644--- a/backend-go/internal/services/permission/project/default_roles.go+++ b/backend-go/internal/services/permission/project/default_roles.go@@ -44,30 +44,12 @@ var AdminPermissions = []gocasl.JSONRule{// PkiCollections{Action: ss(PkiCollectionsActionRead.Name(), PkiCollectionsActionCreate.Name(), PkiCollectionsActionEdit.Name(), PkiCollectionsActionDelete.Name()), Subject: ss(SubPkiCollections)},- // SshCertificateAuthorities- {Action: ss(SshCaActionRead.Name(), SshCaActionCreate.Name(), SshCaActionEdit.Name(), SshCaActionDelete.Name()), Subject: ss(SubSshCertificateAuthorities)},-- // SshCertificates- {Action: ss(SshCertActionRead.Name(), SshCertActionCreate.Name(), SshCertActionEdit.Name(), SshCertActionDelete.Name()), Subject: ss(SubSshCertificates)},-- // SshCertificateTemplates- {Action: ss(SshCertTemplateActionRead.Name(), SshCertTemplateActionCreate.Name(), SshCertTemplateActionEdit.Name(), SshCertTemplateActionDelete.Name()), Subject: ss(SubSshCertificateTemplates)},-- // SshHostGroups- {Action: ss(SshHostGroupsActionRead.Name(), SshHostGroupsActionCreate.Name(), SshHostGroupsActionEdit.Name(), SshHostGroupsActionDelete.Name()), Subject: ss(SubSshHostGroups)},-// PamFolders{Action: ss(PamFoldersActionRead.Name(), PamFoldersActionCreate.Name(), PamFoldersActionEdit.Name(), PamFoldersActionDelete.Name()), Subject: ss(SubPamFolders)},// PamResources{Action: ss(PamResourceActionRead.Name(), PamResourceActionCreate.Name(), PamResourceActionEdit.Name(), PamResourceActionDelete.Name()), Subject: ss(SubPamResources)},- // McpServers- {Action: ss(McpServersActionRead.Name(), McpServersActionCreate.Name(), McpServersActionEdit.Name(), McpServersActionDelete.Name()), Subject: ss(SubMcpServers)},-- // McpActivityLogs- {Action: ss(McpActivityLogsActionRead.Name()), Subject: ss(SubMcpActivityLogs)},-// AuditLogs{Action: ss(AuditLogsActionRead.Name()), Subject: ss(SubAuditLogs)},@@ -92,9 +74,6 @@ var AdminPermissions = []gocasl.JSONRule{// Commits{Action: ss(CommitsActionRead.Name(), CommitsActionPerformRollback.Name()), Subject: ss(SubCommits)},- // SshHosts- {Action: ss(SshHostActionRead.Name(), SshHostActionCreate.Name(), SshHostActionEdit.Name(), SshHostActionDelete.Name(), SshHostActionIssueHostCert.Name()), Subject: ss(SubSshHosts)},-// PkiSubscribers{Action: ss(PkiSubscriberActionRead.Name(), PkiSubscriberActionCreate.Name(), PkiSubscriberActionEdit.Name(), PkiSubscriberActionDelete.Name(), PkiSubscriberActionIssueCert.Name(), PkiSubscriberActionListCerts.Name()), Subject: ss(SubPkiSubscribers)},@@ -167,9 +146,6 @@ var AdminPermissions = []gocasl.JSONRule{// PamDiscovery{Action: ss(PamDiscoveryActionRead.Name(), PamDiscoveryActionCreate.Name(), PamDiscoveryActionEdit.Name(), PamDiscoveryActionDelete.Name(), PamDiscoveryActionRunScan.Name()), Subject: ss(SubPamDiscovery)},- // McpEndpoints- {Action: ss(McpEndpointActionRead.Name(), McpEndpointActionCreate.Name(), McpEndpointActionEdit.Name(), McpEndpointActionDelete.Name(), McpEndpointActionConnect.Name()), Subject: ss(SubMcpEndpoints)},-// ApprovalRequests{Action: ss(ApprovalRequestActionRead.Name(), ApprovalRequestActionCreate.Name()), Subject: ss(SubApprovalRequests)},@@ -264,16 +240,6 @@ var MemberPermissions = []gocasl.JSONRule{// PkiCollections{Action: ss(PkiCollectionsActionRead.Name()), Subject: ss(SubPkiCollections)},- // SshCertificates- {Action: ss(SshCertActionRead.Name()), Subject: ss(SubSshCertificates)},- {Action: ss(SshCertActionCreate.Name()), Subject: ss(SubSshCertificates)},-- // SshCertificateTemplates- {Action: ss(SshCertTemplateActionRead.Name()), Subject: ss(SubSshCertificateTemplates)},-- // SshHosts- {Action: ss(SshHostActionRead.Name()), Subject: ss(SubSshHosts)},-// PkiSubscribers{Action: ss(PkiSubscriberActionRead.Name()), Subject: ss(SubPkiSubscribers)},@@ -319,15 +285,6 @@ var MemberPermissions = []gocasl.JSONRule{// PamDiscovery{Action: ss(PamDiscoveryActionRead.Name()), Subject: ss(SubPamDiscovery)},- // McpEndpoints- {Action: ss(McpEndpointActionRead.Name()), Subject: ss(SubMcpEndpoints)},-- // McpServers- {Action: ss(McpServersActionRead.Name()), Subject: ss(SubMcpServers)},-- // McpActivityLogs- {Action: ss(McpActivityLogsActionRead.Name()), Subject: ss(SubMcpActivityLogs)},-// ApprovalRequests{Action: ss(ApprovalRequestActionCreate.Name()), Subject: ss(SubApprovalRequests)},}@@ -407,12 +364,6 @@ var ViewerPermissions = []gocasl.JSONRule{// Cmek{Action: ss(CmekActionRead.Name()), Subject: ss(SubCmek)},- // SshCertificates- {Action: ss(SshCertActionRead.Name()), Subject: ss(SubSshCertificates)},-- // SshCertificateTemplates- {Action: ss(SshCertTemplateActionRead.Name()), Subject: ss(SubSshCertificateTemplates)},-// SecretSyncs{Action: ss(SecretSyncActionRead.Name()), Subject: ss(SubSecretSyncs)},@@ -451,26 +402,11 @@ var ViewerPermissions = []gocasl.JSONRule{// PamDiscovery{Action: ss(PamDiscoveryActionRead.Name()), Subject: ss(SubPamDiscovery)},-- // McpEndpoints- {Action: ss(McpEndpointActionRead.Name()), Subject: ss(SubMcpEndpoints)},-- // McpServers- {Action: ss(McpServersActionRead.Name()), Subject: ss(SubMcpServers)},-- // McpActivityLogs- {Action: ss(McpActivityLogsActionRead.Name()), Subject: ss(SubMcpActivityLogs)},}// NoAccessPermissions defines the (empty) permission set for the no-access role.var NoAccessPermissions = []gocasl.JSONRule{}-// SshHostBootstrapPermissions defines the permission set for the ssh-host-bootstrapper role.-// Exact port of buildSshHostBootstrapPermissionRules() from default-roles.ts.-var SshHostBootstrapPermissions = []gocasl.JSONRule{- {Action: ss(SshHostActionCreate.Name(), SshHostActionIssueHostCert.Name()), Subject: ss(SubSshHosts)},-}-// CryptographicOperatorPermissions defines the permission set for the cryptographic-operator role.// Exact port of buildCryptographicOperatorPermissionRules() from default-roles.ts.var CryptographicOperatorPermissions = []gocasl.JSONRule{diff --git a/backend-go/internal/services/permission/project/subjects.go b/backend-go/internal/services/permission/project/subjects.goindex dd548716c2..d25806d602 100644--- a/backend-go/internal/services/permission/project/subjects.go+++ b/backend-go/internal/services/permission/project/subjects.go@@ -385,59 +385,6 @@ type WebhooksSubject struct{}func (s WebhooksSubject) SubjectType() string { return SubWebhooks }func (s WebhooksSubject) GetField(string) any { return nil }-// ===========================-// SSH-// ===========================--const SubSshCertificateAuthorities = "ssh-certificate-authorities"--// SshCertificateAuthoritiesSubject — "ssh-certificate-authorities"-type SshCertificateAuthoritiesSubject struct{}--func (s SshCertificateAuthoritiesSubject) SubjectType() string { return SubSshCertificateAuthorities }-func (s SshCertificateAuthoritiesSubject) GetField(string) any { return nil }--const SubSshCertificates = "ssh-certificates"--// SshCertificatesSubject — "ssh-certificates"-type SshCertificatesSubject struct{}--func (s SshCertificatesSubject) SubjectType() string { return SubSshCertificates }-func (s SshCertificatesSubject) GetField(string) any { return nil }--const SubSshCertificateTemplates = "ssh-certificate-templates"--// SshCertificateTemplatesSubject — "ssh-certificate-templates"-type SshCertificateTemplatesSubject struct{}--func (s SshCertificateTemplatesSubject) SubjectType() string { return SubSshCertificateTemplates }-func (s SshCertificateTemplatesSubject) GetField(string) any { return nil }--const SubSshHosts = "ssh-hosts"--// SshHostSubject — "ssh-hosts"-type SshHostSubject struct {- Hostname string-}--func (s SshHostSubject) SubjectType() string { return SubSshHosts }-func (s SshHostSubject) GetField(f string) any {- switch f {- case "hostname":- return s.Hostname- default:- return nil- }-}--const SubSshHostGroups = "ssh-host-groups"--// SshHostGroupsSubject — "ssh-host-groups"-type SshHostGroupsSubject struct{}--func (s SshHostGroupsSubject) SubjectType() string { return SubSshHostGroups }-func (s SshHostGroupsSubject) GetField(string) any { return nil }-// ===========================// PKI / Certificates// ===========================@@ -685,43 +632,6 @@ func (s AppConnectionSubject) GetField(f string) any {}}-// ===========================-// MCP-// ===========================--const SubMcpEndpoints = "mcp-endpoints"--// McpEndpointSubject — "mcp-endpoints"-type McpEndpointSubject struct {- Name string-}--func (s McpEndpointSubject) SubjectType() string { return SubMcpEndpoints }-func (s McpEndpointSubject) GetField(f string) any {- switch f {- case "name":- return s.Name- default:- return nil- }-}--const SubMcpServers = "mcp-servers"--// McpServersSubject — "mcp-servers"-type McpServersSubject struct{}--func (s McpServersSubject) SubjectType() string { return SubMcpServers }-func (s McpServersSubject) GetField(string) any { return nil }--const SubMcpActivityLogs = "mcp-activity-logs"--// McpActivityLogsSubject — "mcp-activity-logs"-type McpActivityLogsSubject struct{}--func (s McpActivityLogsSubject) SubjectType() string { return SubMcpActivityLogs }-func (s McpActivityLogsSubject) GetField(string) any { return nil }-// ===========================// PAM// ===========================diff --git a/backend-go/internal/services/permission/rules.go b/backend-go/internal/services/permission/rules.goindex a58674aa35..daf27a769a 100644--- a/backend-go/internal/services/permission/rules.go+++ b/backend-go/internal/services/permission/rules.go@@ -35,8 +35,6 @@ func buildProjectPermissionRules(roles []roleWithPermissions) ([]gocasl.JSONRuleallRules = append(allRules, project.ViewerPermissions...)case project.RoleNoAccess:allRules = append(allRules, project.NoAccessPermissions...)- case project.RoleSshHostBootstrapper:- allRules = append(allRules, project.SshHostBootstrapPermissions...)case project.RoleKmsCryptographicOperator:allRules = append(allRules, project.CryptographicOperatorPermissions...)case project.RoleCustom:diff --git a/backend-go/internal/services/permission/rules_test.go b/backend-go/internal/services/permission/rules_test.goindex d7badd8dad..ee9f705b70 100644--- a/backend-go/internal/services/permission/rules_test.go+++ b/backend-go/internal/services/permission/rules_test.go@@ -25,7 +25,6 @@ func TestBuildProjectPermissionRules_BuiltinRoles(t *testing.T) {{"member", project.RoleMember, len(project.MemberPermissions)},{"viewer", project.RoleViewer, len(project.ViewerPermissions)},{"no-access", project.RoleNoAccess, 0},- {"ssh-host-bootstrapper", project.RoleSshHostBootstrapper, len(project.SshHostBootstrapPermissions)},{"cryptographic-operator", project.RoleKmsCryptographicOperator, len(project.CryptographicOperatorPermissions)},}@@ -133,11 +132,11 @@ func TestBuildProjectPermissionRules_MultipleRolesMerge(t *testing.T) {roles := []roleWithPermissions{{Role: project.RoleViewer},- {Role: project.RoleSshHostBootstrapper},+ {Role: project.RoleKmsCryptographicOperator},}rules, errs := buildProjectPermissionRules(roles)- expectedLen := len(project.ViewerPermissions) + len(project.SshHostBootstrapPermissions)+ expectedLen := len(project.ViewerPermissions) + len(project.CryptographicOperatorPermissions)assert.Len(t, rules, expectedLen, "rules from multiple roles must be merged")assert.Empty(t, errs)}diff --git a/backend/CLAUDE.md b/backend/CLAUDE.mdindex 7a0a6d5c68..837a0006a6 100644--- a/backend/CLAUDE.md+++ b/backend/CLAUDE.md@@ -173,7 +173,6 @@ Auth extraction happens in `src/server/plugins/auth/`:- **JWT** — user browser sessions (decoded from `Authorization: Bearer` header)- **IDENTITY_ACCESS_TOKEN** — machine-to-machine identity tokens- **SCIM_TOKEN** — SCIM provisioning tokens-- **MCP_JWT** — MCP-specific JWTs (has `.mcp` field in payload)**Deprecated auth modes (do not use in new code):**- **API_KEY** — user API keys (from `x-api-key` header). Deprecated — use identity access tokens instead.diff --git a/backend/package-lock.json b/backend/package-lock.jsonindex ee55fb7a1b..613e99eed0 100644--- a/backend/package-lock.json+++ b/backend/package-lock.json@@ -47,7 +47,6 @@"@infisical/ldapjs": "3.0.11","@infisical/pg-view-generator": "^1.1.0","@infisical/quic": "^1.0.8",- "@modelcontextprotocol/sdk": "^1.26.0","@node-saml/passport-saml": "^5.1.0","@octokit/auth-app": "^7.1.1","@octokit/core": "^5.2.1",@@ -6016,18 +6015,6 @@"integrity": "sha512-lhqDEAvWixy3bZ+UOYbPwUbBkwBq5C1LAJ/xPC8Oi+lL54oyakv/npbA0aU2hgCsx/1NUd4IBvV03+aUBWxerw==","license": "MIT"},- "node_modules/@hono/node-server": {- "version": "1.19.14",- "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz",- "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==",- "license": "MIT",- "engines": {- "node": ">=18.14.1"- },- "peerDependencies": {- "hono": "^4"- }- },"node_modules/@humanwhocodes/config-array": {"version": "0.11.13","resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz",@@ -6731,9 +6718,6 @@"win32"]},- "node_modules/@infisical/quic/node_modules/@infisical/quic-linux-arm": {- "optional": true- },"node_modules/@inquirer/external-editor": {"version": "1.0.3","resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz",@@ -7106,382 +7090,6 @@"@matrixai/errors": "^1.1.7"}},- "node_modules/@modelcontextprotocol/sdk": {- "version": "1.29.0",- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz",- "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==",- "license": "MIT",- "dependencies": {- "@hono/node-server": "^1.19.9",- "ajv": "^8.17.1",- "ajv-formats": "^3.0.1",- "content-type": "^1.0.5",- "cors": "^2.8.5",- "cross-spawn": "^7.0.5",- "eventsource": "^3.0.2",- "eventsource-parser": "^3.0.0",- "express": "^5.2.1",- "express-rate-limit": "^8.2.1",- "hono": "^4.11.4",- "jose": "^6.1.3",- "json-schema-typed": "^8.0.2",- "pkce-challenge": "^5.0.0",- "raw-body": "^3.0.0",- "zod": "^3.25 || ^4.0",- "zod-to-json-schema": "^3.25.1"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "@cfworker/json-schema": "^4.1.1",- "zod": "^3.25 || ^4.0"- },- "peerDependenciesMeta": {- "@cfworker/json-schema": {- "optional": true- },- "zod": {- "optional": false- }- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/accepts": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",- "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",- "license": "MIT",- "dependencies": {- "mime-types": "^3.0.0",- "negotiator": "^1.0.0"- },- "engines": {- "node": ">= 0.6"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser": {- "version": "2.2.1",- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz",- "integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==",- "license": "MIT",- "dependencies": {- "bytes": "^3.1.2",- "content-type": "^1.0.5",- "debug": "^4.4.3",- "http-errors": "^2.0.0",- "iconv-lite": "^0.7.0",- "on-finished": "^2.4.1",- "qs": "^6.14.0",- "raw-body": "^3.0.1",- "type-is": "^2.0.1"- },- "engines": {- "node": ">=18"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz",- "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==",- "license": "MIT",- "engines": {- "node": ">=18"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/debug": {- "version": "4.4.3",- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",- "license": "MIT",- "dependencies": {- "ms": "^2.1.3"- },- "engines": {- "node": ">=6.0"- },- "peerDependenciesMeta": {- "supports-color": {- "optional": true- }- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/eventsource": {- "version": "3.0.7",- "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",- "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",- "license": "MIT",- "dependencies": {- "eventsource-parser": "^3.0.1"- },- "engines": {- "node": ">=18.0.0"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/express": {- "version": "5.2.1",- "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",- "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",- "license": "MIT",- "dependencies": {- "accepts": "^2.0.0",- "body-parser": "^2.2.1",- "content-disposition": "^1.0.0",- "content-type": "^1.0.5",- "cookie": "^0.7.1",- "cookie-signature": "^1.2.1",- "debug": "^4.4.0",- "depd": "^2.0.0",- "encodeurl": "^2.0.0",- "escape-html": "^1.0.3",- "etag": "^1.8.1",- "finalhandler": "^2.1.0",- "fresh": "^2.0.0",- "http-errors": "^2.0.0",- "merge-descriptors": "^2.0.0",- "mime-types": "^3.0.0",- "on-finished": "^2.4.1",- "once": "^1.4.0",- "parseurl": "^1.3.3",- "proxy-addr": "^2.0.7",- "qs": "^6.14.0",- "range-parser": "^1.2.1",- "router": "^2.2.0",- "send": "^1.1.0",- "serve-static": "^2.2.0",- "statuses": "^2.0.1",- "type-is": "^2.0.1",- "vary": "^1.1.2"- },- "engines": {- "node": ">= 18"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": {- "version": "2.1.1",- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",- "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",- "license": "MIT",- "dependencies": {- "debug": "^4.4.0",- "encodeurl": "^2.0.0",- "escape-html": "^1.0.3",- "on-finished": "^2.4.1",- "parseurl": "^1.3.3",- "statuses": "^2.0.1"- },- "engines": {- "node": ">= 18.0.0"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",- "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",- "license": "MIT",- "engines": {- "node": ">= 0.8"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/http-errors": {- "version": "2.0.1",- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",- "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",- "license": "MIT",- "dependencies": {- "depd": "~2.0.0",- "inherits": "~2.0.4",- "setprototypeof": "~1.2.0",- "statuses": "~2.0.2",- "toidentifier": "~1.0.1"- },- "engines": {- "node": ">= 0.8"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite": {- "version": "0.7.0",- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz",- "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",- "license": "MIT",- "dependencies": {- "safer-buffer": ">= 2.1.2 < 3.0.0"- },- "engines": {- "node": ">=0.10.0"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/media-typer": {- "version": "1.1.0",- "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",- "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",- "license": "MIT",- "engines": {- "node": ">= 0.8"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/merge-descriptors": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",- "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",- "license": "MIT",- "engines": {- "node": ">=18"- },- "funding": {- "url": "https://github.com/sponsors/sindresorhus"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/mime-db": {- "version": "1.54.0",- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",- "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",- "license": "MIT",- "engines": {- "node": ">= 0.6"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/mime-types": {- "version": "3.0.2",- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",- "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",- "license": "MIT",- "dependencies": {- "mime-db": "^1.54.0"- },- "engines": {- "node": ">=18"- },- "funding": {- "type": "opencollective",- "url": "https://opencollective.com/express"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/negotiator": {- "version": "1.0.0",- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",- "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",- "license": "MIT",- "engines": {- "node": ">= 0.6"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/raw-body": {- "version": "3.0.2",- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",- "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",- "license": "MIT",- "dependencies": {- "bytes": "~3.1.2",- "http-errors": "~2.0.1",- "iconv-lite": "~0.7.0",- "unpipe": "~1.0.0"- },- "engines": {- "node": ">= 0.10"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/send": {- "version": "1.2.0",- "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz",- "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",- "license": "MIT",- "dependencies": {- "debug": "^4.3.5",- "encodeurl": "^2.0.0",- "escape-html": "^1.0.3",- "etag": "^1.8.1",- "fresh": "^2.0.0",- "http-errors": "^2.0.0",- "mime-types": "^3.0.1",- "ms": "^2.1.3",- "on-finished": "^2.4.1",- "range-parser": "^1.2.1",- "statuses": "^2.0.1"- },- "engines": {- "node": ">= 18"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/serve-static": {- "version": "2.2.0",- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz",- "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",- "license": "MIT",- "dependencies": {- "encodeurl": "^2.0.0",- "escape-html": "^1.0.3",- "parseurl": "^1.3.3",- "send": "^1.2.0"- },- "engines": {- "node": ">= 18"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/statuses": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",- "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",- "license": "MIT",- "engines": {- "node": ">= 0.8"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/type-is": {- "version": "2.0.1",- "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",- "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",- "license": "MIT",- "dependencies": {- "content-type": "^1.0.5",- "media-typer": "^1.1.0",- "mime-types": "^3.0.0"- },- "engines": {- "node": ">= 0.6"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/zod": {- "version": "4.3.6",- "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",- "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",- "license": "MIT",- "funding": {- "url": "https://github.com/sponsors/colinhacks"- }- },- "node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema": {- "version": "3.25.2",- "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",- "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",- "license": "ISC",- "peerDependencies": {- "zod": "^3.25.28 || ^4"- }- },"node_modules/@mongodb-js/saslprep": {"version": "1.1.9","resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz",@@ -15288,14 +14896,6 @@"node": ">= 0.6"}},- "node_modules/cookie-signature": {- "version": "1.2.1",- "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.1.tgz",- "integrity": "sha512-78KWk9T26NhzXtuL26cIJ8/qNHANyJ/ZYrmEXFzUmhZdjpBv+DlWlOANRTGBt48YcyslsLrj0bMLFTmXvLRCOw==",- "engines": {- "node": ">=6.6.0"- }- },"node_modules/core-js": {"version": "3.49.0","resolved": "https://registry.npmjs.org/core-js/-/core-js-3.49.0.tgz",@@ -15340,6 +14940,7 @@"version": "2.8.5","resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz","integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",+ "dev": true,"license": "MIT","dependencies": {"object-assign": "^4",@@ -17117,33 +16718,6 @@"url": "https://opencollective.com/express"}},- "node_modules/express-rate-limit": {- "version": "8.3.2",- "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.3.2.tgz",- "integrity": "sha512-77VmFeJkO0/rvimEDuUC5H30oqUC4EyOhyGccfqoLebB0oiEYfM7nwPrsDsBL1gsTpwfzX8SFy2MT3TDyRq+bg==",- "license": "MIT",- "dependencies": {- "ip-address": "10.1.0"- },- "engines": {- "node": ">= 16"- },- "funding": {- "url": "https://github.com/sponsors/express-rate-limit"- },- "peerDependencies": {- "express": ">= 4.11"- }- },- "node_modules/express-rate-limit/node_modules/ip-address": {- "version": "10.1.0",- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz",- "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==",- "license": "MIT",- "engines": {- "node": ">= 12"- }- },"node_modules/express-session": {"version": "1.19.0","resolved": "https://registry.npmjs.org/express-session/-/express-session-1.19.0.tgz",@@ -18779,15 +18353,6 @@"node": ">=0.10.0"}},- "node_modules/hono": {- "version": "4.12.12",- "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.12.tgz",- "integrity": "sha512-p1JfQMKaceuCbpJKAPKVqyqviZdS0eUxH9v82oWo1kb9xjQ5wA6iP3FNVAPDFlz5/p7d45lO+BpSk1tuSZMF4Q==",- "license": "MIT",- "engines": {- "node": ">=16.9.0"- }- },"node_modules/hpagent": {"version": "1.2.0","resolved": "https://registry.npmjs.org/hpagent/-/hpagent-1.2.0.tgz",@@ -19528,12 +19093,6 @@"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz","integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="},- "node_modules/is-promise": {- "version": "4.0.0",- "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",- "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",- "license": "MIT"- },"node_modules/is-property": {"version": "1.0.2","resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",@@ -20075,6 +19634,7 @@"version": "8.0.2","resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz","integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",+ "dev": true,"license": "BSD-2-Clause"},"node_modules/json-stable-stringify-without-jsonify": {@@ -23386,15 +22946,6 @@"node": ">= 6"}},- "node_modules/pkce-challenge": {- "version": "5.0.1",- "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",- "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",- "license": "MIT",- "engines": {- "node": ">=16.20.0"- }- },"node_modules/pkcs11js": {"version": "2.1.6","resolved": "https://registry.npmjs.org/pkcs11js/-/pkcs11js-2.1.6.tgz",@@ -24990,39 +24541,6 @@"fsevents": "~2.3.2"}},- "node_modules/router": {- "version": "2.2.0",- "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",- "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",- "license": "MIT",- "dependencies": {- "debug": "^4.4.0",- "depd": "^2.0.0",- "is-promise": "^4.0.0",- "parseurl": "^1.3.3",- "path-to-regexp": "^8.0.0"- },- "engines": {- "node": ">= 18"- }- },- "node_modules/router/node_modules/debug": {- "version": "4.4.3",- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",- "license": "MIT",- "dependencies": {- "ms": "^2.1.3"- },- "engines": {- "node": ">=6.0"- },- "peerDependenciesMeta": {- "supports-color": {- "optional": true- }- }- },"node_modules/rrweb-cssom": {"version": "0.8.0","resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz",diff --git a/backend/package.json b/backend/package.jsonindex 22291ae03a..8800917f0f 100644--- a/backend/package.json+++ b/backend/package.json@@ -187,7 +187,6 @@"@infisical/ldapjs": "3.0.11","@infisical/pg-view-generator": "^1.1.0","@infisical/quic": "^1.0.8",- "@modelcontextprotocol/sdk": "^1.26.0","@node-saml/passport-saml": "^5.1.0","@octokit/auth-app": "^7.1.1","@octokit/core": "^5.2.1",diff --git a/backend/src/@types/fastify.d.ts b/backend/src/@types/fastify.d.tsindex 7592a70d8f..3cfaee5827 100644--- a/backend/src/@types/fastify.d.ts+++ b/backend/src/@types/fastify.d.ts@@ -6,9 +6,6 @@ import { TUsers } from "@app/db/schemas";import { TAccessApprovalPolicyServiceFactory } from "@app/ee/services/access-approval-policy/access-approval-policy-types";import { TAccessApprovalRequestServiceFactory } from "@app/ee/services/access-approval-request/access-approval-request-types";import { TAgentProxyCaServiceFactory } from "@app/ee/services/agent-proxy-ca/agent-proxy-ca-service";-import { TAiMcpActivityLogServiceFactory } from "@app/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-service";-import { TAiMcpEndpointServiceFactory } from "@app/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service";-import { TAiMcpServerServiceFactory } from "@app/ee/services/ai-mcp-server/ai-mcp-server-service";import { TAssumePrivilegeServiceFactory } from "@app/ee/services/assume-privilege/assume-privilege-types";import { TAuditLogServiceFactory, TCreateAuditLogDTO } from "@app/ee/services/audit-log/audit-log-types";import { TAuditLogStreamServiceFactory } from "@app/ee/services/audit-log-stream/audit-log-stream-service";@@ -68,10 +65,6 @@ import { TSecretApprovalRequestServiceFactory } from "@app/ee/services/secret-apimport { TSecretRotationV2ServiceFactory } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-service";import { TSecretScanningServiceFactory } from "@app/ee/services/secret-scanning/secret-scanning-service";import { TSecretScanningV2ServiceFactory } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-service";-import { TSshCertificateAuthorityServiceFactory } from "@app/ee/services/ssh/ssh-certificate-authority-service";-import { TSshCertificateTemplateServiceFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-service";-import { TSshHostServiceFactory } from "@app/ee/services/ssh-host/ssh-host-service";-import { TSshHostGroupServiceFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-service";import { TSubOrgServiceFactory } from "@app/ee/services/sub-org/sub-org-service";import { TTrustedIpServiceFactory } from "@app/ee/services/trusted-ip/trusted-ip-types";import { RequestMemoizer } from "@app/lib/request-context/request-memoizer";@@ -365,10 +358,6 @@ declare module "fastify" {pamProjectResolver: TPamProjectResolverFactory;certManagerInstance: TCertManagerInstanceServiceFactory;certManagerExport: TCertManagerExportServiceFactory;- sshCertificateAuthority: TSshCertificateAuthorityServiceFactory;- sshCertificateTemplate: TSshCertificateTemplateServiceFactory;- sshHost: TSshHostServiceFactory;- sshHostGroup: TSshHostGroupServiceFactory;certificateAuthority: TCertificateAuthorityServiceFactory;certificateAuthorityCrl: TCertificateAuthorityCrlServiceFactory;certificateEst: TCertificateEstServiceFactory;@@ -465,9 +454,6 @@ declare module "fastify" {convertor: TConvertorServiceFactory;subOrganization: TSubOrgServiceFactory;pkiAlertV2: TPkiAlertV2ServiceFactory;- aiMcpServer: TAiMcpServerServiceFactory;- aiMcpEndpoint: TAiMcpEndpointServiceFactory;- aiMcpActivityLog: TAiMcpActivityLogServiceFactory;approvalPolicy: TApprovalPolicyServiceFactory;appConnectionCredentialRotation: TAppConnectionCredentialRotationServiceFactory;caSigningConfig: TCaSigningConfigServiceFactory;diff --git a/backend/src/@types/knex.d.ts b/backend/src/@types/knex.d.tsindex 409ebbb932..30ee39af18 100644--- a/backend/src/@types/knex.d.ts+++ b/backend/src/@types/knex.d.ts@@ -20,27 +20,6 @@ import {TAdditionalPrivileges,TAdditionalPrivilegesInsert,TAdditionalPrivilegesUpdate,- TAiMcpActivityLogs,- TAiMcpActivityLogsInsert,- TAiMcpActivityLogsUpdate,- TAiMcpEndpoints,- TAiMcpEndpointServers,- TAiMcpEndpointServersInsert,- TAiMcpEndpointServersUpdate,- TAiMcpEndpointServerTools,- TAiMcpEndpointServerToolsInsert,- TAiMcpEndpointServerToolsUpdate,- TAiMcpEndpointsInsert,- TAiMcpEndpointsUpdate,- TAiMcpServers,- TAiMcpServersInsert,- TAiMcpServersUpdate,- TAiMcpServerTools,- TAiMcpServerToolsInsert,- TAiMcpServerToolsUpdate,- TAiMcpServerUserCredentials,- TAiMcpServerUserCredentialsInsert,- TAiMcpServerUserCredentialsUpdate,TAlertChannelMemberships,TAlertChannelMembershipsInsert,TAlertChannelMembershipsUpdate,@@ -490,9 +469,6 @@ import {TProjectSplitBackfillIds,TProjectSplitBackfillIdsInsert,TProjectSplitBackfillIdsUpdate,- TProjectSshConfigs,- TProjectSshConfigsInsert,- TProjectSshConfigsUpdate,TProjectsUpdate,TProjectTemplateGroupMemberships,TProjectTemplateGroupMembershipsInsert,@@ -665,36 +641,6 @@ import {TSlackIntegrations,TSlackIntegrationsInsert,TSlackIntegrationsUpdate,- TSshCertificateAuthorities,- TSshCertificateAuthoritiesInsert,- TSshCertificateAuthoritiesUpdate,- TSshCertificateAuthoritySecrets,- TSshCertificateAuthoritySecretsInsert,- TSshCertificateAuthoritySecretsUpdate,- TSshCertificateBodies,- TSshCertificateBodiesInsert,- TSshCertificateBodiesUpdate,- TSshCertificates,- TSshCertificatesInsert,- TSshCertificatesUpdate,- TSshCertificateTemplates,- TSshCertificateTemplatesInsert,- TSshCertificateTemplatesUpdate,- TSshHostGroupMemberships,- TSshHostGroupMembershipsInsert,- TSshHostGroupMembershipsUpdate,- TSshHostGroups,- TSshHostGroupsInsert,- TSshHostGroupsUpdate,- TSshHostLoginUserMappings,- TSshHostLoginUserMappingsInsert,- TSshHostLoginUserMappingsUpdate,- TSshHostLoginUsers,- TSshHostLoginUsersInsert,- TSshHostLoginUsersUpdate,- TSshHosts,- TSshHostsInsert,- TSshHostsUpdate,TSuperAdmin,TSuperAdminInsert,TSuperAdminUpdate,@@ -884,52 +830,6 @@ declare module "knex/types/tables" {TUserSecretActivationUpdate>;[TableName.Groups]: KnexOriginal.CompositeTableType<TGroups, TGroupsInsert, TGroupsUpdate>;- [TableName.SshHostGroup]: KnexOriginal.CompositeTableType<- TSshHostGroups,- TSshHostGroupsInsert,- TSshHostGroupsUpdate- >;- [TableName.SshHostGroupMembership]: KnexOriginal.CompositeTableType<- TSshHostGroupMemberships,- TSshHostGroupMembershipsInsert,- TSshHostGroupMembershipsUpdate- >;- [TableName.SshHost]: KnexOriginal.CompositeTableType<TSshHosts, TSshHostsInsert, TSshHostsUpdate>;- [TableName.SshCertificateAuthority]: KnexOriginal.CompositeTableType<- TSshCertificateAuthorities,- TSshCertificateAuthoritiesInsert,- TSshCertificateAuthoritiesUpdate- >;- [TableName.SshCertificateAuthoritySecret]: KnexOriginal.CompositeTableType<- TSshCertificateAuthoritySecrets,- TSshCertificateAuthoritySecretsInsert,- TSshCertificateAuthoritySecretsUpdate- >;- [TableName.SshCertificateTemplate]: KnexOriginal.CompositeTableType<- TSshCertificateTemplates,- TSshCertificateTemplatesInsert,- TSshCertificateTemplatesUpdate- >;- [TableName.SshCertificate]: KnexOriginal.CompositeTableType<- TSshCertificates,- TSshCertificatesInsert,- TSshCertificatesUpdate- >;- [TableName.SshCertificateBody]: KnexOriginal.CompositeTableType<- TSshCertificateBodies,- TSshCertificateBodiesInsert,- TSshCertificateBodiesUpdate- >;- [TableName.SshHostLoginUser]: KnexOriginal.CompositeTableType<- TSshHostLoginUsers,- TSshHostLoginUsersInsert,- TSshHostLoginUsersUpdate- >;- [TableName.SshHostLoginUserMapping]: KnexOriginal.CompositeTableType<- TSshHostLoginUserMappings,- TSshHostLoginUserMappingsInsert,- TSshHostLoginUserMappingsUpdate- >;[TableName.CertificateAuthority]: KnexOriginal.CompositeTableType<TCertificateAuthorities,TCertificateAuthoritiesInsert,@@ -1176,11 +1076,6 @@ declare module "knex/types/tables" {>;[TableName.SuperAdmin]: KnexOriginal.CompositeTableType<TSuperAdmin, TSuperAdminInsert, TSuperAdminUpdate>;[TableName.Project]: KnexOriginal.CompositeTableType<TProjects, TProjectsInsert, TProjectsUpdate>;- [TableName.ProjectSshConfig]: KnexOriginal.CompositeTableType<- TProjectSshConfigs,- TProjectSshConfigsInsert,- TProjectSshConfigsUpdate- >;[TableName.Environment]: KnexOriginal.CompositeTableType<TProjectEnvironments,TProjectEnvironmentsInsert,@@ -1915,37 +1810,6 @@ declare module "knex/types/tables" {TUserMfaRecoveryCodesInsert,TUserMfaRecoveryCodesUpdate>;- [TableName.AiMcpServer]: KnexOriginal.CompositeTableType<TAiMcpServers, TAiMcpServersInsert, TAiMcpServersUpdate>;- [TableName.AiMcpServerTool]: KnexOriginal.CompositeTableType<- TAiMcpServerTools,- TAiMcpServerToolsInsert,- TAiMcpServerToolsUpdate- >;- [TableName.AiMcpEndpoint]: KnexOriginal.CompositeTableType<- TAiMcpEndpoints,- TAiMcpEndpointsInsert,- TAiMcpEndpointsUpdate- >;- [TableName.AiMcpEndpointServer]: KnexOriginal.CompositeTableType<- TAiMcpEndpointServers,- TAiMcpEndpointServersInsert,- TAiMcpEndpointServersUpdate- >;- [TableName.AiMcpEndpointServerTool]: KnexOriginal.CompositeTableType<- TAiMcpEndpointServerTools,- TAiMcpEndpointServerToolsInsert,- TAiMcpEndpointServerToolsUpdate- >;- [TableName.AiMcpServerUserCredential]: KnexOriginal.CompositeTableType<- TAiMcpServerUserCredentials,- TAiMcpServerUserCredentialsInsert,- TAiMcpServerUserCredentialsUpdate- >;- [TableName.AiMcpActivityLog]: KnexOriginal.CompositeTableType<- TAiMcpActivityLogs,- TAiMcpActivityLogsInsert,- TAiMcpActivityLogsUpdate- >;[TableName.ApprovalPolicies]: KnexOriginal.CompositeTableType<TApprovalPolicies,TApprovalPoliciesInsert,diff --git a/backend/src/db/migrations/20250425163216_ssh-nullable-ca-defaults.ts b/backend/src/db/migrations/20250425163216_ssh-nullable-ca-defaults.tsindex 2a0b85e1c6..555904ce85 100644--- a/backend/src/db/migrations/20250425163216_ssh-nullable-ca-defaults.ts+++ b/backend/src/db/migrations/20250425163216_ssh-nullable-ca-defaults.ts@@ -1,6 +1,6 @@import { Knex } from "knex";-import { ProjectType, TableName } from "../schemas";+import { TableName } from "../schemas";export async function up(knex: Knex): Promise<void> {const hasDefaultUserCaCol = await knex.schema.hasColumn(TableName.ProjectSshConfig, "defaultUserSshCaId");@@ -24,7 +24,8 @@ export async function up(knex: Knex): Promise<void> {// (dangtony98): backfill by adding null defaults CAs for all existing Infisical SSH projects// that do not have an associated ProjectSshConfig record introduced in Infisical SSH V2.- const allProjects = await knex(TableName.Project).where("type", ProjectType.SSH).select("id");+ // "ssh" literal: the SSH project type (ProjectType.SSH) was removed with the SSH product+ const allProjects = await knex(TableName.Project).where("type", "ssh").select("id");const projectsWithConfig = await knex(TableName.ProjectSshConfig).select("projectId");const projectIdsWithConfig = new Set(projectsWithConfig.map((config) => config.projectId));diff --git a/backend/src/db/migrations/20250515164622_select-org-products.ts b/backend/src/db/migrations/20250515164622_select-org-products.tsindex c290a4ee2f..a7948093cc 100644--- a/backend/src/db/migrations/20250515164622_select-org-products.ts+++ b/backend/src/db/migrations/20250515164622_select-org-products.ts@@ -15,7 +15,9 @@ export async function up(knex: Knex): Promise<void> {if (!columns.kmsProductEnabled) {t.boolean("kmsProductEnabled").defaultTo(true);}- if (!columns.sshProductEnabled) {+ // "in" check: the sshProductEnabled column was dropped (with the SSH product) from the+ // organizations schema type, so it can no longer be keyed on the typed columnInfo record+ if (!("sshProductEnabled" in columns)) {t.boolean("sshProductEnabled").defaultTo(true);}if (!columns.scannerProductEnabled) {@@ -40,7 +42,7 @@ export async function down(knex: Knex): Promise<void> {if (columns.kmsProductEnabled) {t.dropColumn("kmsProductEnabled");}- if (columns.sshProductEnabled) {+ if ("sshProductEnabled" in columns) {t.dropColumn("sshProductEnabled");}if (columns.scannerProductEnabled) {diff --git a/backend/src/db/migrations/20250718133527_project-unify-revert.ts b/backend/src/db/migrations/20250718133527_project-unify-revert.tsindex d18c38e34f..c2c36ecddc 100644--- a/backend/src/db/migrations/20250718133527_project-unify-revert.ts+++ b/backend/src/db/migrations/20250718133527_project-unify-revert.ts@@ -307,7 +307,8 @@ const kickOutKmsProject = async (knex: Knex, oldProjectId: string) => {};const kickOutSshProject = async (knex: Knex, oldProjectId: string) => {- const newProjectId = await newProject(knex, oldProjectId, ProjectType.SSH);+ // "ssh" literal: the SSH project type (ProjectType.SSH) was removed with the SSH product+ const newProjectId = await newProject(knex, oldProjectId, "ssh" as ProjectType);await knex(TableName.SshHost).where("projectId", oldProjectId).update("projectId", newProjectId);await knex(TableName.ProjectSshConfig).where("projectId", oldProjectId).update("projectId", newProjectId);await knex(TableName.SshCertificateAuthority).where("projectId", oldProjectId).update("projectId", newProjectId);diff --git a/backend/src/db/migrations/20260729150000_drop-ssh-and-ai-mcp-tables.ts b/backend/src/db/migrations/20260729150000_drop-ssh-and-ai-mcp-tables.tsnew file mode 100644index 0000000000..e5e863d476--- /dev/null+++ b/backend/src/db/migrations/20260729150000_drop-ssh-and-ai-mcp-tables.ts@@ -0,0 +1,72 @@+import { Knex } from "knex";++import { TableName } from "../schemas";+import { dropOnUpdateTrigger } from "../utils";++// Drops the tables of the removed Agent Sentinel (ai project type) and SSH project type+// products. Tables are dropped children-first; no live table has a foreign key into+// either cluster. Existing project rows of type "ai" / "ssh" are left in place.+export async function up(knex: Knex): Promise<void> {+ // Agent Sentinel (ai_mcp_*)+ await dropOnUpdateTrigger(knex, TableName.AiMcpServerUserCredential);+ await knex.schema.dropTableIfExists(TableName.AiMcpServerUserCredential);++ await knex.schema.dropTableIfExists(TableName.AiMcpEndpointServerTool);+ await knex.schema.dropTableIfExists(TableName.AiMcpEndpointServer);++ await dropOnUpdateTrigger(knex, TableName.AiMcpEndpoint);+ await knex.schema.dropTableIfExists(TableName.AiMcpEndpoint);++ await knex.schema.dropTableIfExists(TableName.AiMcpServerTool);++ await dropOnUpdateTrigger(knex, TableName.AiMcpServer);+ await knex.schema.dropTableIfExists(TableName.AiMcpServer);++ await knex.schema.dropTableIfExists(TableName.AiMcpActivityLog);++ // SSH product — drop order follows the FK graph (children before parents):+ // ssh_host_login_users FKs ssh_host_groups + ssh_hosts; ssh_certificates FKs+ // ssh_hosts + ssh_certificate_templates + ssh_certificate_authorities.+ await dropOnUpdateTrigger(knex, TableName.SshHostGroupMembership);+ await knex.schema.dropTableIfExists(TableName.SshHostGroupMembership);++ await dropOnUpdateTrigger(knex, TableName.SshHostLoginUserMapping);+ await knex.schema.dropTableIfExists(TableName.SshHostLoginUserMapping);++ await dropOnUpdateTrigger(knex, TableName.SshHostLoginUser);+ await knex.schema.dropTableIfExists(TableName.SshHostLoginUser);++ await dropOnUpdateTrigger(knex, TableName.SshHostGroup);+ await knex.schema.dropTableIfExists(TableName.SshHostGroup);++ await dropOnUpdateTrigger(knex, TableName.SshCertificateBody);+ await knex.schema.dropTableIfExists(TableName.SshCertificateBody);++ await dropOnUpdateTrigger(knex, TableName.SshCertificate);+ await knex.schema.dropTableIfExists(TableName.SshCertificate);++ await dropOnUpdateTrigger(knex, TableName.SshCertificateTemplate);+ await knex.schema.dropTableIfExists(TableName.SshCertificateTemplate);++ await dropOnUpdateTrigger(knex, TableName.ProjectSshConfig);+ await knex.schema.dropTableIfExists(TableName.ProjectSshConfig);++ await dropOnUpdateTrigger(knex, TableName.SshHost);+ await knex.schema.dropTableIfExists(TableName.SshHost);++ await dropOnUpdateTrigger(knex, TableName.SshCertificateAuthoritySecret);+ await knex.schema.dropTableIfExists(TableName.SshCertificateAuthoritySecret);++ await dropOnUpdateTrigger(knex, TableName.SshCertificateAuthority);+ await knex.schema.dropTableIfExists(TableName.SshCertificateAuthority);++ // Org-level SSH product toggle+ const hasSshProductEnabled = await knex.schema.hasColumn(TableName.Organization, "sshProductEnabled");+ if (hasSshProductEnabled) {+ await knex.schema.alterTable(TableName.Organization, (t) => {+ t.dropColumn("sshProductEnabled");+ });+ }+}++export async function down(): Promise<void> {}diff --git a/backend/src/db/sanitized-schema.yaml b/backend/src/db/sanitized-schema.yamlindex 4a399ef0c5..34c74cd208 100644--- a/backend/src/db/sanitized-schema.yaml+++ b/backend/src/db/sanitized-schema.yaml@@ -17,67 +17,6 @@ tables:- editedByUserId- editNote- - name: ai_mcp_activity_logs- source: public.ai_mcp_activity_logs- columns:- - id- - projectId- - endpointName- - serverName- - toolName- - actor- - createdAt- - updatedAt-- - name: ai_mcp_endpoint_server_tools- source: public.ai_mcp_endpoint_server_tools- columns:- - id- - aiMcpEndpointId- - aiMcpServerToolId- - isEnabled-- - name: ai_mcp_endpoint_servers- source: public.ai_mcp_endpoint_servers- columns:- - id- - aiMcpEndpointId- - aiMcpServerId-- - name: ai_mcp_endpoints- source: public.ai_mcp_endpoints- columns:- - id- - name- - description- - status- - projectId- - createdAt- - updatedAt-- - name: ai_mcp_server_tools- source: public.ai_mcp_server_tools- columns:- - id- - name- - description- - inputSchema- - aiMcpServerId-- - name: ai_mcp_servers- source: public.ai_mcp_servers- columns:- - id- - name- - url- - description- - status- - credentialMode- - authMethod- - projectId- - createdAt- - updatedAt-- name: app_connectionssource: public.app_connectionscolumns:@@ -707,7 +646,6 @@ tables:- secretsProductEnabled- pkiProductEnabled- kmsProductEnabled- - sshProductEnabled- scannerProductEnabled- shareSecretsProductEnabled- maxSharedSecretLifetime@@ -1246,57 +1184,6 @@ tables:- projectId- expiryNotificationSent- - name: ssh_certificate_authorities- source: public.ssh_certificate_authorities- columns:- - id- - createdAt- - updatedAt- - projectId- - status- - friendlyName- - keyAlgorithm- - keySource-- - name: ssh_certificates- source: public.ssh_certificates- columns:- - id- - createdAt- - updatedAt- - sshCaId- - sshCertificateTemplateId- - serialNumber- - certType- - principals- - keyId- - notBefore- - notAfter- - sshHostId-- - name: ssh_host_groups- source: public.ssh_host_groups- columns:- - id- - createdAt- - updatedAt- - projectId- - name-- - name: ssh_hosts- source: public.ssh_hosts- columns:- - id- - createdAt- - updatedAt- - projectId- - hostname- - userCertTtl- - hostCertTtl- - userSshCaId- - hostSshCaId- - alias-- name: user_group_membershipsource: public.user_group_membershipcolumns:diff --git a/backend/src/db/schemas/ai-mcp-activity-logs.ts b/backend/src/db/schemas/ai-mcp-activity-logs.tsdeleted file mode 100644index 314fefc242..0000000000--- a/backend/src/db/schemas/ai-mcp-activity-logs.ts+++ /dev/null@@ -1,25 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpActivityLogsSchema = z.object({- id: z.string().uuid(),- projectId: z.string(),- endpointName: z.string(),- serverName: z.string(),- toolName: z.string(),- actor: z.string(),- request: z.unknown(),- response: z.unknown(),- createdAt: z.date(),- updatedAt: z.date()-});--export type TAiMcpActivityLogs = z.infer<typeof AiMcpActivityLogsSchema>;-export type TAiMcpActivityLogsInsert = Omit<z.input<typeof AiMcpActivityLogsSchema>, TImmutableDBKeys>;-export type TAiMcpActivityLogsUpdate = Partial<Omit<z.input<typeof AiMcpActivityLogsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ai-mcp-endpoint-server-tools.ts b/backend/src/db/schemas/ai-mcp-endpoint-server-tools.tsdeleted file mode 100644index 273261e692..0000000000--- a/backend/src/db/schemas/ai-mcp-endpoint-server-tools.ts+++ /dev/null@@ -1,21 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpEndpointServerToolsSchema = z.object({- id: z.string().uuid(),- aiMcpEndpointId: z.string().uuid(),- aiMcpServerToolId: z.string().uuid(),- isEnabled: z.boolean().default(false)-});--export type TAiMcpEndpointServerTools = z.infer<typeof AiMcpEndpointServerToolsSchema>;-export type TAiMcpEndpointServerToolsInsert = Omit<z.input<typeof AiMcpEndpointServerToolsSchema>, TImmutableDBKeys>;-export type TAiMcpEndpointServerToolsUpdate = Partial<- Omit<z.input<typeof AiMcpEndpointServerToolsSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ai-mcp-endpoint-servers.ts b/backend/src/db/schemas/ai-mcp-endpoint-servers.tsdeleted file mode 100644index 4fd870d0db..0000000000--- a/backend/src/db/schemas/ai-mcp-endpoint-servers.ts+++ /dev/null@@ -1,18 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpEndpointServersSchema = z.object({- id: z.string().uuid(),- aiMcpEndpointId: z.string().uuid(),- aiMcpServerId: z.string().uuid()-});--export type TAiMcpEndpointServers = z.infer<typeof AiMcpEndpointServersSchema>;-export type TAiMcpEndpointServersInsert = Omit<z.input<typeof AiMcpEndpointServersSchema>, TImmutableDBKeys>;-export type TAiMcpEndpointServersUpdate = Partial<Omit<z.input<typeof AiMcpEndpointServersSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ai-mcp-endpoints.ts b/backend/src/db/schemas/ai-mcp-endpoints.tsdeleted file mode 100644index d0af20aef2..0000000000--- a/backend/src/db/schemas/ai-mcp-endpoints.ts+++ /dev/null@@ -1,25 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpEndpointsSchema = z.object({- id: z.string().uuid(),- name: z.string(),- description: z.string().nullable().optional(),- status: z.string().nullable().optional(),- projectId: z.string(),- createdAt: z.date(),- updatedAt: z.date(),- piiRequestFiltering: z.boolean().default(false),- piiResponseFiltering: z.boolean().default(false),- piiEntityTypes: z.string().array().nullable().optional()-});--export type TAiMcpEndpoints = z.infer<typeof AiMcpEndpointsSchema>;-export type TAiMcpEndpointsInsert = Omit<z.input<typeof AiMcpEndpointsSchema>, TImmutableDBKeys>;-export type TAiMcpEndpointsUpdate = Partial<Omit<z.input<typeof AiMcpEndpointsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ai-mcp-server-tools.ts b/backend/src/db/schemas/ai-mcp-server-tools.tsdeleted file mode 100644index d3cd967fd9..0000000000--- a/backend/src/db/schemas/ai-mcp-server-tools.ts+++ /dev/null@@ -1,20 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpServerToolsSchema = z.object({- id: z.string().uuid(),- name: z.string(),- description: z.string().nullable().optional(),- inputSchema: z.unknown().nullable().optional(),- aiMcpServerId: z.string().uuid()-});--export type TAiMcpServerTools = z.infer<typeof AiMcpServerToolsSchema>;-export type TAiMcpServerToolsInsert = Omit<z.input<typeof AiMcpServerToolsSchema>, TImmutableDBKeys>;-export type TAiMcpServerToolsUpdate = Partial<Omit<z.input<typeof AiMcpServerToolsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ai-mcp-server-user-credentials.ts b/backend/src/db/schemas/ai-mcp-server-user-credentials.tsdeleted file mode 100644index cc247d60f9..0000000000--- a/backend/src/db/schemas/ai-mcp-server-user-credentials.ts+++ /dev/null@@ -1,28 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { zodBuffer } from "@app/lib/zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpServerUserCredentialsSchema = z.object({- id: z.string().uuid(),- userId: z.string().uuid(),- aiMcpServerId: z.string().uuid(),- encryptedCredentials: zodBuffer,- createdAt: z.date(),- updatedAt: z.date()-});--export type TAiMcpServerUserCredentials = z.infer<typeof AiMcpServerUserCredentialsSchema>;-export type TAiMcpServerUserCredentialsInsert = Omit<- z.input<typeof AiMcpServerUserCredentialsSchema>,- TImmutableDBKeys->;-export type TAiMcpServerUserCredentialsUpdate = Partial<- Omit<z.input<typeof AiMcpServerUserCredentialsSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ai-mcp-servers.ts b/backend/src/db/schemas/ai-mcp-servers.tsdeleted file mode 100644index 42a5714df2..0000000000--- a/backend/src/db/schemas/ai-mcp-servers.ts+++ /dev/null@@ -1,30 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { zodBuffer } from "@app/lib/zod";--import { TImmutableDBKeys } from "./models";--export const AiMcpServersSchema = z.object({- id: z.string().uuid(),- name: z.string(),- url: z.string(),- description: z.string().nullable().optional(),- status: z.string().nullable().optional(),- credentialMode: z.string().nullable().optional(),- authMethod: z.string().nullable().optional(),- encryptedCredentials: zodBuffer.nullable().optional(),- encryptedOauthConfig: zodBuffer.nullable().optional(),- projectId: z.string(),- createdAt: z.date(),- updatedAt: z.date(),- gatewayId: z.string().uuid().nullable().optional()-});--export type TAiMcpServers = z.infer<typeof AiMcpServersSchema>;-export type TAiMcpServersInsert = Omit<z.input<typeof AiMcpServersSchema>, TImmutableDBKeys>;-export type TAiMcpServersUpdate = Partial<Omit<z.input<typeof AiMcpServersSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/index.ts b/backend/src/db/schemas/index.tsindex 06aab0bc35..28d3bcb7c6 100644--- a/backend/src/db/schemas/index.ts+++ b/backend/src/db/schemas/index.ts@@ -4,13 +4,6 @@ export * from "./access-approval-policies-bypassers";export * from "./access-approval-requests";export * from "./access-approval-requests-reviewers";export * from "./additional-privileges";-export * from "./ai-mcp-activity-logs";-export * from "./ai-mcp-endpoint-server-tools";-export * from "./ai-mcp-endpoint-servers";-export * from "./ai-mcp-endpoints";-export * from "./ai-mcp-server-tools";-export * from "./ai-mcp-server-user-credentials";-export * from "./ai-mcp-servers";export * from "./alert-channel-memberships";export * from "./alert-channel-recipients";export * from "./alert-channels";@@ -194,7 +187,6 @@ export * from "./project-memberships";export * from "./project-roles";export * from "./project-slack-configs";export * from "./project-split-backfill-ids";-export * from "./project-ssh-configs";export * from "./project-template-group-memberships";export * from "./project-template-identity-memberships";export * from "./project-template-user-memberships";@@ -256,16 +248,6 @@ export * from "./secrets-v2";export * from "./service-tokens";export * from "./signup-onboarding-responses";export * from "./slack-integrations";-export * from "./ssh-certificate-authorities";-export * from "./ssh-certificate-authority-secrets";-export * from "./ssh-certificate-bodies";-export * from "./ssh-certificate-templates";-export * from "./ssh-certificates";-export * from "./ssh-host-group-memberships";-export * from "./ssh-host-groups";-export * from "./ssh-host-login-user-mappings";-export * from "./ssh-host-login-users";-export * from "./ssh-hosts";export * from "./super-admin";export * from "./totp-configs";export * from "./trusted-ips";diff --git a/backend/src/db/schemas/models.ts b/backend/src/db/schemas/models.tsindex 07eb1a4aa9..9e31ccc2cf 100644--- a/backend/src/db/schemas/models.ts+++ b/backend/src/db/schemas/models.ts@@ -3,6 +3,7 @@ import { z } from "zod";export enum TableName {Users = "users",EmailDomains = "email_domains",+ // ssh_* tables were dropped with the SSH product; members kept for historical migrationsSshHostGroup = "ssh_host_groups",SshHostGroupMembership = "ssh_host_group_memberships",SshHost = "ssh_hosts",@@ -71,6 +72,7 @@ export enum TableName {SignupOnboardingResponse = "signup_onboarding_responses",SuperAdmin = "super_admin",RateLimit = "rate_limit",+ // dropped with the SSH product; member kept for historical migrationsProjectSshConfig = "project_ssh_configs",Project = "projects",ProjectBot = "project_bots",@@ -289,7 +291,7 @@ export enum TableName {// PKI Inventory ViewsCertificateInventoryView = "certificate_inventory_views",- // AI+ // AI (ai_mcp_* tables were dropped with Agent Sentinel; members kept for historical migrations)AiMcpServer = "ai_mcp_servers",AiMcpServerTool = "ai_mcp_server_tools",AiMcpServerUserCredential = "ai_mcp_server_user_credentials",@@ -378,8 +380,6 @@ export enum ProjectMembershipRole {Custom = "custom",Viewer = "viewer",NoAccess = "no-access",- // ssh- SshHostBootstrapper = "ssh-host-bootstrapper",// kmsKmsCryptographicOperator = "cryptographic-operator"}@@ -445,20 +445,16 @@ export enum ProjectType {SecretManager = "secret-manager",CertificateManager = "cert-manager",KMS = "kms",- SSH = "ssh",SecretScanning = "secret-scanning",- PAM = "pam",- AI = "ai"+ PAM = "pam"}export enum ActionProjectType {SecretManager = ProjectType.SecretManager,CertificateManager = ProjectType.CertificateManager,KMS = ProjectType.KMS,- SSH = ProjectType.SSH,SecretScanning = ProjectType.SecretScanning,PAM = ProjectType.PAM,- AI = ProjectType.AI,// project operations that happen on all typesAny = "any"}diff --git a/backend/src/db/schemas/organizations.ts b/backend/src/db/schemas/organizations.tsindex 33fc6eff09..54afbf3beb 100644--- a/backend/src/db/schemas/organizations.ts+++ b/backend/src/db/schemas/organizations.ts@@ -32,7 +32,6 @@ export const OrganizationsSchema = z.object({secretsProductEnabled: z.boolean().default(true).nullable().optional(),pkiProductEnabled: z.boolean().default(true).nullable().optional(),kmsProductEnabled: z.boolean().default(true).nullable().optional(),- sshProductEnabled: z.boolean().default(true).nullable().optional(),scannerProductEnabled: z.boolean().default(true).nullable().optional(),shareSecretsProductEnabled: z.boolean().default(true).nullable().optional(),maxSharedSecretLifetime: z.number().default(2592000).nullable().optional(),diff --git a/backend/src/db/schemas/project-ssh-configs.ts b/backend/src/db/schemas/project-ssh-configs.tsdeleted file mode 100644index d0be89ee3d..0000000000--- a/backend/src/db/schemas/project-ssh-configs.ts+++ /dev/null@@ -1,21 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const ProjectSshConfigsSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- projectId: z.string(),- defaultUserSshCaId: z.string().uuid().nullable().optional(),- defaultHostSshCaId: z.string().uuid().nullable().optional()-});--export type TProjectSshConfigs = z.infer<typeof ProjectSshConfigsSchema>;-export type TProjectSshConfigsInsert = Omit<z.input<typeof ProjectSshConfigsSchema>, TImmutableDBKeys>;-export type TProjectSshConfigsUpdate = Partial<Omit<z.input<typeof ProjectSshConfigsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ssh-certificate-authorities.ts b/backend/src/db/schemas/ssh-certificate-authorities.tsdeleted file mode 100644index 75603406f6..0000000000--- a/backend/src/db/schemas/ssh-certificate-authorities.ts+++ /dev/null@@ -1,25 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshCertificateAuthoritiesSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- projectId: z.string(),- status: z.string(),- friendlyName: z.string(),- keyAlgorithm: z.string(),- keySource: z.string()-});--export type TSshCertificateAuthorities = z.infer<typeof SshCertificateAuthoritiesSchema>;-export type TSshCertificateAuthoritiesInsert = Omit<z.input<typeof SshCertificateAuthoritiesSchema>, TImmutableDBKeys>;-export type TSshCertificateAuthoritiesUpdate = Partial<- Omit<z.input<typeof SshCertificateAuthoritiesSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ssh-certificate-authority-secrets.ts b/backend/src/db/schemas/ssh-certificate-authority-secrets.tsdeleted file mode 100644index 934c10ab23..0000000000--- a/backend/src/db/schemas/ssh-certificate-authority-secrets.ts+++ /dev/null@@ -1,27 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { zodBuffer } from "@app/lib/zod";--import { TImmutableDBKeys } from "./models";--export const SshCertificateAuthoritySecretsSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshCaId: z.string().uuid(),- encryptedPrivateKey: zodBuffer-});--export type TSshCertificateAuthoritySecrets = z.infer<typeof SshCertificateAuthoritySecretsSchema>;-export type TSshCertificateAuthoritySecretsInsert = Omit<- z.input<typeof SshCertificateAuthoritySecretsSchema>,- TImmutableDBKeys->;-export type TSshCertificateAuthoritySecretsUpdate = Partial<- Omit<z.input<typeof SshCertificateAuthoritySecretsSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ssh-certificate-bodies.ts b/backend/src/db/schemas/ssh-certificate-bodies.tsdeleted file mode 100644index baafb773b9..0000000000--- a/backend/src/db/schemas/ssh-certificate-bodies.ts+++ /dev/null@@ -1,22 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { zodBuffer } from "@app/lib/zod";--import { TImmutableDBKeys } from "./models";--export const SshCertificateBodiesSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshCertId: z.string().uuid(),- encryptedCertificate: zodBuffer-});--export type TSshCertificateBodies = z.infer<typeof SshCertificateBodiesSchema>;-export type TSshCertificateBodiesInsert = Omit<z.input<typeof SshCertificateBodiesSchema>, TImmutableDBKeys>;-export type TSshCertificateBodiesUpdate = Partial<Omit<z.input<typeof SshCertificateBodiesSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ssh-certificate-templates.ts b/backend/src/db/schemas/ssh-certificate-templates.tsdeleted file mode 100644index 6c16c3942f..0000000000--- a/backend/src/db/schemas/ssh-certificate-templates.ts+++ /dev/null@@ -1,30 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshCertificateTemplatesSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshCaId: z.string().uuid(),- status: z.string(),- name: z.string(),- ttl: z.string(),- maxTTL: z.string(),- allowedUsers: z.string().array(),- allowedHosts: z.string().array(),- allowUserCertificates: z.boolean(),- allowHostCertificates: z.boolean(),- allowCustomKeyIds: z.boolean()-});--export type TSshCertificateTemplates = z.infer<typeof SshCertificateTemplatesSchema>;-export type TSshCertificateTemplatesInsert = Omit<z.input<typeof SshCertificateTemplatesSchema>, TImmutableDBKeys>;-export type TSshCertificateTemplatesUpdate = Partial<- Omit<z.input<typeof SshCertificateTemplatesSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ssh-certificates.ts b/backend/src/db/schemas/ssh-certificates.tsdeleted file mode 100644index 1bfd1fe6e9..0000000000--- a/backend/src/db/schemas/ssh-certificates.ts+++ /dev/null@@ -1,27 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshCertificatesSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshCaId: z.string().uuid().nullable().optional(),- sshCertificateTemplateId: z.string().uuid().nullable().optional(),- serialNumber: z.string(),- certType: z.string(),- principals: z.string().array(),- keyId: z.string(),- notBefore: z.date(),- notAfter: z.date(),- sshHostId: z.string().uuid().nullable().optional()-});--export type TSshCertificates = z.infer<typeof SshCertificatesSchema>;-export type TSshCertificatesInsert = Omit<z.input<typeof SshCertificatesSchema>, TImmutableDBKeys>;-export type TSshCertificatesUpdate = Partial<Omit<z.input<typeof SshCertificatesSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ssh-host-group-memberships.ts b/backend/src/db/schemas/ssh-host-group-memberships.tsdeleted file mode 100644index 80a891e07e..0000000000--- a/backend/src/db/schemas/ssh-host-group-memberships.ts+++ /dev/null@@ -1,22 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshHostGroupMembershipsSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshHostGroupId: z.string().uuid(),- sshHostId: z.string().uuid()-});--export type TSshHostGroupMemberships = z.infer<typeof SshHostGroupMembershipsSchema>;-export type TSshHostGroupMembershipsInsert = Omit<z.input<typeof SshHostGroupMembershipsSchema>, TImmutableDBKeys>;-export type TSshHostGroupMembershipsUpdate = Partial<- Omit<z.input<typeof SshHostGroupMembershipsSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ssh-host-groups.ts b/backend/src/db/schemas/ssh-host-groups.tsdeleted file mode 100644index 5476e7fa1b..0000000000--- a/backend/src/db/schemas/ssh-host-groups.ts+++ /dev/null@@ -1,20 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshHostGroupsSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- projectId: z.string(),- name: z.string()-});--export type TSshHostGroups = z.infer<typeof SshHostGroupsSchema>;-export type TSshHostGroupsInsert = Omit<z.input<typeof SshHostGroupsSchema>, TImmutableDBKeys>;-export type TSshHostGroupsUpdate = Partial<Omit<z.input<typeof SshHostGroupsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ssh-host-login-user-mappings.ts b/backend/src/db/schemas/ssh-host-login-user-mappings.tsdeleted file mode 100644index fd5fa460cd..0000000000--- a/backend/src/db/schemas/ssh-host-login-user-mappings.ts+++ /dev/null@@ -1,23 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshHostLoginUserMappingsSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshHostLoginUserId: z.string().uuid(),- userId: z.string().uuid().nullable().optional(),- groupId: z.string().uuid().nullable().optional()-});--export type TSshHostLoginUserMappings = z.infer<typeof SshHostLoginUserMappingsSchema>;-export type TSshHostLoginUserMappingsInsert = Omit<z.input<typeof SshHostLoginUserMappingsSchema>, TImmutableDBKeys>;-export type TSshHostLoginUserMappingsUpdate = Partial<- Omit<z.input<typeof SshHostLoginUserMappingsSchema>, TImmutableDBKeys>->;diff --git a/backend/src/db/schemas/ssh-host-login-users.ts b/backend/src/db/schemas/ssh-host-login-users.tsdeleted file mode 100644index 6060db9034..0000000000--- a/backend/src/db/schemas/ssh-host-login-users.ts+++ /dev/null@@ -1,21 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshHostLoginUsersSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- sshHostId: z.string().uuid().nullable().optional(),- loginUser: z.string(),- sshHostGroupId: z.string().uuid().nullable().optional()-});--export type TSshHostLoginUsers = z.infer<typeof SshHostLoginUsersSchema>;-export type TSshHostLoginUsersInsert = Omit<z.input<typeof SshHostLoginUsersSchema>, TImmutableDBKeys>;-export type TSshHostLoginUsersUpdate = Partial<Omit<z.input<typeof SshHostLoginUsersSchema>, TImmutableDBKeys>>;diff --git a/backend/src/db/schemas/ssh-hosts.ts b/backend/src/db/schemas/ssh-hosts.tsdeleted file mode 100644index 54b36a6bd3..0000000000--- a/backend/src/db/schemas/ssh-hosts.ts+++ /dev/null@@ -1,25 +0,0 @@-// Code generated by automation script, DO NOT EDIT.-// Automated by pulling database and generating zod schema-// To update. Just run npm run generate:schema-// Written by akhilmhdh.--import { z } from "zod";--import { TImmutableDBKeys } from "./models";--export const SshHostsSchema = z.object({- id: z.string().uuid(),- createdAt: z.date(),- updatedAt: z.date(),- projectId: z.string(),- hostname: z.string(),- userCertTtl: z.string(),- hostCertTtl: z.string(),- userSshCaId: z.string().uuid(),- hostSshCaId: z.string().uuid(),- alias: z.string().nullable().optional()-});--export type TSshHosts = z.infer<typeof SshHostsSchema>;-export type TSshHostsInsert = Omit<z.input<typeof SshHostsSchema>, TImmutableDBKeys>;-export type TSshHostsUpdate = Partial<Omit<z.input<typeof SshHostsSchema>, TImmutableDBKeys>>;diff --git a/backend/src/ee/routes/ai/mcp-endpoint-metadata-router.ts b/backend/src/ee/routes/ai/mcp-endpoint-metadata-router.tsdeleted file mode 100644index c90da7ed9b..0000000000--- a/backend/src/ee/routes/ai/mcp-endpoint-metadata-router.ts+++ /dev/null@@ -1,144 +0,0 @@-import { z } from "zod";--import { getConfig } from "@app/lib/config/env";-import { removeTrailingSlash } from "@app/lib/fn";-import { readLimit } from "@app/server/config/rateLimiter";--const getMcpUrls = (siteUrl: string, endpointId: string) => {- // The MCP resource/connect URL- const resourceUrl = `${siteUrl}/api/v1/ai/mcp/endpoints/${endpointId}/connect`;- // The authorization server issuer (RFC 8414: metadata at /.well-known/oauth-authorization-server/{path})- const authServerIssuer = `${siteUrl}/mcp-endpoints/${endpointId}`;-- // OAuth endpoint URLs- const apiBaseUrl = `${siteUrl}/api/v1/ai/mcp/endpoints/${endpointId}`;- const tokenEndpointUrl = `${apiBaseUrl}/oauth/token`;- const authorizeEndpointUrl = `${apiBaseUrl}/oauth/authorize`;- const registrationEndpointUrl = `${apiBaseUrl}/oauth/register`;-- return {- resourceUrl,- authServerIssuer,- tokenEndpointUrl,- authorizeEndpointUrl,- registrationEndpointUrl- };-};--export const registerMcpEndpointMetadataRouter = async (server: FastifyZodProvider) => {- const appCfg = getConfig();- const siteUrl = removeTrailingSlash(appCfg.SITE_URL || "");- if (!siteUrl) {- return; // SITE_URL not configured, skip MCP endpoint metadata registration- }-- const siteHost = new URL(siteUrl).host;- const scopeAccess = `https://${siteHost}/mcp:access`;-- // OAuth 2.1: Protected Resource metadata- // GET /mcp-endpoints/:endpointId/.well-known/oauth-protected-resource- server.route({- method: "GET",- url: "/:endpointId/.well-known/oauth-protected-resource",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- endpointId: z.string().trim().min(1)- })- },- handler: async (req, reply) => {- const { resourceUrl, authServerIssuer } = getMcpUrls(siteUrl, req.params.endpointId);- return reply.send({- resource: resourceUrl,- authorization_servers: [authServerIssuer],- scopes_supported: ["openid", scopeAccess],- bearer_methods_supported: ["header"]- });- }- });-};--// RFC 8414 compliant OAuth Authorization Server metadata-// GET /.well-known/oauth-authorization-server/mcp-endpoints/:endpointId-export const registerMcpEndpointAuthServerMetadataRouter = async (server: FastifyZodProvider) => {- const appCfg = getConfig();- const siteUrl = removeTrailingSlash(appCfg.SITE_URL || "");- if (!siteUrl) {- return; // SITE_URL not configured, skip MCP auth server metadata registration- }- const siteHost = new URL(siteUrl).host;- const scopeAccess = `https://${siteHost}/mcp:access`;-- server.route({- method: "GET",- url: "/mcp-endpoints/:endpointId",- schema: {- params: z.object({- endpointId: z.string().trim().min(1)- })- },- config: {- rateLimit: readLimit- },- handler: async (req, reply) => {- const { authServerIssuer, authorizeEndpointUrl, tokenEndpointUrl, registrationEndpointUrl } = getMcpUrls(- siteUrl,- req.params.endpointId- );-- return reply.send({- issuer: authServerIssuer,- authorization_endpoint: authorizeEndpointUrl,- token_endpoint: tokenEndpointUrl,- registration_endpoint: registrationEndpointUrl,- response_types_supported: ["code"],- grant_types_supported: ["authorization_code"],- code_challenge_methods_supported: ["S256"],- token_endpoint_auth_methods_supported: ["none"],- scopes_supported: ["openid", scopeAccess]- });- }- });-};--// RFC 9728 compliant: Protected Resource metadata at path-appended URL-// The MCP Inspector's OAuth discovery process makes a call to `/.well-known/oauth-protected-resource/api/v1/ai/mcp/endpoints/:endpointId/connect`-// Then falls back to `/.well-known/oauth-protected-resource`, which is simpler but loses the `endpointId` info-//-// Therefore, we need to make sure that we respond to its call made to `/.well-known/oauth-protected-resource/api/v1/ai/mcp/endpoints/:endpointId/connect`-// This constrains our API to have `.well-known/oauth-protected-resource` as the prefix and the path from the connect URL as the suffix.-export const registerRfc9728ProtectedResourceMetadataRouter = async (server: FastifyZodProvider) => {- const appCfg = getConfig();- const siteUrl = removeTrailingSlash(appCfg.SITE_URL || "");- if (!siteUrl) {- return;- }-- const siteHost = new URL(siteUrl).host;- const scopeAccess = `https://${siteHost}/mcp:access`;-- server.route({- method: "GET",- url: "/api/v1/ai/mcp/endpoints/:endpointId/connect",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- endpointId: z.string().trim().min(1)- })- },- handler: async (req) => {- const { resourceUrl, authServerIssuer } = getMcpUrls(siteUrl, req.params.endpointId);- // Return endpoint-specific auth server so MCP Inspector uses endpoint-specific OAuth endpoints- return {- resource: resourceUrl,- authorization_servers: [authServerIssuer],- scopes_supported: ["openid", scopeAccess],- bearer_methods_supported: ["header"]- };- }- });-};diff --git a/backend/src/ee/routes/v1/ai-mcp-activity-log-router.ts b/backend/src/ee/routes/v1/ai-mcp-activity-log-router.tsdeleted file mode 100644index be557ed8a7..0000000000--- a/backend/src/ee/routes/v1/ai-mcp-activity-log-router.ts+++ /dev/null@@ -1,70 +0,0 @@-import { z } from "zod";--import { AiMcpActivityLogsSchema } from "@app/db/schemas";-import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { readLimit } from "@app/server/config/rateLimiter";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";--export const registerAiMcpActivityLogRouter = async (server: FastifyZodProvider) => {- server.route({- url: "/",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- querystring: z.object({- projectId: z.string().trim().min(1),- endpointName: z.string().optional(),- serverName: z.string().optional(),- toolName: z.string().optional(),- actor: z.string().optional(),- startDate: z.string().datetime().optional(),- endDate: z.string().datetime().optional(),- offset: z.coerce.number().default(0),- limit: z.coerce.number().max(100).default(20)- }),- response: {- 200: z.object({- activityLogs: z.array(AiMcpActivityLogsSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { projectId, endpointName, serverName, toolName, actor, startDate, endDate, offset, limit } = req.query;-- const activityLogs = await server.services.aiMcpActivityLog.listActivityLogs({- projectId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- filter: {- endpointName,- serverName,- toolName,- actor,- startDate,- endDate,- offset,- limit- }- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ACTIVITY_LOG_LIST,- metadata: {- count: activityLogs.length- }- }- });-- return { activityLogs };- }- });-};diff --git a/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts b/backend/src/ee/routes/v1/ai-mcp-endpoint-router.tsdeleted file mode 100644index 1032227773..0000000000--- a/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts+++ /dev/null@@ -1,968 +0,0 @@-import { FastifyReply, FastifyRequest, HookHandlerDoneFunction } from "fastify";-import { z } from "zod";--import { AiMcpEndpointServerToolsSchema } from "@app/db/schemas/ai-mcp-endpoint-server-tools";-import { AiMcpEndpointsSchema } from "@app/db/schemas/ai-mcp-endpoints";-import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { getConfig } from "@app/lib/config/env";-import { BadRequestError, UnauthorizedError } from "@app/lib/errors";-import { logger } from "@app/lib/logger";-import { ms } from "@app/lib/ms";-import { readLimit, writeLimit } from "@app/server/config/rateLimiter";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";--const sendWwwAuthenticate = (reply: FastifyReply, endpointId: string, description?: string) => {- const appCfg = getConfig();- const protectedResourceMetadataUrl = `${appCfg.SITE_URL}/mcp-endpoints/${endpointId}/.well-known/oauth-protected-resource`;- let header = `Bearer resource_metadata="${protectedResourceMetadataUrl}", scope="openid"`;- if (description) header = `${header}, error_description="${description}"`;- void reply.header("WWW-Authenticate", header);-};--// Custom onRequest hook to enforce auth while returning proper WWW-Authenticate hint for MCP clients-const requireMcpAuthHook = <TReq extends FastifyRequest, TRes extends FastifyReply>(- req: TReq,- reply: TRes,- done: HookHandlerDoneFunction,- endpointId: string-) => {- const { auth } = req;- if (!auth) {- sendWwwAuthenticate(reply, endpointId, "Missing authorization header");- void reply.status(401).send();- return;- }-- const allowed = auth.authMode === AuthMode.MCP_JWT;- if (!allowed) {- void reply.status(403).send();- return;- }-- if (!req.permission.orgId) {- void reply.status(401).send({ message: "Unauthorized: organization context required" });- return;- }-- done();-};--export const registerAiMcpEndpointRouter = async (server: FastifyZodProvider) => {- server.route({- method: "POST",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- })- },- url: "/:endpointId/connect",- onRequest: (req, reply, done) =>- requireMcpAuthHook(req, reply, done, (req.params as { endpointId: string }).endpointId),- handler: async (req, res) => {- await res.hijack(); // allow manual control of the underlying res-- if (req.auth.authMode === AuthMode.MCP_JWT && req.params.endpointId !== req.auth.token.mcp?.endpointId) {- throw new UnauthorizedError({ message: "Unauthorized" });- }-- const {- server: mcpServer,- transport,- projectId,- endpointName,- cleanup- } = await server.services.aiMcpEndpoint.interactWithMcp({- endpointId: req.params.endpointId,- userId: req.permission.id,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_CONNECT,- metadata: {- endpointId: req.params.endpointId,- endpointName: endpointName || "",- userId: req.permission.id- }- }- });-- // Close transport and cleanup gateway proxies when client disconnects- res.raw.on("close", () => {- void transport.close().catch((err) => {- logger.error(err, "Failed to close transport for mcp endpoint");- });-- // Cleanup gateway proxies- if (cleanup) {- void cleanup().catch((err) => {- logger.error(err, "Failed to cleanup gateway proxies for mcp endpoint");- });- }- });-- await mcpServer.connect(transport);- await transport.handleRequest(req.raw, res.raw, req.body);- }- });-- server.route({- method: ["GET", "DELETE"],- config: {- rateLimit: writeLimit- },- url: "/:endpointId/connect",-- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- })- },- onRequest: (req, reply, done) =>- requireMcpAuthHook(req, reply, done, (req.params as { endpointId: string }).endpointId),- handler: async (_req, res) => {- void res- .status(405)- .header("Allow", "POST")- .send({- jsonrpc: "2.0",- error: {- code: -32000,- message: "Method not allowed"- },- id: null- });- }- });-- server.route({- url: "/",- method: "POST",- config: {- rateLimit: writeLimit- },- schema: {- body: z.object({- projectId: z.string().uuid().trim().min(1),- name: z.string().trim().min(1).max(64),- description: z.string().trim().max(256).optional(),- serverIds: z.array(z.string().uuid()).default([])- }),- response: {- 200: z.object({- endpoint: AiMcpEndpointsSchema- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const endpoint = await server.services.aiMcpEndpoint.createMcpEndpoint({- projectId: req.body.projectId,- name: req.body.name,- description: req.body.description,- serverIds: req.body.serverIds,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: req.body.projectId,- event: {- type: EventType.MCP_ENDPOINT_CREATE,- metadata: {- endpointId: endpoint.id,- name: endpoint.name,- description: req.body.description,- serverIds: req.body.serverIds- }- }- });-- return { endpoint };- }- });-- server.route({- url: "/",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- querystring: z.object({- projectId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- endpoints: z.array(- AiMcpEndpointsSchema.extend({- connectedServers: z.number(),- activeTools: z.number(),- piiRequestFiltering: z.boolean().optional(),- piiResponseFiltering: z.boolean().optional(),- piiEntityTypes: z.array(z.string()).nullable().optional()- })- ),- totalCount: z.number()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const endpoints = await server.services.aiMcpEndpoint.listMcpEndpoints({- projectId: req.query.projectId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: req.query.projectId,- event: {- type: EventType.MCP_ENDPOINT_LIST,- metadata: {- count: endpoints.length- }- }- });-- return {- endpoints,- totalCount: endpoints.length- };- }- });-- server.route({- url: "/:endpointId",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- endpoint: AiMcpEndpointsSchema.extend({- connectedServers: z.number(),- activeTools: z.number(),- serverIds: z.array(z.string()),- piiRequestFiltering: z.boolean().optional(),- piiResponseFiltering: z.boolean().optional(),- piiEntityTypes: z.array(z.string()).nullable().optional()- })- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const endpoint = await server.services.aiMcpEndpoint.getMcpEndpointById({- endpointId: req.params.endpointId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: endpoint.projectId,- event: {- type: EventType.MCP_ENDPOINT_GET,- metadata: {- endpointId: endpoint.id,- name: endpoint.name- }- }- });-- return { endpoint };- }- });-- server.route({- url: "/:endpointId",- method: "PATCH",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- body: z.object({- name: z.string().trim().min(1).max(64).optional(),- description: z.string().trim().max(256).optional(),- serverIds: z.array(z.string().uuid()).optional(),- piiRequestFiltering: z.boolean().optional(),- piiResponseFiltering: z.boolean().optional(),- piiEntityTypes: z.array(z.string()).optional()- }),- response: {- 200: z.object({- endpoint: AiMcpEndpointsSchema- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const endpoint = await server.services.aiMcpEndpoint.updateMcpEndpoint({- endpointId: req.params.endpointId,- ...req.body,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: endpoint.projectId,- event: {- type: EventType.MCP_ENDPOINT_UPDATE,- metadata: {- endpointId: endpoint.id,- name: req.body.name,- description: req.body.description,- serverIds: req.body.serverIds,- piiRequestFiltering: req.body.piiRequestFiltering,- piiResponseFiltering: req.body.piiResponseFiltering,- piiEntityTypes: req.body.piiEntityTypes?.join(",")- }- }- });-- return { endpoint };- }- });-- server.route({- url: "/:endpointId",- method: "DELETE",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- endpoint: AiMcpEndpointsSchema- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const endpoint = await server.services.aiMcpEndpoint.deleteMcpEndpoint({- endpointId: req.params.endpointId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: endpoint.projectId,- event: {- type: EventType.MCP_ENDPOINT_DELETE,- metadata: {- endpointId: endpoint.id,- name: endpoint.name- }- }- });-- return { endpoint };- }- });-- server.route({- url: "/:endpointId/tools",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- tools: z.array(AiMcpEndpointServerToolsSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { tools, projectId, endpointName } = await server.services.aiMcpEndpoint.listEndpointTools({- endpointId: req.params.endpointId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_LIST_TOOLS,- metadata: {- endpointId: req.params.endpointId,- endpointName,- toolCount: tools.length- }- }- });-- return { tools };- }- });-- server.route({- url: "/:endpointId/tools/:serverToolId",- method: "POST",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1),- serverToolId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- tool: AiMcpEndpointServerToolsSchema- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { tool, projectId, endpointName, toolName } = await server.services.aiMcpEndpoint.enableEndpointTool({- endpointId: req.params.endpointId,- serverToolId: req.params.serverToolId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_ENABLE_TOOL,- metadata: {- endpointId: req.params.endpointId,- endpointName,- serverToolId: req.params.serverToolId,- toolName- }- }- });-- return { tool };- }- });-- server.route({- url: "/:endpointId/tools/:serverToolId",- method: "DELETE",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1),- serverToolId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- message: z.string()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { projectId, endpointName, toolName } = await server.services.aiMcpEndpoint.disableEndpointTool({- endpointId: req.params.endpointId,- serverToolId: req.params.serverToolId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_DISABLE_TOOL,- metadata: {- endpointId: req.params.endpointId,- endpointName,- serverToolId: req.params.serverToolId,- toolName- }- }- });-- return { message: "Tool disabled" };- }- });-- server.route({- url: "/:endpointId/tools/bulk",- method: "PATCH",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- body: z.object({- tools: z.array(- z.object({- serverToolId: z.string().uuid(),- isEnabled: z.boolean()- })- )- }),- response: {- 200: z.object({- tools: z.array(AiMcpEndpointServerToolsSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { tools, projectId, endpointName } = await server.services.aiMcpEndpoint.bulkUpdateEndpointTools({- endpointId: req.params.endpointId,- tools: req.body.tools,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_BULK_UPDATE_TOOLS,- metadata: {- endpointId: req.params.endpointId,- endpointName,- toolsUpdated: req.body.tools.length- }- }- });-- return { tools };- }- });-- // OAUTH 2.0- server.route({- method: "POST",- url: "/:endpointId/oauth/register",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- body: z.object({- redirect_uris: z.array(- z- .string()- .url()- .refine(- (uri) => uri.startsWith("https://") || uri.startsWith("http://"),- "Redirect URI must start with https:// or http://"- )- ),- token_endpoint_auth_method: z.string(),- grant_types: z.array(z.string()),- response_types: z.array(z.string()),- client_name: z.string(),- client_uri: z.string().optional(),- scope: z.string().optional()- }),- response: {- 200: z.object({- client_id: z.string(),- redirect_uris: z.array(- z- .string()- .url()- .refine(- (uri) => uri.startsWith("https://") || uri.startsWith("http://"),- "Redirect URI must start with https:// or http://"- )- ),- client_name: z.string(),- client_uri: z.string().optional(),- grant_types: z.array(z.string()),- response_types: z.array(z.string()),- token_endpoint_auth_method: z.string(),- client_id_issued_at: z.number()- })- }- },- handler: async (req) => {- const payload = await server.services.aiMcpEndpoint.oauthRegisterClient({- endpointId: req.params.endpointId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: payload.projectId,- event: {- type: EventType.MCP_ENDPOINT_OAUTH_CLIENT_REGISTER,- metadata: {- endpointId: req.params.endpointId,- endpointName: payload.endpointName,- clientId: payload.client_id,- clientName: payload.client_name- }- }- });-- return payload;- }- });-- // OAuth authorize - redirect to scope selection page- server.route({- method: "GET",- url: "/:endpointId/oauth/authorize",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- querystring: z.object({- response_type: z.string(),- client_id: z.string(),- code_challenge: z.string(),- code_challenge_method: z.enum(["S256"]),- redirect_uri: z.string(),- resource: z.string().optional(),- state: z.string().optional()- })- },- handler: async (req, res) => {- await server.services.aiMcpEndpoint.oauthAuthorizeClient({- clientId: req.query.client_id,- state: req.query.state- });- const query = new URLSearchParams({- ...req.query,- endpointId: req.params.endpointId- }).toString();-- void res.redirect(`/organization/mcp-endpoint-finalize?${query}`);- }- });-- server.route({- method: "POST",- url: "/:endpointId/oauth/finalize",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- body: z.object({- response_type: z.string(),- client_id: z.string(),- code_challenge: z.string(),- code_challenge_method: z.enum(["S256"]),- redirect_uri: z- .string()- .url()- .refine(- (uri) => uri.startsWith("https://") || uri.startsWith("http://"),- "Redirect URI must start with https:// or http://"- ),- resource: z.string().optional(),- expireIn: z.string().refine((val) => ms(val) > 0, "Max TTL must be a positive number")- }),- response: {- 200: z.object({- callbackUrl: z.string()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const userInfo = req.auth.authMode === AuthMode.JWT ? req.auth.user : null;- if (!userInfo) throw new BadRequestError({ message: "User info not found" });-- const {- url: redirectUri,- projectId,- endpointName,- clientId- } = await server.services.aiMcpEndpoint.oauthFinalize({- endpointId: req.params.endpointId,- clientId: req.body.client_id,- codeChallenge: req.body.code_challenge,- codeChallengeMethod: req.body.code_challenge_method,- redirectUri: req.body.redirect_uri,- resource: req.body.resource,- responseType: req.body.response_type,- tokenId: req.auth.authMode === AuthMode.JWT ? req.auth.tokenVersionId : "",- userInfo,- expiry: req.body.expireIn,- permission: req.permission,- userAgent: req.auditLogInfo.userAgent || "",- userIp: req.auditLogInfo.ipAddress || ""- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_OAUTH_AUTHORIZE,- metadata: {- endpointId: req.params.endpointId,- endpointName,- clientId- }- }- });-- return { callbackUrl: redirectUri.toString() };- }- });-- server.route({- method: "POST",- url: "/:endpointId/oauth/token",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- body: z.object({- grant_type: z.literal("authorization_code"),- code: z.string(),- redirect_uri: z.string().url(),- code_verifier: z.string(),- client_id: z.string(),- resource: z.string().optional()- }),- response: {- 200: z.object({- access_token: z.string(),- token_type: z.string(),- expires_in: z.number(),- scope: z.string()- })- }- },- handler: async (req) => {- const payload = await server.services.aiMcpEndpoint.oauthTokenExchange({- endpointId: req.params.endpointId,- ...req.body- });- return payload;- }- });-- // Get servers requiring personal authentication- server.route({- method: "GET",- url: "/:endpointId/servers-requiring-auth",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- servers: z.array(- z.object({- id: z.string(),- name: z.string(),- url: z.string(),- hasCredentials: z.boolean(),- authMethod: z.string()- })- )- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const servers = await server.services.aiMcpEndpoint.getServersRequiringAuth({- endpointId: req.params.endpointId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- return { servers };- }- });-- // Initiate OAuth for a server (personal credential mode)- server.route({- method: "POST",- url: "/:endpointId/servers/:serverId/oauth/initiate",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1),- serverId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- authUrl: z.string(),- sessionId: z.string()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const result = await server.services.aiMcpEndpoint.initiateServerOAuth({- endpointId: req.params.endpointId,- serverId: req.params.serverId,- actorId: req.permission.id,- actor: req.permission.type,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- return result;- }- });-- // Verify bearer token against MCP server- server.route({- method: "POST",- url: "/:endpointId/servers/:serverId/verify-token",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1),- serverId: z.string().uuid().trim().min(1)- }),- body: z.object({- accessToken: z.string().min(1)- }),- response: {- 200: z.object({- valid: z.boolean(),- message: z.string().optional()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const result = await server.services.aiMcpEndpoint.verifyServerBearerToken({- endpointId: req.params.endpointId,- serverId: req.params.serverId,- accessToken: req.body.accessToken,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- return result;- }- });-- // Save user credentials after OAuth completes- server.route({- method: "POST",- url: "/:endpointId/servers/:serverId/credentials",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- endpointId: z.string().uuid().trim().min(1),- serverId: z.string().uuid().trim().min(1)- }),- body: z.object({- accessToken: z.string().min(1),- refreshToken: z.string().optional(),- expiresAt: z.number().optional(),- tokenType: z.string().optional()- }),- response: {- 200: z.object({- success: z.boolean()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { success, projectId, endpointName, serverName } =- await server.services.aiMcpEndpoint.saveUserServerCredential({- endpointId: req.params.endpointId,- serverId: req.params.serverId,- ...req.body,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_ENDPOINT_SAVE_USER_CREDENTIAL,- metadata: {- endpointId: req.params.endpointId,- endpointName,- serverId: req.params.serverId,- serverName- }- }- });-- return { success };- }- });-};diff --git a/backend/src/ee/routes/v1/ai-mcp-server-router.ts b/backend/src/ee/routes/v1/ai-mcp-server-router.tsdeleted file mode 100644index e2ae794e70..0000000000--- a/backend/src/ee/routes/v1/ai-mcp-server-router.ts+++ /dev/null@@ -1,477 +0,0 @@-import { z } from "zod";--import { AiMcpServerToolsSchema } from "@app/db/schemas/ai-mcp-server-tools";-import { AiMcpServersSchema } from "@app/db/schemas/ai-mcp-servers";-import { AiMcpServerAuthMethod, AiMcpServerCredentialMode } from "@app/ee/services/ai-mcp-server/ai-mcp-server-enum";-import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { readLimit, writeLimit } from "@app/server/config/rateLimiter";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";--// Common fields for MCP server creation-const CreateMcpServerBaseSchema = z.object({- projectId: z.string().uuid().trim().min(1),- name: z.string().trim().min(1).max(64),- url: z.string().trim().url(),- description: z.string().trim().max(256).optional(),- credentialMode: z.nativeEnum(AiMcpServerCredentialMode),- oauthClientId: z.string().trim().min(1).optional(),- oauthClientSecret: z.string().trim().min(1).optional(),- gatewayId: z.string().uuid().optional()-});--const McpServerCredentialsSchema = z.discriminatedUnion("authMethod", [- z.object({- authMethod: z.literal(AiMcpServerAuthMethod.BASIC),- credentials: z.object({- username: z.string().min(1),- password: z.string().min(1)- })- }),- z.object({- authMethod: z.literal(AiMcpServerAuthMethod.BEARER),- credentials: z.object({- token: z.string().min(1)- })- }),- z.object({- authMethod: z.literal(AiMcpServerAuthMethod.OAUTH),- credentials: z.object({- accessToken: z.string().min(1),- refreshToken: z.string().optional(),- expiresAt: z.number().optional(),- tokenType: z.string().optional()- })- })-]);--export const registerAiMcpServerRouter = async (server: FastifyZodProvider) => {- server.route({- url: "/oauth/initiate",- method: "POST",- config: {- rateLimit: writeLimit- },- schema: {- body: z.object({- projectId: z.string().uuid().trim().min(1),- url: z.string().trim().url(),- clientId: z.string().trim().min(1).optional(),- clientSecret: z.string().trim().min(1).optional(),- gatewayId: z.string().uuid().optional()- }),- response: {- 200: z.object({- authUrl: z.string(),- sessionId: z.string()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const result = await server.services.aiMcpServer.initiateOAuth({- projectId: req.body.projectId,- url: req.body.url,- clientId: req.body.clientId,- clientSecret: req.body.clientSecret,- gatewayId: req.body.gatewayId,- actorId: req.permission.id,- actor: req.permission.type,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- return result;- }- });-- // OAuth: Callback (redirect from MCP server)- server.route({- url: "/oauth/callback",- method: "GET",- config: {- rateLimit: writeLimit- },- schema: {- querystring: z.object({- code: z.string(),- state: z.string() // session ID- })- },- handler: async (req, res) => {- const { code, state: sessionId } = req.query;-- try {- await server.services.aiMcpServer.handleOAuthCallback({- sessionId,- code- });-- // Return HTML that closes the popup immediately- return await res.type("text/html").send(`- <!DOCTYPE html>- <html>- <head><title>OAuth Complete</title></head>- <body>- <script>window.close();</script>- </body>- </html>- `);- } catch {- // Return error HTML that closes immediately- return res.type("text/html").send(`- <!DOCTYPE html>- <html>- <head><title>OAuth Error</title></head>- <body>- <script>window.close();</script>- </body>- </html>- `);- }- }- });-- server.route({- url: "/oauth/status/:sessionId",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- sessionId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- authorized: z.boolean(),- accessToken: z.string().optional(),- refreshToken: z.string().optional(),- expiresAt: z.number().optional(),- tokenType: z.string().optional(),- clientId: z.string().optional(),- clientSecret: z.string().optional()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const result = await server.services.aiMcpServer.getOAuthStatus({- sessionId: req.params.sessionId,- actorId: req.permission.id,- actor: req.permission.type,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- return result;- }- });-- // Create MCP Server- server.route({- url: "/",- method: "POST",- config: {- rateLimit: writeLimit- },- schema: {- body: CreateMcpServerBaseSchema.and(McpServerCredentialsSchema),- response: {- 200: z.object({- server: AiMcpServersSchema.omit({ encryptedCredentials: true, encryptedOauthConfig: true })- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const mcpServer = await server.services.aiMcpServer.createMcpServer({- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: req.body.projectId,- event: {- type: EventType.MCP_SERVER_CREATE,- metadata: {- serverId: mcpServer.id,- name: mcpServer.name,- url: mcpServer.url,- credentialMode: req.body.credentialMode,- authMethod: req.body.authMethod- }- }- });-- return { server: mcpServer };- }- });-- server.route({- url: "/",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- querystring: z.object({- projectId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- servers: z.array(AiMcpServersSchema.omit({ encryptedCredentials: true, encryptedOauthConfig: true })),- totalCount: z.number()- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const mcpServers = await server.services.aiMcpServer.listMcpServers({- projectId: req.query.projectId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: req.query.projectId,- event: {- type: EventType.MCP_SERVER_LIST,- metadata: {- count: mcpServers.length- }- }- });-- return {- servers: mcpServers,- totalCount: mcpServers.length- };- }- });-- server.route({- url: "/:serverId",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- serverId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- server: AiMcpServersSchema.omit({ encryptedCredentials: true, encryptedOauthConfig: true })- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const mcpServer = await server.services.aiMcpServer.getMcpServerById({- serverId: req.params.serverId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: mcpServer.projectId,- event: {- type: EventType.MCP_SERVER_GET,- metadata: {- serverId: mcpServer.id,- name: mcpServer.name- }- }- });-- return { server: mcpServer };- }- });-- server.route({- url: "/:serverId",- method: "PATCH",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- serverId: z.string().uuid().trim().min(1)- }),- body: z.object({- name: z.string().trim().min(1).max(64).optional(),- description: z.string().trim().max(256).optional(),- gatewayId: z.string().uuid().nullable().optional()- }),- response: {- 200: z.object({- server: AiMcpServersSchema.omit({ encryptedCredentials: true, encryptedOauthConfig: true })- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const mcpServer = await server.services.aiMcpServer.updateMcpServer({- serverId: req.params.serverId,- ...req.body,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: mcpServer.projectId,- event: {- type: EventType.MCP_SERVER_UPDATE,- metadata: {- serverId: mcpServer.id,- name: mcpServer.name- }- }- });-- return { server: mcpServer };- }- });-- server.route({- url: "/:serverId/tools",- method: "GET",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- serverId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- tools: z.array(AiMcpServerToolsSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { tools, projectId, serverName } = await server.services.aiMcpServer.listMcpServerTools({- serverId: req.params.serverId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_SERVER_LIST_TOOLS,- metadata: {- serverId: req.params.serverId,- serverName,- toolCount: tools.length- }- }- });-- return { tools };- }- });-- server.route({- url: "/:serverId/tools/sync",- method: "POST",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- serverId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- tools: z.array(AiMcpServerToolsSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const { tools, projectId, serverName } = await server.services.aiMcpServer.syncMcpServerTools({- serverId: req.params.serverId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.MCP_SERVER_SYNC_TOOLS,- metadata: {- serverId: req.params.serverId,- serverName,- toolCount: tools.length- }- }- });-- return { tools };- }- });-- server.route({- url: "/:serverId",- method: "DELETE",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- serverId: z.string().uuid().trim().min(1)- }),- response: {- 200: z.object({- server: AiMcpServersSchema.omit({ encryptedCredentials: true, encryptedOauthConfig: true })- })- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const mcpServer = await server.services.aiMcpServer.deleteMcpServer({- serverId: req.params.serverId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: mcpServer.projectId,- event: {- type: EventType.MCP_SERVER_DELETE,- metadata: {- serverId: mcpServer.id,- name: mcpServer.name- }- }- });-- return { server: mcpServer };- }- });-};diff --git a/backend/src/ee/routes/v1/index.ts b/backend/src/ee/routes/v1/index.tsindex da75b774fc..1a621cf7bf 100644--- a/backend/src/ee/routes/v1/index.ts+++ b/backend/src/ee/routes/v1/index.ts@@ -5,9 +5,6 @@ import { injectCertManagerProjectId } from "@app/server/plugins/inject-cert-manaimport { registerAccessApprovalPolicyRouter } from "./access-approval-policy-router";import { registerAccessApprovalRequestRouter } from "./access-approval-request-router";import { registerAgentProxyCaRouter } from "./agent-proxy-ca-router";-import { registerAiMcpActivityLogRouter } from "./ai-mcp-activity-log-router";-import { registerAiMcpEndpointRouter } from "./ai-mcp-endpoint-router";-import { registerAiMcpServerRouter } from "./ai-mcp-server-router";import { registerAssumePrivilegeRouter } from "./assume-privilege-router";import { AUDIT_LOG_STREAM_REGISTER_ROUTER_MAP, registerAuditLogStreamRouter } from "./audit-log-stream-routers";import { registerCaCrlRouter } from "./certificate-authority-crl-router";@@ -46,17 +43,13 @@ import { registerProjectRouter } from "./project-router";import { registerProxiedServiceRouter } from "./proxied-service-router";import { registerRateLimitRouter } from "./rate-limit-router";import { registerRelayRouter } from "./relay-router";+import { registerRemovedProductTombstoneRouter } from "./removed-product-tombstone-router";import { registerSamlRouter } from "./saml-router";import { registerScimRouter } from "./scim-router";import { registerSecretApprovalRequestRouter } from "./secret-approval-request-router";import { registerSecretRouter } from "./secret-router";import { registerSecretScanningRouter } from "./secret-scanning-router";import { registerSecretVersionRouter } from "./secret-version-router";-import { registerSshCaRouter } from "./ssh-certificate-authority-router";-import { registerSshCertRouter } from "./ssh-certificate-router";-import { registerSshCertificateTemplateRouter } from "./ssh-certificate-template-router";-import { registerSshHostGroupRouter } from "./ssh-host-group-router";-import { registerSshHostRouter } from "./ssh-host-router";import { registerSubOrgRouter } from "./sub-org-router";import { registerTrustedIpRouter } from "./trusted-ip-router";import { registerUserAdditionalPrivilegeRouter } from "./user-additional-privilege-router";@@ -130,16 +123,20 @@ export const registerV1EERoutes = async (server: FastifyZodProvider) => {{ prefix: "/cert-manager" });+ // 410 tombstones for the removed SSH and Agent Sentinel (AI MCP) products; see+ // the router file for rationale and removal conditions.await server.register(- async (sshRouter) => {- await sshRouter.register(registerSshCaRouter, { prefix: "/ca" });- await sshRouter.register(registerSshCertRouter, { prefix: "/certificates" });- await sshRouter.register(registerSshCertificateTemplateRouter, { prefix: "/certificate-templates" });- await sshRouter.register(registerSshHostRouter, { prefix: "/hosts" });- await sshRouter.register(registerSshHostGroupRouter, { prefix: "/host-groups" });- },+ registerRemovedProductTombstoneRouter(+ "The Infisical SSH product has been removed. SSH host access is now available through Infisical PAM (https://infisical.com/docs/documentation/platform/pam/overview). If you are using 'infisical ssh' CLI commands, upgrade to the latest CLI version."+ ),{ prefix: "/ssh" });+ await server.register(+ registerRemovedProductTombstoneRouter(+ "The Infisical Agent Sentinel (MCP) product has been removed. See Agent Proxy for agent traffic management (https://infisical.com/docs/documentation/platform/agent-proxy/overview)."+ ),+ { prefix: "/ai/mcp" }+ );await server.register(async (ssoRouter) => {@@ -204,14 +201,5 @@ export const registerV1EERoutes = async (server: FastifyZodProvider) => {{ prefix: "/kmip" });- await server.register(- async (aiRouter) => {- await aiRouter.register(registerAiMcpServerRouter, { prefix: "/mcp/servers" });- await aiRouter.register(registerAiMcpEndpointRouter, { prefix: "/mcp/endpoints" });- await aiRouter.register(registerAiMcpActivityLogRouter, { prefix: "/mcp/activity-logs" });- },- { prefix: "/ai" }- );-await server.register(registerPamRouters, { prefix: "/pam" });};diff --git a/backend/src/ee/routes/v1/ssh-certificate-authority-router.ts b/backend/src/ee/routes/v1/ssh-certificate-authority-router.tsdeleted file mode 100644index e20d492637..0000000000--- a/backend/src/ee/routes/v1/ssh-certificate-authority-router.ts+++ /dev/null@@ -1,312 +0,0 @@-import { z } from "zod";--import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { normalizeSshPrivateKey } from "@app/ee/services/ssh/ssh-certificate-authority-fns";-import { sanitizedSshCa } from "@app/ee/services/ssh/ssh-certificate-authority-schema";-import { SshCaKeySource, SshCaStatus } from "@app/ee/services/ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { sanitizedSshCertificateTemplate } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-schema";-import { ApiDocsTags, SSH_CERTIFICATE_AUTHORITIES } from "@app/lib/api-docs";-import { readLimit, writeLimit } from "@app/server/config/rateLimiter";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";--export const registerSshCaRouter = async (server: FastifyZodProvider) => {- server.route({- method: "POST",- url: "/",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- description: "Create SSH CA",- body: z- .object({- projectId: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.projectId),- friendlyName: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.friendlyName),- keyAlgorithm: z- .nativeEnum(SshCertKeyAlgorithm)- .default(SshCertKeyAlgorithm.ED25519)- .describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.keyAlgorithm),- publicKey: z.string().trim().optional().describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.publicKey),- privateKey: z- .string()- .trim()- .optional()- .transform((val) => (val ? normalizeSshPrivateKey(val) : undefined))- .describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.privateKey),- keySource: z- .nativeEnum(SshCaKeySource)- .default(SshCaKeySource.INTERNAL)- .describe(SSH_CERTIFICATE_AUTHORITIES.CREATE.keySource)- })- .refine((data) => data.keySource === SshCaKeySource.INTERNAL || (!!data.publicKey && !!data.privateKey), {- message: "publicKey and privateKey are required when keySource is external",- path: ["publicKey"]- })- .refine((data) => data.keySource === SshCaKeySource.EXTERNAL || !!data.keyAlgorithm, {- message: "keyAlgorithm is required when keySource is internal",- path: ["keyAlgorithm"]- }),- response: {- 200: z.object({- ca: sanitizedSshCa.extend({- publicKey: z.string()- })- })- }- },- handler: async (req) => {- const ca = await server.services.sshCertificateAuthority.createSshCa({- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: ca.projectId,- event: {- type: EventType.CREATE_SSH_CA,- metadata: {- sshCaId: ca.id,- friendlyName: ca.friendlyName- }- }- });-- return {- ca- };- }- });-- server.route({- method: "GET",- url: "/:sshCaId",- config: {- rateLimit: readLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- description: "Get SSH CA",- params: z.object({- sshCaId: z.string().trim().describe(SSH_CERTIFICATE_AUTHORITIES.GET.sshCaId)- }),- response: {- 200: z.object({- ca: sanitizedSshCa.extend({- publicKey: z.string()- })- })- }- },- handler: async (req) => {- const ca = await server.services.sshCertificateAuthority.getSshCaById({- caId: req.params.sshCaId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: ca.projectId,- event: {- type: EventType.GET_SSH_CA,- metadata: {- sshCaId: ca.id,- friendlyName: ca.friendlyName- }- }- });-- return {- ca- };- }- });-- server.route({- method: "GET",- url: "/:sshCaId/public-key",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- description: "Get public key of SSH CA",- params: z.object({- sshCaId: z.string().trim().describe(SSH_CERTIFICATE_AUTHORITIES.GET_PUBLIC_KEY.sshCaId)- }),- response: {- 200: z.string()- }- },- handler: async (req) => {- const publicKey = await server.services.sshCertificateAuthority.getSshCaPublicKey({- caId: req.params.sshCaId- });-- return publicKey;- }- });-- server.route({- method: "PATCH",- url: "/:sshCaId",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- description: "Update SSH CA",- params: z.object({- sshCaId: z.string().trim().describe(SSH_CERTIFICATE_AUTHORITIES.UPDATE.sshCaId)- }),- body: z.object({- friendlyName: z.string().optional().describe(SSH_CERTIFICATE_AUTHORITIES.UPDATE.friendlyName),- status: z.nativeEnum(SshCaStatus).optional().describe(SSH_CERTIFICATE_AUTHORITIES.UPDATE.status)- }),- response: {- 200: z.object({- ca: sanitizedSshCa.extend({- publicKey: z.string()- })- })- }- },- handler: async (req) => {- const ca = await server.services.sshCertificateAuthority.updateSshCaById({- caId: req.params.sshCaId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: ca.projectId,- event: {- type: EventType.UPDATE_SSH_CA,- metadata: {- sshCaId: ca.id,- friendlyName: ca.friendlyName,- status: ca.status as SshCaStatus- }- }- });-- return {- ca- };- }- });-- server.route({- method: "DELETE",- url: "/:sshCaId",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- description: "Delete SSH CA",- params: z.object({- sshCaId: z.string().trim().describe(SSH_CERTIFICATE_AUTHORITIES.DELETE.sshCaId)- }),- response: {- 200: z.object({- ca: sanitizedSshCa- })- }- },- handler: async (req) => {- const ca = await server.services.sshCertificateAuthority.deleteSshCaById({- caId: req.params.sshCaId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: ca.projectId,- event: {- type: EventType.DELETE_SSH_CA,- metadata: {- sshCaId: ca.id,- friendlyName: ca.friendlyName- }- }- });-- return {- ca- };- }- });-- server.route({- method: "GET",- url: "/:sshCaId/certificate-templates",- config: {- rateLimit: readLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- description: "Get list of certificate templates for the SSH CA",- params: z.object({- sshCaId: z.string().trim().describe(SSH_CERTIFICATE_AUTHORITIES.GET_CERTIFICATE_TEMPLATES.sshCaId)- }),- response: {- 200: z.object({- certificateTemplates: sanitizedSshCertificateTemplate.array()- })- }- },- handler: async (req) => {- const { certificateTemplates, ca } = await server.services.sshCertificateAuthority.getSshCaCertificateTemplates({- caId: req.params.sshCaId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: ca.projectId,- event: {- type: EventType.GET_SSH_CA_CERTIFICATE_TEMPLATES,- metadata: {- sshCaId: ca.id,- friendlyName: ca.friendlyName- }- }- });-- return {- certificateTemplates- };- }- });-};diff --git a/backend/src/ee/routes/v1/ssh-certificate-router.ts b/backend/src/ee/routes/v1/ssh-certificate-router.tsdeleted file mode 100644index 4706e992d4..0000000000--- a/backend/src/ee/routes/v1/ssh-certificate-router.ts+++ /dev/null@@ -1,192 +0,0 @@-import { z } from "zod";--import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { SshCertType } from "@app/ee/services/ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { ApiDocsTags, SSH_CERTIFICATE_AUTHORITIES } from "@app/lib/api-docs";-import { ms } from "@app/lib/ms";-import { writeLimit } from "@app/server/config/rateLimiter";-import { getTelemetryDistinctId } from "@app/server/lib/telemetry";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";-import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";--export const registerSshCertRouter = async (server: FastifyZodProvider) => {- server.route({- method: "POST",- url: "/sign",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificates],- description: "Sign SSH public key",- body: z.object({- certificateTemplateId: z- .string()- .trim()- .min(1)- .describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.certificateTemplateId),- publicKey: z.string().trim().describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.publicKey),- certType: z- .nativeEnum(SshCertType)- .default(SshCertType.USER)- .describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.certType),- principals: z- .array(z.string().transform((val) => val.trim()))- .nonempty("Principals array must not be empty")- .describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.principals),- ttl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .optional()- .describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.ttl),- keyId: z.string().trim().max(50).optional().describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.keyId)- }),- response: {- 200: z.object({- serialNumber: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.serialNumber),- signedKey: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.SIGN_SSH_KEY.signedKey)- })- }- },- handler: async (req) => {- const { serialNumber, signedPublicKey, certificateTemplate, ttl, keyId } =- await server.services.sshCertificateAuthority.signSshKey({- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- orgId: req.permission.orgId,- event: {- type: EventType.SIGN_SSH_KEY,- metadata: {- certificateTemplateId: certificateTemplate.id,- certType: req.body.certType,- principals: req.body.principals,- ttl: String(ttl),- keyId- }- }- });-- await server.services.telemetry.sendPostHogEvents({- event: PostHogEventTypes.SignSshKey,- distinctId: getTelemetryDistinctId(req),- organizationId: req.permission.orgId,- properties: {- certificateTemplateId: req.body.certificateTemplateId,- principals: req.body.principals,- ...req.auditLogInfo- }- });-- return {- serialNumber,- signedKey: signedPublicKey- };- }- });-- server.route({- method: "POST",- url: "/issue",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificates],- description: "Issue SSH credentials (certificate + key)",- body: z.object({- certificateTemplateId: z- .string()- .trim()- .min(1)- .describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.certificateTemplateId),- keyAlgorithm: z- .nativeEnum(SshCertKeyAlgorithm)- .default(SshCertKeyAlgorithm.ED25519)- .describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.keyAlgorithm),- certType: z- .nativeEnum(SshCertType)- .default(SshCertType.USER)- .describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.certType),- principals: z- .array(z.string().transform((val) => val.trim()))- .nonempty("Principals array must not be empty")- .describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.principals),- ttl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .optional()- .describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.ttl),- keyId: z.string().trim().max(50).optional().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.keyId)- }),- response: {- 200: z.object({- serialNumber: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.serialNumber),- signedKey: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.signedKey),- privateKey: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.privateKey),- publicKey: z.string().describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.publicKey),- keyAlgorithm: z- .nativeEnum(SshCertKeyAlgorithm)- .describe(SSH_CERTIFICATE_AUTHORITIES.ISSUE_SSH_CREDENTIALS.keyAlgorithm)- })- }- },- handler: async (req) => {- const { serialNumber, signedPublicKey, privateKey, publicKey, certificateTemplate, ttl, keyId } =- await server.services.sshCertificateAuthority.issueSshCreds({- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- orgId: req.permission.orgId,- event: {- type: EventType.ISSUE_SSH_CREDS,- metadata: {- certificateTemplateId: certificateTemplate.id,- keyAlgorithm: req.body.keyAlgorithm,- certType: req.body.certType,- principals: req.body.principals,- ttl: String(ttl),- keyId- }- }- });-- await server.services.telemetry.sendPostHogEvents({- event: PostHogEventTypes.IssueSshCreds,- distinctId: getTelemetryDistinctId(req),- organizationId: req.permission.orgId,- properties: {- certificateTemplateId: req.body.certificateTemplateId,- principals: req.body.principals,- ...req.auditLogInfo- }- });-- return {- serialNumber,- signedKey: signedPublicKey,- privateKey,- publicKey,- keyAlgorithm: req.body.keyAlgorithm- };- }- });-};diff --git a/backend/src/ee/routes/v1/ssh-certificate-template-router.ts b/backend/src/ee/routes/v1/ssh-certificate-template-router.tsdeleted file mode 100644index 26e8cad3b6..0000000000--- a/backend/src/ee/routes/v1/ssh-certificate-template-router.ts+++ /dev/null@@ -1,266 +0,0 @@-import slugify from "@sindresorhus/slugify";-import { z } from "zod";--import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { sanitizedSshCertificateTemplate } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-schema";-import { SshCertTemplateStatus } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-types";-import {- isValidHostPattern,- isValidUserPattern-} from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-validators";-import { ApiDocsTags, SSH_CERTIFICATE_TEMPLATES } from "@app/lib/api-docs";-import { ms } from "@app/lib/ms";-import { readLimit, writeLimit } from "@app/server/config/rateLimiter";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";--export const registerSshCertificateTemplateRouter = async (server: FastifyZodProvider) => {- server.route({- method: "GET",- url: "/:certificateTemplateId",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateTemplates],- params: z.object({- certificateTemplateId: z.string().describe(SSH_CERTIFICATE_TEMPLATES.GET.certificateTemplateId)- }),- response: {- 200: sanitizedSshCertificateTemplate- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const certificateTemplate = await server.services.sshCertificateTemplate.getSshCertTemplate({- id: req.params.certificateTemplateId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: certificateTemplate.projectId,- event: {- type: EventType.GET_SSH_CERTIFICATE_TEMPLATE,- metadata: {- certificateTemplateId: certificateTemplate.id- }- }- });-- return certificateTemplate;- }- });-- server.route({- method: "POST",- url: "/",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateTemplates],- body: z- .object({- sshCaId: z.string().describe(SSH_CERTIFICATE_TEMPLATES.CREATE.sshCaId),- name: z- .string()- .min(1)- .max(36)- .refine((v) => slugify(v) === v, {- message: "Name must be a valid slug"- })- .describe(SSH_CERTIFICATE_TEMPLATES.CREATE.name),- ttl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .default("1h")- .describe(SSH_CERTIFICATE_TEMPLATES.CREATE.ttl),- maxTTL: z- .string()- .refine((val) => ms(val) > 0, "Max TTL must be a positive number")- .default("30d")- .describe(SSH_CERTIFICATE_TEMPLATES.CREATE.maxTTL),- allowedUsers: z- .array(z.string().refine(isValidUserPattern, "Invalid user pattern"))- .describe(SSH_CERTIFICATE_TEMPLATES.CREATE.allowedUsers),- allowedHosts: z- .array(z.string().refine(isValidHostPattern, "Invalid host pattern"))- .describe(SSH_CERTIFICATE_TEMPLATES.CREATE.allowedHosts),- allowUserCertificates: z.boolean().describe(SSH_CERTIFICATE_TEMPLATES.CREATE.allowUserCertificates),- allowHostCertificates: z.boolean().describe(SSH_CERTIFICATE_TEMPLATES.CREATE.allowHostCertificates),- allowCustomKeyIds: z.boolean().describe(SSH_CERTIFICATE_TEMPLATES.CREATE.allowCustomKeyIds)- })- .refine((data) => ms(data.maxTTL) >= ms(data.ttl), {- message: "Max TTL must be greater than or equal to TTL",- path: ["maxTTL"]- }),- response: {- 200: sanitizedSshCertificateTemplate- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { certificateTemplate, ca } = await server.services.sshCertificateTemplate.createSshCertTemplate({- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: ca.projectId,- event: {- type: EventType.CREATE_SSH_CERTIFICATE_TEMPLATE,- metadata: {- certificateTemplateId: certificateTemplate.id,- sshCaId: ca.id,- name: certificateTemplate.name,- ttl: certificateTemplate.ttl,- maxTTL: certificateTemplate.maxTTL,- allowedUsers: certificateTemplate.allowedUsers,- allowedHosts: certificateTemplate.allowedHosts,- allowUserCertificates: certificateTemplate.allowUserCertificates,- allowHostCertificates: certificateTemplate.allowHostCertificates,- allowCustomKeyIds: certificateTemplate.allowCustomKeyIds- }- }- });-- return certificateTemplate;- }- });-- server.route({- method: "PATCH",- url: "/:certificateTemplateId",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateTemplates],- body: z.object({- status: z.nativeEnum(SshCertTemplateStatus).optional(),- name: z- .string()- .min(1)- .max(36)- .refine((v) => slugify(v) === v, {- message: "Slug must be a valid slug"- })- .optional()- .describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.name),- ttl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .optional()- .describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.ttl),- maxTTL: z- .string()- .refine((val) => ms(val) > 0, "Max TTL must be a positive number")- .optional()- .describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.maxTTL),- allowedUsers: z- .array(z.string().refine(isValidUserPattern, "Invalid user pattern"))- .optional()- .describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.allowedUsers),- allowedHosts: z- .array(z.string().refine(isValidHostPattern, "Invalid host pattern"))- .optional()- .describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.allowedHosts),- allowUserCertificates: z.boolean().optional().describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.allowUserCertificates),- allowHostCertificates: z.boolean().optional().describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.allowHostCertificates),- allowCustomKeyIds: z.boolean().optional().describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.allowCustomKeyIds)- }),- params: z.object({- certificateTemplateId: z.string().describe(SSH_CERTIFICATE_TEMPLATES.UPDATE.certificateTemplateId)- }),- response: {- 200: sanitizedSshCertificateTemplate- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { certificateTemplate, projectId } = await server.services.sshCertificateTemplate.updateSshCertTemplate({- ...req.body,- id: req.params.certificateTemplateId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId,- event: {- type: EventType.UPDATE_SSH_CERTIFICATE_TEMPLATE,- metadata: {- status: certificateTemplate.status as SshCertTemplateStatus,- certificateTemplateId: certificateTemplate.id,- sshCaId: certificateTemplate.sshCaId,- name: certificateTemplate.name,- ttl: certificateTemplate.ttl,- maxTTL: certificateTemplate.maxTTL,- allowedUsers: certificateTemplate.allowedUsers,- allowedHosts: certificateTemplate.allowedHosts,- allowUserCertificates: certificateTemplate.allowUserCertificates,- allowHostCertificates: certificateTemplate.allowHostCertificates,- allowCustomKeyIds: certificateTemplate.allowCustomKeyIds- }- }- });-- return certificateTemplate;- }- });-- server.route({- method: "DELETE",- url: "/:certificateTemplateId",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateTemplates],- params: z.object({- certificateTemplateId: z.string().describe(SSH_CERTIFICATE_TEMPLATES.DELETE.certificateTemplateId)- }),- response: {- 200: sanitizedSshCertificateTemplate- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const certificateTemplate = await server.services.sshCertificateTemplate.deleteSshCertTemplate({- id: req.params.certificateTemplateId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: certificateTemplate.projectId,- event: {- type: EventType.DELETE_SSH_CERTIFICATE_TEMPLATE,- metadata: {- certificateTemplateId: certificateTemplate.id- }- }- });-- return certificateTemplate;- }- });-};diff --git a/backend/src/ee/routes/v1/ssh-host-group-router.ts b/backend/src/ee/routes/v1/ssh-host-group-router.tsdeleted file mode 100644index c6f35c7e1f..0000000000--- a/backend/src/ee/routes/v1/ssh-host-group-router.ts+++ /dev/null@@ -1,360 +0,0 @@-import { z } from "zod";--import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { loginMappingSchema, sanitizedSshHost } from "@app/ee/services/ssh-host/ssh-host-schema";-import { sanitizedSshHostGroup } from "@app/ee/services/ssh-host-group/ssh-host-group-schema";-import { EHostGroupMembershipFilter } from "@app/ee/services/ssh-host-group/ssh-host-group-types";-import { ApiDocsTags, SSH_HOST_GROUPS } from "@app/lib/api-docs";-import { readLimit, writeLimit } from "@app/server/config/rateLimiter";-import { slugSchema } from "@app/server/lib/schemas";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";--export const registerSshHostGroupRouter = async (server: FastifyZodProvider) => {- server.route({- method: "GET",- url: "/:sshHostGroupId",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Get SSH Host Group",- params: z.object({- sshHostGroupId: z.string().describe(SSH_HOST_GROUPS.GET.sshHostGroupId)- }),- response: {- 200: sanitizedSshHostGroup.extend({- loginMappings: z.array(loginMappingSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshHostGroup = await server.services.sshHostGroup.getSshHostGroup({- sshHostGroupId: req.params.sshHostGroupId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHostGroup.projectId,- event: {- type: EventType.GET_SSH_HOST_GROUP,- metadata: {- sshHostGroupId: sshHostGroup.id,- name: sshHostGroup.name- }- }- });-- return sshHostGroup;- }- });-- server.route({- method: "POST",- url: "/",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Create SSH Host Group",- body: z.object({- projectId: z.string().describe(SSH_HOST_GROUPS.CREATE.projectId),- name: slugSchema({ min: 1, max: 64, field: "name" }).describe(SSH_HOST_GROUPS.CREATE.name),- loginMappings: z.array(loginMappingSchema).default([]).describe(SSH_HOST_GROUPS.CREATE.loginMappings)- }),- response: {- 200: sanitizedSshHostGroup.extend({- loginMappings: z.array(loginMappingSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshHostGroup = await server.services.sshHostGroup.createSshHostGroup({- ...req.body,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHostGroup.projectId,- event: {- type: EventType.CREATE_SSH_HOST_GROUP,- metadata: {- sshHostGroupId: sshHostGroup.id,- name: sshHostGroup.name,- loginMappings: sshHostGroup.loginMappings- }- }- });-- return sshHostGroup;- }- });-- server.route({- method: "PATCH",- url: "/:sshHostGroupId",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Update SSH Host Group",- params: z.object({- sshHostGroupId: z.string().trim().describe(SSH_HOST_GROUPS.UPDATE.sshHostGroupId)- }),- body: z.object({- name: slugSchema({ min: 1, max: 64, field: "name" }).describe(SSH_HOST_GROUPS.UPDATE.name).optional(),- loginMappings: z.array(loginMappingSchema).optional().describe(SSH_HOST_GROUPS.UPDATE.loginMappings)- }),- response: {- 200: sanitizedSshHostGroup.extend({- loginMappings: z.array(loginMappingSchema)- })- }- },- handler: async (req) => {- const sshHostGroup = await server.services.sshHostGroup.updateSshHostGroup({- sshHostGroupId: req.params.sshHostGroupId,- ...req.body,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHostGroup.projectId,- event: {- type: EventType.UPDATE_SSH_HOST_GROUP,- metadata: {- sshHostGroupId: sshHostGroup.id,- name: sshHostGroup.name,- loginMappings: sshHostGroup.loginMappings- }- }- });-- return sshHostGroup;- }- });-- server.route({- method: "DELETE",- url: "/:sshHostGroupId",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Delete SSH Host Group",- params: z.object({- sshHostGroupId: z.string().describe(SSH_HOST_GROUPS.DELETE.sshHostGroupId)- }),- response: {- 200: sanitizedSshHostGroup.extend({- loginMappings: z.array(loginMappingSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshHostGroup = await server.services.sshHostGroup.deleteSshHostGroup({- sshHostGroupId: req.params.sshHostGroupId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHostGroup.projectId,- event: {- type: EventType.DELETE_SSH_HOST_GROUP,- metadata: {- sshHostGroupId: sshHostGroup.id,- name: sshHostGroup.name- }- }- });-- return sshHostGroup;- }- });-- server.route({- method: "GET",- url: "/:sshHostGroupId/hosts",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Get SSH Hosts in a Host Group",- params: z.object({- sshHostGroupId: z.string().describe(SSH_HOST_GROUPS.GET.sshHostGroupId)- }),- querystring: z.object({- filter: z.nativeEnum(EHostGroupMembershipFilter).optional().describe(SSH_HOST_GROUPS.GET.filter)- }),- response: {- 200: z.object({- hosts: sanitizedSshHost- .pick({- id: true,- hostname: true,- alias: true- })- .merge(- z.object({- isPartOfGroup: z.boolean(),- joinedGroupAt: z.date().nullable()- })- )- .array(),- totalCount: z.number()- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { sshHostGroup, hosts, totalCount } = await server.services.sshHostGroup.listSshHostGroupHosts({- sshHostGroupId: req.params.sshHostGroupId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.query- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHostGroup.projectId,- event: {- type: EventType.GET_SSH_HOST_GROUP_HOSTS,- metadata: {- sshHostGroupId: req.params.sshHostGroupId,- name: sshHostGroup.name- }- }- });-- return { hosts, totalCount };- }- });-- server.route({- method: "POST",- url: "/:sshHostGroupId/hosts/:hostId",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Add an SSH Host to a Host Group",- params: z.object({- sshHostGroupId: z.string().describe(SSH_HOST_GROUPS.ADD_HOST.sshHostGroupId),- hostId: z.string().describe(SSH_HOST_GROUPS.ADD_HOST.hostId)- }),- response: {- 200: sanitizedSshHost.extend({- loginMappings: z.array(loginMappingSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { sshHostGroup, sshHost } = await server.services.sshHostGroup.addHostToSshHostGroup({- sshHostGroupId: req.params.sshHostGroupId,- hostId: req.params.hostId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHost.projectId,- event: {- type: EventType.ADD_HOST_TO_SSH_HOST_GROUP,- metadata: {- sshHostGroupId: sshHostGroup.id,- sshHostId: sshHost.id,- hostname: sshHost.hostname- }- }- });-- return sshHost;- }- });-- server.route({- method: "DELETE",- url: "/:sshHostGroupId/hosts/:hostId",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- description: "Remove an SSH Host from a Host Group",- params: z.object({- sshHostGroupId: z.string().describe(SSH_HOST_GROUPS.DELETE_HOST.sshHostGroupId),- hostId: z.string().describe(SSH_HOST_GROUPS.DELETE_HOST.hostId)- }),- response: {- 200: sanitizedSshHost.extend({- loginMappings: z.array(loginMappingSchema)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { sshHostGroup, sshHost } = await server.services.sshHostGroup.removeHostFromSshHostGroup({- sshHostGroupId: req.params.sshHostGroupId,- hostId: req.params.hostId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshHost.projectId,- event: {- type: EventType.REMOVE_HOST_FROM_SSH_HOST_GROUP,- metadata: {- sshHostGroupId: sshHostGroup.id,- sshHostId: sshHost.id,- hostname: sshHost.hostname- }- }- });-- return sshHost;- }- });-};diff --git a/backend/src/ee/routes/v1/ssh-host-router.ts b/backend/src/ee/routes/v1/ssh-host-router.tsdeleted file mode 100644index 50512a292d..0000000000--- a/backend/src/ee/routes/v1/ssh-host-router.ts+++ /dev/null@@ -1,493 +0,0 @@-import { z } from "zod";--import { EventType } from "@app/ee/services/audit-log/audit-log-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { loginMappingSchema, sanitizedSshHost } from "@app/ee/services/ssh-host/ssh-host-schema";-import { LoginMappingSource } from "@app/ee/services/ssh-host/ssh-host-types";-import { isValidHostname } from "@app/ee/services/ssh-host/ssh-host-validators";-import { ApiDocsTags, SSH_HOSTS } from "@app/lib/api-docs";-import { ms } from "@app/lib/ms";-import { publicSshCaLimit, readLimit, writeLimit } from "@app/server/config/rateLimiter";-import { slugSchema } from "@app/server/lib/schemas";-import { getTelemetryDistinctId } from "@app/server/lib/telemetry";-import { verifyAuth } from "@app/server/plugins/auth/verify-auth";-import { AuthMode } from "@app/services/auth/auth-type";-import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";--export const registerSshHostRouter = async (server: FastifyZodProvider) => {- server.route({- method: "GET",- url: "/",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- response: {- 200: z.array(- sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- )- }- },- onRequest: verifyAuth([AuthMode.JWT]),- handler: async (req) => {- const hosts = await server.services.sshHost.listSshHosts({- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- return hosts;- }- });-- server.route({- method: "GET",- url: "/:sshHostId",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- params: z.object({- sshHostId: z.string().describe(SSH_HOSTS.GET.sshHostId)- }),- response: {- 200: sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const host = await server.services.sshHost.getSshHostById({- sshHostId: req.params.sshHostId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: host.projectId,- event: {- type: EventType.GET_SSH_HOST,- metadata: {- sshHostId: host.id,- hostname: host.hostname- }- }- });-- return host;- }- });-- server.route({- method: "POST",- url: "/",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Register SSH Host",- body: z.object({- projectId: z.string().describe(SSH_HOSTS.CREATE.projectId),- hostname: z- .string()- .min(1)- .trim()- .refine((v) => isValidHostname(v), {- message: "Hostname must be a valid hostname"- })- .describe(SSH_HOSTS.CREATE.hostname),- alias: slugSchema({ min: 0, max: 64, field: "alias" }).describe(SSH_HOSTS.CREATE.alias).default(""),- userCertTtl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .default("8h")- .describe(SSH_HOSTS.CREATE.userCertTtl),- hostCertTtl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .default("1y")- .describe(SSH_HOSTS.CREATE.hostCertTtl),- loginMappings: z.array(loginMappingSchema).default([]).describe(SSH_HOSTS.CREATE.loginMappings),- userSshCaId: z.string().describe(SSH_HOSTS.CREATE.userSshCaId).optional(),- hostSshCaId: z.string().describe(SSH_HOSTS.CREATE.hostSshCaId).optional()- }),- response: {- 200: sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const host = await server.services.sshHost.createSshHost({- ...req.body,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: host.projectId,- event: {- type: EventType.CREATE_SSH_HOST,- metadata: {- sshHostId: host.id,- hostname: host.hostname,- alias: host.alias ?? null,- userCertTtl: host.userCertTtl,- hostCertTtl: host.hostCertTtl,- loginMappings: host.loginMappings,- userSshCaId: host.userSshCaId,- hostSshCaId: host.hostSshCaId- }- }- });-- return host;- }- });-- server.route({- method: "PATCH",- url: "/:sshHostId",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Update SSH Host",- params: z.object({- sshHostId: z.string().trim().describe(SSH_HOSTS.UPDATE.sshHostId)- }),- body: z.object({- hostname: z- .string()- .trim()- .min(1)- .refine((v) => isValidHostname(v), {- message: "Hostname must be a valid hostname"- })- .optional()- .describe(SSH_HOSTS.UPDATE.hostname),- alias: slugSchema({ min: 0, max: 64, field: "alias" }).describe(SSH_HOSTS.UPDATE.alias).optional(),- userCertTtl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .optional()- .describe(SSH_HOSTS.UPDATE.userCertTtl),- hostCertTtl: z- .string()- .refine((val) => ms(val) > 0, "TTL must be a positive number")- .optional()- .describe(SSH_HOSTS.UPDATE.hostCertTtl),- loginMappings: z.array(loginMappingSchema).optional().describe(SSH_HOSTS.UPDATE.loginMappings)- }),- response: {- 200: sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- }- },- handler: async (req) => {- const host = await server.services.sshHost.updateSshHost({- sshHostId: req.params.sshHostId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: host.projectId,- event: {- type: EventType.UPDATE_SSH_HOST,- metadata: {- sshHostId: host.id,- hostname: host.hostname,- alias: host.alias,- userCertTtl: host.userCertTtl,- hostCertTtl: host.hostCertTtl,- loginMappings: host.loginMappings,- userSshCaId: host.userSshCaId,- hostSshCaId: host.hostSshCaId- }- }- });-- return host;- }- });-- server.route({- method: "DELETE",- url: "/:sshHostId",- config: {- rateLimit: writeLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Delete SSH Host",- params: z.object({- sshHostId: z.string().describe(SSH_HOSTS.DELETE.sshHostId)- }),- response: {- 200: sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const host = await server.services.sshHost.deleteSshHost({- sshHostId: req.params.sshHostId,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: host.projectId,- event: {- type: EventType.DELETE_SSH_HOST,- metadata: {- sshHostId: host.id,- hostname: host.hostname- }- }- });-- return host;- }- });-- server.route({- method: "POST",- url: "/:sshHostId/issue-user-cert",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT]),- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Issue SSH certificate for user",- params: z.object({- sshHostId: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.sshHostId)- }),- body: z.object({- loginUser: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.loginUser)- }),- response: {- 200: z.object({- serialNumber: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.serialNumber),- signedKey: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.signedKey),- privateKey: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.privateKey),- publicKey: z.string().describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.publicKey),- keyAlgorithm: z.nativeEnum(SshCertKeyAlgorithm).describe(SSH_HOSTS.ISSUE_SSH_CREDENTIALS.keyAlgorithm)- })- }- },- handler: async (req) => {- const { serialNumber, signedPublicKey, privateKey, publicKey, keyAlgorithm, host, principals } =- await server.services.sshHost.issueSshHostUserCert({- sshHostId: req.params.sshHostId,- loginUser: req.body.loginUser,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- orgId: req.permission.orgId,- event: {- type: EventType.ISSUE_SSH_HOST_USER_CERT,- metadata: {- sshHostId: req.params.sshHostId,- hostname: host.hostname,- loginUser: req.body.loginUser,- principals,- ttl: host.userCertTtl- }- }- });-- await server.services.telemetry.sendPostHogEvents({- event: PostHogEventTypes.IssueSshHostUserCert,- distinctId: getTelemetryDistinctId(req),- organizationId: req.permission.orgId,- properties: {- sshHostId: req.params.sshHostId,- hostname: host.hostname,- principals,- ...req.auditLogInfo- }- });-- return {- serialNumber,- signedKey: signedPublicKey,- privateKey,- publicKey,- keyAlgorithm- };- }- });-- server.route({- method: "POST",- url: "/:sshHostId/issue-host-cert",- config: {- rateLimit: writeLimit- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Issue SSH certificate for host",- params: z.object({- sshHostId: z.string().describe(SSH_HOSTS.ISSUE_HOST_CERT.sshHostId)- }),- body: z.object({- publicKey: z.string().describe(SSH_HOSTS.ISSUE_HOST_CERT.publicKey)- }),- response: {- 200: z.object({- serialNumber: z.string().describe(SSH_HOSTS.ISSUE_HOST_CERT.serialNumber),- signedKey: z.string().describe(SSH_HOSTS.ISSUE_HOST_CERT.signedKey)- })- }- },- handler: async (req) => {- const { host, principals, serialNumber, signedPublicKey } = await server.services.sshHost.issueSshHostHostCert({- sshHostId: req.params.sshHostId,- publicKey: req.body.publicKey,- actor: req.permission.type,- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actorOrgId: req.permission.orgId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- orgId: req.permission.orgId,- event: {- type: EventType.ISSUE_SSH_HOST_HOST_CERT,- metadata: {- sshHostId: req.params.sshHostId,- hostname: host.hostname,- principals,- serialNumber,- ttl: host.hostCertTtl- }- }- });-- await server.services.telemetry.sendPostHogEvents({- event: PostHogEventTypes.IssueSshHostHostCert,- organizationId: req.permission.orgId,- distinctId: getTelemetryDistinctId(req),- properties: {- sshHostId: req.params.sshHostId,- hostname: host.hostname,- principals,- ...req.auditLogInfo- }- });-- return {- serialNumber,- signedKey: signedPublicKey- };- }- });-- server.route({- method: "GET",- url: "/:sshHostId/user-ca-public-key",- config: {- rateLimit: publicSshCaLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Get public key of the user SSH CA linked to the host",- params: z.object({- sshHostId: z.string().trim().describe(SSH_HOSTS.GET_USER_CA_PUBLIC_KEY.sshHostId)- }),- response: {- 200: z.string().describe(SSH_HOSTS.GET_USER_CA_PUBLIC_KEY.publicKey)- }- },- handler: async (req) => {- const publicKey = await server.services.sshHost.getSshHostUserCaPk(req.params.sshHostId);- return publicKey;- }- });-- server.route({- method: "GET",- url: "/:sshHostId/host-ca-public-key",- config: {- rateLimit: publicSshCaLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- description: "Get public key of the host SSH CA linked to the host",- params: z.object({- sshHostId: z.string().trim().describe(SSH_HOSTS.GET_HOST_CA_PUBLIC_KEY.sshHostId)- }),- response: {- 200: z.string().describe(SSH_HOSTS.GET_HOST_CA_PUBLIC_KEY.publicKey)- }- },- handler: async (req) => {- const publicKey = await server.services.sshHost.getSshHostHostCaPk(req.params.sshHostId);- return publicKey;- }- });-};diff --git a/backend/src/ee/routes/v2/gateway-router.ts b/backend/src/ee/routes/v2/gateway-router.tsindex 49f57f2ec8..540688b6f0 100644--- a/backend/src/ee/routes/v2/gateway-router.ts+++ b/backend/src/ee/routes/v2/gateway-router.ts@@ -234,14 +234,6 @@ export const registerGatewayV2Router = async (server: FastifyZodProvider) => {identityName: z.string()})),- mcpServers: z.array(- z.object({- id: z.string(),- name: z.string(),- projectId: z.string(),- projectName: z.string()- })- ),pkiDiscoveryConfigs: z.array(z.object({id: z.string(),diff --git a/backend/src/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-dal.ts b/backend/src/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-dal.tsdeleted file mode 100644index 82afff447c..0000000000--- a/backend/src/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-dal.ts+++ /dev/null@@ -1,86 +0,0 @@-import knex from "knex";--import { TDbClient } from "@app/db";-import { TableName, TAiMcpActivityLogs } from "@app/db/schemas";-import { DatabaseError, GatewayTimeoutError } from "@app/lib/errors";-import { ormify, selectAllTableCols, TOrmify } from "@app/lib/knex";--export type TFindActivityLogsQuery = {- projectId: string;- endpointName?: string;- serverName?: string;- toolName?: string;- actor?: string;- startDate?: string;- endDate?: string;- limit?: number;- offset?: number;-};--export interface TAiMcpActivityLogDALFactory extends Omit<TOrmify<TableName.AiMcpActivityLog>, "find"> {- find: (arg: TFindActivityLogsQuery, tx?: knex.Knex) => Promise<TAiMcpActivityLogs[]>;-}--export const aiMcpActivityLogDALFactory = (db: TDbClient): TAiMcpActivityLogDALFactory => {- const aiMcpActivityLogOrm = ormify(db, TableName.AiMcpActivityLog);-- const find: TAiMcpActivityLogDALFactory["find"] = async (- { projectId, endpointName, serverName, toolName, actor, startDate, endDate, limit = 20, offset = 0 },- tx- ) => {- try {- const sqlQuery = (tx || db.replicaNode())(TableName.AiMcpActivityLog).where(- `${TableName.AiMcpActivityLog}.projectId`,- projectId- );-- // Apply date filters if provided- if (startDate) {- void sqlQuery.whereRaw(`"${TableName.AiMcpActivityLog}"."createdAt" >= ?::timestamptz`, [startDate]);- }- if (endDate) {- void sqlQuery.andWhereRaw(`"${TableName.AiMcpActivityLog}"."createdAt" < ?::timestamptz`, [endDate]);- }-- // Apply exact filters- if (endpointName) {- void sqlQuery.where(`${TableName.AiMcpActivityLog}.endpointName`, endpointName);- }-- if (serverName) {- void sqlQuery.where(`${TableName.AiMcpActivityLog}.serverName`, serverName);- }-- if (toolName) {- void sqlQuery.where(`${TableName.AiMcpActivityLog}.toolName`, toolName);- }-- if (actor) {- void sqlQuery.where(`${TableName.AiMcpActivityLog}.actor`, actor);- }-- // Apply pagination and ordering- void sqlQuery- .select(selectAllTableCols(TableName.AiMcpActivityLog))- .limit(limit)- .offset(offset)- .orderBy(`${TableName.AiMcpActivityLog}.createdAt`, "desc");-- // Timeout long running queries to prevent DB resource issues (2 minutes)- const docs = await sqlQuery.timeout(1000 * 120);-- return docs;- } catch (error) {- if (error instanceof knex.KnexTimeoutError) {- throw new GatewayTimeoutError({- error,- message: "Failed to fetch MCP activity logs due to timeout. Add more search filters."- });- }-- throw new DatabaseError({ error });- }- };-- return { ...aiMcpActivityLogOrm, find };-};diff --git a/backend/src/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-service.ts b/backend/src/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-service.tsdeleted file mode 100644index 8078389725..0000000000--- a/backend/src/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-service.ts+++ /dev/null@@ -1,71 +0,0 @@-import { ForbiddenError } from "@casl/ability";--import { ActionProjectType, TAiMcpActivityLogsInsert } from "@app/db/schemas";-import { TProjectPermission } from "@app/lib/types";--import { TPermissionServiceFactory } from "../permission/permission-service-types";-import { ProjectPermissionActions, ProjectPermissionSub } from "../permission/project-permission";-import { TAiMcpActivityLogDALFactory, TFindActivityLogsQuery } from "./ai-mcp-activity-log-dal";--export type TAiMcpActivityLogServiceFactory = ReturnType<typeof aiMcpActivityLogServiceFactory>;--export type TAiMcpActivityLogServiceFactoryDep = {- aiMcpActivityLogDAL: TAiMcpActivityLogDALFactory;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;-};--export type TListActivityLogsFilter = {- endpointName?: string;- serverName?: string;- toolName?: string;- actor?: string;- startDate?: string;- endDate?: string;- limit?: number;- offset?: number;-};--export type TListActivityLogsDTO = TProjectPermission & {- filter?: TListActivityLogsFilter;-};--export const aiMcpActivityLogServiceFactory = ({- aiMcpActivityLogDAL,- permissionService-}: TAiMcpActivityLogServiceFactoryDep) => {- const createActivityLog = async (activityLog: TAiMcpActivityLogsInsert) => {- return aiMcpActivityLogDAL.create(activityLog);- };-- const listActivityLogs = async ({- projectId,- actor,- actorId,- actorAuthMethod,- actorOrgId,- filter- }: TListActivityLogsDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.McpActivityLogs);-- const query: TFindActivityLogsQuery = {- projectId,- ...filter- };-- return aiMcpActivityLogDAL.find(query);- };-- return {- createActivityLog,- listActivityLogs- };-};diff --git a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-dal.ts b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-dal.tsdeleted file mode 100644index 63f174a86d..0000000000--- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-dal.ts+++ /dev/null@@ -1,11 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TAiMcpEndpointDALFactory = ReturnType<typeof aiMcpEndpointDALFactory>;--export const aiMcpEndpointDALFactory = (db: TDbClient) => {- const aiMcpEndpointOrm = ormify(db, TableName.AiMcpEndpoint);-- return aiMcpEndpointOrm;-};diff --git a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-enum.ts b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-enum.tsdeleted file mode 100644index ff487a0ba0..0000000000--- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-enum.ts+++ /dev/null@@ -1,4 +0,0 @@-export enum AiMcpEndpointStatus {- ACTIVE = "active",- DISABLED = "disabled"-}diff --git a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-dal.ts b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-dal.tsdeleted file mode 100644index 99671e5d69..0000000000--- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-dal.ts+++ /dev/null@@ -1,16 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TAiMcpEndpointServerDALFactory = ReturnType<typeof aiMcpEndpointServerDALFactory>;--export const aiMcpEndpointServerDALFactory = (db: TDbClient) => {- const aiMcpEndpointServerOrm = ormify(db, TableName.AiMcpEndpointServer);-- const countByEndpointId = async (aiMcpEndpointId: string) => {- const result = await db.replicaNode()(TableName.AiMcpEndpointServer).where({ aiMcpEndpointId }).count().first();- return Number(result?.count ?? 0);- };-- return { ...aiMcpEndpointServerOrm, countByEndpointId };-};diff --git a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-tool-dal.ts b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-tool-dal.tsdeleted file mode 100644index 823ba3a020..0000000000--- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-tool-dal.ts+++ /dev/null@@ -1,16 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TAiMcpEndpointServerToolDALFactory = ReturnType<typeof aiMcpEndpointServerToolDALFactory>;--export const aiMcpEndpointServerToolDALFactory = (db: TDbClient) => {- const aiMcpEndpointServerToolOrm = ormify(db, TableName.AiMcpEndpointServerTool);-- const countByEndpointId = async (aiMcpEndpointId: string) => {- const result = await db.replicaNode()(TableName.AiMcpEndpointServerTool).where({ aiMcpEndpointId }).count().first();- return Number(result?.count ?? 0);- };-- return { ...aiMcpEndpointServerToolOrm, countByEndpointId };-};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.tsdeleted file mode 100644index 0d913f4571..0000000000--- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service.ts+++ /dev/null@@ -1,1514 +0,0 @@-import crypto from "node:crypto";--import { ForbiddenError, subject } from "@casl/ability";-import { Client } from "@modelcontextprotocol/sdk/client/index.js";-import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";-import { Server as RawMcpServer } from "@modelcontextprotocol/sdk/server/index.js";-import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";-import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";-import { z } from "zod";--import { ActionProjectType, TAiMcpEndpoints } from "@app/db/schemas";-import { KeyStorePrefixes, KeyStoreTtls, TKeyStoreFactory } from "@app/keystore/keystore";-import { getConfig } from "@app/lib/config/env";-import { crypto as cryptoModule } from "@app/lib/crypto";-import { DatabaseErrorCode } from "@app/lib/error-codes";-import { BadRequestError, DatabaseError, NotFoundError, UnauthorizedError } from "@app/lib/errors";-import { GatewayProxyProtocol } from "@app/lib/gateway";-import { setupRelayServer } from "@app/lib/gateway-v2/gateway-v2";-import { logger } from "@app/lib/logger";-import { ms } from "@app/lib/ms";-import { PiiEntityType, redactPiiFromObject } from "@app/lib/pii";-import { requestMemoKeys } from "@app/lib/request-context/memo-keys";-import { requestMemoize } from "@app/lib/request-context/request-memoizer";-import { ActorType, AuthMethod, AuthTokenType } from "@app/services/auth/auth-type";-import { TAuthTokenServiceFactory } from "@app/services/auth-token/auth-token-service";-import { TKmsServiceFactory } from "@app/services/kms/kms-service";-import { KmsDataKey } from "@app/services/kms/kms-types";-import { TUserDALFactory } from "@app/services/user/user-dal";--import { TAiMcpActivityLogServiceFactory } from "../ai-mcp-activity-log/ai-mcp-activity-log-service";-import { TAiMcpServerDALFactory } from "../ai-mcp-server/ai-mcp-server-dal";-import { AiMcpServerCredentialMode } from "../ai-mcp-server/ai-mcp-server-enum";-import { ssrfSafeMcpFetch } from "../ai-mcp-server/ai-mcp-server-fns";-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 { TGatewayV2ServiceFactory } from "../gateway-v2/gateway-v2-service";-import { TPermissionServiceFactory } from "../permission/permission-service-types";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "../permission/project-permission";-import { TAiMcpEndpointDALFactory } from "./ai-mcp-endpoint-dal";-import { AiMcpEndpointStatus } from "./ai-mcp-endpoint-enum";-import { TAiMcpEndpointServerDALFactory } from "./ai-mcp-endpoint-server-dal";-import { TAiMcpEndpointServerToolDALFactory } from "./ai-mcp-endpoint-server-tool-dal";-import {- TAiMcpEndpointWithServers,- TBulkUpdateEndpointToolsDTO,- TCreateAiMcpEndpointDTO,- TDeleteAiMcpEndpointDTO,- TDisableEndpointToolDTO,- TEnableEndpointToolDTO,- TGetAiMcpEndpointDTO,- TGetServersRequiringAuthDTO,- TInitiateServerOAuthDTO,- TInteractWithMcpDTO,- TListAiMcpEndpointsDTO,- TListEndpointToolsDTO,- TOAuthAuthorizeClientDTO,- TOAuthFinalizeDTO,- TOAuthRegisterClientDTO,- TOAuthTokenExchangeDTO,- TSaveUserServerCredentialDTO,- TServerAuthStatus,- TUpdateAiMcpEndpointDTO,- TVerifyServerBearerTokenDTO-} from "./ai-mcp-endpoint-types";--type TAiMcpEndpointServiceFactoryDep = {- aiMcpEndpointDAL: TAiMcpEndpointDALFactory;- aiMcpActivityLogService: TAiMcpActivityLogServiceFactory;- aiMcpEndpointServerDAL: TAiMcpEndpointServerDALFactory;- aiMcpEndpointServerToolDAL: TAiMcpEndpointServerToolDALFactory;- aiMcpServerDAL: TAiMcpServerDALFactory;- aiMcpServerToolDAL: TAiMcpServerToolDALFactory;- aiMcpServerUserCredentialDAL: TAiMcpServerUserCredentialDALFactory;- aiMcpServerService: Pick<- TAiMcpServerServiceFactory,- "getCredentialsForServer" | "initiateOAuth" | "getOAuthStatus" | "getServerOAuthConfig"- >;- kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;- keyStore: Pick<TKeyStoreFactory, "setItemWithExpiry" | "getItem" | "deleteItem">;- authTokenService: Pick<TAuthTokenServiceFactory, "getUserTokenSessionById">;- userDAL: TUserDALFactory;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;- gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">;-};--// OAuth schemas for parsing cached data-const DynamicClientInfoSchema = z.object({- client_id: z.string(),- redirect_uris: z.array(z.string()),- client_name: z.string(),- client_uri: z.string().optional(),- grant_types: z.array(z.string()),- response_types: z.array(z.string()),- token_endpoint_auth_method: z.string(),- client_id_issued_at: z.number(),- state: z.string().optional()-});--const OauthChallengeCodeSchema = z.object({- codeChallenge: z.string(),- codeChallengeMethod: z.string(),- userId: z.string(),- endpointId: z.string(),- expiry: z.string(),- redirectUri: z.string(),- userInfo: z.object({- tokenId: z.string(),- orgId: z.string(),- authMethod: z.string().nullable(),- email: z.string(),- actorIp: z.string(),- actorName: z.string(),- actorUserAgent: z.string()- })-});--// PKCE challenge computation-const computePkceChallenge = (codeVerifier: string) => {- const sha256 = crypto.createHash("sha256").update(codeVerifier).digest();- return Buffer.from(sha256).toString("base64url");-};--export type TAiMcpEndpointServiceFactory = ReturnType<typeof aiMcpEndpointServiceFactory>;--export const aiMcpEndpointServiceFactory = ({- aiMcpEndpointDAL,- aiMcpEndpointServerDAL,- aiMcpEndpointServerToolDAL,- aiMcpServerDAL,- aiMcpServerToolDAL,- aiMcpServerUserCredentialDAL,- aiMcpServerService,- aiMcpActivityLogService,- kmsService,- keyStore,- authTokenService,- userDAL,- permissionService,- gatewayV2Service-}: TAiMcpEndpointServiceFactoryDep) => {- /**- * Opens a long-lived gateway proxy for MCP sessions.- *- * This creates a local TCP server that tunnels connections through a V2 gateway- * to reach MCP servers on private networks. The proxy remains open until the- * cleanup function is called.- *- * @returns Port to connect to and cleanup function, or null if gateway not found- */- const $openGatewayProxy = async (inputs: {- gatewayId: string;- targetHost: string;- targetPort: number;- }): Promise<{ port: number; cleanup: () => Promise<void> } | null> => {- const gatewayV2ConnectionDetails = await gatewayV2Service.getPlatformConnectionDetailsByGatewayId({- gatewayId: inputs.gatewayId,- targetHost: inputs.targetHost,- targetPort: inputs.targetPort- });-- if (!gatewayV2ConnectionDetails) {- return null;- }-- const relayServer = await setupRelayServer({- protocol: GatewayProxyProtocol.Http,- relayHost: gatewayV2ConnectionDetails.relayHost,- gateway: gatewayV2ConnectionDetails.gateway,- relay: gatewayV2ConnectionDetails.relay- });-- return {- port: relayServer.port,- cleanup: relayServer.cleanup- };- };-- /**- * Wraps an HTTP request to route it through a V2 gateway proxy.- *- * Used for short-lived operations like OAuth discovery and tool fetching- * where the connection doesn't need to persist.- *- * @throws NotFoundError if the gateway doesn't exist- */- const $gatewayHttpProxyWrapper = async <T>(- inputs: {- gatewayId: string;- targetHost: string;- targetPort: number;- },- gatewayCallback: (host: string, port: number) => Promise<T>- ): Promise<T> => {- const proxyResult = await $openGatewayProxy(inputs);-- if (!proxyResult) {- throw new NotFoundError({ message: `Gateway with ID ${inputs.gatewayId} not found or not available` });- }-- try {- return await gatewayCallback("http://localhost", proxyResult.port);- } finally {- await proxyResult.cleanup();- }- };-- const interactWithMcp = async ({- endpointId,- userId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TInteractWithMcpDTO) => {- const appCfg = getConfig();-- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Connect,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const user = await requestMemoize(requestMemoKeys.userFindById(userId), () => userDAL.findById(userId));- if (!user) {- throw new NotFoundError({ message: `User with ID '${userId}' not found` });- }-- // Get connected servers for this endpoint- const connectedServerLinks = await aiMcpEndpointServerDAL.find({ aiMcpEndpointId: endpointId });-- // Get enabled tools for this endpoint- const enabledToolConfigs = await aiMcpEndpointServerToolDAL.find({ aiMcpEndpointId: endpointId });- const enabledToolIds = new Set(enabledToolConfigs.map((t) => t.aiMcpServerToolId));-- // Get the actual server details- const serverIds = connectedServerLinks.map((link) => link.aiMcpServerId);- const servers = await Promise.all(serverIds.map((id) => aiMcpServerDAL.findById(id)));- const validServers = servers.filter((s) => s !== null && s !== undefined);-- if (validServers.length === 0) {- // Return an empty MCP server if no servers are connected- const emptyServer = new RawMcpServer(- {- name: "infisical-mcp-endpoint",- version: appCfg.INFISICAL_PLATFORM_VERSION || "0.0.1"- },- {- capabilities: {- tools: {}- }- }- );- emptyServer.setRequestHandler(ListToolsRequestSchema, () => ({ tools: [] }));- emptyServer.setRequestHandler(CallToolRequestSchema, () => {- throw new Error("No MCP servers connected to this endpoint");- });-- const transport = new StreamableHTTPServerTransport({- sessionIdGenerator: undefined,- enableJsonResponse: true- });-- // No-op cleanup since there are no gateway connections- const cleanup = async () => {};-- return { server: emptyServer, transport, cleanup };- }-- // Track gateway proxy cleanup functions for long-lived MCP sessions- const gatewayCleanups: Array<() => Promise<void>> = [];-- // Connect to each server and get their tools- const mcpClientTools = await Promise.all(- validServers.map(async (mcpServer) => {- // Get the database tool records for this server (to map tool names to IDs)- const dbServerTools = await aiMcpServerToolDAL.find({ aiMcpServerId: mcpServer.id });- // Create a map from tool name to database tool ID for this specific server- const toolNameToDbId = new Map(dbServerTools.map((t) => [t.name, t.id]));-- // Get credentials based on server's credential mode- const credentialsResult = await aiMcpServerService.getCredentialsForServer({- serverId: mcpServer.id,- serverUrl: mcpServer.url,- credentialMode: mcpServer.credentialMode,- projectId: endpoint.projectId,- userId- });-- if (!credentialsResult) {- logger.warn(`No credentials found for MCP server ${mcpServer.name} (mode: ${mcpServer.credentialMode})`);- return { client: null, server: mcpServer, tools: [], toolNameToDbId };- }-- const headers: Record<string, string> = {};- if (credentialsResult.accessToken) {- headers.Authorization = `Bearer ${credentialsResult.accessToken}`;- }-- // Helper function to connect to MCP server and get tools- const connectAndGetTools = async (- serverUrl: string- ): Promise<{- client: Client;- tools: Array<{ name: string; description?: string; inputSchema?: Record<string, unknown> }>;- }> => {- const client = new Client({- name: `infisical-mcp-client-${mcpServer.name}`,- version: "1.0.0"- });-- const clientTransport = new StreamableHTTPClientTransport(new URL(serverUrl), {- fetch: ssrfSafeMcpFetch,- requestInit: { headers }- });-- await client.connect(clientTransport);-- // Get tools from this server- const { tools } = await client.listTools();-- return {- client,- tools: tools as Array<{ name: string; description?: string; inputSchema?: Record<string, unknown> }>- };- };-- try {- let clientResult: {- client: Client;- tools: Array<{ name: string; description?: string; inputSchema?: Record<string, unknown> }>;- };-- if (mcpServer.gatewayId) {- // Route through gateway proxy - use long-lived proxy for V2 gateways- const urlObj = new URL(mcpServer.url);- const targetHost = urlObj.hostname;- let targetPort = 80;- if (urlObj.port) {- targetPort = Number(urlObj.port);- } else if (urlObj.protocol === "https:") {- targetPort = 443;- }-- // Try to open a long-lived V2 gateway proxy- const proxyResult = await $openGatewayProxy({- gatewayId: mcpServer.gatewayId,- targetHost,- targetPort- });-- if (!proxyResult) {- throw new NotFoundError({ message: "Gateway not found or not available" });- }-- gatewayCleanups.push(proxyResult.cleanup);- const proxyUrl = `http://localhost:${proxyResult.port}${urlObj.pathname}${urlObj.search}`;- clientResult = await connectAndGetTools(proxyUrl);- } else {- // Direct connection (no gateway)- clientResult = await connectAndGetTools(mcpServer.url);- }-- return {- client: clientResult.client,- server: mcpServer,- tools: clientResult.tools,- toolNameToDbId- };- } catch (error) {- // If connection fails, return empty tools for this server- logger.error(error, `Failed to connect to MCP server ${mcpServer.name} (${mcpServer.url})`);- return { client: null, server: mcpServer, tools: [], toolNameToDbId };- }- })- );-- // Filter tools to only include explicitly enabled ones (least privilege principle)- // If no tools are explicitly enabled, no tools will be available- const enabledMcpClientTools = mcpClientTools.map((clientTool) => ({- ...clientTool,- tools: clientTool.tools.filter((tool) => {- // Get the database ID for this tool (specific to this server)- const dbToolId = clientTool.toolNameToDbId.get(tool.name);- // Only include if the database tool ID is explicitly enabled- return dbToolId !== undefined && enabledToolIds.has(dbToolId);- })- }));-- // Create the aggregating MCP server- const server = new RawMcpServer(- {- name: "infisical-mcp-endpoint",- version: appCfg.INFISICAL_PLATFORM_VERSION || "0.0.1"- },- {- capabilities: {- tools: {}- }- }- );-- // Handle ListTools request - aggregate tools from all connected servers- server.setRequestHandler(ListToolsRequestSchema, () => ({- tools: enabledMcpClientTools.flatMap((el) => el.tools)- }));-- // Handle CallTool request - route to the appropriate server- server.setRequestHandler(CallToolRequestSchema, async (request) => {- const { name, arguments: args } = request.params;-- // Find the server that has this tool- const selectedMcpClient = enabledMcpClientTools.find((el) => el.tools.find((t) => t.name === name));- if (!selectedMcpClient || !selectedMcpClient.client) {- throw new Error(`Unknown tool: ${name}`);- }-- // Apply PII redaction to request if enabled- const piiEntityTypes = (endpoint.piiEntityTypes as PiiEntityType[]) || [];- const sanitizedArgs =- endpoint.piiRequestFiltering && piiEntityTypes.length > 0 ? redactPiiFromObject(args, piiEntityTypes) : args;-- try {- const result = await selectedMcpClient.client.callTool({- name,- arguments: sanitizedArgs- });-- // Apply PII redaction to response if enabled- const sanitizedResult =- endpoint.piiResponseFiltering && piiEntityTypes.length > 0- ? redactPiiFromObject(result, piiEntityTypes)- : result;-- await aiMcpActivityLogService.createActivityLog({- endpointName: endpoint.name,- serverName: selectedMcpClient.server.name,- toolName: name,- actor: user.email || "",- request: sanitizedArgs,- response: sanitizedResult,- projectId: endpoint.projectId- });-- return sanitizedResult as Record<string, unknown>;- } catch (error) {- // Log the full error internally for system administrators- logger.error(- {- error,- endpointName: endpoint.name,- serverName: selectedMcpClient.server.name,- toolName: name,- actor: user.email || "",- projectId: endpoint.projectId- },- "Tool call failed"- );-- // Log failed activity with full error details for user visibility in activity logs- const errorMessage = error instanceof Error ? error.message : String(error);- await aiMcpActivityLogService.createActivityLog({- endpointName: endpoint.name,- serverName: selectedMcpClient.server.name,- toolName: name,- actor: user.email || "",- request: sanitizedArgs,- response: { error: errorMessage },- projectId: endpoint.projectId- });-- // Return generic error to client to avoid information leakage- return {- content: [- {- type: "text",- text: "Tool execution failed"- }- ],- isError: true- };- }- });-- const transport = new StreamableHTTPServerTransport({- sessionIdGenerator: undefined,- enableJsonResponse: true- });-- // Create cleanup function that closes all gateway proxies- const cleanup = async () => {- await Promise.all(- gatewayCleanups.map((fn) =>- fn().catch((err) => {- logger.error(err, "Failed to cleanup gateway proxy");- })- )- );- };-- return { server, transport, projectId: endpoint.projectId, endpointName: endpoint.name, cleanup };- };-- const createMcpEndpoint = async ({- projectId,- name,- description,- serverIds,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TCreateAiMcpEndpointDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Create,- subject(ProjectPermissionSub.McpEndpoints, { name })- );-- // Validate that all serverIds belong to the same project- if (serverIds && serverIds.length > 0) {- const servers = await aiMcpServerDAL.find({ $in: { id: serverIds } });-- if (servers.length !== serverIds.length) {- throw new NotFoundError({ message: "One or more MCP servers not found" });- }-- const invalidServers = servers.filter((server) => server.projectId !== projectId);- if (invalidServers.length > 0) {- throw new BadRequestError({- message: "All MCP servers must belong to the same project as the endpoint"- });- }- }-- let endpoint: TAiMcpEndpoints;- try {- endpoint = await aiMcpEndpointDAL.create({- projectId,- name,- description,- status: AiMcpEndpointStatus.ACTIVE- });- } catch (err) {- if (err instanceof DatabaseError && (err.error as { code: string })?.code === DatabaseErrorCode.UniqueViolation) {- throw new BadRequestError({- message: `An MCP endpoint with the name "${name}" already exists in this project`- });- }- throw err;- }-- // Connect servers if provided- if (serverIds && serverIds.length > 0) {- await aiMcpEndpointServerDAL.insertMany(- serverIds.map((serverId) => ({- aiMcpEndpointId: endpoint.id,- aiMcpServerId: serverId- }))- );- }-- return endpoint;- };-- const listMcpEndpoints = async ({- projectId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TListAiMcpEndpointsDTO): Promise<TAiMcpEndpointWithServers[]> => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- const endpoints = await aiMcpEndpointDAL.find({ projectId });-- // Filter endpoints based on read permission with conditions- const filteredEndpoints = endpoints.filter((ep) =>- permission.can(- ProjectPermissionMcpEndpointActions.Read,- subject(ProjectPermissionSub.McpEndpoints, { name: ep.name })- )- );-- // Get connected servers count and tools count for each endpoint- const endpointsWithStats = await Promise.all(- filteredEndpoints.map(async (endpoint) => {- const [connectedServersCount, activeToolsCount] = await Promise.all([- aiMcpEndpointServerDAL.countByEndpointId(endpoint.id),- aiMcpEndpointServerToolDAL.countByEndpointId(endpoint.id)- ]);-- return {- ...endpoint,- connectedServers: connectedServersCount,- activeTools: activeToolsCount- };- })- );-- return endpointsWithStats;- };-- const getMcpEndpointById = async ({- endpointId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TGetAiMcpEndpointDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Read,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const [connectedServers, activeToolsCount] = await Promise.all([- aiMcpEndpointServerDAL.find({ aiMcpEndpointId: endpointId }),- aiMcpEndpointServerToolDAL.countByEndpointId(endpointId)- ]);-- return {- ...endpoint,- connectedServers: connectedServers.length,- activeTools: activeToolsCount,- serverIds: connectedServers.map((s) => s.aiMcpServerId)- };- };-- const updateMcpEndpoint = async ({- endpointId,- name,- description,- serverIds,- piiRequestFiltering,- piiResponseFiltering,- piiEntityTypes,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TUpdateAiMcpEndpointDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Edit,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const updateData: {- name?: string;- description?: string;- piiRequestFiltering?: boolean;- piiResponseFiltering?: boolean;- piiEntityTypes?: string[];- } = {};- if (name !== undefined) updateData.name = name;- if (description !== undefined) updateData.description = description;- if (piiRequestFiltering !== undefined) updateData.piiRequestFiltering = piiRequestFiltering;- if (piiResponseFiltering !== undefined) updateData.piiResponseFiltering = piiResponseFiltering;- if (piiEntityTypes !== undefined) updateData.piiEntityTypes = piiEntityTypes;-- let updatedEndpoint = endpoint;- if (Object.keys(updateData).length > 0) {- try {- updatedEndpoint = await aiMcpEndpointDAL.updateById(endpointId, updateData);- } catch (err) {- if (- err instanceof DatabaseError &&- (err.error as { code: string })?.code === DatabaseErrorCode.UniqueViolation- ) {- throw new BadRequestError({- message: `An MCP endpoint with the name "${updateData.name}" already exists in this project`- });- }- throw err;- }- }-- // Update server connections if provided- if (serverIds !== undefined) {- // Validate that all serverIds belong to the same project- if (serverIds.length > 0) {- const servers = await aiMcpServerDAL.find({ $in: { id: serverIds } });-- if (servers.length !== serverIds.length) {- throw new NotFoundError({ message: "One or more MCP servers not found" });- }-- const invalidServers = servers.filter((server) => server.projectId !== endpoint.projectId);- if (invalidServers.length > 0) {- throw new BadRequestError({- message: "All MCP servers must belong to the same project as the endpoint"- });- }- }-- // Delete existing connections- await aiMcpEndpointServerDAL.delete({ aiMcpEndpointId: endpointId });-- // Add new connections- if (serverIds.length > 0) {- await aiMcpEndpointServerDAL.insertMany(- serverIds.map((serverId) => ({- aiMcpEndpointId: endpointId,- aiMcpServerId: serverId- }))- );- }- }-- return updatedEndpoint;- };-- const deleteMcpEndpoint = async ({- endpointId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TDeleteAiMcpEndpointDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Delete,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- await aiMcpEndpointDAL.deleteById(endpointId);-- return endpoint;- };-- const listEndpointTools = async ({- endpointId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TListEndpointToolsDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Read,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const toolConfigs = await aiMcpEndpointServerToolDAL.find({ aiMcpEndpointId: endpointId });- return { tools: toolConfigs, projectId: endpoint.projectId, endpointName: endpoint.name };- };-- const enableEndpointTool = async ({- endpointId,- serverToolId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TEnableEndpointToolDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Edit,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- // Get the tool name for audit logging- const serverTool = await aiMcpServerToolDAL.findById(serverToolId);- const toolName = serverTool?.name || "Unknown Tool";-- const existingConfig = await aiMcpEndpointServerToolDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerToolId: serverToolId- });-- if (existingConfig) {- return { tool: existingConfig, projectId: endpoint.projectId, endpointName: endpoint.name, toolName };- }-- const tool = await aiMcpEndpointServerToolDAL.create({- aiMcpEndpointId: endpointId,- aiMcpServerToolId: serverToolId,- isEnabled: true- });- return { tool, projectId: endpoint.projectId, endpointName: endpoint.name, toolName };- };-- const disableEndpointTool = async ({- endpointId,- serverToolId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TDisableEndpointToolDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Edit,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- // Get the tool name for audit logging- const serverTool = await aiMcpServerToolDAL.findById(serverToolId);- const toolName = serverTool?.name || "Unknown Tool";-- const existingConfig = await aiMcpEndpointServerToolDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerToolId: serverToolId- });-- if (existingConfig) {- await aiMcpEndpointServerToolDAL.deleteById(existingConfig.id);- }-- return { projectId: endpoint.projectId, endpointName: endpoint.name, toolName };- };-- const bulkUpdateEndpointTools = async ({- endpointId,- tools,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TBulkUpdateEndpointToolsDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Edit,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- // Separate tools to enable and disable- const toEnable = tools.filter((t) => t.isEnabled);- const toDisable = tools.filter((t) => !t.isEnabled);-- // Delete disabled tools- if (toDisable.length > 0) {- await Promise.all(- toDisable.map(async ({ serverToolId }) => {- const existing = await aiMcpEndpointServerToolDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerToolId: serverToolId- });- if (existing) {- await aiMcpEndpointServerToolDAL.deleteById(existing.id);- }- })- );- }-- // Create enabled tools (if not already existing)- const results = await Promise.all(- toEnable.map(async ({ serverToolId }) => {- const existing = await aiMcpEndpointServerToolDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerToolId: serverToolId- });- if (existing) {- return existing;- }- return aiMcpEndpointServerToolDAL.create({- aiMcpEndpointId: endpointId,- aiMcpServerToolId: serverToolId,- isEnabled: true- });- })- );-- return { tools: results, projectId: endpoint.projectId, endpointName: endpoint.name };- };-- // OAuth 2.0 Methods- // Called by MCP client during Dynamic Client Registration (DCR) - no auth required- const oauthRegisterClient = async ({- endpointId,- client_name,- client_uri,- grant_types,- redirect_uris,- response_types,- token_endpoint_auth_method- }: TOAuthRegisterClientDTO) => {- // Verify the endpoint exists- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const clientId = `mcp_client_${crypto.randomBytes(32).toString("hex")}`;- const now = Math.floor(Date.now() / 1000);-- const payload = {- client_id: clientId,- client_name,- client_uri,- grant_types,- redirect_uris,- response_types,- token_endpoint_auth_method,- client_id_issued_at: now,- projectId: endpoint.projectId,- endpointName: endpoint.name- };-- await keyStore.setItemWithExpiry(- KeyStorePrefixes.AiMcpEndpointOAuthClient(clientId),- KeyStoreTtls.AiMcpEndpointOAuthFlowInSeconds,- JSON.stringify(payload)- );-- return payload;- };-- const oauthAuthorizeClient = async ({ clientId, state }: TOAuthAuthorizeClientDTO) => {- const oauthClientCache = await keyStore.getItem(KeyStorePrefixes.AiMcpEndpointOAuthClient(clientId));- if (!oauthClientCache) {- throw new UnauthorizedError({ message: `MCP OAuth client with id ${clientId} not found` });- }-- // Update with state- await keyStore.setItemWithExpiry(- KeyStorePrefixes.AiMcpEndpointOAuthClient(clientId),- KeyStoreTtls.AiMcpEndpointOAuthFlowInSeconds,- JSON.stringify({ ...JSON.parse(oauthClientCache), state })- );- };-- const oauthFinalize = async ({- endpointId,- clientId,- codeChallenge,- codeChallengeMethod,- redirectUri,- expiry,- tokenId,- userInfo,- permission,- userAgent,- userIp- }: TOAuthFinalizeDTO) => {- const oauthClientCache = await keyStore.getItem(KeyStorePrefixes.AiMcpEndpointOAuthClient(clientId));- if (!oauthClientCache) {- throw new UnauthorizedError({ message: `MCP OAuth client with id ${clientId} not found` });- }-- const oauthClient = await DynamicClientInfoSchema.parseAsync(JSON.parse(oauthClientCache));- const isValidRedirectUri = oauthClient.redirect_uris.some((el) => new URL(el).toString() === redirectUri);- if (!isValidRedirectUri) throw new BadRequestError({ message: "Redirect URI mismatch" });-- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- // Check Connect permission at authorization time- const { permission: projectPermission } = await permissionService.getProjectPermission({- actor: permission.type as ActorType,- actorId: permission.id,- projectId: endpoint.projectId,- actorAuthMethod: permission.authMethod as AuthMethod,- actorOrgId: permission.orgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(projectPermission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Connect,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const code = crypto.randomBytes(32).toString("hex");- await keyStore.setItemWithExpiry(- KeyStorePrefixes.AiMcpEndpointOAuthCode(clientId, code),- KeyStoreTtls.AiMcpEndpointOAuthFlowInSeconds,- JSON.stringify({- codeChallenge,- codeChallengeMethod,- userId: permission.id,- endpointId,- expiry,- redirectUri,- userInfo: {- tokenId,- orgId: permission.orgId,- authMethod: permission.authMethod,- email: userInfo.email || "",- actorIp: userIp,- actorName: `${userInfo.firstName || ""} ${userInfo.lastName || ""}`.trim(),- actorUserAgent: userAgent- }- })- );-- const url = new URL(redirectUri);- url.searchParams.set("code", code);- if (oauthClient.state) url.searchParams.set("state", String(oauthClient.state));- return { url, projectId: endpoint.projectId, endpointName: endpoint.name, clientId };- };-- const oauthTokenExchange = async (dto: TOAuthTokenExchangeDTO) => {- const appCfg = getConfig();-- if (dto.grant_type !== "authorization_code") {- throw new BadRequestError({ message: "Only authorization_code grant type is supported" });- }-- const oauthClientCache = await keyStore.getItem(KeyStorePrefixes.AiMcpEndpointOAuthClient(dto.client_id));- if (!oauthClientCache) {- throw new UnauthorizedError({ message: `MCP OAuth client with id ${dto.client_id} not found` });- }-- const oauthAuthorizeSessionCache = await keyStore.getItem(- KeyStorePrefixes.AiMcpEndpointOAuthCode(dto.client_id, dto.code)- );- if (!oauthAuthorizeSessionCache) {- throw new UnauthorizedError({ message: "MCP OAuth session not found" });- }-- const oauthAuthorizeInfo = await OauthChallengeCodeSchema.parseAsync(JSON.parse(oauthAuthorizeSessionCache));- const isInvalidRedirectUri = dto.redirect_uri !== oauthAuthorizeInfo.redirectUri;- if (isInvalidRedirectUri) throw new BadRequestError({ message: "Redirect URI mismatch" });-- // Delete the code (one-time use)- await keyStore.deleteItem(KeyStorePrefixes.AiMcpEndpointOAuthCode(dto.client_id, dto.code));-- // Verify PKCE challenge- const challenge = computePkceChallenge(dto.code_verifier);- if (challenge !== oauthAuthorizeInfo.codeChallenge) {- throw new BadRequestError({ message: "PKCE challenge mismatch" });- }-- // Verify user session is still valid- const tokenSession = await authTokenService.getUserTokenSessionById(- oauthAuthorizeInfo.userInfo.tokenId,- oauthAuthorizeInfo.userId- );- if (!tokenSession) throw new UnauthorizedError({ message: "User session not found" });-- // Generate MCP access token- const accessToken = cryptoModule.jwt().sign(- {- authMethod: oauthAuthorizeInfo.userInfo.authMethod,- authTokenType: AuthTokenType.ACCESS_TOKEN,- userId: oauthAuthorizeInfo.userId,- tokenVersionId: tokenSession.id,- accessVersion: tokenSession.accessVersion,- organizationId: oauthAuthorizeInfo.userInfo.orgId,- isMfaVerified: true,- mcp: {- endpointId: oauthAuthorizeInfo.endpointId- }- },- appCfg.AUTH_SECRET,- { expiresIn: oauthAuthorizeInfo.expiry }- );-- return {- access_token: accessToken,- token_type: "Bearer",- expires_in: Math.floor(ms(oauthAuthorizeInfo.expiry) / 1000),- scope: "openid"- };- };-- // Get servers that require personal authentication for an endpoint- const getServersRequiringAuth = async ({- endpointId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TGetServersRequiringAuthDTO): Promise<TServerAuthStatus[]> => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Read,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- // Get connected servers- const connectedServerLinks = await aiMcpEndpointServerDAL.find({ aiMcpEndpointId: endpointId });- const serverIds = connectedServerLinks.map((link) => link.aiMcpServerId);-- if (serverIds.length === 0) {- return [];- }-- // Get server details- const servers = await Promise.all(serverIds.map((id) => aiMcpServerDAL.findById(id)));- const validServers = servers.filter((s) => s !== null && s !== undefined);-- // Filter to only servers with personal credential mode- const personalServers = validServers.filter((s) => s.credentialMode === AiMcpServerCredentialMode.PERSONAL);-- if (personalServers.length === 0) {- return [];- }-- // Check which servers the user already has credentials for- const serversWithAuthStatus = await Promise.all(- personalServers.map(async (server) => {- const existingCredential = await aiMcpServerUserCredentialDAL.findByUserAndServer(actorId, server.id);-- return {- id: server.id,- name: server.name,- url: server.url,- hasCredentials: Boolean(existingCredential),- authMethod: server.authMethod || "oauth"- };- })- );-- return serversWithAuthStatus;- };-- // Initiate OAuth for a server (personal credential mode)- const initiateServerOAuth = async ({- endpointId,- serverId,- actorId,- actor,- actorAuthMethod,- actorOrgId- }: TInitiateServerOAuthDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Connect,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- // Check that the server is linked to this endpoint- const serverLink = await aiMcpEndpointServerDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerId: serverId- });-- if (!serverLink) {- throw new BadRequestError({ message: "This MCP server is not linked to the specified endpoint" });- }-- if (server.credentialMode !== AiMcpServerCredentialMode.PERSONAL) {- throw new BadRequestError({ message: "This server does not use personal credentials" });- }-- // Get stored OAuth config (client ID/secret) if available- const oauthConfig = await aiMcpServerService.getServerOAuthConfig(serverId);-- // Use the existing MCP server OAuth initiate with stored client credentials- return aiMcpServerService.initiateOAuth({- projectId: endpoint.projectId,- url: server.url,- actorId,- clientId: oauthConfig?.clientId,- clientSecret: oauthConfig?.clientSecret- });- };-- // Verify bearer token against MCP server- const verifyServerBearerToken = async ({- endpointId,- serverId,- accessToken,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TVerifyServerBearerTokenDTO): Promise<{ valid: boolean; message?: string }> => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Connect,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- // Check that the server is linked to this endpoint- const serverLink = await aiMcpEndpointServerDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerId: serverId- });-- if (!serverLink) {- throw new BadRequestError({ message: "This MCP server is not linked to the specified endpoint" });- }-- // Helper function to verify token by connecting to the MCP server- const verifyWithUrl = async (targetUrl: string): Promise<{ valid: boolean; message?: string }> => {- let client: Client | undefined;- try {- client = new Client({- name: "infisical-mcp-client",- version: "1.0.0"- });-- const transport = new StreamableHTTPClientTransport(new URL(targetUrl), {- fetch: ssrfSafeMcpFetch,- requestInit: {- headers: {- Authorization: `Bearer ${accessToken}`- }- }- });-- await client.connect(transport);- await client.listTools();- await client.close();-- return { valid: true };- } catch (error) {- const err = error as { code?: string | number; cause?: { code?: string } };- const errCode = err?.code || err?.cause?.code;-- // All non-auth failures share one message: separating connection-refused- // from other errors would let an attacker probe whether internal ports- // are open by cycling redirect targets.- let message = "Unable to verify token";- if (errCode === 401 || errCode === 403) {- message = "Invalid token";- }-- return { valid: false, message };- } finally {- if (client) {- try {- await client.close();- } catch {- // Ignore close errors- }- }- }- };-- // Route through gateway if configured- if (server.gatewayId) {- const urlObj = new URL(server.url);- const targetHost = urlObj.hostname;- let targetPort = 80;- if (urlObj.port) {- targetPort = Number(urlObj.port);- } else if (urlObj.protocol === "https:") {- targetPort = 443;- }-- return $gatewayHttpProxyWrapper({ gatewayId: server.gatewayId, targetHost, targetPort }, async (host, port) => {- const proxyUrl = `${host}:${port}${urlObj.pathname}${urlObj.search}`;- return verifyWithUrl(proxyUrl);- });- }-- // Direct connection (no gateway)- return verifyWithUrl(server.url);- };-- // Save user credentials after OAuth completes- const saveUserServerCredential = async ({- endpointId,- serverId,- accessToken,- refreshToken,- expiresAt,- tokenType,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TSaveUserServerCredentialDTO) => {- const endpoint = await aiMcpEndpointDAL.findById(endpointId);- if (!endpoint) {- throw new NotFoundError({ message: `MCP endpoint with ID '${endpointId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: endpoint.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionMcpEndpointActions.Connect,- subject(ProjectPermissionSub.McpEndpoints, { name: endpoint.name })- );-- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- // Check that the server is linked to this endpoint- const serverLink = await aiMcpEndpointServerDAL.findOne({- aiMcpEndpointId: endpointId,- aiMcpServerId: serverId- });-- if (!serverLink) {- throw new BadRequestError({ message: "This MCP server is not linked to the specified endpoint" });- }-- // Encrypt the credentials- const credentials = {- accessToken,- refreshToken,- expiresAt,- tokenType: tokenType || "Bearer"- };-- const { encryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: endpoint.projectId- });-- const encryptedCredentials = encryptor({- plainText: Buffer.from(JSON.stringify(credentials))- }).cipherTextBlob;-- // Upsert the credential- await aiMcpServerUserCredentialDAL.upsertCredential({- userId: actorId,- aiMcpServerId: serverId,- encryptedCredentials- });-- return {- success: true,- projectId: endpoint.projectId,- endpointName: endpoint.name,- serverName: server.name- };- };-- return {- interactWithMcp,- createMcpEndpoint,- listMcpEndpoints,- getMcpEndpointById,- updateMcpEndpoint,- deleteMcpEndpoint,- listEndpointTools,- enableEndpointTool,- disableEndpointTool,- bulkUpdateEndpointTools,- oauthRegisterClient,- oauthAuthorizeClient,- oauthFinalize,- oauthTokenExchange,- getServersRequiringAuth,- initiateServerOAuth,- verifyServerBearerToken,- saveUserServerCredential- };-};diff --git a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-types.ts b/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-types.tsdeleted file mode 100644index 1726703d2e..0000000000--- a/backend/src/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-types.ts+++ /dev/null@@ -1,163 +0,0 @@-import { TProjectPermission } from "@app/lib/types";--export type TCreateAiMcpEndpointDTO = {- name: string;- description?: string;- serverIds?: string[];-} & TProjectPermission;--export type TUpdateAiMcpEndpointDTO = {- endpointId: string;- name?: string;- description?: string;- serverIds?: string[];- piiRequestFiltering?: boolean;- piiResponseFiltering?: boolean;- piiEntityTypes?: string[];-} & Omit<TProjectPermission, "projectId">;--export type TDeleteAiMcpEndpointDTO = {- endpointId: string;-} & Omit<TProjectPermission, "projectId">;--export type TGetAiMcpEndpointDTO = {- endpointId: string;-} & Omit<TProjectPermission, "projectId">;--export type TInteractWithMcpDTO = {- endpointId: string;- userId: string;-} & Omit<TProjectPermission, "projectId">;--export type TListAiMcpEndpointsDTO = TProjectPermission;--export type TAiMcpEndpointWithServers = {- id: string;- name: string;- description?: string | null;- status?: string | null;- piiRequestFiltering?: boolean;- piiResponseFiltering?: boolean;- piiEntityTypes?: string[] | null;- projectId: string;- createdAt: Date;- updatedAt: Date;- connectedServers: number;- activeTools: number;-};--export type TListEndpointToolsDTO = {- endpointId: string;-} & Omit<TProjectPermission, "projectId">;--export type TEnableEndpointToolDTO = {- endpointId: string;- serverToolId: string;-} & Omit<TProjectPermission, "projectId">;--export type TDisableEndpointToolDTO = {- endpointId: string;- serverToolId: string;-} & Omit<TProjectPermission, "projectId">;--export type TBulkUpdateEndpointToolsDTO = {- endpointId: string;- tools: Array<{- serverToolId: string;- isEnabled: boolean;- }>;-} & Omit<TProjectPermission, "projectId">;--export type TEndpointToolConfig = {- id: string;- aiMcpEndpointId: string;- aiMcpServerToolId: string;- isEnabled: boolean;-};--// OAuth 2.0 Types-export type TOAuthRegisterClientDTO = {- endpointId: string;- redirect_uris: string[];- token_endpoint_auth_method: string;- grant_types: string[];- response_types: string[];- client_name: string;- client_uri?: string;-};--export type TOAuthAuthorizeClientDTO = {- clientId: string;- state?: string;-};--export type TOAuthFinalizeDTO = {- endpointId: string;- clientId: string;- codeChallenge: string;- codeChallengeMethod: string;- redirectUri: string;- resource?: string;- responseType: string;- path?: string;- expiry: string;- tokenId: string;- userInfo: {- id: string;- email?: string | null;- firstName?: string | null;- lastName?: string | null;- };- permission: {- type: string;- id: string;- orgId: string;- authMethod: string | null;- };- userAgent: string;- userIp: string;-};--export type TOAuthTokenExchangeDTO = {- endpointId: string;- grant_type: "authorization_code";- code: string;- redirect_uri: string;- code_verifier: string;- client_id: string;-};--// Personal credentials types-export type TGetServersRequiringAuthDTO = {- endpointId: string;-} & Omit<TProjectPermission, "projectId">;--export type TServerAuthStatus = {- id: string;- name: string;- url: string;- hasCredentials: boolean;- authMethod: string;- oauthClientId?: string;- oauthClientSecret?: string;-};--export type TInitiateServerOAuthDTO = {- endpointId: string;- serverId: string;-} & Omit<TProjectPermission, "projectId">;--export type TSaveUserServerCredentialDTO = {- endpointId: string;- serverId: string;- accessToken: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;-} & Omit<TProjectPermission, "projectId">;--export type TVerifyServerBearerTokenDTO = {- endpointId: string;- serverId: string;- accessToken: string;-} & Omit<TProjectPermission, "projectId">;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.tsdeleted file mode 100644index c56ea86451..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-dal.ts+++ /dev/null@@ -1,36 +0,0 @@-import { Knex } from "knex";--import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TAiMcpServerDALFactory = ReturnType<typeof aiMcpServerDALFactory>;--export const aiMcpServerDALFactory = (db: TDbClient) => {- const aiMcpServerOrm = ormify(db, TableName.AiMcpServer);-- const findByGatewayId = async (gatewayId: string, tx?: Knex) => {- const docs = await (tx || db.replicaNode())(TableName.AiMcpServer)- .leftJoin(TableName.Project, `${TableName.AiMcpServer}.projectId`, `${TableName.Project}.id`)- .where(`${TableName.AiMcpServer}.gatewayId`, gatewayId)- .select(- db.ref("id").withSchema(TableName.AiMcpServer),- db.ref("name").withSchema(TableName.AiMcpServer),- db.ref("projectId").withSchema(TableName.AiMcpServer),- db.ref("name").withSchema(TableName.Project).as("projectName")- );-- return docs;- };-- 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/ai-mcp-server/ai-mcp-server-enum.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-enum.tsdeleted file mode 100644index 9cc6f75125..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-enum.ts+++ /dev/null@@ -1,16 +0,0 @@-export enum AiMcpServerCredentialMode {- SHARED = "shared",- PERSONAL = "personal"-}--export enum AiMcpServerAuthMethod {- BASIC = "basic",- BEARER = "bearer",- OAUTH = "oauth"-}--export enum AiMcpServerStatus {- ACTIVE = "active",- DISABLED = "disabled",- UNINITIALIZED = "uninitialized"-}diff --git a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-fns.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-fns.tsdeleted file mode 100644index c31dce6e24..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-fns.ts+++ /dev/null@@ -1,5 +0,0 @@-// Refuses to follow HTTP redirects when talking to an MCP server. The server URL-// is validated against private IPs at registration time; without this, a 302 at-// request time could redirect the backend fetch to internal network addresses.-export const ssrfSafeMcpFetch = (url: string | URL, init?: RequestInit): Promise<Response> =>- fetch(url, { ...init, redirect: "manual" });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.tsdeleted file mode 100644index 9b81452707..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-service.ts+++ /dev/null@@ -1,1293 +0,0 @@-import crypto from "node:crypto";--import { ForbiddenError } from "@casl/ability";-// eslint-disable-next-line @typescript-eslint/ban-ts-comment-// @ts-ignore - MCP SDK uses ESM with .js extensions which don't resolve types with moduleResolution: "Node"-import { Client } from "@modelcontextprotocol/sdk/client/index.js";-// eslint-disable-next-line @typescript-eslint/ban-ts-comment-// @ts-ignore - MCP SDK uses ESM with .js extensions which don't resolve types with moduleResolution: "Node"-import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";-import { isAxiosError } from "axios";--import { ActionProjectType, OrganizationActionScope } from "@app/db/schemas";-import { verifyHostInputValidity } from "@app/ee/services/dynamic-secret/dynamic-secret-fns";-import { KeyStorePrefixes, KeyStoreTtls, TKeyStoreFactory } from "@app/keystore/keystore";-import { getConfig } from "@app/lib/config/env";-import { request } from "@app/lib/config/request";-import { BadRequestError, NotFoundError } from "@app/lib/errors";-import { GatewayProxyProtocol } from "@app/lib/gateway";-import { withGatewayV2Proxy } from "@app/lib/gateway-v2/gateway-v2";-import { logger } from "@app/lib/logger";-import { ssrfSafeGet, ssrfSafePost } from "@app/lib/validator";-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 { TGatewayV2DALFactory } from "../gateway-v2/gateway-v2-dal";-import { TGatewayV2ServiceFactory } from "../gateway-v2/gateway-v2-service";-import { OrgPermissionGatewayActions, OrgPermissionSubjects } from "../permission/org-permission";-import { TPermissionServiceFactory } from "../permission/permission-service-types";-import { ProjectPermissionActions, ProjectPermissionSub } from "../permission/project-permission";-import { TAiMcpServerDALFactory } from "./ai-mcp-server-dal";-import { AiMcpServerAuthMethod, AiMcpServerCredentialMode, AiMcpServerStatus } from "./ai-mcp-server-enum";-import { ssrfSafeMcpFetch } from "./ai-mcp-server-fns";-import { TAiMcpServerToolDALFactory } from "./ai-mcp-server-tool-dal";-import {- TAiMcpServerCredentials,- TCreateAiMcpServerDTO,- TDeleteMcpServerDTO,- TGetMcpServerByIdDTO,- TGetOAuthStatusDTO,- THandleOAuthCallbackDTO,- TInitiateOAuthDTO,- TListMcpServersDTO,- TListMcpServerToolsDTO,- TOAuthAuthorizationServerMetadata,- TOAuthDynamicClientMetadata,- TOAuthProtectedResourceMetadata,- TOAuthSession,- TOAuthTokenResponse,- TSyncMcpServerToolsDTO,- TUpdateAiMcpServerDTO-} from "./ai-mcp-server-types";-import { TAiMcpServerUserCredentialDALFactory } from "./ai-mcp-server-user-credential-dal";--type TAiMcpServerServiceFactoryDep = {- aiMcpServerDAL: TAiMcpServerDALFactory;- aiMcpServerToolDAL: TAiMcpServerToolDALFactory;- aiMcpServerUserCredentialDAL: TAiMcpServerUserCredentialDALFactory;- kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;- keyStore: Pick<TKeyStoreFactory, "getItem" | "setItemWithExpiry" | "deleteItem">;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "getOrgPermission">;- gatewayV2DAL: Pick<TGatewayV2DALFactory, "find">;- gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">;-};--export type TAiMcpServerServiceFactory = ReturnType<typeof aiMcpServerServiceFactory>;--// Buffer time before token expiry to trigger refresh (5 minutes)-const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000;--/**- * Refresh an OAuth access token using the refresh token- */-const refreshOAuthToken = async (- serverUrl: string,- refreshToken: string,- clientId: string,- clientSecret?: string-): Promise<{ accessToken: string; refreshToken?: string; expiresAt?: number }> => {- const serverUrlObj = new URL(serverUrl);-- // Try both URL formats - some servers use origin-only, others use origin + pathname- let serverMetadata: TOAuthAuthorizationServerMetadata;-- try {- // First try: origin-only format- const originOnlyUrl = `${serverUrlObj.origin}/.well-known/oauth-authorization-server`;- const { data } = await ssrfSafeGet<TOAuthAuthorizationServerMetadata>(originOnlyUrl);- serverMetadata = data;- } catch {- // Second try: origin + pathname format- const pathnameUrl = `${serverUrlObj.origin}/.well-known/oauth-authorization-server${serverUrlObj.pathname !== "/" ? serverUrlObj.pathname : ""}`;- const { data } = await ssrfSafeGet<TOAuthAuthorizationServerMetadata>(pathnameUrl);- serverMetadata = data;- }-- const tokenParams: Record<string, string> = {- grant_type: "refresh_token",- refresh_token: refreshToken,- client_id: clientId- };-- // Add client_secret for confidential clients- if (clientSecret) {- tokenParams.client_secret = clientSecret;- }-- const { data: tokenResponse } = await ssrfSafePost<TOAuthTokenResponse>(- serverMetadata.token_endpoint,- new URLSearchParams(tokenParams).toString(),- {- headers: {- "Content-Type": "application/x-www-form-urlencoded"- }- }- );-- return {- accessToken: tokenResponse.access_token,- refreshToken: tokenResponse.refresh_token,- expiresAt: tokenResponse.expires_in ? Date.now() + tokenResponse.expires_in * 1000 : undefined- };-};--// Helper to encrypt credentials-const encryptCredentials = async ({- projectId,- credentials,- kmsService-}: {- projectId: string;- credentials: TAiMcpServerCredentials;- kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;-}) => {- const { encryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId- });-- const { cipherTextBlob } = encryptor({- plainText: Buffer.from(JSON.stringify(credentials))- });-- return cipherTextBlob;-};--// MCP tool type from the SDK response-type TMcpTool = {- name: string;- description?: string;- inputSchema?: Record<string, unknown>;-};--export const aiMcpServerServiceFactory = ({- aiMcpServerDAL,- aiMcpServerToolDAL,- aiMcpServerUserCredentialDAL,- kmsService,- keyStore,- permissionService,- gatewayV2DAL,- gatewayV2Service-}: TAiMcpServerServiceFactoryDep) => {- /**- * Wraps an HTTP request to route it through a V2 gateway proxy.- *- * Used for short-lived operations like OAuth discovery and tool fetching- * where the connection doesn't need to persist.- *- * @throws NotFoundError if the gateway doesn't exist- */- const $gatewayHttpProxyWrapper = async <T>(- inputs: {- gatewayId: string;- targetHost: string;- targetPort: number;- },- gatewayCallback: (host: string, port: number) => Promise<T>- ): Promise<T> => {- const gatewayV2ConnectionDetails = await gatewayV2Service.getPlatformConnectionDetailsByGatewayId({- gatewayId: inputs.gatewayId,- targetHost: inputs.targetHost,- targetPort: inputs.targetPort- });-- if (!gatewayV2ConnectionDetails) {- throw new NotFoundError({ message: `Gateway with ID ${inputs.gatewayId} not found or not available` });- }-- const callbackResult = await withGatewayV2Proxy(- async (port) => {- return gatewayCallback("http://localhost", port);- },- {- relayHost: gatewayV2ConnectionDetails.relayHost,- gateway: gatewayV2ConnectionDetails.gateway,- relay: gatewayV2ConnectionDetails.relay,- protocol: GatewayProxyProtocol.Http- }- );-- return callbackResult;- };-- /* 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, gatewayId?: string): Promise<TMcpTool[]> => {- const fetchToolsCallback = async (host: string, port: number): Promise<TMcpTool[]> => {- let client: Client | undefined;- try {- client = new Client({- name: "infisical-mcp-client",- version: "1.0.0"- });-- // When using gateway, construct the URL with localhost and the proxy port, preserving the path- let targetUrl = serverUrl;- if (gatewayId) {- const originalUrl = new URL(serverUrl);- targetUrl = new URL(`${originalUrl.pathname}${originalUrl.search}`, `${host}:${port}`).toString();- }-- const transport = new StreamableHTTPClientTransport(new URL(targetUrl), {- fetch: ssrfSafeMcpFetch,- requestInit: {- headers: {- Authorization: `Bearer ${accessToken}`- }- }- });-- await client.connect(transport);- const { tools } = await client.listTools();-- return tools.map((tool: { name: string; description?: string; inputSchema?: unknown }) => ({- name: tool.name,- description: tool.description,- inputSchema: tool.inputSchema as Record<string, unknown> | undefined- }));- } finally {- if (client) {- await client.close();- }- }- };-- try {- if (gatewayId) {- // Route through gateway proxy- const urlObj = new URL(serverUrl);- const targetHost = urlObj.hostname;- let targetPort = 80;- if (urlObj.port) {- targetPort = Number(urlObj.port);- } else if (urlObj.protocol === "https:") {- targetPort = 443;- }-- return await $gatewayHttpProxyWrapper({ gatewayId, targetHost, targetPort }, fetchToolsCallback);- }- // Direct connection (no gateway)- return await fetchToolsCallback(serverUrl, 0);- } catch (error) {- // Log but don't fail - tools can be fetched later- logger.error(error, "Failed to fetch tools from MCP server");- return [];- }- };- /* eslint-enable @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 */-- /**- * Parse WWW-Authenticate header to extract resource_metadata URL- * Format: Bearer resource_metadata="https://..."- */- const parseWwwAuthenticateHeader = (header: string): string | null => {- const match = header.match(/resource_metadata="([^"]+)"/);- return match ? match[1] : null;- };-- /**- * Helper to create a gateway-aware HTTP request function- * Returns a function that can make requests either directly or through a gateway proxy.- *- * When not using a gateway, requests use SSRF-safe methods that:- * - Validate each URL (including redirect targets) for private/internal IPs- * - Enforce HTTPS in production- * - Manually follow redirects with validation at each hop- * - Block POST redirects entirely- */- const createGatewayAwareRequest = (- gatewayId: string | undefined,- mcpUrlObj: URL- ): {- get: <T>(url: string) => Promise<{ data: T }>;- // getRaw returns full response including status and headers (for OAuth discovery that needs 401 headers)- getRaw: <T>(url: string) => Promise<{ data: T; status: number; headers: Record<string, unknown> }>;- post: <T>(url: string, data: unknown, config?: { headers?: Record<string, string> }) => Promise<{ data: T }>;- } => {- if (!gatewayId) {- // Direct requests (no gateway) - use SSRF-safe methods with redirect validation- return {- get: async <T>(url: string) => {- const response = await ssrfSafeGet<T>(url);- return { data: response.data };- },- getRaw: async <T>(url: string) => {- // For getRaw, we need to accept all status codes (including 401 for OAuth discovery)- // but still validate redirects before following them- return ssrfSafeGet<T>(url, { validateStatus: () => true });- },- post: <T>(url: string, data: unknown, config?: { headers?: Record<string, string> }) =>- ssrfSafePost<T>(url, data, config)- };- }-- // Gateway-proxied requests - gateway handles network isolation- const targetHost = mcpUrlObj.hostname;- let targetPort = 80;- if (mcpUrlObj.port) {- targetPort = Number(mcpUrlObj.port);- } else if (mcpUrlObj.protocol === "https:") {- targetPort = 443;- }-- return {- get: async <T>(url: string) => {- return $gatewayHttpProxyWrapper({ gatewayId, targetHost, targetPort }, async (host, port) => {- // Replace the original host/port with the proxy host/port- const originalUrl = new URL(url);- const proxyUrl = new URL(`${originalUrl.pathname}${originalUrl.search}`, `${host}:${port}`).toString();- return request.get<T>(proxyUrl);- });- },- getRaw: async <T>(url: string) => {- return $gatewayHttpProxyWrapper({ gatewayId, targetHost, targetPort }, async (host, port) => {- // Replace the original host/port with the proxy host/port- const originalUrl = new URL(url);- const proxyUrl = new URL(`${originalUrl.pathname}${originalUrl.search}`, `${host}:${port}`).toString();- // Use validateStatus to accept all responses (including 401) so we can access headers- const response = await request.get<T>(proxyUrl, { validateStatus: () => true });- return { data: response.data, status: response.status, headers: response.headers as Record<string, unknown> };- });- },- post: async <T>(url: string, data: unknown, config?: { headers?: Record<string, string> }) => {- return $gatewayHttpProxyWrapper({ gatewayId, targetHost, targetPort }, async (host, port) => {- // Replace the original host/port with the proxy host/port- const originalUrl = new URL(url);- const proxyUrl = new URL(`${originalUrl.pathname}${originalUrl.search}`, `${host}:${port}`).toString();- return request.post<T>(proxyUrl, data, config);- });- }- };- };-- /**- * Discover OAuth metadata by following the RFC 9728 Protected Resource Metadata flow:- * 1. Try to access the MCP server URL → get 401 with WWW-Authenticate header- * 2. Parse the protected resource metadata URL from the header- * 3. Fetch the protected resource metadata to get authorization_servers- * 4. Fetch the authorization server metadata- *- * All URLs in the discovery chain are validated for SSRF protection when not using a gateway.- */- const discoverOAuthMetadata = async (- mcpUrl: string,- gatewayId?: string- ): Promise<{- protectedResource: TOAuthProtectedResourceMetadata;- authServer: TOAuthAuthorizationServerMetadata;- }> => {- let resourceMetadataUrl: string | null = null;-- const url = new URL(mcpUrl);-- // Create gateway-aware request helper- const gatewayRequest = createGatewayAwareRequest(gatewayId, url);-- // 1. Try to access the MCP server to get WWW-Authenticate header- // Use getRaw to get full response including status and headers (needed for 401 with WWW-Authenticate)- const initialResponse = await gatewayRequest.getRaw(mcpUrl);-- if (initialResponse.status === 401) {- // Extract WWW-Authenticate header from 401 response- const wwwAuth = initialResponse.headers["www-authenticate"] as string | undefined;- if (wwwAuth) {- const parsedResourceMetadataUrl = parseWwwAuthenticateHeader(wwwAuth);- if (parsedResourceMetadataUrl) {- resourceMetadataUrl = parsedResourceMetadataUrl;- }- }- } else if (initialResponse.status >= 200 && initialResponse.status < 300) {- // If we get a success response, the server doesn't require auth (unusual)- throw new BadRequestError({- message: "MCP server did not return authentication requirements"- });- } else {- // Other error status codes- throw new BadRequestError({- message: `MCP server returned unexpected status: ${initialResponse.status}`- });- }-- const urlObj = new URL(mcpUrl);-- if (!resourceMetadataUrl) {- // Fallback: Try common .well-known paths (derived from validated mcpUrl origin, so safe)- const possiblePaths = [- `${urlObj.origin}/.well-known/oauth-protected-resource${urlObj.pathname}`,- `${urlObj.origin}/.well-known/oauth-protected-resource`- ];-- // Try paths sequentially (using Promise.allSettled would change semantics)- // eslint-disable-next-line no-restricted-syntax- for (const path of possiblePaths) {- try {- // eslint-disable-next-line no-await-in-loop- const { data } = await gatewayRequest.get<TOAuthProtectedResourceMetadata>(path);- if (data.authorization_servers?.length > 0) {- resourceMetadataUrl = path;- break;- }- } catch {- // Continue to next path- }- }- }-- if (!resourceMetadataUrl) {- // Fallback: Try auth server metadata directly (for servers like Linear- // that don't support RFC 9728 Protected Resource Metadata)- try {- const authServerMetadataUrl = `${urlObj.origin}/.well-known/oauth-authorization-server`;- const { data: authServer } = await gatewayRequest.get<TOAuthAuthorizationServerMetadata>(authServerMetadataUrl);- if (authServer.authorization_endpoint && authServer.token_endpoint) {- return {- protectedResource: {- resource: mcpUrl,- authorization_servers: [urlObj.origin]- } as TOAuthProtectedResourceMetadata,- authServer- };- }- } catch (err) {- // Log non-404 errors for debugging, but still fall through- if (!isAxiosError(err) || err.response?.status !== 404) {- logger.warn(err, "Failed to fetch OAuth authorization server metadata");- }- }-- throw new BadRequestError({- message: "Could not discover OAuth metadata for MCP server."- });- }-- // 2. Fetch protected resource metadata- const { data: protectedResource } = await gatewayRequest.get<TOAuthProtectedResourceMetadata>(resourceMetadataUrl);-- if (!protectedResource.authorization_servers?.length) {- throw new BadRequestError({- message: "Protected resource metadata does not specify any authorization servers"- });- }-- // 3. Get the authorization server URL and fetch its metadata- const authServerUrl = protectedResource.authorization_servers[0];- const authServerUrlObj = new URL(authServerUrl);-- // Try both URL formats - some servers use origin-only, others use origin + pathname- let authServer: TOAuthAuthorizationServerMetadata;-- try {- // First try: origin-only format- const originOnlyUrl = `${authServerUrlObj.origin}/.well-known/oauth-authorization-server`;- const { data } = await gatewayRequest.get<TOAuthAuthorizationServerMetadata>(originOnlyUrl);- authServer = data;- } catch {- // Second try: origin + pathname format- const pathnameUrl = `${authServerUrlObj.origin}/.well-known/oauth-authorization-server${authServerUrlObj.pathname !== "/" ? authServerUrlObj.pathname : ""}`;- const { data } = await gatewayRequest.get<TOAuthAuthorizationServerMetadata>(pathnameUrl);- authServer = data;- }-- return { protectedResource, authServer };- };-- /**- * Initiate OAuth flow for MCP server- * Returns the authorization URL and session ID- * Supports both DCR (Dynamic Client Registration) and hardcoded client credentials- */- const initiateOAuth = async ({- projectId,- url,- actorId,- clientId,- clientSecret,- gatewayId,- actor,- actorAuthMethod,- actorOrgId- }: TInitiateOAuthDTO) => {- const appCfg = getConfig();-- // Check permissions only when actor context is provided (called from router)- if (actor && actorAuthMethod && actorOrgId) {- const { permission } = await permissionService.getProjectPermission({- actor: actor as ActorType,- actorId,- projectId,- actorAuthMethod: actorAuthMethod as AuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.McpServers);-- // Validate gateway exists and user has permission to attach it- if (gatewayId) {- const [gateway] = await gatewayV2DAL.find({ id: gatewayId, orgId: actorOrgId });- if (!gateway) {- throw new NotFoundError({ message: `Gateway with ID ${gatewayId} not found` });- }-- const { permission: orgPermission } = await permissionService.getOrgPermission({- scope: OrganizationActionScope.Any,- actor: actor as ActorType,- actorId,- orgId: actorOrgId,- actorAuthMethod: actorAuthMethod as AuthMethod,- actorOrgId- });-- ForbiddenError.from(orgPermission).throwUnlessCan(- OrgPermissionGatewayActions.AttachGateways,- OrgPermissionSubjects.Gateway- );- }- }-- const urlObj = new URL(url);-- // Create gateway-aware request helper for DCR- const gatewayRequest = createGatewayAwareRequest(gatewayId, urlObj);-- // 1. Discover OAuth metadata following RFC 9728 flow (route through gateway if configured)- // Note: discoverOAuthMetadata validates all URLs in the discovery chain- const { protectedResource, authServer } = await discoverOAuthMetadata(url, gatewayId);-- // 2. Generate session ID- const sessionId = crypto.randomUUID();-- // 3. Build redirect URI- const redirectUri = `${appCfg.SITE_URL}/api/v1/ai/mcp/servers/oauth/callback`;-- // 4. Get client credentials - either from DCR or hardcoded- let resolvedClientId: string;- let resolvedClientSecret: string | undefined;-- if (clientId) {- // Use hardcoded client credentials (for servers like GitHub that don't support DCR)- resolvedClientId = clientId;- resolvedClientSecret = clientSecret;- } else {- // Use Dynamic Client Registration- if (!authServer.registration_endpoint) {- throw new BadRequestError({- message: "MCP server does not support Dynamic Client Registration. Please provide a client ID and secret."- });- }-- // Route DCR request through gateway when configured- const { data: clientMetadata } = await gatewayRequest.post<TOAuthDynamicClientMetadata>(- authServer.registration_endpoint,- {- redirect_uris: [redirectUri],- token_endpoint_auth_method: "none",- grant_types: ["authorization_code"],- response_types: ["code"],- client_name: `Infisical MCP Client - ${actorId}`- },- {- headers: {- "Content-Type": "application/json"- }- }- );-- resolvedClientId = clientMetadata.client_id;- resolvedClientSecret = clientMetadata.client_secret;- }-- // 5. Generate PKCE code verifier and challenge- const codeVerifier = crypto.randomBytes(32).toString("base64url");- const codeChallenge = crypto.createHash("sha256").update(codeVerifier).digest("base64url");-- // 6. Store session data in keystore (include auth server token endpoint and gateway for callback)- const sessionData: TOAuthSession = {- actorId,- codeVerifier,- codeChallenge,- clientId: resolvedClientId,- clientSecret: resolvedClientSecret,- projectId,- serverUrl: url,- redirectUri,- tokenEndpoint: authServer.token_endpoint,- gatewayId,- authorized: false- };-- await keyStore.setItemWithExpiry(- KeyStorePrefixes.AiMcpServerOAuth(sessionId),- KeyStoreTtls.AiMcpServerOAuthSessionInSeconds,- JSON.stringify(sessionData)- );-- // 7. Build authorization URL- const authUrl = new URL(authServer.authorization_endpoint);- authUrl.searchParams.set("client_id", resolvedClientId);- authUrl.searchParams.set("redirect_uri", redirectUri);- authUrl.searchParams.set("response_type", "code");-- // Use scopes from protected resource if available, otherwise default- const scopes = protectedResource.scopes_supported?.join(" ") || "read write";- authUrl.searchParams.set("scope", scopes);-- authUrl.searchParams.set("code_challenge", codeChallenge);- authUrl.searchParams.set("code_challenge_method", "S256");- authUrl.searchParams.set("state", sessionId);-- return {- authUrl: authUrl.toString(),- sessionId- };- };-- /**- * Handle OAuth callback from MCP server- * Exchanges authorization code for tokens- */- const handleOAuthCallback = async ({ sessionId, code }: THandleOAuthCallbackDTO) => {- // 1. Get session data from keystore- const sessionDataStr = await keyStore.getItem(KeyStorePrefixes.AiMcpServerOAuth(sessionId));- if (!sessionDataStr) {- throw new BadRequestError({- message: "OAuth session not found or expired. Please try again."- });- }-- const sessionData = JSON.parse(sessionDataStr) as TOAuthSession;-- if (sessionData.authorized) {- throw new BadRequestError({- message: "OAuth session already authorized"- });- }-- // Create gateway-aware request helper using the stored gatewayId- const serverUrlObj = new URL(sessionData.serverUrl);- const gatewayRequest = createGatewayAwareRequest(sessionData.gatewayId, serverUrlObj);- // 2. Exchange code for tokens using the stored token endpoint- const tokenParams: Record<string, string> = {- grant_type: "authorization_code",- code,- redirect_uri: sessionData.redirectUri,- client_id: sessionData.clientId,- code_verifier: sessionData.codeVerifier- };-- // Add client_secret if available- if (sessionData.clientSecret) {- tokenParams.client_secret = sessionData.clientSecret;- }-- // Route token exchange through gateway when configured- const { data: tokenResponse } = await gatewayRequest.post<TOAuthTokenResponse>(- sessionData.tokenEndpoint,- new URLSearchParams(tokenParams).toString(),- {- headers: {- "Content-Type": "application/x-www-form-urlencoded",- Accept: "application/json" // GitHub returns form-urlencoded by default without this- }- }- );-- // 4. Update session with tokens- const updatedSession: TOAuthSession = {- ...sessionData,- accessToken: tokenResponse.access_token,- refreshToken: tokenResponse.refresh_token,- expiresAt: tokenResponse.expires_in ? Date.now() + tokenResponse.expires_in * 1000 : undefined,- tokenType: tokenResponse.token_type,- authorized: true- };-- await keyStore.setItemWithExpiry(- KeyStorePrefixes.AiMcpServerOAuth(sessionId),- KeyStoreTtls.AiMcpServerOAuthSessionInSeconds,- JSON.stringify(updatedSession)- );-- return { success: true, projectId: sessionData.projectId };- };-- /**- * Get OAuth status for a session- */- const getOAuthStatus = async ({ sessionId, actorId, actor, actorAuthMethod, actorOrgId }: TGetOAuthStatusDTO) => {- const sessionDataStr = await keyStore.getItem(KeyStorePrefixes.AiMcpServerOAuth(sessionId));- if (!sessionDataStr) {- return { authorized: false };- }-- const sessionData = JSON.parse(sessionDataStr) as TOAuthSession;-- // Verify the actor matches who initiated the OAuth flow- if (sessionData.actorId !== actorId) {- throw new BadRequestError({ message: "Unauthorized to access this OAuth session" });- }-- const { permission } = await permissionService.getProjectPermission({- actor: actor as ActorType,- actorId,- projectId: sessionData.projectId,- actorAuthMethod: actorAuthMethod as AuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.McpServers);-- if (!sessionData.authorized) {- return { authorized: false };- }-- return {- authorized: true,- accessToken: sessionData.accessToken,- refreshToken: sessionData.refreshToken,- expiresAt: sessionData.expiresAt,- tokenType: sessionData.tokenType,- clientId: sessionData.clientId,- clientSecret: sessionData.clientSecret- };- };-- const createMcpServer = async ({- projectId,- name,- url,- description,- credentialMode,- authMethod,- credentials,- oauthClientId,- oauthClientSecret,- gatewayId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TCreateAiMcpServerDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.McpServers);-- // Block OAuth + Gateway combination (OAuth requires external redirect which doesn't work through gateway)- if (gatewayId && authMethod === AiMcpServerAuthMethod.OAUTH) {- throw new BadRequestError({- message:- "OAuth authentication is not supported when using a gateway. Please use Bearer or Basic authentication."- });- }-- // Validate gateway exists and user has permission to attach it- if (gatewayId) {- const [gateway] = await gatewayV2DAL.find({ id: gatewayId, orgId: actorOrgId });- if (!gateway) {- throw new NotFoundError({ message: `Gateway with ID ${gatewayId} not found` });- }-- const { permission: orgPermission } = await permissionService.getOrgPermission({- scope: OrganizationActionScope.Any,- actor,- actorId,- orgId: actorOrgId,- actorAuthMethod,- actorOrgId- });-- ForbiddenError.from(orgPermission).throwUnlessCan(- OrgPermissionGatewayActions.AttachGateways,- OrgPermissionSubjects.Gateway- );- }-- const urlObj = new URL(url);- if (!gatewayId) {- await verifyHostInputValidity({ host: urlObj.hostname, isGateway: false, isDynamicSecret: false });- }-- const encryptedCredentials = await encryptCredentials({- projectId,- credentials,- kmsService- });-- // Encrypt OAuth config (client ID/secret) if provided- let encryptedOauthConfig: Buffer | undefined;- if (oauthClientId) {- const { encryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId- });- encryptedOauthConfig = encryptor({- plainText: Buffer.from(JSON.stringify({ clientId: oauthClientId, clientSecret: oauthClientSecret }))- }).cipherTextBlob;- }-- const server = await aiMcpServerDAL.create({- projectId,- name,- url,- description,- credentialMode,- authMethod,- encryptedCredentials,- encryptedOauthConfig,- gatewayId,- status: AiMcpServerStatus.ACTIVE- });-- // Fetch and store tools from MCP server- // Get access token from credentials (for OAuth or Bearer auth)- let accessToken: string | undefined;- if ("accessToken" in credentials) {- accessToken = credentials.accessToken;- } else if ("token" in credentials) {- accessToken = credentials.token;- }-- if (accessToken) {- const tools = await fetchMcpTools(url, accessToken, gatewayId);-- if (tools.length > 0) {- await aiMcpServerToolDAL.insertMany(- tools.map((tool) => ({- aiMcpServerId: server.id,- name: tool.name,- description: tool.description,- inputSchema: tool.inputSchema- }))- );- }- }-- return server;- };-- const listMcpServers = async ({ projectId, actor, actorId, actorAuthMethod, actorOrgId }: TListMcpServersDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.McpServers);-- const servers = await aiMcpServerDAL.find({ projectId });- return servers;- };-- const getMcpServerById = async ({ serverId, actor, actorId, actorAuthMethod, actorOrgId }: TGetMcpServerByIdDTO) => {- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: server.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.McpServers);-- return server;- };-- const updateMcpServer = async (dto: TUpdateAiMcpServerDTO) => {- const { serverId, name, description, gatewayId, actor, actorId, actorAuthMethod, actorOrgId } = dto;-- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: server.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.McpServers);-- // Validate gateway if changing to a new gateway- if (gatewayId !== undefined && gatewayId !== null && gatewayId !== server.gatewayId) {- const [gateway] = await gatewayV2DAL.find({ id: gatewayId, orgId: actorOrgId });- if (!gateway) {- throw new NotFoundError({ message: `Gateway with ID ${gatewayId} not found` });- }-- const { permission: orgPermission } = await permissionService.getOrgPermission({- scope: OrganizationActionScope.Any,- actor,- actorId,- orgId: actorOrgId,- actorAuthMethod,- actorOrgId- });-- ForbiddenError.from(orgPermission).throwUnlessCan(- OrgPermissionGatewayActions.AttachGateways,- OrgPermissionSubjects.Gateway- );- }-- const updateData: { name?: string; description?: string; gatewayId?: string | null } = {};- if (name !== undefined) updateData.name = name;- if (description !== undefined) updateData.description = description;- if (gatewayId !== undefined) updateData.gatewayId = gatewayId;-- const updatedServer = await aiMcpServerDAL.updateById(serverId, updateData);-- return updatedServer;- };-- const deleteMcpServer = async ({ serverId, actor, actorId, actorAuthMethod, actorOrgId }: TDeleteMcpServerDTO) => {- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: server.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.McpServers);-- await aiMcpServerDAL.deleteById(serverId);- return server;- };-- const listMcpServerTools = async ({- serverId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TListMcpServerToolsDTO) => {- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: server.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.McpServers);-- const tools = await aiMcpServerToolDAL.find({ aiMcpServerId: serverId });- return { tools, projectId: server.projectId, serverName: server.name };- };-- const syncMcpServerTools = async ({- serverId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TSyncMcpServerToolsDTO) => {- const server = await aiMcpServerDAL.findById(serverId);- if (!server) {- throw new NotFoundError({ message: `MCP server with ID '${serverId}' not found` });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: server.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.AI- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.McpServers);-- if (!server.encryptedCredentials) {- throw new BadRequestError({ message: "Server credentials not found" });- }-- // Decrypt credentials to get access token- const { decryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: server.projectId- });-- const decryptedCredentials = JSON.parse(- decryptor({ cipherTextBlob: server.encryptedCredentials }).toString()- ) as TAiMcpServerCredentials;-- // Get access token from credentials- let accessToken: string | undefined;- if ("accessToken" in decryptedCredentials) {- accessToken = decryptedCredentials.accessToken;- } else if ("token" in decryptedCredentials) {- accessToken = decryptedCredentials.token;- }-- if (!accessToken) {- throw new BadRequestError({ message: "No access token available for this server" });- }-- // Fetch tools from MCP server (route through gateway if configured)- const fetchedTools = await fetchMcpTools(server.url, accessToken, server.gatewayId ?? undefined);-- // Delete existing tools- await aiMcpServerToolDAL.delete({ aiMcpServerId: serverId });-- // Insert new tools- if (fetchedTools.length > 0) {- await aiMcpServerToolDAL.insertMany(- fetchedTools.map((tool) => ({- aiMcpServerId: serverId,- name: tool.name,- description: tool.description,- inputSchema: tool.inputSchema- }))- );- }-- // Return the newly inserted tools- const tools = await aiMcpServerToolDAL.find({ aiMcpServerId: serverId });- return { tools, projectId: server.projectId, serverName: server.name };- };-- /**- * Get decrypted credentials for an MCP server, automatically refreshing OAuth tokens if expired.- * This is the single source of truth for getting valid credentials.- */- const getServerCredentials = async ({- serverId,- projectId- }: {- serverId: string;- projectId: string;- }): Promise<{ credentials: TAiMcpServerCredentials; accessToken: string | undefined } | null> => {- const server = await aiMcpServerDAL.findById(serverId);- if (!server || !server.encryptedCredentials) {- return null;- }-- // Create cipher pair for decryption (and encryption if we need to refresh)- const { decryptor, encryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId- });-- let credentials = JSON.parse(- decryptor({ cipherTextBlob: server.encryptedCredentials }).toString()- ) as TAiMcpServerCredentials;-- // Handle OAuth credentials with potential token refresh- if ("accessToken" in credentials) {- const isExpired =- "expiresAt" in credentials &&- credentials.expiresAt &&- Date.now() >= credentials.expiresAt - TOKEN_REFRESH_BUFFER_MS;-- if (isExpired && "refreshToken" in credentials && credentials.refreshToken) {- // Decrypt OAuth config to get client credentials for refresh- let oauthConfig: { clientId: string; clientSecret?: string } | undefined;- if (server.encryptedOauthConfig) {- oauthConfig = JSON.parse(decryptor({ cipherTextBlob: server.encryptedOauthConfig }).toString()) as {- clientId: string;- clientSecret?: string;- };- }-- if (!oauthConfig?.clientId) {- logger.error({ serverId }, "Cannot refresh OAuth token: missing client_id in OAuth config");- } else {- try {- const refreshedTokens = await refreshOAuthToken(- server.url,- credentials.refreshToken,- oauthConfig.clientId,- oauthConfig.clientSecret- );-- credentials = {- ...credentials,- accessToken: refreshedTokens.accessToken,- refreshToken: refreshedTokens.refreshToken || credentials.refreshToken,- expiresAt: refreshedTokens.expiresAt- };-- // Persist the refreshed credentials- const { cipherTextBlob: newEncryptedCredentials } = encryptor({- plainText: Buffer.from(JSON.stringify(credentials))- });-- await aiMcpServerDAL.updateById(serverId, {- encryptedCredentials: newEncryptedCredentials- });-- logger.info({ serverId }, "Refreshed OAuth token for MCP server");- } catch (refreshError) {- logger.error(refreshError, `Failed to refresh OAuth token for MCP server ${serverId}`);- // Return expired token - caller can decide how to handle the error- }- }- }-- return { credentials, accessToken: credentials.accessToken };- }-- // Handle bearer token credentials- if ("token" in credentials) {- return { credentials, accessToken: credentials.token };- }-- // Basic auth or other types - no access token- return { credentials, accessToken: undefined };- };-- // Get stored OAuth config (client ID/secret) for a server- const getServerOAuthConfig = async (- serverId: string- ): Promise<{ clientId: string; clientSecret?: string } | null> => {- const server = await aiMcpServerDAL.findById(serverId);- if (!server || !server.encryptedOauthConfig) {- return null;- }-- const { decryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: server.projectId- });-- const decrypted = decryptor({ cipherTextBlob: server.encryptedOauthConfig });- return JSON.parse(decrypted.toString()) as { clientId: string; clientSecret?: string };- };-- // Get user's personal credentials for a server (with token refresh)- const getUserServerCredentials = async ({- serverId,- userId,- projectId,- serverUrl- }: {- serverId: string;- userId: string;- projectId: string;- serverUrl: string;- }): Promise<{ accessToken: string } | null> => {- const userCredential = await aiMcpServerUserCredentialDAL.findByUserAndServer(userId, serverId);- if (!userCredential) {- return null;- }-- // Create cipher pair for decryption (and encryption if we need to refresh)- const { decryptor, encryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId- });-- let credentials = JSON.parse(decryptor({ cipherTextBlob: userCredential.encryptedCredentials }).toString()) as {- accessToken: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;- };-- // Check if token is expired and needs refresh- const isExpired = credentials.expiresAt && Date.now() >= credentials.expiresAt - TOKEN_REFRESH_BUFFER_MS;-- if (isExpired && credentials.refreshToken) {- // Get OAuth config (client_id is needed for refresh)- const oauthConfig = await getServerOAuthConfig(serverId);-- if (!oauthConfig?.clientId) {- logger.error({ serverId, userId }, "Cannot refresh OAuth token: missing client_id in OAuth config");- } else {- try {- const refreshedTokens = await refreshOAuthToken(- serverUrl,- credentials.refreshToken,- oauthConfig.clientId,- oauthConfig.clientSecret- );-- credentials = {- ...credentials,- accessToken: refreshedTokens.accessToken,- refreshToken: refreshedTokens.refreshToken || credentials.refreshToken,- expiresAt: refreshedTokens.expiresAt- };-- // Persist the refreshed credentials- const { cipherTextBlob: newEncryptedCredentials } = encryptor({- plainText: Buffer.from(JSON.stringify(credentials))- });-- await aiMcpServerUserCredentialDAL.upsertCredential({- userId,- aiMcpServerId: serverId,- encryptedCredentials: newEncryptedCredentials- });-- logger.info({ serverId, userId }, "Refreshed OAuth token for user's MCP server credentials");- } catch (refreshError) {- logger.error(refreshError, `Failed to refresh OAuth token for user ${userId} on MCP server ${serverId}`);- // Return expired token - caller can decide how to handle the error- }- }- }-- return { accessToken: credentials.accessToken };- };-- // Unified method to get credentials based on credential mode- const getCredentialsForServer = async ({- serverId,- serverUrl,- credentialMode,- projectId,- userId- }: {- serverId: string;- serverUrl: string;- credentialMode?: string | null;- projectId: string;- userId: string;- }): Promise<{ accessToken?: string } | null> => {- if (credentialMode === AiMcpServerCredentialMode.PERSONAL) {- return getUserServerCredentials({ serverId, userId, projectId, serverUrl });- }- return getServerCredentials({ serverId, projectId });- };-- return {- initiateOAuth,- handleOAuthCallback,- getOAuthStatus,- createMcpServer,- getMcpServerById,- updateMcpServer,- listMcpServers,- deleteMcpServer,- listMcpServerTools,- syncMcpServerTools,- getCredentialsForServer,- getServerOAuthConfig- };-};diff --git a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-tool-dal.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-tool-dal.tsdeleted file mode 100644index c121200861..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-tool-dal.ts+++ /dev/null@@ -1,11 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TAiMcpServerToolDALFactory = ReturnType<typeof aiMcpServerToolDALFactory>;--export const aiMcpServerToolDALFactory = (db: TDbClient) => {- const aiMcpServerToolOrm = ormify(db, TableName.AiMcpServerTool);-- return aiMcpServerToolOrm;-};diff --git a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-types.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-types.tsdeleted file mode 100644index 09aea362d7..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-types.ts+++ /dev/null@@ -1,144 +0,0 @@-import { TProjectPermission } from "@app/lib/types";-import { ActorAuthMethod } from "@app/services/auth/auth-type";--import { AiMcpServerAuthMethod, AiMcpServerCredentialMode } from "./ai-mcp-server-enum";--// OAuth types from MCP server-// Protected Resource Metadata (RFC 9728)-export type TOAuthProtectedResourceMetadata = {- resource: string;- resource_name?: string;- authorization_servers: string[];- bearer_methods_supported?: string[];- scopes_supported?: string[];-};--// Authorization Server Metadata (RFC 8414)-export type TOAuthAuthorizationServerMetadata = {- issuer: string;- authorization_endpoint: string;- token_endpoint: string;- registration_endpoint?: string; // Optional - not all servers support DCR- scopes_supported?: string[];- response_types_supported?: string[];- grant_types_supported?: string[];- token_endpoint_auth_methods_supported?: string[];- code_challenge_methods_supported?: string[];-};--export type TOAuthDynamicClientMetadata = {- client_id: string;- client_secret?: string;- client_id_issued_at?: number;- client_secret_expires_at?: number;- redirect_uris: string[];- token_endpoint_auth_method: string;- grant_types: string[];- response_types: string[];- client_name?: string;-};--export type TOAuthTokenResponse = {- access_token: string;- token_type: string;- expires_in?: number;- refresh_token?: string;- scope?: string;-};--// Credential types-export type TBasicCredentials = {- username: string;- password: string;-};--export type TBearerCredentials = {- token: string;-};--export type TOAuthCredentials = {- accessToken: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;-};--export type TAiMcpServerCredentials = TBasicCredentials | TBearerCredentials | TOAuthCredentials;--// OAuth session stored in keystore-export type TOAuthSession = {- actorId: string;- codeVerifier: string;- codeChallenge: string;- clientId: string;- clientSecret?: string; // For servers that don't support DCR (like GitHub)- projectId: string;- serverUrl: string;- redirectUri: string;- tokenEndpoint: string; // Stored from OAuth discovery for token exchange- gatewayId?: string;- // Set after callback- accessToken?: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;- authorized?: boolean;-};--export type TInitiateOAuthDTO = {- projectId: string;- url: string;- actorId: string;- clientId?: string;- clientSecret?: string;- gatewayId?: string;- actor?: string;- actorAuthMethod?: ActorAuthMethod;- actorOrgId?: string;-};--export type THandleOAuthCallbackDTO = {- sessionId: string;- code: string;-};--export type TGetOAuthStatusDTO = {- sessionId: string;-} & Omit<TProjectPermission, "projectId">;--export type TCreateAiMcpServerDTO = {- name: string;- url: string;- description?: string;- credentialMode: AiMcpServerCredentialMode;- authMethod: AiMcpServerAuthMethod;- credentials: TBasicCredentials | TBearerCredentials | TOAuthCredentials;- oauthClientId?: string;- oauthClientSecret?: string;- gatewayId?: string;-} & TProjectPermission;--export type TListMcpServersDTO = TProjectPermission;--export type TGetMcpServerByIdDTO = {- serverId: string;-} & Omit<TProjectPermission, "projectId">;--export type TUpdateAiMcpServerDTO = {- serverId: string;- name?: string;- description?: string;- gatewayId?: string | null;-} & Omit<TProjectPermission, "projectId">;--export type TDeleteMcpServerDTO = {- serverId: string;-} & Omit<TProjectPermission, "projectId">;--export type TListMcpServerToolsDTO = {- serverId: string;-} & Omit<TProjectPermission, "projectId">;--export type TSyncMcpServerToolsDTO = {- serverId: string;-} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-user-credential-dal.ts b/backend/src/ee/services/ai-mcp-server/ai-mcp-server-user-credential-dal.tsdeleted file mode 100644index 59d10d0068..0000000000--- a/backend/src/ee/services/ai-mcp-server/ai-mcp-server-user-credential-dal.ts+++ /dev/null@@ -1,26 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName, TAiMcpServerUserCredentialsInsert } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TAiMcpServerUserCredentialDALFactory = ReturnType<typeof aiMcpServerUserCredentialDALFactory>;--export const aiMcpServerUserCredentialDALFactory = (db: TDbClient) => {- const aiMcpServerUserCredentialOrm = ormify(db, TableName.AiMcpServerUserCredential);-- const findByUserAndServer = async (userId: string, aiMcpServerId: string) => {- return aiMcpServerUserCredentialOrm.findOne({ userId, aiMcpServerId });- };-- const upsertCredential = async (data: TAiMcpServerUserCredentialsInsert) => {- const [result] = await aiMcpServerUserCredentialOrm.upsert([data], ["userId", "aiMcpServerId"], undefined, [- "encryptedCredentials"- ]);- return result;- };-- return {- ...aiMcpServerUserCredentialOrm,- findByUserAndServer,- upsertCredential- };-};diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex 1ad3efed59..5b5d31b571 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -25,10 +25,6 @@ import {TUpdateSecretScanningDataSourceDTO,TUpdateSecretScanningFindingDTO} from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-types";-import { SshCaStatus, SshCertType } from "@app/ee/services/ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { SshCertTemplateStatus } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-types";-import { TLoginMapping } from "@app/ee/services/ssh-host/ssh-host-types";import { SymmetricKeyAlgorithm } from "@app/lib/crypto/cipher";import { HmacAlgorithm } from "@app/lib/crypto/hmac";import { AsymmetricKeyAlgorithm, SigningAlgorithm } from "@app/lib/crypto/sign/types";@@ -362,32 +358,8 @@ export enum EventType {SECRET_APPROVAL_CLOSED = "secret-approval-closed",SECRET_APPROVAL_REOPENED = "secret-approval-reopened",SECRET_APPROVAL_REQUEST_REVIEW = "secret-approval-request-review",- SIGN_SSH_KEY = "sign-ssh-key",- ISSUE_SSH_CREDS = "issue-ssh-creds",- CREATE_SSH_CA = "create-ssh-certificate-authority",- GET_SSH_CA = "get-ssh-certificate-authority",- UPDATE_SSH_CA = "update-ssh-certificate-authority",- DELETE_SSH_CA = "delete-ssh-certificate-authority",- GET_SSH_CA_CERTIFICATE_TEMPLATES = "get-ssh-certificate-authority-certificate-templates",- CREATE_SSH_CERTIFICATE_TEMPLATE = "create-ssh-certificate-template",- UPDATE_SSH_CERTIFICATE_TEMPLATE = "update-ssh-certificate-template",- DELETE_SSH_CERTIFICATE_TEMPLATE = "delete-ssh-certificate-template",- GET_SSH_CERTIFICATE_TEMPLATE = "get-ssh-certificate-template",GET_AZURE_AD_TEMPLATES = "get-azure-ad-templates",GET_ADCS_TEMPLATES = "get-adcs-templates",- GET_SSH_HOST = "get-ssh-host",- CREATE_SSH_HOST = "create-ssh-host",- UPDATE_SSH_HOST = "update-ssh-host",- DELETE_SSH_HOST = "delete-ssh-host",- ISSUE_SSH_HOST_USER_CERT = "issue-ssh-host-user-cert",- ISSUE_SSH_HOST_HOST_CERT = "issue-ssh-host-host-cert",- GET_SSH_HOST_GROUP = "get-ssh-host-group",- CREATE_SSH_HOST_GROUP = "create-ssh-host-group",- UPDATE_SSH_HOST_GROUP = "update-ssh-host-group",- DELETE_SSH_HOST_GROUP = "delete-ssh-host-group",- GET_SSH_HOST_GROUP_HOSTS = "get-ssh-host-group-hosts",- ADD_HOST_TO_SSH_HOST_GROUP = "add-host-to-ssh-host-group",- REMOVE_HOST_FROM_SSH_HOST_GROUP = "remove-host-from-ssh-host-group",CREATE_CA = "create-certificate-authority",GET_CA = "get-certificate-authority",GET_CAS = "get-certificate-authorities",@@ -530,9 +502,6 @@ export enum EventType {DELETE_SLACK_INTEGRATION = "delete-slack-integration",GET_PROJECT_WORKFLOW_INTEGRATION_CONFIG = "get-project-workflow-integration-config",UPDATE_PROJECT_WORKFLOW_INTEGRATION_CONFIG = "update-project-workflow-integration-config",-- GET_PROJECT_SSH_CONFIG = "get-project-ssh-config",- UPDATE_PROJECT_SSH_CONFIG = "update-project-ssh-config",INTEGRATION_SYNCED = "integration-synced",CREATE_CMEK = "create-cmek",UPDATE_CMEK = "update-cmek",@@ -794,33 +763,6 @@ export enum EventType {ATTEMPT_ACME_CHALLENGE = "attempt-acme-challenge",FAIL_ACME_CHALLENGE = "fail-acme-challenge",- // MCP Endpoints- MCP_ENDPOINT_CREATE = "mcp-endpoint-create",- MCP_ENDPOINT_UPDATE = "mcp-endpoint-update",- MCP_ENDPOINT_DELETE = "mcp-endpoint-delete",- MCP_ENDPOINT_GET = "mcp-endpoint-get",- MCP_ENDPOINT_LIST = "mcp-endpoint-list",- MCP_ENDPOINT_LIST_TOOLS = "mcp-endpoint-list-tools",- MCP_ENDPOINT_ENABLE_TOOL = "mcp-endpoint-enable-tool",- MCP_ENDPOINT_DISABLE_TOOL = "mcp-endpoint-disable-tool",- MCP_ENDPOINT_BULK_UPDATE_TOOLS = "mcp-endpoint-bulk-update-tools",- MCP_ENDPOINT_OAUTH_CLIENT_REGISTER = "mcp-endpoint-oauth-client-register",- MCP_ENDPOINT_OAUTH_AUTHORIZE = "mcp-endpoint-oauth-authorize",- MCP_ENDPOINT_CONNECT = "mcp-endpoint-connect",- MCP_ENDPOINT_SAVE_USER_CREDENTIAL = "mcp-endpoint-save-user-credential",-- // MCP Servers- MCP_SERVER_CREATE = "mcp-server-create",- MCP_SERVER_UPDATE = "mcp-server-update",- MCP_SERVER_DELETE = "mcp-server-delete",- MCP_SERVER_GET = "mcp-server-get",- MCP_SERVER_LIST = "mcp-server-list",- MCP_SERVER_LIST_TOOLS = "mcp-server-list-tools",- MCP_SERVER_SYNC_TOOLS = "mcp-server-sync-tools",-- // MCP Activity Logs- MCP_ACTIVITY_LOG_LIST = "mcp-activity-log-list",-// Dynamic SecretsCREATE_DYNAMIC_SECRET = "create-dynamic-secret",UPDATE_DYNAMIC_SECRET = "update-dynamic-secret",@@ -2743,243 +2685,6 @@ interface SecretApprovalRequestReview {};}-interface SignSshKey {- type: EventType.SIGN_SSH_KEY;- metadata: {- certificateTemplateId: string;- certType: SshCertType;- principals: string[];- ttl: string;- keyId: string;- };-}--interface IssueSshCreds {- type: EventType.ISSUE_SSH_CREDS;- metadata: {- certificateTemplateId: string;- keyAlgorithm: SshCertKeyAlgorithm;- certType: SshCertType;- principals: string[];- ttl: string;- keyId: string;- };-}--interface CreateSshCa {- type: EventType.CREATE_SSH_CA;- metadata: {- sshCaId: string;- friendlyName: string;- };-}--interface GetSshCa {- type: EventType.GET_SSH_CA;- metadata: {- sshCaId: string;- friendlyName: string;- };-}--interface UpdateSshCa {- type: EventType.UPDATE_SSH_CA;- metadata: {- sshCaId: string;- friendlyName: string;- status: SshCaStatus;- };-}--interface DeleteSshCa {- type: EventType.DELETE_SSH_CA;- metadata: {- sshCaId: string;- friendlyName: string;- };-}--interface GetSshCaCertificateTemplates {- type: EventType.GET_SSH_CA_CERTIFICATE_TEMPLATES;- metadata: {- sshCaId: string;- friendlyName: string;- };-}--interface CreateSshCertificateTemplate {- type: EventType.CREATE_SSH_CERTIFICATE_TEMPLATE;- metadata: {- certificateTemplateId: string;- sshCaId: string;- name: string;- ttl: string;- maxTTL: string;- allowedUsers: string[];- allowedHosts: string[];- allowUserCertificates: boolean;- allowHostCertificates: boolean;- allowCustomKeyIds: boolean;- };-}--interface GetSshCertificateTemplate {- type: EventType.GET_SSH_CERTIFICATE_TEMPLATE;- metadata: {- certificateTemplateId: string;- };-}--interface UpdateSshCertificateTemplate {- type: EventType.UPDATE_SSH_CERTIFICATE_TEMPLATE;- metadata: {- certificateTemplateId: string;- sshCaId: string;- name: string;- status: SshCertTemplateStatus;- ttl: string;- maxTTL: string;- allowedUsers: string[];- allowedHosts: string[];- allowUserCertificates: boolean;- allowHostCertificates: boolean;- allowCustomKeyIds: boolean;- };-}--interface DeleteSshCertificateTemplate {- type: EventType.DELETE_SSH_CERTIFICATE_TEMPLATE;- metadata: {- certificateTemplateId: string;- };-}--interface CreateSshHost {- type: EventType.CREATE_SSH_HOST;- metadata: {- sshHostId: string;- hostname: string;- alias: string | null;- userCertTtl: string;- hostCertTtl: string;- loginMappings: TLoginMapping[];- userSshCaId: string;- hostSshCaId: string;- };-}--interface UpdateSshHost {- type: EventType.UPDATE_SSH_HOST;- metadata: {- sshHostId: string;- hostname?: string;- alias?: string | null;- userCertTtl?: string;- hostCertTtl?: string;- loginMappings?: TLoginMapping[];- userSshCaId?: string;- hostSshCaId?: string;- };-}--interface DeleteSshHost {- type: EventType.DELETE_SSH_HOST;- metadata: {- sshHostId: string;- hostname: string;- };-}--interface GetSshHost {- type: EventType.GET_SSH_HOST;- metadata: {- sshHostId: string;- hostname: string;- };-}--interface IssueSshHostUserCert {- type: EventType.ISSUE_SSH_HOST_USER_CERT;- metadata: {- sshHostId: string;- hostname: string;- loginUser: string;- principals: string[];- ttl: string;- };-}--interface IssueSshHostHostCert {- type: EventType.ISSUE_SSH_HOST_HOST_CERT;- metadata: {- sshHostId: string;- hostname: string;- serialNumber: string;- principals: string[];- ttl: string;- };-}--interface GetSshHostGroupEvent {- type: EventType.GET_SSH_HOST_GROUP;- metadata: {- sshHostGroupId: string;- name: string;- };-}--interface CreateSshHostGroupEvent {- type: EventType.CREATE_SSH_HOST_GROUP;- metadata: {- sshHostGroupId: string;- name: string;- loginMappings: TLoginMapping[];- };-}--interface UpdateSshHostGroupEvent {- type: EventType.UPDATE_SSH_HOST_GROUP;- metadata: {- sshHostGroupId: string;- name?: string;- loginMappings?: TLoginMapping[];- };-}--interface DeleteSshHostGroupEvent {- type: EventType.DELETE_SSH_HOST_GROUP;- metadata: {- sshHostGroupId: string;- name: string;- };-}--interface GetSshHostGroupHostsEvent {- type: EventType.GET_SSH_HOST_GROUP_HOSTS;- metadata: {- sshHostGroupId: string;- name: string;- };-}--interface AddHostToSshHostGroupEvent {- type: EventType.ADD_HOST_TO_SSH_HOST_GROUP;- metadata: {- sshHostGroupId: string;- sshHostId: string;- hostname: string;- };-}--interface RemoveHostFromSshHostGroupEvent {- type: EventType.REMOVE_HOST_FROM_SSH_HOST_GROUP;- metadata: {- sshHostGroupId: string;- sshHostId: string;- hostname: string;- };-}-interface CreateGroupEvent {type: EventType.CREATE_GROUP;metadata: {@@ -4323,24 +4028,6 @@ interface GetProjectWorkflowIntegrationConfig {};}-interface GetProjectSshConfig {- type: EventType.GET_PROJECT_SSH_CONFIG;- metadata: {- id: string;- projectId: string;- };-}--interface UpdateProjectSshConfig {- type: EventType.UPDATE_PROJECT_SSH_CONFIG;- metadata: {- id: string;- projectId: string;- defaultUserSshCaId?: string | null;- defaultHostSshCaId?: string | null;- };-}-interface IntegrationSyncedEvent {type: EventType.INTEGRATION_SYNCED;metadata: {@@ -5702,7 +5389,6 @@ interface OrgUpdateEvent {secretsProductEnabled?: boolean;pkiProductEnabled?: boolean;kmsProductEnabled?: boolean;- sshProductEnabled?: boolean;scannerProductEnabled?: boolean;shareSecretsProductEnabled?: boolean;};@@ -6663,195 +6349,6 @@ interface FailAcmeChallengeEvent {};}-interface McpEndpointCreateEvent {- type: EventType.MCP_ENDPOINT_CREATE;- metadata: {- endpointId: string;- name: string;- description?: string;- serverIds: string[];- };-}--interface McpEndpointUpdateEvent {- type: EventType.MCP_ENDPOINT_UPDATE;- metadata: {- endpointId: string;- name?: string;- description?: string;- serverIds?: string[];- piiRequestFiltering?: boolean;- piiResponseFiltering?: boolean;- piiEntityTypes?: string;- };-}--interface McpEndpointDeleteEvent {- type: EventType.MCP_ENDPOINT_DELETE;- metadata: {- endpointId: string;- name: string;- };-}--interface McpEndpointGetEvent {- type: EventType.MCP_ENDPOINT_GET;- metadata: {- endpointId: string;- name: string;- };-}--interface McpEndpointListEvent {- type: EventType.MCP_ENDPOINT_LIST;- metadata: {- count: number;- };-}--interface McpEndpointListToolsEvent {- type: EventType.MCP_ENDPOINT_LIST_TOOLS;- metadata: {- endpointId: string;- endpointName: string;- toolCount: number;- };-}--interface McpEndpointEnableToolEvent {- type: EventType.MCP_ENDPOINT_ENABLE_TOOL;- metadata: {- endpointId: string;- endpointName: string;- serverToolId: string;- toolName: string;- };-}--interface McpEndpointDisableToolEvent {- type: EventType.MCP_ENDPOINT_DISABLE_TOOL;- metadata: {- endpointId: string;- endpointName: string;- serverToolId: string;- toolName: string;- };-}--interface McpEndpointBulkUpdateToolsEvent {- type: EventType.MCP_ENDPOINT_BULK_UPDATE_TOOLS;- metadata: {- endpointId: string;- endpointName: string;- toolsUpdated: number;- };-}--interface McpEndpointOAuthClientRegisterEvent {- type: EventType.MCP_ENDPOINT_OAUTH_CLIENT_REGISTER;- metadata: {- endpointId: string;- endpointName: string;- clientId: string;- clientName: string;- };-}--interface McpEndpointOAuthAuthorizeEvent {- type: EventType.MCP_ENDPOINT_OAUTH_AUTHORIZE;- metadata: {- endpointId: string;- endpointName: string;- clientId: string;- };-}--interface McpEndpointConnectEvent {- type: EventType.MCP_ENDPOINT_CONNECT;- metadata: {- endpointId: string;- endpointName: string;- userId: string;- };-}--interface McpEndpointSaveUserCredentialEvent {- type: EventType.MCP_ENDPOINT_SAVE_USER_CREDENTIAL;- metadata: {- endpointId: string;- endpointName: string;- serverId: string;- serverName: string;- };-}--interface McpServerCreateEvent {- type: EventType.MCP_SERVER_CREATE;- metadata: {- serverId: string;- name: string;- url: string;- credentialMode: string;- authMethod: string;- };-}--interface McpServerUpdateEvent {- type: EventType.MCP_SERVER_UPDATE;- metadata: {- serverId: string;- name: string;- };-}--interface McpServerDeleteEvent {- type: EventType.MCP_SERVER_DELETE;- metadata: {- serverId: string;- name: string;- };-}--interface McpServerGetEvent {- type: EventType.MCP_SERVER_GET;- metadata: {- serverId: string;- name: string;- };-}--interface McpServerListEvent {- type: EventType.MCP_SERVER_LIST;- metadata: {- count: number;- };-}--interface McpServerListToolsEvent {- type: EventType.MCP_SERVER_LIST_TOOLS;- metadata: {- serverId: string;- serverName: string;- toolCount: number;- };-}--interface McpServerSyncToolsEvent {- type: EventType.MCP_SERVER_SYNC_TOOLS;- metadata: {- serverId: string;- serverName: string;- toolCount: number;- };-}--interface McpActivityLogListEvent {- type: EventType.MCP_ACTIVITY_LOG_LIST;- metadata: {- count: number;- };-}-interface GetDynamicSecretLeaseEvent {type: EventType.GET_DYNAMIC_SECRET_LEASE;metadata: {@@ -7676,23 +7173,6 @@ export type Event =| SecretApprovalClosed| SecretApprovalRequest| SecretApprovalReopened- | SignSshKey- | IssueSshCreds- | CreateSshCa- | GetSshCa- | UpdateSshCa- | DeleteSshCa- | GetSshCaCertificateTemplates- | CreateSshCertificateTemplate- | UpdateSshCertificateTemplate- | GetSshCertificateTemplate- | DeleteSshCertificateTemplate- | CreateSshHost- | UpdateSshHost- | DeleteSshHost- | GetSshHost- | IssueSshHostUserCert- | IssueSshHostHostCert| CreateCa| GetCa| GetCAs@@ -7819,8 +7299,6 @@ export type Event =| GetSlackIntegration| UpdateProjectWorkflowIntegrationConfig| GetProjectWorkflowIntegrationConfig- | GetProjectSshConfig- | UpdateProjectSshConfig| IntegrationSyncedEvent| CreateCmekEvent| UpdateCmekEvent@@ -7861,13 +7339,6 @@ export type Event =| TestHsmConnectorEvent| CreateGitHubAppEvent| DeleteGitHubAppEvent- | GetSshHostGroupEvent- | CreateSshHostGroupEvent- | UpdateSshHostGroupEvent- | DeleteSshHostGroupEvent- | GetSshHostGroupHostsEvent- | AddHostToSshHostGroupEvent- | RemoveHostFromSshHostGroupEvent| CreateSharedSecretEvent| DeleteSharedSecretEvent| ReadSharedSecretEvent@@ -8091,27 +7562,6 @@ export type Event =| PassedAcmeChallengeEvent| AttemptAcmeChallengeEvent| FailAcmeChallengeEvent- | McpEndpointCreateEvent- | McpEndpointUpdateEvent- | McpEndpointDeleteEvent- | McpEndpointGetEvent- | McpEndpointListEvent- | McpEndpointListToolsEvent- | McpEndpointEnableToolEvent- | McpEndpointDisableToolEvent- | McpEndpointBulkUpdateToolsEvent- | McpEndpointOAuthClientRegisterEvent- | McpEndpointOAuthAuthorizeEvent- | McpEndpointConnectEvent- | McpEndpointSaveUserCredentialEvent- | McpServerCreateEvent- | McpServerUpdateEvent- | McpServerDeleteEvent- | McpServerGetEvent- | McpServerListEvent- | McpServerListToolsEvent- | McpServerSyncToolsEvent- | McpActivityLogListEvent| CreateDynamicSecretEvent| UpdateDynamicSecretEvent| DeleteDynamicSecretEventdiff --git a/backend/src/ee/services/dynamic-secret/providers/models.ts b/backend/src/ee/services/dynamic-secret/providers/models.tsindex d74f7a3136..52265b01fb 100644--- a/backend/src/ee/services/dynamic-secret/providers/models.ts+++ b/backend/src/ee/services/dynamic-secret/providers/models.ts@@ -2,7 +2,7 @@ import RE2 from "re2";import { z } from "zod";import { TDynamicSecrets } from "@app/db/schemas";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";+import { SshCertKeyAlgorithm } from "@app/lib/ssh";import { CharacterType, characterValidator } from "@app/lib/validator/validate-string";import { ResourceMetadataNonEncryptionSchema } from "@app/services/resource-metadata/resource-metadata-schema";import { TConstraint } from "@app/services/secret-validation-rule/secret-validation-rule-types";diff --git a/backend/src/ee/services/dynamic-secret/providers/ssh.ts b/backend/src/ee/services/dynamic-secret/providers/ssh.tsindex 02abf56368..f238f2141b 100644--- a/backend/src/ee/services/dynamic-secret/providers/ssh.ts+++ b/backend/src/ee/services/dynamic-secret/providers/ssh.ts@@ -2,11 +2,9 @@ import slugify from "@sindresorhus/slugify";import RE2 from "re2";import { BadRequestError } from "@app/lib/errors";+import { createSshCert, createSshKeyPair, getSshPublicKey, SshCertKeyAlgorithm, SshCertType } from "@app/lib/ssh";import { TDynamicSecretLeaseConfig } from "../../dynamic-secret-lease/dynamic-secret-lease-types";-import { createSshCert, createSshKeyPair, getSshPublicKey } from "../../ssh/ssh-certificate-authority-fns";-import { SshCertType } from "../../ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "../../ssh-certificate/ssh-certificate-types";import { DynamicSecretSshSchema, SshStoredSchema, TDynamicProviderFns } from "./models";export const SshProvider = (): TDynamicProviderFns => {diff --git a/backend/src/ee/services/gateway-v2/gateway-v2-service.ts b/backend/src/ee/services/gateway-v2/gateway-v2-service.tsindex b3229ca68d..d5eb46c931 100644--- a/backend/src/ee/services/gateway-v2/gateway-v2-service.ts+++ b/backend/src/ee/services/gateway-v2/gateway-v2-service.ts@@ -29,7 +29,6 @@ import { NotificationType } from "@app/services/notification/notification-types"import { TOrgDALFactory } from "@app/services/org/org-dal";import { TSmtpService } from "@app/services/smtp/smtp-service";-import { TAiMcpServerDALFactory } from "../ai-mcp-server/ai-mcp-server-dal";import { TDynamicSecretDALFactory } from "../dynamic-secret/dynamic-secret-dal";import { PamAccountType } from "../pam/pam-enums";import { OrgPermissionGatewayActions, OrgPermissionSubjects } from "../permission/org-permission";@@ -65,7 +64,6 @@ type TGatewayV2ServiceFactoryDep = {appConnectionDAL: Pick<TAppConnectionDALFactory, "findByGatewayId" | "countByGatewayId">;dynamicSecretDAL: Pick<TDynamicSecretDALFactory, "findByGatewayId" | "countByGatewayId">;identityKubernetesAuthDAL: Pick<TIdentityKubernetesAuthDALFactory, "findByGatewayId" | "countByGatewayId">;- aiMcpServerDAL: Pick<TAiMcpServerDALFactory, "findByGatewayId" | "countByGatewayId">;pkiDiscoveryConfigDAL: Pick<TPkiDiscoveryConfigDALFactory, "findByGatewayId" | "countByGatewayId">;resourceAuthMethodService: Pick<TResourceAuthMethodServiceFactory,@@ -87,7 +85,6 @@ export const gatewayV2ServiceFactory = ({appConnectionDAL,dynamicSecretDAL,identityKubernetesAuthDAL,- aiMcpServerDAL,pkiDiscoveryConfigDAL,resourceAuthMethodService}: TGatewayV2ServiceFactoryDep) => {@@ -302,21 +299,15 @@ export const gatewayV2ServiceFactory = ({const gatewayIds = gateways.map((g) => g.id);- const [- appConnectionsCounts,- dynamicSecretsCounts,- 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) => 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 [appConnectionsCounts, dynamicSecretsCounts, kubernetesAuthsCounts, 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) => identityKubernetesAuthDAL.countByGatewayId(id).then((count) => ({ id, count })))+ ),+ Promise.all(gatewayIds.map((id) => pkiDiscoveryConfigDAL.countByGatewayId(id).then((count) => ({ id, count }))))+ ]);const countMap = new Map<string, number>();@@ -329,9 +320,6 @@ export const gatewayV2ServiceFactory = ({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);}@@ -1160,11 +1148,10 @@ export const gatewayV2ServiceFactory = ({OrgPermissionSubjects.Gateway);- const [appConnections, dynamicSecrets, kubernetesAuths, mcpServers, pkiDiscoveryConfigs] = await Promise.all([+ const [appConnections, dynamicSecrets, kubernetesAuths, pkiDiscoveryConfigs] = await Promise.all([appConnectionDAL.findByGatewayId(gatewayId),dynamicSecretDAL.findByGatewayId(gatewayId),identityKubernetesAuthDAL.findByGatewayId(gatewayId),- aiMcpServerDAL.findByGatewayId(gatewayId),pkiDiscoveryConfigDAL.findByGatewayId(gatewayId)]);@@ -1172,7 +1159,6 @@ export const gatewayV2ServiceFactory = ({appConnections,dynamicSecrets,kubernetesAuths,- mcpServers,pkiDiscoveryConfigs};};diff --git a/backend/src/ee/services/gateway-v2/gateway-v2-types.ts b/backend/src/ee/services/gateway-v2/gateway-v2-types.tsindex af8ff4da09..a7cbb9bdec 100644--- a/backend/src/ee/services/gateway-v2/gateway-v2-types.ts+++ b/backend/src/ee/services/gateway-v2/gateway-v2-types.ts@@ -35,13 +35,6 @@ export type TGatewayConnectedKubernetesAuth = {identityName: string;};-export type TGatewayConnectedMcpServer = {- id: string;- name: string;- projectId: string;- projectName?: string;-};-export type TGatewayConnectedPkiDiscoveryConfig = {id: string;name: string;@@ -53,6 +46,5 @@ export type TGatewayConnectedResources = {appConnections: TGatewayConnectedAppConnection[];dynamicSecrets: TGatewayConnectedDynamicSecret[];kubernetesAuths: TGatewayConnectedKubernetesAuth[];- mcpServers: TGatewayConnectedMcpServer[];pkiDiscoveryConfigs: TGatewayConnectedPkiDiscoveryConfig[];};diff --git a/backend/src/ee/services/license/__mocks__/license-fns.ts b/backend/src/ee/services/license/__mocks__/license-fns.tsindex 85d91628e6..52f75e3fdc 100644--- a/backend/src/ee/services/license/__mocks__/license-fns.ts+++ b/backend/src/ee/services/license/__mocks__/license-fns.ts@@ -38,7 +38,6 @@ export const getDefaultOnPremFeatures = () => {secretApproval: true,secretRotation: true,caCrl: false,- sshHostGroups: false,enterpriseSecretSyncs: false,enterpriseCertificateSyncs: false,enterpriseAppConnections: true,diff --git a/backend/src/ee/services/license/licence-enums.ts b/backend/src/ee/services/license/licence-enums.tsindex 64a08667f5..06d9c9d56e 100644--- a/backend/src/ee/services/license/licence-enums.ts+++ b/backend/src/ee/services/license/licence-enums.ts@@ -9,7 +9,6 @@ export const BillingPlanRows = {CustomAlerts: { name: "Custom alerts", field: "customAlerts" },AuditLogs: { name: "Audit logs", field: "auditLogs" },SamlSSO: { name: "SAML SSO", field: "samlSSO" },- SshHostGroups: { name: "SSH Host Groups", field: "sshHostGroups" },Hsm: { name: "Hardware Security Module (HSM)", field: "hsm" },OidcSSO: { name: "OIDC SSO", field: "oidcSSO" },SecretApproval: { name: "Secret approvals", field: "secretApproval" },diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.tsindex 75bad2c30b..b7c81ce7f2 100644--- a/backend/src/ee/services/license/license-fns.ts+++ b/backend/src/ee/services/license/license-fns.ts@@ -113,7 +113,6 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({gateway: false,gatewayPool: false,pamSlackNotifications: false,- sshHostGroups: false,secretScanning: false,enterpriseSecretSyncs: false,enterpriseCertificateSyncs: false,diff --git a/backend/src/ee/services/license/license-types.ts b/backend/src/ee/services/license/license-types.tsindex 0dcd972035..ef193b42d5 100644--- a/backend/src/ee/services/license/license-types.ts+++ b/backend/src/ee/services/license/license-types.ts@@ -101,7 +101,6 @@ export type TFeatureSet = {gateway: false;gatewayPool: false;pamSlackNotifications: boolean;- sshHostGroups: false;secretScanning: false;enterpriseSecretSyncs: false;enterpriseCertificateSyncs: false;diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.tsindex 48cd2c9867..9a489bc67c 100644--- a/backend/src/ee/services/pam-account/pam-account-service.ts+++ b/backend/src/ee/services/pam-account/pam-account-service.ts@@ -12,11 +12,10 @@ import {ResourcePermissionSet,ResourcePermissionSub} from "@app/ee/services/permission/resource-permission";-import { createSshKeyPair } from "@app/ee/services/ssh/ssh-certificate-authority-fns";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";import { conditionsMatcher } from "@app/lib/casl";import { DatabaseErrorCode } from "@app/lib/error-codes";import { BadRequestError, DatabaseError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";+import { createSshKeyPair, SshCertKeyAlgorithm } from "@app/lib/ssh";import { TAppConnectionDALFactory } from "@app/services/app-connection/app-connection-dal";import { TKmsServiceFactory } from "@app/services/kms/kms-service";import { KmsDataKey } from "@app/services/kms/kms-types";diff --git a/backend/src/ee/services/pam-discovery/pam-discovery-source-service.ts b/backend/src/ee/services/pam-discovery/pam-discovery-source-service.tsindex 454946aed7..ef4daa56f7 100644--- a/backend/src/ee/services/pam-discovery/pam-discovery-source-service.ts+++ b/backend/src/ee/services/pam-discovery/pam-discovery-source-service.ts@@ -6,14 +6,12 @@ import { TGatewayV2DALFactory } from "@app/ee/services/gateway-v2/gateway-v2-dalimport { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";import { ResourcePermissionPamResourceActions } from "@app/ee/services/permission/resource-permission";-import { createSshCert, createSshKeyPair } from "@app/ee/services/ssh/ssh-certificate-authority-fns";-import { SshCertType } from "@app/ee/services/ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";import { getConfig } from "@app/lib/config/env";import { CronJobName, TCronJobFactory } from "@app/lib/cron/cron-job";import { DatabaseErrorCode } from "@app/lib/error-codes";import { BadRequestError, DatabaseError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";import { logger } from "@app/lib/logger";+import { createSshCert, createSshKeyPair, SshCertKeyAlgorithm, SshCertType } from "@app/lib/ssh";import { QueueJobs, QueueName, TQueueServiceFactory } from "@app/queue";import { ActorType } from "@app/services/auth/auth-type";import { TKmsServiceFactory } from "@app/services/kms/kms-service";diff --git a/backend/src/ee/services/pam-session/pam-session-service.ts b/backend/src/ee/services/pam-session/pam-session-service.tsindex 482d614bbd..8cd1a95766 100644--- a/backend/src/ee/services/pam-session/pam-session-service.ts+++ b/backend/src/ee/services/pam-session/pam-session-service.ts@@ -3,11 +3,9 @@ import RE2 from "re2";import { TGatewayPoolServiceFactory } from "@app/ee/services/gateway-pool/gateway-pool-service";import { TGatewayV2ServiceFactory } from "@app/ee/services/gateway-v2/gateway-v2-service";import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";-import { createSshCert, createSshKeyPair } from "@app/ee/services/ssh/ssh-certificate-authority-fns";-import { SshCertType } from "@app/ee/services/ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";import { ms } from "@app/lib/ms";+import { createSshCert, createSshKeyPair, SshCertKeyAlgorithm, SshCertType } from "@app/lib/ssh";import { ActorType } from "@app/services/auth/auth-type";import { TKmsServiceFactory } from "@app/services/kms/kms-service";import { KmsDataKey } from "@app/services/kms/kms-types";diff --git a/backend/src/ee/services/permission/default-roles.ts b/backend/src/ee/services/permission/default-roles.tsindex 414518acf8..215fdcf537 100644--- a/backend/src/ee/services/permission/default-roles.ts+++ b/backend/src/ee/services/permission/default-roles.ts@@ -21,7 +21,6 @@ import {ProjectPermissionIdentityActions,ProjectPermissionInsightsActions,ProjectPermissionKmipActions,- ProjectPermissionMcpEndpointActions,ProjectPermissionMemberActions,ProjectPermissionPkiCertificateInstallationActions,ProjectPermissionPkiDiscoveryActions,@@ -39,7 +38,6 @@ import {ProjectPermissionSecretScanningFindingActions,ProjectPermissionSecretSyncActions,ProjectPermissionSet,- ProjectPermissionSshHostActions,ProjectPermissionSub} from "@app/ee/services/permission/project-permission";import {@@ -71,13 +69,7 @@ const buildAdminPermissionRules = () => {ProjectPermissionSub.IpAllowList,ProjectPermissionSub.PkiAlerts,ProjectPermissionSub.PkiCollections,- ProjectPermissionSub.CertificateInventoryViews,- ProjectPermissionSub.SshCertificateAuthorities,- ProjectPermissionSub.SshCertificates,- ProjectPermissionSub.SshCertificateTemplates,- ProjectPermissionSub.SshHostGroups,- ProjectPermissionSub.McpServers,- ProjectPermissionSub.McpActivityLogs+ ProjectPermissionSub.CertificateInventoryViews].forEach((el) => {can([@@ -176,17 +168,6 @@ const buildAdminPermissionRules = () => {ProjectPermissionSub.Commits);- can(- [- ProjectPermissionSshHostActions.Edit,- ProjectPermissionSshHostActions.Read,- ProjectPermissionSshHostActions.Create,- ProjectPermissionSshHostActions.Delete,- ProjectPermissionSshHostActions.IssueHostCert- ],- ProjectPermissionSub.SshHosts- );-can([ProjectPermissionPkiSubscriberActions.Edit,@@ -430,17 +411,6 @@ const buildAdminPermissionRules = () => {ProjectPermissionSub.HoneyTokens);- can(- [- ProjectPermissionMcpEndpointActions.Read,- ProjectPermissionMcpEndpointActions.Connect,- ProjectPermissionMcpEndpointActions.Create,- ProjectPermissionMcpEndpointActions.Edit,- ProjectPermissionMcpEndpointActions.Delete- ],- ProjectPermissionSub.McpEndpoints- );-can([ProjectPermissionApprovalRequestActions.Read, ProjectPermissionApprovalRequestActions.Create],ProjectPermissionSub.ApprovalRequests@@ -634,12 +604,6 @@ const buildMemberPermissionRules = () => {ProjectPermissionSub.Application);- can([ProjectPermissionActions.Read], ProjectPermissionSub.SshCertificates);- can([ProjectPermissionActions.Create], ProjectPermissionSub.SshCertificates);- can([ProjectPermissionActions.Read], ProjectPermissionSub.SshCertificateTemplates);-- can([ProjectPermissionSshHostActions.Read], ProjectPermissionSub.SshHosts);-can([ProjectPermissionCmekActions.Create,@@ -704,10 +668,6 @@ const buildMemberPermissionRules = () => {ProjectPermissionSub.HsmConnectors);- can([ProjectPermissionMcpEndpointActions.Read], ProjectPermissionSub.McpEndpoints);- can([ProjectPermissionActions.Read], ProjectPermissionSub.McpServers);- can([ProjectPermissionActions.Read], ProjectPermissionSub.McpActivityLogs);-can([ProjectPermissionApprovalRequestActions.Create], ProjectPermissionSub.ApprovalRequests);return rules;@@ -750,8 +710,6 @@ const buildViewerPermissionRules = () => {can(ProjectPermissionPkiTemplateActions.Read, ProjectPermissionSub.CertificateTemplates);can(ProjectPermissionCertificatePolicyActions.Read, ProjectPermissionSub.CertificatePolicies);can(ProjectPermissionCmekActions.Read, ProjectPermissionSub.Cmek);- can(ProjectPermissionActions.Read, ProjectPermissionSub.SshCertificates);- can(ProjectPermissionActions.Read, ProjectPermissionSub.SshCertificateTemplates);can(ProjectPermissionSecretSyncActions.Read, ProjectPermissionSub.SecretSyncs);can(ProjectPermissionPkiSyncActions.Read, ProjectPermissionSub.PkiSyncs);can(@@ -786,10 +744,6 @@ const buildViewerPermissionRules = () => {ProjectPermissionSub.SecretEventSubscriptions);- can([ProjectPermissionMcpEndpointActions.Read], ProjectPermissionSub.McpEndpoints);- can([ProjectPermissionActions.Read], ProjectPermissionSub.McpServers);- can([ProjectPermissionActions.Read], ProjectPermissionSub.McpActivityLogs);-return rules;};@@ -798,17 +752,6 @@ const buildNoAccessProjectPermission = () => {return rules;};-const buildSshHostBootstrapPermissionRules = () => {- const { can, rules } = new AbilityBuilder<MongoAbility<ProjectPermissionSet>>(createMongoAbility);-- can(- [ProjectPermissionSshHostActions.Create, ProjectPermissionSshHostActions.IssueHostCert],- ProjectPermissionSub.SshHosts- );-- return rules;-};-const buildCryptographicOperatorPermissionRules = () => {const { can, rules } = new AbilityBuilder<MongoAbility<ProjectPermissionSet>>(createMongoAbility);@@ -833,9 +776,6 @@ export const projectMemberPermissions = buildMemberPermissionRules();export const projectViewerPermission = buildViewerPermissionRules();export const projectNoAccessPermissions = buildNoAccessProjectPermission();-// SSH-export const sshHostBootstrapPermissions = buildSshHostBootstrapPermissionRules();-// KMSexport const cryptographicOperatorPermissions = buildCryptographicOperatorPermissionRules();diff --git a/backend/src/ee/services/permission/permission-service.ts b/backend/src/ee/services/permission/permission-service.tsindex 6a8031a867..8681150302 100644--- a/backend/src/ee/services/permission/permission-service.ts+++ b/backend/src/ee/services/permission/permission-service.ts@@ -31,8 +31,7 @@ import {projectViewerPermission,signerAdminPermissions,signerAuditorPermissions,- signerOperatorPermissions,- sshHostBootstrapPermissions+ signerOperatorPermissions} from "@app/ee/services/permission/default-roles";import { ResourcePermissionSet } from "@app/ee/services/permission/resource-permission";import { KeyStorePrefixes, KeyStoreTtls, TKeyStoreFactory } from "@app/keystore/keystore";@@ -40,6 +39,7 @@ import { withCacheFingerprint } from "@app/lib/cache/with-cache";import { conditionsMatcher } from "@app/lib/casl";import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";import { objectify } from "@app/lib/fn";+import { logger } from "@app/lib/logger";import { requestMemoKeys } from "@app/lib/request-context/memo-keys";import { RequestContextKey } from "@app/lib/request-context/request-context-keys";import { requestMemoize } from "@app/lib/request-context/request-memoizer";@@ -133,8 +133,6 @@ const buildProjectPermissionRules = (projectUserRoles: TBuildProjectPermissionDTreturn projectViewerPermission;case ProjectMembershipRole.NoAccess:return projectNoAccessPermissions;- case ProjectMembershipRole.SshHostBootstrapper:- return sshHostBootstrapPermissions;case ProjectMembershipRole.KmsCryptographicOperator:return cryptographicOperatorPermissions;case ProjectMembershipRole.Custom: {@@ -143,10 +141,12 @@ const buildProjectPermissionRules = (projectUserRoles: TBuildProjectPermissionDT);}default:- throw new NotFoundError({- name: "ProjectRoleInvalid",- message: `Project role '${role}' not found`- });+ // Membership rows can still hold role slugs whose products were removed+ // (e.g. "ssh-host-bootstrapper"). Contribute no rules instead of failing+ // the whole permission build, so the actor's other roles keep working;+ // backend-go skips unknown slugs the same way.+ logger.warn(`buildProjectPermissionRules: unknown project role slug, granting no rules [role=${role}]`);+ return [];}}).reduce((prev, curr) => prev.concat(curr), [] as RawRuleOf<MongoAbility<ProjectPermissionSet>>[])diff --git a/backend/src/ee/services/permission/project-permission.ts b/backend/src/ee/services/permission/project-permission.tsindex f7330aa127..3208f6e729 100644--- a/backend/src/ee/services/permission/project-permission.ts+++ b/backend/src/ee/services/permission/project-permission.ts@@ -109,14 +109,6 @@ export enum ProjectPermissionGroupActions {AssignRole = "assign-role"}-export enum ProjectPermissionSshHostActions {- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete",- IssueHostCert = "issue-host-cert"-}-export enum ProjectPermissionPkiTemplateActions {Read = "read",Create = "create",@@ -274,14 +266,6 @@ export enum ProjectPermissionInsightsActions {DeleteReport = "delete-report"}-export enum ProjectPermissionMcpEndpointActions {- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete",- Connect = "connect"-}-export enum ProjectPermissionHoneyTokenActions {Read = "read",ReadCredentials = "read-credentials",@@ -349,11 +333,6 @@ export enum ProjectPermissionSub {CertificateAuthorities = "certificate-authorities",Certificates = "certificates",CertificateTemplates = "certificate-templates",- SshCertificateAuthorities = "ssh-certificate-authorities",- SshCertificates = "ssh-certificates",- SshCertificateTemplates = "ssh-certificate-templates",- SshHosts = "ssh-hosts",- SshHostGroups = "ssh-host-groups",PkiSubscribers = "pki-subscribers",PkiAlerts = "pki-alerts",PkiCollections = "pki-collections",@@ -378,9 +357,6 @@ export enum ProjectPermissionSub {ApprovalRequests = "approval-requests",ApprovalRequestGrants = "approval-request-grants",ProjectFolderGrant = "project-folder-grant",- McpEndpoints = "mcp-endpoints",- McpServers = "mcp-servers",- McpActivityLogs = "mcp-activity-logs",HoneyTokens = "honey-tokens",ProxiedServices = "proxied-services",Insights = "insights"@@ -504,10 +480,6 @@ export type GroupSubjectFields = {assignableRole?: string;};-export type SshHostSubjectFields = {- hostname: string;-};-export type PkiTemplateSubjectFields = {name: string;// (dangtony98): consider adding [commonName] as a subject field in the future@@ -547,10 +519,6 @@ export type AppConnectionSubjectFields = {connectionId: string;};-export type McpEndpointSubjectFields = {- name: string;-};-export type HoneyTokenSubjectFields = {environment: string;secretPath: string;@@ -650,13 +618,6 @@ export type ProjectPermissionSet =| (ForcedSubject<ProjectPermissionSub.CertificateTemplates> & PkiTemplateSubjectFields))]- | [ProjectPermissionActions, ProjectPermissionSub.SshCertificateAuthorities]- | [ProjectPermissionActions, ProjectPermissionSub.SshCertificates]- | [ProjectPermissionActions, ProjectPermissionSub.SshCertificateTemplates]- | [- ProjectPermissionSshHostActions,- ProjectPermissionSub.SshHosts | (ForcedSubject<ProjectPermissionSub.SshHosts> & SshHostSubjectFields)- ]| [ProjectPermissionPkiSubscriberActions,(@@ -664,7 +625,6 @@ export type ProjectPermissionSet =| (ForcedSubject<ProjectPermissionSub.PkiSubscribers> & PkiSubscriberSubjectFields))]- | [ProjectPermissionActions, ProjectPermissionSub.SshHostGroups]| [ProjectPermissionActions, ProjectPermissionSub.PkiAlerts]| [ProjectPermissionActions, ProjectPermissionSub.PkiCollections]| [ProjectPermissionActions, ProjectPermissionSub.CertificateInventoryViews]@@ -697,10 +657,6 @@ export type ProjectPermissionSet =)]| [ProjectPermissionHsmConnectorActions, ProjectPermissionSub.HsmConnectors]- | [- ProjectPermissionMcpEndpointActions,- ProjectPermissionSub.McpEndpoints | (ForcedSubject<ProjectPermissionSub.McpEndpoints> & McpEndpointSubjectFields)- ]| [ProjectPermissionHoneyTokenActions,ProjectPermissionSub.HoneyTokens | (ForcedSubject<ProjectPermissionSub.HoneyTokens> & HoneyTokenSubjectFields)@@ -712,8 +668,6 @@ export type ProjectPermissionSet =| (ForcedSubject<ProjectPermissionSub.ProxiedServices> & ProxiedServiceSubjectFields))]- | [ProjectPermissionActions, ProjectPermissionSub.McpServers]- | [ProjectPermissionActions, ProjectPermissionSub.McpActivityLogs]| [ProjectPermissionCertificateProfileActions,(@@ -1244,37 +1198,6 @@ const GroupConditionSchema = z}).partial();-const SshHostConditionSchema = z- .object({- hostname: z.union([- z.string(),- z- .object({- [PermissionConditionOperators.$EQ]: PermissionConditionSchema[PermissionConditionOperators.$EQ],- [PermissionConditionOperators.$GLOB]: PermissionConditionSchema[PermissionConditionOperators.$GLOB],- [PermissionConditionOperators.$IN]: PermissionConditionSchema[PermissionConditionOperators.$IN]- })- .partial()- ])- })- .partial();--const McpEndpointConditionSchema = z- .object({- name: z.union([- z.string(),- z- .object({- [PermissionConditionOperators.$EQ]: PermissionConditionSchema[PermissionConditionOperators.$EQ],- [PermissionConditionOperators.$NEQ]: PermissionConditionSchema[PermissionConditionOperators.$NEQ],- [PermissionConditionOperators.$GLOB]: PermissionConditionSchema[PermissionConditionOperators.$GLOB],- [PermissionConditionOperators.$IN]: PermissionConditionSchema[PermissionConditionOperators.$IN]- })- .partial()- ])- })- .partial();-const PkiSubscriberConditionSchema = z.object({name: z.union([@@ -1540,34 +1463,6 @@ const GeneralPermissionSchema = ["Describe what action an entity can take.")}),- z.object({- subject: z- .literal(ProjectPermissionSub.SshCertificateAuthorities)- .describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(- "Describe what action an entity can take."- )- }),- z.object({- subject: z.literal(ProjectPermissionSub.SshCertificates).describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(- "Describe what action an entity can take."- )- }),- z.object({- subject: z- .literal(ProjectPermissionSub.SshCertificateTemplates)- .describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(- "Describe what action an entity can take."- )- }),- z.object({- subject: z.literal(ProjectPermissionSub.SshHostGroups).describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(- "Describe what action an entity can take."- )- }),z.object({subject: z.literal(ProjectPermissionSub.PkiAlerts).describe("The entity this permission pertains to."),action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(@@ -1678,28 +1573,6 @@ const GeneralPermissionSchema = ["Describe what action an entity can take.")}),- z.object({- subject: z.literal(ProjectPermissionSub.McpEndpoints).describe("The entity this permission pertains to."),- inverted: z.boolean().optional().describe("Whether rule allows or forbids."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionMcpEndpointActions).describe(- "Describe what action an entity can take."- ),- conditions: McpEndpointConditionSchema.describe(- "When specified, only matching conditions will be allowed to access given resource."- ).optional()- }),- z.object({- subject: z.literal(ProjectPermissionSub.McpServers).describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(- "Describe what action an entity can take."- )- }),- z.object({- subject: z.literal(ProjectPermissionSub.McpActivityLogs).describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionActions).describe(- "Describe what action an entity can take."- )- }),z.object({subject: z.literal(ProjectPermissionSub.HoneyTokens).describe("The entity this permission pertains to."),inverted: z.boolean().optional().describe("Whether rule allows or forbids."),@@ -1784,6 +1657,38 @@ export const ProjectPermissionV1Schema = z.discriminatedUnion("subject", [...GeneralPermissionSchema]);+// DEPRECATED, tolerated write vocabulary for removed products (SSH, Agent Sentinel).+//+// The products were removed in ENG-5432, but permission JSON stored in customer+// databases (custom roles, user/identity additional privileges, project templates)+// and enumerated in API/Terraform configs can still carry these subjects. This+// schema validates every permission write, so rejecting them would 422 any+// read-modify-write client that round-trips a stale rule (e.g. the Terraform+// project-template resource re-sends server-read roles on unrelated edits).+//+// These entries accept the historical vocabulary and grant nothing: no enforcement+// code checks these subjects anymore, so matching CASL rules are inert. Do not add+// new consumers. Remove this block together with a data migration that scrubs the+// subjects from stored permission JSON in a future breaking release.+const DeprecatedRemovedSubjectActionSchema = z+ .union([z.string().trim().min(1).max(64), z.string().trim().min(1).max(64).array().min(1)])+ .transform((el) => (typeof el === "string" ? [el] : el));++const buildDeprecatedRemovedSubjectSchema = <T extends string>(subject: T) =>+ z.object({+ subject: z+ .literal(subject)+ .describe("DEPRECATED. The entity belonged to a removed product; accepted for backwards compatibility."),+ inverted: z.boolean().optional().describe("Whether rule allows or forbids."),+ action: DeprecatedRemovedSubjectActionSchema.describe(+ "DEPRECATED. Accepted for backwards compatibility; grants nothing."+ ),+ conditions: z+ .record(z.string(), z.unknown())+ .optional()+ .describe("DEPRECATED. Accepted for backwards compatibility; ignored.")+ });+export const ProjectPermissionV2Schema = z.discriminatedUnion("subject", [z.object({subject: z.literal(ProjectPermissionSub.Secrets).describe("The entity this permission pertains to."),@@ -1835,16 +1740,6 @@ export const ProjectPermissionV2Schema = z.discriminatedUnion("subject", ["When specified, only matching conditions will be allowed to access given resource.").optional()}),- z.object({- subject: z.literal(ProjectPermissionSub.SshHosts).describe("The entity this permission pertains to."),- action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionSshHostActions).describe(- "Describe what action an entity can take."- ),- inverted: z.boolean().optional().describe("Whether rule allows or forbids."),- conditions: SshHostConditionSchema.describe(- "When specified, only matching conditions will be allowed to access given resource."- ).optional()- }),z.object({subject: z.literal(ProjectPermissionSub.PkiSubscribers).describe("The entity this permission pertains to."),action: CASL_ACTION_SCHEMA_NATIVE_ENUM(ProjectPermissionPkiSubscriberActions).describe(@@ -1947,6 +1842,16 @@ export const ProjectPermissionV2Schema = z.discriminatedUnion("subject", ["When specified, only matching conditions will be allowed to access given resource.").optional()}),+ // DEPRECATED removed-product subjects, accepted but inert (see comment on+ // buildDeprecatedRemovedSubjectSchema above).+ buildDeprecatedRemovedSubjectSchema("ssh-certificate-authorities"),+ buildDeprecatedRemovedSubjectSchema("ssh-certificates"),+ buildDeprecatedRemovedSubjectSchema("ssh-certificate-templates"),+ buildDeprecatedRemovedSubjectSchema("ssh-hosts"),+ buildDeprecatedRemovedSubjectSchema("ssh-host-groups"),+ buildDeprecatedRemovedSubjectSchema("mcp-endpoints"),+ buildDeprecatedRemovedSubjectSchema("mcp-servers"),+ buildDeprecatedRemovedSubjectSchema("mcp-activity-logs"),...GeneralPermissionSchema]);diff --git a/backend/src/ee/services/project-template/project-template-service.ts b/backend/src/ee/services/project-template/project-template-service.tsindex 99e4ade816..694b599648 100644--- a/backend/src/ee/services/project-template/project-template-service.ts+++ b/backend/src/ee/services/project-template/project-template-service.ts@@ -155,12 +155,9 @@ export const projectTemplateServiceFactory = ({);return [- ...(type && type !== ProjectType.SSH+ ...(type? [getDefaultProjectTemplate(actor.orgId, type)]- : Object.values(ProjectType)- // Filter out SSH since we're deprecating- .filter((projectType) => projectType !== ProjectType.SSH)- .map((projectType) => getDefaultProjectTemplate(actor.orgId, projectType))),+ : Object.values(ProjectType).map((projectType) => getDefaultProjectTemplate(actor.orgId, projectType))),...templatesWithMembers];};@@ -276,10 +273,6 @@ export const projectTemplateServiceFactory = ({});});- if (type === ProjectType.AI) {- throw new BadRequestError({ message: "Agent Sentinel project templates are not supported" });- }-if (type === ProjectType.CertificateManager) {throw new BadRequestError({ message: "Certificate Manager project templates are not supported" });}diff --git a/backend/src/ee/services/relay/relay-service.ts b/backend/src/ee/services/relay/relay-service.tsindex ab4a488df5..7a05911ec3 100644--- a/backend/src/ee/services/relay/relay-service.ts+++ b/backend/src/ee/services/relay/relay-service.ts@@ -11,6 +11,7 @@ import { BadRequestError, DatabaseError, ForbiddenRequestError, NotFoundError }import { groupBy } from "@app/lib/fn";import { createRelayConnection } from "@app/lib/gateway-v2/gateway-v2";import { logger } from "@app/lib/logger";+import { createSshCert, createSshKeyPair, SshCertKeyAlgorithm, SshCertType } from "@app/lib/ssh";import { ActorAuthMethod, ActorType } from "@app/services/auth/auth-type";import { constructPemChainFromCerts, prependCertToPemChain } from "@app/services/certificate/certificate-fns";import { CertExtendedKeyUsage, CertKeyAlgorithm, CertKeyUsage } from "@app/services/certificate/certificate-types";@@ -31,9 +32,6 @@ import { TGatewayV2DALFactory } from "../gateway-v2/gateway-v2-dal";import { OrgPermissionRelayActions, OrgPermissionSubjects } from "../permission/org-permission";import { TPermissionServiceFactory } from "../permission/permission-service-types";import { TResourceAuthMethodServiceFactory } from "../resource-auth-method/resource-auth-method-service";-import { createSshCert, createSshKeyPair } from "../ssh/ssh-certificate-authority-fns";-import { SshCertType } from "../ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "../ssh-certificate/ssh-certificate-types";import { TInstanceRelayConfigDALFactory } from "./instance-relay-config-dal";import { TOrgRelayConfigDALFactory } from "./org-relay-config-dal";import { RELAY_CONNECTING_GATEWAY_INFO } from "./relay-constants";diff --git a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-dal.ts b/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-dal.tsdeleted file mode 100644index b8afa0df2a..0000000000--- a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-dal.ts+++ /dev/null@@ -1,66 +0,0 @@-import { Knex } from "knex";--import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { DatabaseError } from "@app/lib/errors";-import { ormify, selectAllTableCols } from "@app/lib/knex";--export type TSshCertificateTemplateDALFactory = ReturnType<typeof sshCertificateTemplateDALFactory>;--export const sshCertificateTemplateDALFactory = (db: TDbClient) => {- const sshCertificateTemplateOrm = ormify(db, TableName.SshCertificateTemplate);-- const getById = async (id: string, tx?: Knex) => {- try {- const certTemplate = await (tx || db.replicaNode())(TableName.SshCertificateTemplate)- .join(- TableName.SshCertificateAuthority,- `${TableName.SshCertificateAuthority}.id`,- `${TableName.SshCertificateTemplate}.sshCaId`- )- .join(TableName.Project, `${TableName.Project}.id`, `${TableName.SshCertificateAuthority}.projectId`)- .where(`${TableName.SshCertificateTemplate}.id`, "=", id)- .select(selectAllTableCols(TableName.SshCertificateTemplate))- .select(- db.ref("projectId").withSchema(TableName.SshCertificateAuthority),- db.ref("friendlyName").as("caName").withSchema(TableName.SshCertificateAuthority),- db.ref("status").as("caStatus").withSchema(TableName.SshCertificateAuthority)- )- .first();-- return certTemplate;- } catch (error) {- throw new DatabaseError({ error, name: "Get SSH certificate template by ID" });- }- };-- /**- * Returns the SSH certificate template named [name] within project with id [projectId]- */- const getByName = async (name: string, projectId: string, tx?: Knex) => {- try {- const certTemplate = await (tx || db.replicaNode())(TableName.SshCertificateTemplate)- .join(- TableName.SshCertificateAuthority,- `${TableName.SshCertificateAuthority}.id`,- `${TableName.SshCertificateTemplate}.sshCaId`- )- .join(TableName.Project, `${TableName.Project}.id`, `${TableName.SshCertificateAuthority}.projectId`)- .where(`${TableName.SshCertificateTemplate}.name`, "=", name)- .where(`${TableName.Project}.id`, "=", projectId)- .select(selectAllTableCols(TableName.SshCertificateTemplate))- .select(- db.ref("projectId").withSchema(TableName.SshCertificateAuthority),- db.ref("friendlyName").as("caName").withSchema(TableName.SshCertificateAuthority),- db.ref("status").as("caStatus").withSchema(TableName.SshCertificateAuthority)- )- .first();-- return certTemplate;- } catch (error) {- throw new DatabaseError({ error, name: "Get SSH certificate template by name" });- }- };-- return { ...sshCertificateTemplateOrm, getById, getByName };-};diff --git a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-schema.ts b/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-schema.tsdeleted file mode 100644index fb7a952035..0000000000--- a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-schema.ts+++ /dev/null@@ -1,15 +0,0 @@-import { SshCertificateTemplatesSchema } from "@app/db/schemas";--export const sanitizedSshCertificateTemplate = SshCertificateTemplatesSchema.pick({- id: true,- sshCaId: true,- status: true,- name: true,- ttl: true,- maxTTL: true,- allowedUsers: true,- allowedHosts: true,- allowCustomKeyIds: true,- allowUserCertificates: true,- allowHostCertificates: true-});diff --git a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-service.ts b/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-service.tsdeleted file mode 100644index 49d8c1ab67..0000000000--- a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-service.ts+++ /dev/null@@ -1,249 +0,0 @@-import { ForbiddenError } from "@casl/ability";--import { ActionProjectType } from "@app/db/schemas";-import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";-import { BadRequestError, NotFoundError } from "@app/lib/errors";-import { ms } from "@app/lib/ms";--import { TSshCertificateAuthorityDALFactory } from "../ssh/ssh-certificate-authority-dal";-import { TSshCertificateTemplateDALFactory } from "./ssh-certificate-template-dal";-import {- SshCertTemplateStatus,- TCreateSshCertTemplateDTO,- TDeleteSshCertTemplateDTO,- TGetSshCertTemplateDTO,- TUpdateSshCertTemplateDTO-} from "./ssh-certificate-template-types";--type TSshCertificateTemplateServiceFactoryDep = {- sshCertificateTemplateDAL: Pick<- TSshCertificateTemplateDALFactory,- "transaction" | "getByName" | "create" | "updateById" | "deleteById" | "getById"- >;- sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "findById">;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;-};--export type TSshCertificateTemplateServiceFactory = ReturnType<typeof sshCertificateTemplateServiceFactory>;--export const sshCertificateTemplateServiceFactory = ({- sshCertificateTemplateDAL,- sshCertificateAuthorityDAL,- permissionService-}: TSshCertificateTemplateServiceFactoryDep) => {- const createSshCertTemplate = async ({- sshCaId,- name,- ttl,- maxTTL,- allowUserCertificates,- allowHostCertificates,- allowedUsers,- allowedHosts,- allowCustomKeyIds,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TCreateSshCertTemplateDTO) => {- const ca = await sshCertificateAuthorityDAL.findById(sshCaId);- if (!ca) {- throw new NotFoundError({- message: `SSH CA with ID ${sshCaId} not found`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: ca.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Create,- ProjectPermissionSub.SshCertificateTemplates- );-- if (ms(ttl) > ms(maxTTL)) {- throw new BadRequestError({- message: "TTL cannot be greater than max TTL"- });- }-- const newCertificateTemplate = await sshCertificateTemplateDAL.transaction(async (tx) => {- const existingTemplate = await sshCertificateTemplateDAL.getByName(name, ca.projectId, tx);- if (existingTemplate) {- throw new BadRequestError({- message: `SSH certificate template with name ${name} already exists`- });- }-- const certificateTemplate = await sshCertificateTemplateDAL.create(- {- sshCaId,- name,- ttl,- maxTTL,- allowUserCertificates,- allowHostCertificates,- allowedUsers,- allowedHosts,- allowCustomKeyIds,- status: SshCertTemplateStatus.ACTIVE- },- tx- );-- return certificateTemplate;- });-- return { certificateTemplate: newCertificateTemplate, ca };- };-- const updateSshCertTemplate = async ({- id,- status,- name,- ttl,- maxTTL,- allowUserCertificates,- allowHostCertificates,- allowedUsers,- allowedHosts,- allowCustomKeyIds,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TUpdateSshCertTemplateDTO) => {- const certTemplate = await sshCertificateTemplateDAL.getById(id);- if (!certTemplate) {- throw new NotFoundError({- message: `SSH certificate template with ID ${id} not found`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: certTemplate.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Edit,- ProjectPermissionSub.SshCertificateTemplates- );-- const updatedCertificateTemplate = await sshCertificateTemplateDAL.transaction(async (tx) => {- if (name) {- const existingTemplate = await sshCertificateTemplateDAL.getByName(name, certTemplate.projectId, tx);- if (existingTemplate && existingTemplate.id !== id) {- throw new BadRequestError({- message: `SSH certificate template with name ${name} already exists`- });- }- }-- if (ms(ttl || certTemplate.ttl) > ms(maxTTL || certTemplate.maxTTL)) {- throw new BadRequestError({- message: "TTL cannot be greater than max TTL"- });- }-- const certificateTemplate = await sshCertificateTemplateDAL.updateById(- id,- {- status,- name,- ttl,- maxTTL,- allowUserCertificates,- allowHostCertificates,- allowedUsers,- allowedHosts,- allowCustomKeyIds- },- tx- );-- return certificateTemplate;- });-- return {- certificateTemplate: updatedCertificateTemplate,- projectId: certTemplate.projectId- };- };-- const deleteSshCertTemplate = async ({- id,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TDeleteSshCertTemplateDTO) => {- const certificateTemplate = await sshCertificateTemplateDAL.getById(id);- if (!certificateTemplate) {- throw new NotFoundError({- message: `SSH certificate template with ID ${id} not found`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: certificateTemplate.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Delete,- ProjectPermissionSub.SshCertificateTemplates- );-- await sshCertificateTemplateDAL.deleteById(certificateTemplate.id);-- return certificateTemplate;- };-- const getSshCertTemplate = async ({ id, actorId, actorAuthMethod, actor, actorOrgId }: TGetSshCertTemplateDTO) => {- const certTemplate = await sshCertificateTemplateDAL.getById(id);- if (!certTemplate) {- throw new NotFoundError({- message: `SSH certificate template with ID ${id} not found`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: certTemplate.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Read,- ProjectPermissionSub.SshCertificateTemplates- );-- return certTemplate;- };-- return {- createSshCertTemplate,- updateSshCertTemplate,- deleteSshCertTemplate,- getSshCertTemplate- };-};diff --git a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-types.ts b/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-types.tsdeleted file mode 100644index 64de1bf0c1..0000000000--- a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-types.ts+++ /dev/null@@ -1,39 +0,0 @@-import { TProjectPermission } from "@app/lib/types";--export enum SshCertTemplateStatus {- ACTIVE = "active",- DISABLED = "disabled"-}--export type TCreateSshCertTemplateDTO = {- sshCaId: string;- name: string;- ttl: string;- maxTTL: string;- allowUserCertificates: boolean;- allowHostCertificates: boolean;- allowedUsers: string[];- allowedHosts: string[];- allowCustomKeyIds: boolean;-} & Omit<TProjectPermission, "projectId">;--export type TUpdateSshCertTemplateDTO = {- id: string;- status?: SshCertTemplateStatus;- name?: string;- ttl?: string;- maxTTL?: string;- allowUserCertificates?: boolean;- allowHostCertificates?: boolean;- allowedUsers?: string[];- allowedHosts?: string[];- allowCustomKeyIds?: boolean;-} & Omit<TProjectPermission, "projectId">;--export type TGetSshCertTemplateDTO = {- id: string;-} & Omit<TProjectPermission, "projectId">;--export type TDeleteSshCertTemplateDTO = {- id: string;-} & Omit<TProjectPermission, "projectId">;diff --git a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-validators.ts b/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-validators.tsdeleted file mode 100644index a09cc55ff4..0000000000--- a/backend/src/ee/services/ssh-certificate-template/ssh-certificate-template-validators.ts+++ /dev/null@@ -1,35 +0,0 @@-import { isIP } from "net";-import RE2 from "re2";--import { isFQDN } from "@app/lib/validator/validate-url";--// Validates usernames or wildcard (*)-export const isValidUserPattern = (value: string): boolean => {- // Length check before regex to prevent ReDoS- if (typeof value !== "string") return false;- if (value.length > 32) return false; // Maximum Linux username length- if (value === "*") return true; // Handle wildcard separately-- // Simpler, more specific pattern for usernames- const userRegex = new RE2(/^[a-z_][a-z0-9_-]*$/i);- return userRegex.test(value);-};--// Validates hostnames, wildcard domains, or IP addresses-export const isValidHostPattern = (value: string): boolean => {- // Input validation- if (typeof value !== "string") return false;-- // Length check- if (value.length > 255) return false;-- // Handle the wildcard case separately- if (value === "*") return true;-- // Check for IP addresses using Node.js built-in functions- if (isIP(value)) return true;-- return isFQDN(value, {- allow_wildcard: true- });-};diff --git a/backend/src/ee/services/ssh-certificate/ssh-certificate-body-dal.ts b/backend/src/ee/services/ssh-certificate/ssh-certificate-body-dal.tsdeleted file mode 100644index c3d16a39e0..0000000000--- a/backend/src/ee/services/ssh-certificate/ssh-certificate-body-dal.ts+++ /dev/null@@ -1,10 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TSshCertificateBodyDALFactory = ReturnType<typeof sshCertificateBodyDALFactory>;--export const sshCertificateBodyDALFactory = (db: TDbClient) => {- const sshCertificateBodyOrm = ormify(db, TableName.SshCertificateBody);- return sshCertificateBodyOrm;-};diff --git a/backend/src/ee/services/ssh-certificate/ssh-certificate-dal.ts b/backend/src/ee/services/ssh-certificate/ssh-certificate-dal.tsdeleted file mode 100644index 9c5bd1d3eb..0000000000--- a/backend/src/ee/services/ssh-certificate/ssh-certificate-dal.ts+++ /dev/null@@ -1,38 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { DatabaseError } from "@app/lib/errors";-import { ormify } from "@app/lib/knex";--export type TSshCertificateDALFactory = ReturnType<typeof sshCertificateDALFactory>;--export const sshCertificateDALFactory = (db: TDbClient) => {- const sshCertificateOrm = ormify(db, TableName.SshCertificate);-- const countSshCertificatesInProject = async (projectId: string) => {- try {- interface CountResult {- count: string;- }-- const query = db- .replicaNode()(TableName.SshCertificate)- .join(- TableName.SshCertificateAuthority,- `${TableName.SshCertificate}.sshCaId`,- `${TableName.SshCertificateAuthority}.id`- )- .join(TableName.Project, `${TableName.SshCertificateAuthority}.projectId`, `${TableName.Project}.id`)- .where(`${TableName.Project}.id`, projectId);-- const count = await query.count("*").first();-- return parseInt((count as unknown as CountResult).count || "0", 10);- } catch (error) {- throw new DatabaseError({ error, name: "Count all SSH certificates in project" });- }- };- return {- ...sshCertificateOrm,- countSshCertificatesInProject- };-};diff --git a/backend/src/ee/services/ssh-certificate/ssh-certificate-schema.ts b/backend/src/ee/services/ssh-certificate/ssh-certificate-schema.tsdeleted file mode 100644index cf8d59d8cd..0000000000--- a/backend/src/ee/services/ssh-certificate/ssh-certificate-schema.ts+++ /dev/null@@ -1,13 +0,0 @@-import { SshCertificatesSchema } from "@app/db/schemas";--export const sanitizedSshCertificate = SshCertificatesSchema.pick({- id: true,- sshCaId: true,- sshCertificateTemplateId: true,- serialNumber: true,- certType: true,- principals: true,- keyId: true,- notBefore: true,- notAfter: true-});diff --git a/backend/src/ee/services/ssh-certificate/ssh-certificate-types.ts b/backend/src/ee/services/ssh-certificate/ssh-certificate-types.tsdeleted file mode 100644index 14e2755eed..0000000000--- a/backend/src/ee/services/ssh-certificate/ssh-certificate-types.ts+++ /dev/null@@ -1,7 +0,0 @@-export enum SshCertKeyAlgorithm {- RSA_2048 = "RSA_2048",- RSA_4096 = "RSA_4096",- ECDSA_P256 = "EC_prime256v1",- ECDSA_P384 = "EC_secp384r1",- ED25519 = "ED25519"-}diff --git a/backend/src/ee/services/ssh-host-group/ssh-host-group-dal.ts b/backend/src/ee/services/ssh-host-group/ssh-host-group-dal.tsdeleted file mode 100644index 2f57cce3a2..0000000000--- a/backend/src/ee/services/ssh-host-group/ssh-host-group-dal.ts+++ /dev/null@@ -1,231 +0,0 @@-import { Knex } from "knex";--import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { BadRequestError, DatabaseError } from "@app/lib/errors";-import { groupBy, unique } from "@app/lib/fn";-import { ormify } from "@app/lib/knex";--import { EHostGroupMembershipFilter } from "./ssh-host-group-types";--export type TSshHostGroupDALFactory = ReturnType<typeof sshHostGroupDALFactory>;--export const sshHostGroupDALFactory = (db: TDbClient) => {- const sshHostGroupOrm = ormify(db, TableName.SshHostGroup);-- const findSshHostGroupsWithLoginMappings = async (projectId: string, tx?: Knex) => {- try {- // First, get all the SSH host groups with their login mappings- const rows = await (tx || db.replicaNode())(TableName.SshHostGroup)- .leftJoin(- TableName.SshHostLoginUser,- `${TableName.SshHostGroup}.id`,- `${TableName.SshHostLoginUser}.sshHostGroupId`- )- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.SshHostLoginUserMapping}.userId`, `${TableName.Users}.id`)- .leftJoin(TableName.Groups, `${TableName.SshHostLoginUserMapping}.groupId`, `${TableName.Groups}.id`)- .where(`${TableName.SshHostGroup}.projectId`, projectId)- .select(- db.ref("id").withSchema(TableName.SshHostGroup).as("sshHostGroupId"),- db.ref("projectId").withSchema(TableName.SshHostGroup),- db.ref("name").withSchema(TableName.SshHostGroup),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("username").withSchema(TableName.Users),- db.ref("userId").withSchema(TableName.SshHostLoginUserMapping),- db.ref("slug").withSchema(TableName.Groups).as("groupSlug")- )- .orderBy(`${TableName.SshHostGroup}.updatedAt`, "desc");-- const hostsGrouped = groupBy(rows, (r) => r.sshHostGroupId);-- const hostGroupIds = Object.keys(hostsGrouped);-- type HostCountRow = {- sshHostGroupId: string;- host_count: string;- };-- const hostCountsQuery = (await (tx ||- db- .replicaNode()(TableName.SshHostGroupMembership)- .select(`${TableName.SshHostGroupMembership}.sshHostGroupId`, db.raw(`count(*) as host_count`))- .whereIn(`${TableName.SshHostGroupMembership}.sshHostGroupId`, hostGroupIds)- .groupBy(`${TableName.SshHostGroupMembership}.sshHostGroupId`))) as HostCountRow[];-- const hostCountsMap = hostCountsQuery.reduce<Record<string, number>>((acc, { sshHostGroupId, host_count }) => {- acc[sshHostGroupId] = Number(host_count);- return acc;- }, {});-- return Object.values(hostsGrouped).map((hostRows) => {- const { sshHostGroupId, name } = hostRows[0];- const loginMappingGrouped = groupBy(- hostRows.filter((r) => r.loginUser),- (r) => r.loginUser- );- const loginMappings = Object.entries(loginMappingGrouped).map(([loginUser, entries]) => ({- loginUser,- allowedPrincipals: {- usernames: unique(entries.map((e) => e.username)).filter(Boolean),- groups: unique(entries.map((e) => e.groupSlug)).filter(Boolean)- }- }));- return {- id: sshHostGroupId,- projectId,- name,- loginMappings,- hostCount: hostCountsMap[sshHostGroupId] ?? 0- };- });- } catch (error) {- throw new DatabaseError({ error, name: `${TableName.SshHostGroup}: FindSshHostGroupsWithLoginMappings` });- }- };-- const findSshHostGroupByIdWithLoginMappings = async (sshHostGroupId: string, tx?: Knex) => {- try {- const rows = await (tx || db.replicaNode())(TableName.SshHostGroup)- .leftJoin(- TableName.SshHostLoginUser,- `${TableName.SshHostGroup}.id`,- `${TableName.SshHostLoginUser}.sshHostGroupId`- )- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.SshHostLoginUserMapping}.userId`, `${TableName.Users}.id`)- .leftJoin(TableName.Groups, `${TableName.SshHostLoginUserMapping}.groupId`, `${TableName.Groups}.id`)- .where(`${TableName.SshHostGroup}.id`, sshHostGroupId)- .select(- db.ref("id").withSchema(TableName.SshHostGroup).as("sshHostGroupId"),- db.ref("projectId").withSchema(TableName.SshHostGroup),- db.ref("name").withSchema(TableName.SshHostGroup),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("username").withSchema(TableName.Users),- db.ref("userId").withSchema(TableName.SshHostLoginUserMapping),- db.ref("slug").withSchema(TableName.Groups).as("groupSlug")- );-- if (rows.length === 0) return null;-- const { sshHostGroupId: id, projectId, name } = rows[0];-- const loginMappingGrouped = groupBy(- rows.filter((r) => r.loginUser),- (r) => r.loginUser- );-- const loginMappings = Object.entries(loginMappingGrouped).map(([loginUser, entries]) => ({- loginUser,- allowedPrincipals: {- usernames: unique(entries.map((e) => e.username)).filter(Boolean),- groups: unique(entries.map((e) => e.groupSlug)).filter(Boolean)- }- }));-- return {- id,- projectId,- name,- loginMappings- };- } catch (error) {- throw new DatabaseError({ error, name: `${TableName.SshHostGroup}: FindSshHostGroupByIdWithLoginMappings` });- }- };-- const findAllSshHostsInGroup = async ({- sshHostGroupId,- offset = 0,- limit,- filter- }: {- sshHostGroupId: string;- offset?: number;- limit?: number;- filter?: EHostGroupMembershipFilter;- }) => {- try {- const sshHostGroup = await db- .replicaNode()(TableName.SshHostGroup)- .where(`${TableName.SshHostGroup}.id`, sshHostGroupId)- .select("projectId")- .first();-- if (!sshHostGroup) {- throw new BadRequestError({- message: `SSH host group with ID ${sshHostGroupId} not found`- });- }-- const query = db- .replicaNode()(TableName.SshHost)- .where(`${TableName.SshHost}.projectId`, sshHostGroup.projectId)- .leftJoin(TableName.SshHostGroupMembership, (bd) => {- bd.on(`${TableName.SshHostGroupMembership}.sshHostId`, "=", `${TableName.SshHost}.id`).andOn(- `${TableName.SshHostGroupMembership}.sshHostGroupId`,- "=",- db.raw("?", [sshHostGroupId])- );- })- .select(- db.ref("id").withSchema(TableName.SshHost),- db.ref("hostname").withSchema(TableName.SshHost),- db.ref("alias").withSchema(TableName.SshHost),- db.ref("sshHostGroupId").withSchema(TableName.SshHostGroupMembership),- db.ref("createdAt").withSchema(TableName.SshHostGroupMembership).as("joinedGroupAt"),- db.raw(`count(*) OVER() as total_count`)- )- .offset(offset)- .orderBy(`${TableName.SshHost}.hostname`, "asc");-- if (limit) {- void query.limit(limit);- }-- if (filter) {- switch (filter) {- case EHostGroupMembershipFilter.GROUP_MEMBERS:- void query.andWhere(`${TableName.SshHostGroupMembership}.createdAt`, "is not", null);- break;- case EHostGroupMembershipFilter.NON_GROUP_MEMBERS:- void query.andWhere(`${TableName.SshHostGroupMembership}.createdAt`, "is", null);- break;- default:- break;- }- }-- const hosts = await query;-- return {- hosts: hosts.map(({ id, hostname, alias, sshHostGroupId: memberGroupId, joinedGroupAt }) => ({- id,- hostname,- alias,- isPartOfGroup: !!memberGroupId,- joinedGroupAt- })),- // @ts-expect-error col select is raw and not strongly typed- totalCount: Number(hosts?.[0]?.total_count ?? 0)- };- } catch (error) {- throw new DatabaseError({ error, name: `${TableName.SshHostGroupMembership}: FindAllSshHostsInGroup` });- }- };-- return {- findSshHostGroupsWithLoginMappings,- findSshHostGroupByIdWithLoginMappings,- findAllSshHostsInGroup,- ...sshHostGroupOrm- };-};diff --git a/backend/src/ee/services/ssh-host-group/ssh-host-group-membership-dal.ts b/backend/src/ee/services/ssh-host-group/ssh-host-group-membership-dal.tsdeleted file mode 100644index 54179c2d97..0000000000--- a/backend/src/ee/services/ssh-host-group/ssh-host-group-membership-dal.ts+++ /dev/null@@ -1,13 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TSshHostGroupMembershipDALFactory = ReturnType<typeof sshHostGroupMembershipDALFactory>;--export const sshHostGroupMembershipDALFactory = (db: TDbClient) => {- const sshHostGroupMembershipOrm = ormify(db, TableName.SshHostGroupMembership);-- return {- ...sshHostGroupMembershipOrm- };-};diff --git a/backend/src/ee/services/ssh-host-group/ssh-host-group-schema.ts b/backend/src/ee/services/ssh-host-group/ssh-host-group-schema.tsdeleted file mode 100644index 4ebf3000d4..0000000000--- a/backend/src/ee/services/ssh-host-group/ssh-host-group-schema.ts+++ /dev/null@@ -1,7 +0,0 @@-import { SshHostGroupsSchema } from "@app/db/schemas";--export const sanitizedSshHostGroup = SshHostGroupsSchema.pick({- id: true,- projectId: true,- name: true-});diff --git a/backend/src/ee/services/ssh-host-group/ssh-host-group-service.ts b/backend/src/ee/services/ssh-host-group/ssh-host-group-service.tsdeleted file mode 100644index 0846532f9e..0000000000--- a/backend/src/ee/services/ssh-host-group/ssh-host-group-service.ts+++ /dev/null@@ -1,431 +0,0 @@-import { ForbiddenError } from "@casl/ability";--import { ActionProjectType } from "@app/db/schemas";-import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";-import { TSshHostDALFactory } from "@app/ee/services/ssh-host/ssh-host-dal";-import { TSshHostLoginUserMappingDALFactory } from "@app/ee/services/ssh-host/ssh-host-login-user-mapping-dal";-import { TSshHostLoginUserDALFactory } from "@app/ee/services/ssh-host/ssh-login-user-dal";-import { TSshHostGroupDALFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-dal";-import { TSshHostGroupMembershipDALFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-membership-dal";-import { BadRequestError, NotFoundError } from "@app/lib/errors";-import { TProjectDALFactory } from "@app/services/project/project-dal";-import { TUserDALFactory } from "@app/services/user/user-dal";--import { TGroupDALFactory } from "../group/group-dal";-import { TLicenseServiceFactory } from "../license/license-service";-import { createSshLoginMappings } from "../ssh-host/ssh-host-fns";-import {- TAddHostToSshHostGroupDTO,- TCreateSshHostGroupDTO,- TDeleteSshHostGroupDTO,- TGetSshHostGroupDTO,- TListSshHostGroupHostsDTO,- TRemoveHostFromSshHostGroupDTO,- TUpdateSshHostGroupDTO-} from "./ssh-host-group-types";--type TSshHostGroupServiceFactoryDep = {- projectDAL: Pick<TProjectDALFactory, "findById" | "find">;- sshHostDAL: Pick<TSshHostDALFactory, "findSshHostByIdWithLoginMappings">;- sshHostGroupDAL: Pick<- TSshHostGroupDALFactory,- | "create"- | "updateById"- | "findById"- | "deleteById"- | "transaction"- | "findSshHostGroupByIdWithLoginMappings"- | "findAllSshHostsInGroup"- | "findOne"- | "find"- >;- sshHostGroupMembershipDAL: Pick<TSshHostGroupMembershipDALFactory, "create" | "deleteById" | "findOne">;- sshHostLoginUserDAL: Pick<TSshHostLoginUserDALFactory, "create" | "transaction" | "delete">;- sshHostLoginUserMappingDAL: Pick<TSshHostLoginUserMappingDALFactory, "insertMany">;- userDAL: Pick<TUserDALFactory, "find">;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "checkGroupProjectPermission">;- licenseService: Pick<TLicenseServiceFactory, "getPlan">;- groupDAL: Pick<TGroupDALFactory, "findGroupsByProjectId">;-};--export type TSshHostGroupServiceFactory = ReturnType<typeof sshHostGroupServiceFactory>;--export const sshHostGroupServiceFactory = ({- projectDAL,- sshHostDAL,- sshHostGroupDAL,- sshHostGroupMembershipDAL,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- userDAL,- permissionService,- licenseService,- groupDAL-}: TSshHostGroupServiceFactoryDep) => {- const createSshHostGroup = async ({- projectId,- name,- loginMappings,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TCreateSshHostGroupDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Create, ProjectPermissionSub.SshHostGroups);-- const plan = await licenseService.getPlan(actorOrgId);- if (!plan.sshHostGroups)- throw new BadRequestError({- message: "Failed to create SSH host group due to plan restriction. Upgrade plan to create group."- });-- const newSshHostGroup = await sshHostGroupDAL.transaction(async (tx) => {- // (dangtony98): room to optimize check to ensure that- // the SSH host group name is unique across the whole org- const project = await projectDAL.findById(projectId, tx);- if (!project) throw new NotFoundError({ message: `Project with ID '${projectId}' not found` });- const projects = await projectDAL.find(- {- orgId: project.orgId- },- { tx }- );-- const existingSshHostGroup = await sshHostGroupDAL.find(- {- name,- $in: {- projectId: projects.map((p) => p.id)- }- },- { tx }- );-- if (existingSshHostGroup.length) {- throw new BadRequestError({- message: `SSH host group with name '${name}' already exists in the organization`- });- }-- const sshHostGroup = await sshHostGroupDAL.create(- {- projectId,- name- },- tx- );-- await createSshLoginMappings({- sshHostGroupId: sshHostGroup.id,- loginMappings,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- groupDAL,- userDAL,- permissionService,- projectId,- actorAuthMethod,- actorOrgId,- tx- });-- const newSshHostGroupWithLoginMappings = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(- sshHostGroup.id,- tx- );- if (!newSshHostGroupWithLoginMappings) {- throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroup.id}' not found` });- }-- return newSshHostGroupWithLoginMappings;- });-- return newSshHostGroup;- };-- const updateSshHostGroup = async ({- sshHostGroupId,- name,- loginMappings,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TUpdateSshHostGroupDTO) => {- const sshHostGroup = await sshHostGroupDAL.findById(sshHostGroupId);- if (!sshHostGroup) throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroupId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.SshHostGroups);-- const plan = await licenseService.getPlan(actorOrgId);- if (!plan.sshHostGroups)- throw new BadRequestError({- message: "Failed to update SSH host group due to plan restriction. Upgrade plan to update group."- });-- const updatedSshHostGroup = await sshHostGroupDAL.transaction(async (tx) => {- if (name && name !== sshHostGroup.name) {- // (dangtony98): room to optimize check to ensure that- // the SSH host group name is unique across the whole org- const project = await projectDAL.findById(sshHostGroup.projectId, tx);- if (!project) throw new NotFoundError({ message: `Project with ID '${sshHostGroup.projectId}' not found` });- const projects = await projectDAL.find(- {- orgId: project.orgId- },- { tx }- );-- const existingSshHostGroup = await sshHostGroupDAL.find(- {- name,- $in: {- projectId: projects.map((p) => p.id)- }- },- { tx }- );-- if (existingSshHostGroup.length) {- throw new BadRequestError({- message: `SSH host group with name '${name}' already exists in the organization`- });- }- await sshHostGroupDAL.updateById(- sshHostGroupId,- {- name- },- tx- );- }-- if (loginMappings) {- await sshHostLoginUserDAL.delete({ sshHostGroupId: sshHostGroup.id }, tx);- if (loginMappings.length) {- await createSshLoginMappings({- sshHostGroupId: sshHostGroup.id,- loginMappings,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- groupDAL,- userDAL,- permissionService,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- tx- });- }- }-- const updatedSshHostGroupWithLoginMappings = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(- sshHostGroup.id,- tx- );- if (!updatedSshHostGroupWithLoginMappings) {- throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroup.id}' not found` });- }-- return updatedSshHostGroupWithLoginMappings;- });-- return updatedSshHostGroup;- };-- const getSshHostGroup = async ({- sshHostGroupId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TGetSshHostGroupDTO) => {- const sshHostGroup = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(sshHostGroupId);- if (!sshHostGroup) throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroupId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SshHostGroups);-- return sshHostGroup;- };-- const deleteSshHostGroup = async ({- sshHostGroupId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TDeleteSshHostGroupDTO) => {- const sshHostGroup = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(sshHostGroupId);- if (!sshHostGroup) throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroupId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.SshHostGroups);-- await sshHostGroupDAL.deleteById(sshHostGroupId);-- return sshHostGroup;- };-- const listSshHostGroupHosts = async ({- sshHostGroupId,- actor,- actorId,- actorAuthMethod,- actorOrgId,- filter- }: TListSshHostGroupHostsDTO) => {- const sshHostGroup = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(sshHostGroupId);- if (!sshHostGroup) throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroupId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SshHostGroups);-- const { hosts, totalCount } = await sshHostGroupDAL.findAllSshHostsInGroup({ sshHostGroupId, filter });- return { sshHostGroup, hosts, totalCount };- };-- const addHostToSshHostGroup = async ({- sshHostGroupId,- hostId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TAddHostToSshHostGroupDTO) => {- const sshHostGroup = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(sshHostGroupId);- if (!sshHostGroup) throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroupId}' not found` });-- const sshHost = await sshHostDAL.findSshHostByIdWithLoginMappings(hostId);- if (!sshHost) {- throw new NotFoundError({- message: `SSH host with ID ${hostId} not found`- });- }-- if (sshHostGroup.projectId !== sshHost.projectId) {- throw new BadRequestError({- message: `SSH host with ID ${hostId} not found in project ${sshHostGroup.projectId}`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.SshHostGroups);-- await sshHostGroupMembershipDAL.create({ sshHostGroupId, sshHostId: hostId });-- return { sshHostGroup, sshHost };- };-- const removeHostFromSshHostGroup = async ({- sshHostGroupId,- hostId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TRemoveHostFromSshHostGroupDTO) => {- const sshHostGroup = await sshHostGroupDAL.findSshHostGroupByIdWithLoginMappings(sshHostGroupId);- if (!sshHostGroup) throw new NotFoundError({ message: `SSH host group with ID '${sshHostGroupId}' not found` });-- const sshHost = await sshHostDAL.findSshHostByIdWithLoginMappings(hostId);- if (!sshHost) {- throw new NotFoundError({- message: `SSH host with ID ${hostId} not found`- });- }-- if (sshHostGroup.projectId !== sshHost.projectId) {- throw new BadRequestError({- message: `SSH host with ID ${hostId} not found in project ${sshHostGroup.projectId}`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshHostGroup.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.SshHostGroups);-- const sshHostGroupMembership = await sshHostGroupMembershipDAL.findOne({- sshHostGroupId,- sshHostId: hostId- });-- if (!sshHostGroupMembership) {- throw new NotFoundError({- message: `SSH host with ID ${hostId} not found in SSH host group with ID ${sshHostGroupId}`- });- }-- await sshHostGroupMembershipDAL.deleteById(sshHostGroupMembership.id);-- return { sshHostGroup, sshHost };- };-- return {- createSshHostGroup,- getSshHostGroup,- deleteSshHostGroup,- updateSshHostGroup,- listSshHostGroupHosts,- addHostToSshHostGroup,- removeHostFromSshHostGroup- };-};diff --git a/backend/src/ee/services/ssh-host-group/ssh-host-group-types.ts b/backend/src/ee/services/ssh-host-group/ssh-host-group-types.tsdeleted file mode 100644index 52f805f024..0000000000--- a/backend/src/ee/services/ssh-host-group/ssh-host-group-types.ts+++ /dev/null@@ -1,41 +0,0 @@-import { TLoginMapping } from "@app/ee/services/ssh-host/ssh-host-types";-import { TProjectPermission } from "@app/lib/types";--export type TCreateSshHostGroupDTO = {- name: string;- loginMappings: TLoginMapping[];-} & TProjectPermission;--export type TUpdateSshHostGroupDTO = {- sshHostGroupId: string;- name?: string;- loginMappings?: TLoginMapping[];-} & Omit<TProjectPermission, "projectId">;--export type TGetSshHostGroupDTO = {- sshHostGroupId: string;-} & Omit<TProjectPermission, "projectId">;--export type TDeleteSshHostGroupDTO = {- sshHostGroupId: string;-} & Omit<TProjectPermission, "projectId">;--export type TListSshHostGroupHostsDTO = {- sshHostGroupId: string;- filter?: EHostGroupMembershipFilter;-} & Omit<TProjectPermission, "projectId">;--export type TAddHostToSshHostGroupDTO = {- sshHostGroupId: string;- hostId: string;-} & Omit<TProjectPermission, "projectId">;--export type TRemoveHostFromSshHostGroupDTO = {- sshHostGroupId: string;- hostId: string;-} & Omit<TProjectPermission, "projectId">;--export enum EHostGroupMembershipFilter {- GROUP_MEMBERS = "group-members",- NON_GROUP_MEMBERS = "non-group-members"-}diff --git a/backend/src/ee/services/ssh-host/ssh-host-dal.ts b/backend/src/ee/services/ssh-host/ssh-host-dal.tsdeleted file mode 100644index 3b8564ce27..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-dal.ts+++ /dev/null@@ -1,350 +0,0 @@-import { Knex } from "knex";--import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { DatabaseError } from "@app/lib/errors";-import { groupBy, unique } from "@app/lib/fn";-import { ormify } from "@app/lib/knex";--import { LoginMappingSource } from "./ssh-host-types";--export type TSshHostDALFactory = ReturnType<typeof sshHostDALFactory>;--export const sshHostDALFactory = (db: TDbClient) => {- const sshHostOrm = ormify(db, TableName.SshHost);-- const findUserAccessibleSshHosts = async (projectIds: string[], userId: string, tx?: Knex) => {- try {- const knex = tx || db.replicaNode();-- const user = await knex(TableName.Users).where({ id: userId }).select("username").first();-- if (!user) {- throw new DatabaseError({ name: `${TableName.Users}: UserNotFound`, error: new Error("User not found") });- }-- // get hosts where user has direct login mappings- const directHostRows = await knex(TableName.SshHost)- .leftJoin(TableName.SshHostLoginUser, `${TableName.SshHost}.id`, `${TableName.SshHostLoginUser}.sshHostId`)- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.Users}.id`, `${TableName.SshHostLoginUserMapping}.userId`)- .leftJoin(- TableName.UserGroupMembership,- `${TableName.UserGroupMembership}.groupId`,- `${TableName.SshHostLoginUserMapping}.groupId`- )- .whereIn(`${TableName.SshHost}.projectId`, projectIds)- .andWhere((bd) => {- void bd- .where(`${TableName.SshHostLoginUserMapping}.userId`, userId)- .orWhere(`${TableName.UserGroupMembership}.userId`, userId);- })- .select(- db.ref("id").withSchema(TableName.SshHost).as("sshHostId"),- db.ref("projectId").withSchema(TableName.SshHost),- db.ref("hostname").withSchema(TableName.SshHost),- db.ref("alias").withSchema(TableName.SshHost),- db.ref("userCertTtl").withSchema(TableName.SshHost),- db.ref("hostCertTtl").withSchema(TableName.SshHost),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("userSshCaId").withSchema(TableName.SshHost),- db.ref("hostSshCaId").withSchema(TableName.SshHost)- );-- // get hosts where user has login mappings via host groups- const groupHostRows = await knex(TableName.SshHostGroupMembership)- .join(- TableName.SshHostLoginUser,- `${TableName.SshHostGroupMembership}.sshHostGroupId`,- `${TableName.SshHostLoginUser}.sshHostGroupId`- )- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .join(TableName.SshHost, `${TableName.SshHostGroupMembership}.sshHostId`, `${TableName.SshHost}.id`)- .leftJoin(- TableName.UserGroupMembership,- `${TableName.UserGroupMembership}.groupId`,- `${TableName.SshHostLoginUserMapping}.groupId`- )- .whereIn(`${TableName.SshHost}.projectId`, projectIds)- .andWhere((bd) => {- void bd- .where(`${TableName.SshHostLoginUserMapping}.userId`, userId)- .orWhere(`${TableName.UserGroupMembership}.userId`, userId);- })- .select(- db.ref("id").withSchema(TableName.SshHost).as("sshHostId"),- db.ref("projectId").withSchema(TableName.SshHost),- db.ref("hostname").withSchema(TableName.SshHost),- db.ref("alias").withSchema(TableName.SshHost),- db.ref("userCertTtl").withSchema(TableName.SshHost),- db.ref("hostCertTtl").withSchema(TableName.SshHost),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("userSshCaId").withSchema(TableName.SshHost),- db.ref("hostSshCaId").withSchema(TableName.SshHost)- );-- const directHostRowsWithSource = directHostRows.map((row) => ({- ...row,- source: LoginMappingSource.HOST- }));-- const groupHostRowsWithSource = groupHostRows.map((row) => ({- ...row,- source: LoginMappingSource.HOST_GROUP- }));-- const mergedRows = [...directHostRowsWithSource, ...groupHostRowsWithSource];-- const hostsGrouped = groupBy(mergedRows, (r) => r.sshHostId);-- return Object.values(hostsGrouped).map((hostRows) => {- const { sshHostId, hostname, alias, userCertTtl, hostCertTtl, userSshCaId, hostSshCaId, projectId } =- hostRows[0];-- const loginMappingGrouped = groupBy(hostRows, (r) => r.loginUser);- const loginMappings = Object.entries(loginMappingGrouped).map(([loginUser, mappings]) => {- // Prefer HOST source over HOST_GROUP- const preferredMapping =- mappings.find((m) => m.source === LoginMappingSource.HOST) ||- mappings.find((m) => m.source === LoginMappingSource.HOST_GROUP);-- return {- loginUser,- allowedPrincipals: {- usernames: [user.username]- },- source: preferredMapping!.source- };- });-- return {- id: sshHostId,- hostname,- alias,- projectId,- userCertTtl,- hostCertTtl,- loginMappings,- userSshCaId,- hostSshCaId- };- });- } catch (error) {- throw new DatabaseError({ error, name: `${TableName.SshHost}: FindSshHostsWithPrincipalsAcrossProjects` });- }- };-- const findSshHostsWithLoginMappings = async (projectId: string, tx?: Knex) => {- try {- const rows = await (tx || db.replicaNode())(TableName.SshHost)- .leftJoin(TableName.SshHostLoginUser, `${TableName.SshHost}.id`, `${TableName.SshHostLoginUser}.sshHostId`)- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.SshHostLoginUserMapping}.userId`, `${TableName.Users}.id`)- .leftJoin(TableName.Groups, `${TableName.SshHostLoginUserMapping}.groupId`, `${TableName.Groups}.id`)- .where(`${TableName.SshHost}.projectId`, projectId)- .select(- db.ref("id").withSchema(TableName.SshHost).as("sshHostId"),- db.ref("projectId").withSchema(TableName.SshHost),- db.ref("hostname").withSchema(TableName.SshHost),- db.ref("alias").withSchema(TableName.SshHost),- db.ref("userCertTtl").withSchema(TableName.SshHost),- db.ref("hostCertTtl").withSchema(TableName.SshHost),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("username").withSchema(TableName.Users),- db.ref("userId").withSchema(TableName.SshHostLoginUserMapping),- db.ref("slug").withSchema(TableName.Groups).as("groupSlug"),- db.ref("userSshCaId").withSchema(TableName.SshHost),- db.ref("hostSshCaId").withSchema(TableName.SshHost)- )- .orderBy(`${TableName.SshHost}.updatedAt`, "desc");-- // process login mappings inherited from groups that hosts are part of- const hostIds = unique(rows.map((r) => r.sshHostId)).filter(Boolean);- const groupRows = await (tx || db.replicaNode())(TableName.SshHostGroupMembership)- .join(- TableName.SshHostLoginUser,- `${TableName.SshHostGroupMembership}.sshHostGroupId`,- `${TableName.SshHostLoginUser}.sshHostGroupId`- )- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.SshHostLoginUserMapping}.userId`, `${TableName.Users}.id`)- .leftJoin(TableName.Groups, `${TableName.SshHostLoginUserMapping}.groupId`, `${TableName.Groups}.id`)- .select(- db.ref("sshHostId").withSchema(TableName.SshHostGroupMembership),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("username").withSchema(TableName.Users),- db.ref("slug").withSchema(TableName.Groups).as("groupSlug")- )- .whereIn(`${TableName.SshHostGroupMembership}.sshHostId`, hostIds);-- const groupedGroupMappings = groupBy(groupRows, (r) => r.sshHostId);-- const hostsGrouped = groupBy(rows, (r) => r.sshHostId);- return Object.values(hostsGrouped).map((hostRows) => {- const { sshHostId, hostname, alias, userCertTtl, hostCertTtl, userSshCaId, hostSshCaId } = hostRows[0];-- // direct login mappings- const loginMappingGrouped = groupBy(- hostRows.filter((r) => r.loginUser),- (r) => r.loginUser- );-- const directMappings = Object.entries(loginMappingGrouped).map(([loginUser, entries]) => ({- loginUser,- allowedPrincipals: {- usernames: unique(entries.map((e) => e.username)).filter(Boolean),- groups: unique(entries.map((e) => e.groupSlug)).filter(Boolean)- },- source: LoginMappingSource.HOST- }));-- // group-inherited login mappings- const inheritedGroupRows = groupedGroupMappings[sshHostId] || [];- const inheritedGrouped = groupBy(inheritedGroupRows, (r) => r.loginUser);-- const groupMappings = Object.entries(inheritedGrouped).map(([loginUser, entries]) => ({- loginUser,- allowedPrincipals: {- usernames: unique(entries.map((e) => e.username)).filter(Boolean),- groups: unique(entries.map((e) => e.groupSlug)).filter(Boolean)- },- source: LoginMappingSource.HOST_GROUP- }));-- return {- id: sshHostId,- hostname,- alias,- projectId,- userCertTtl,- hostCertTtl,- loginMappings: [...directMappings, ...groupMappings],- userSshCaId,- hostSshCaId- };- });- } catch (error) {- throw new DatabaseError({ error, name: `${TableName.SshHost}: FindSshHostsWithLoginMappings` });- }- };-- const findSshHostByIdWithLoginMappings = async (sshHostId: string, tx?: Knex) => {- try {- const rows = await (tx || db.replicaNode())(TableName.SshHost)- .leftJoin(TableName.SshHostLoginUser, `${TableName.SshHost}.id`, `${TableName.SshHostLoginUser}.sshHostId`)- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.SshHostLoginUserMapping}.userId`, `${TableName.Users}.id`)- .leftJoin(TableName.Groups, `${TableName.SshHostLoginUserMapping}.groupId`, `${TableName.Groups}.id`)- .where(`${TableName.SshHost}.id`, sshHostId)- .select(- db.ref("id").withSchema(TableName.SshHost).as("sshHostId"),- db.ref("projectId").withSchema(TableName.SshHost),- db.ref("hostname").withSchema(TableName.SshHost),- db.ref("alias").withSchema(TableName.SshHost),- db.ref("userCertTtl").withSchema(TableName.SshHost),- db.ref("hostCertTtl").withSchema(TableName.SshHost),- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("username").withSchema(TableName.Users),- db.ref("userId").withSchema(TableName.SshHostLoginUserMapping),- db.ref("userSshCaId").withSchema(TableName.SshHost),- db.ref("hostSshCaId").withSchema(TableName.SshHost),- db.ref("slug").withSchema(TableName.Groups).as("groupSlug")- );-- if (rows.length === 0) return null;-- const { sshHostId: id, projectId, hostname, alias, userCertTtl, hostCertTtl, userSshCaId, hostSshCaId } = rows[0];-- // direct login mappings- const directGrouped = groupBy(- rows.filter((r) => r.loginUser),- (r) => r.loginUser- );-- const directMappings = Object.entries(directGrouped).map(([loginUser, entries]) => ({- loginUser,- allowedPrincipals: {- usernames: unique(entries.map((e) => e.username)).filter(Boolean),- groups: unique(entries.map((e) => e.groupSlug)).filter(Boolean)- },- source: LoginMappingSource.HOST- }));-- // group login mappings- const groupRows = await (tx || db.replicaNode())(TableName.SshHostGroupMembership)- .join(- TableName.SshHostLoginUser,- `${TableName.SshHostGroupMembership}.sshHostGroupId`,- `${TableName.SshHostLoginUser}.sshHostGroupId`- )- .leftJoin(- TableName.SshHostLoginUserMapping,- `${TableName.SshHostLoginUser}.id`,- `${TableName.SshHostLoginUserMapping}.sshHostLoginUserId`- )- .leftJoin(TableName.Users, `${TableName.SshHostLoginUserMapping}.userId`, `${TableName.Users}.id`)- .leftJoin(TableName.Groups, `${TableName.SshHostLoginUserMapping}.groupId`, `${TableName.Groups}.id`)- .where(`${TableName.SshHostGroupMembership}.sshHostId`, sshHostId)- .select(- db.ref("loginUser").withSchema(TableName.SshHostLoginUser),- db.ref("username").withSchema(TableName.Users),- db.ref("slug").withSchema(TableName.Groups).as("groupSlug")- );-- const groupGrouped = groupBy(- groupRows.filter((r) => r.loginUser),- (r) => r.loginUser- );-- const groupMappings = Object.entries(groupGrouped).map(([loginUser, entries]) => ({- loginUser,- allowedPrincipals: {- usernames: unique(entries.map((e) => e.username)).filter(Boolean),- groups: unique(entries.map((e) => e.groupSlug)).filter(Boolean)- },- source: LoginMappingSource.HOST_GROUP- }));-- return {- id,- projectId,- hostname,- alias,- userCertTtl,- hostCertTtl,- loginMappings: [...directMappings, ...groupMappings],- userSshCaId,- hostSshCaId- };- } catch (error) {- throw new DatabaseError({ error, name: `${TableName.SshHost}: FindSshHostByIdWithLoginMappings` });- }- };-- return {- ...sshHostOrm,- findSshHostsWithLoginMappings,- findUserAccessibleSshHosts,- findSshHostByIdWithLoginMappings- };-};diff --git a/backend/src/ee/services/ssh-host/ssh-host-fns.ts b/backend/src/ee/services/ssh-host/ssh-host-fns.tsdeleted file mode 100644index 7e188a5fe0..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-fns.ts+++ /dev/null@@ -1,124 +0,0 @@-import { Knex } from "knex";--import { ActionProjectType } from "@app/db/schemas";-import { BadRequestError } from "@app/lib/errors";-import { ActorType } from "@app/services/auth/auth-type";--import { ProjectPermissionSshHostActions, ProjectPermissionSub } from "../permission/project-permission";-import { TCreateSshLoginMappingsDTO } from "./ssh-host-types";--/**- * Create SSH login mappings for a given SSH host- * or SSH host group.- */-export const createSshLoginMappings = async ({- sshHostId,- sshHostGroupId,- loginMappings,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- groupDAL,- userDAL,- permissionService,- projectId,- actorAuthMethod,- actorOrgId,- tx: outerTx-}: TCreateSshLoginMappingsDTO) => {- const processCreation = async (tx: Knex) => {- // (dangtony98): room to optimize- for await (const { loginUser, allowedPrincipals } of loginMappings) {- const sshHostLoginUser = await sshHostLoginUserDAL.create(- // (dangtony98): should either pass in sshHostId or sshHostGroupId but not both- {- sshHostId,- sshHostGroupId,- loginUser- },- tx- );-- if (allowedPrincipals.usernames && allowedPrincipals.usernames.length > 0) {- const users = await userDAL.find(- {- $in: {- username: allowedPrincipals.usernames- }- },- { tx }- );-- const foundUsernames = new Set(users.map((u) => u.username));-- for (const uname of allowedPrincipals.usernames) {- if (!foundUsernames.has(uname)) {- throw new BadRequestError({- message: `Invalid username: ${uname}`- });- }- }-- for await (const user of users) {- // check that each user has access to the SSH project- await permissionService.getProjectPermission({- actor: ActorType.USER,- actorId: user.id,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });- }-- await sshHostLoginUserMappingDAL.insertMany(- users.map((user) => ({- sshHostLoginUserId: sshHostLoginUser.id,- userId: user.id- })),- tx- );- }-- if (allowedPrincipals.groups && allowedPrincipals.groups.length > 0) {- const projectGroups = await groupDAL.findGroupsByProjectId(projectId);- const groups = projectGroups.filter((g) => allowedPrincipals.groups?.includes(g.slug));-- if (groups.length !== allowedPrincipals.groups?.length) {- throw new BadRequestError({- message: `Invalid group slugs: ${allowedPrincipals.groups- .filter((g) => !projectGroups.some((pg) => pg.slug === g))- .join(", ")}`- });- }-- for await (const group of groups) {- // check that each group has access to the SSH project and have read access to hosts- const hasPermission = await permissionService.checkGroupProjectPermission({- groupId: group.id,- projectId,- checkPermissions: [ProjectPermissionSshHostActions.Read, ProjectPermissionSub.SshHosts]- });- if (!hasPermission) {- throw new BadRequestError({- message: `Group ${group.slug} does not have access to the SSH project`- });- }- }-- await sshHostLoginUserMappingDAL.insertMany(- groups.map((group) => ({- sshHostLoginUserId: sshHostLoginUser.id,- groupId: group.id- })),- tx- );- }- }- };-- if (outerTx) {- return processCreation(outerTx);- }-- return sshHostLoginUserDAL.transaction(processCreation);-};diff --git a/backend/src/ee/services/ssh-host/ssh-host-login-user-mapping-dal.ts b/backend/src/ee/services/ssh-host/ssh-host-login-user-mapping-dal.tsdeleted file mode 100644index 0d9e8013bc..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-login-user-mapping-dal.ts+++ /dev/null@@ -1,10 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TSshHostLoginUserMappingDALFactory = ReturnType<typeof sshHostLoginUserMappingDALFactory>;--export const sshHostLoginUserMappingDALFactory = (db: TDbClient) => {- const sshHostLoginUserMappingOrm = ormify(db, TableName.SshHostLoginUserMapping);- return sshHostLoginUserMappingOrm;-};diff --git a/backend/src/ee/services/ssh-host/ssh-host-schema.ts b/backend/src/ee/services/ssh-host/ssh-host-schema.tsdeleted file mode 100644index c8acb37bf5..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-schema.ts+++ /dev/null@@ -1,38 +0,0 @@-import { z } from "zod";--import { SshHostsSchema } from "@app/db/schemas";--export const sanitizedSshHost = SshHostsSchema.pick({- id: true,- projectId: true,- hostname: true,- alias: true,- userCertTtl: true,- hostCertTtl: true,- userSshCaId: true,- hostSshCaId: true-});--export const loginMappingSchema = z.object({- loginUser: z.string().trim(),- allowedPrincipals: z- .object({- usernames: z- .array(z.string().trim())- .transform((usernames) => Array.from(new Set(usernames)))- .optional(),- groups: z- .array(z.string().trim())- .transform((groups) => Array.from(new Set(groups)))- .optional()- })- .refine(- (data) => {- return (data.usernames && data.usernames.length > 0) || (data.groups && data.groups.length > 0);- },- {- message: "At least one username or group must be provided",- path: ["allowedPrincipals"]- }- )-});diff --git a/backend/src/ee/services/ssh-host/ssh-host-service.ts b/backend/src/ee/services/ssh-host/ssh-host-service.tsdeleted file mode 100644index 37d843c479..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-service.ts+++ /dev/null@@ -1,656 +0,0 @@-import { ForbiddenError, subject } from "@casl/ability";--import { ActionProjectType } from "@app/db/schemas";-import { TGroupDALFactory } from "@app/ee/services/group/group-dal";-import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";-import { ProjectPermissionSshHostActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";-import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";-import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";-import { TSshCertificateBodyDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-body-dal";-import { TSshCertificateDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-dal";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { TSshHostDALFactory } from "@app/ee/services/ssh-host/ssh-host-dal";-import { TSshHostLoginUserMappingDALFactory } from "@app/ee/services/ssh-host/ssh-host-login-user-mapping-dal";-import { TSshHostLoginUserDALFactory } from "@app/ee/services/ssh-host/ssh-login-user-dal";-import { PgSqlLock } from "@app/keystore/keystore";-import { BadRequestError, NotFoundError, UnauthorizedError } from "@app/lib/errors";-import { ActorType } from "@app/services/auth/auth-type";-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 { bootstrapSshProject } from "@app/services/project/project-fns";-import { TProjectSshConfigDALFactory } from "@app/services/project/project-ssh-config-dal";-import { TUserDALFactory } from "@app/services/user/user-dal";--import { TUserGroupMembershipDALFactory } from "../group/user-group-membership-dal";-import {- convertActorToPrincipals,- createSshCert,- createSshKeyPair,- getSshPublicKey-} from "../ssh/ssh-certificate-authority-fns";-import { SshCertType } from "../ssh/ssh-certificate-authority-types";-import { createSshLoginMappings } from "./ssh-host-fns";-import {- TCreateSshHostDTO,- TDeleteSshHostDTO,- TGetSshHostDTO,- TIssueSshHostHostCertDTO,- TIssueSshHostUserCertDTO,- TListSshHostsDTO,- TUpdateSshHostDTO-} from "./ssh-host-types";--type TSshHostServiceFactoryDep = {- userDAL: Pick<TUserDALFactory, "findById" | "find">;- groupDAL: Pick<TGroupDALFactory, "findGroupsByProjectId">;- projectDAL: Pick<TProjectDALFactory, "find">;- projectSshConfigDAL: Pick<TProjectSshConfigDALFactory, "findOne" | "transaction" | "create">;- sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "findOne" | "transaction" | "create">;- sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "findOne" | "create">;- sshCertificateDAL: Pick<TSshCertificateDALFactory, "create" | "transaction">;- sshCertificateBodyDAL: Pick<TSshCertificateBodyDALFactory, "create">;- userGroupMembershipDAL: Pick<TUserGroupMembershipDALFactory, "findGroupMembershipsByUserIdInOrg">;- sshHostDAL: Pick<- TSshHostDALFactory,- | "transaction"- | "create"- | "findById"- | "updateById"- | "deleteById"- | "findOne"- | "findSshHostByIdWithLoginMappings"- | "findUserAccessibleSshHosts"- >;- sshHostLoginUserDAL: TSshHostLoginUserDALFactory;- sshHostLoginUserMappingDAL: TSshHostLoginUserMappingDALFactory;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "checkGroupProjectPermission">;- kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;-};--export type TSshHostServiceFactory = ReturnType<typeof sshHostServiceFactory>;--export const sshHostServiceFactory = ({- userDAL,- userGroupMembershipDAL,- groupDAL,- projectDAL,- projectSshConfigDAL,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- sshCertificateDAL,- sshCertificateBodyDAL,- sshHostDAL,- sshHostLoginUserMappingDAL,- sshHostLoginUserDAL,- permissionService,- kmsService-}: TSshHostServiceFactoryDep) => {- /**- * Return list of all SSH hosts that a user can issue user SSH certificates for- * (i.e. is able to access / connect to) across all SSH projects in the organization- */- const listSshHosts = async ({ actorId, actorAuthMethod, actor, actorOrgId }: TListSshHostsDTO) => {- if (actor !== ActorType.USER) {- // (dangtony98): only support user for now- throw new BadRequestError({ message: `Actor type ${actor} not supported` });- }-- const sshProjects = await projectDAL.find({- orgId: actorOrgId- });-- const allowedHosts = [];-- for await (const project of sshProjects) {- try {- await permissionService.getProjectPermission({- actor,- actorId,- projectId: project.id,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- const projectHosts = await sshHostDAL.findUserAccessibleSshHosts([project.id], actorId);-- allowedHosts.push(...projectHosts);- } catch {- // intentionally ignore projects where user lacks access- }- }-- return allowedHosts;- };-- const createSshHost = async ({- projectId,- hostname,- alias,- userCertTtl,- hostCertTtl,- loginMappings,- userSshCaId: requestedUserSshCaId,- hostSshCaId: requestedHostSshCaId,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TCreateSshHostDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionSshHostActions.Create,- subject(ProjectPermissionSub.SshHosts, {- hostname- })- );-- const resolveSshCaId = async ({- requestedId,- fallbackId,- label- }: {- requestedId?: string;- fallbackId?: string | null;- label: "User" | "Host";- }) => {- const finalId = requestedId ?? fallbackId;- if (!finalId) {- throw new BadRequestError({ message: `Missing ${label.toLowerCase()} SSH CA` });- }-- const ca = await sshCertificateAuthorityDAL.findOne({- id: finalId,- projectId- });-- if (!ca) {- throw new BadRequestError({- message: `${label} SSH CA with ID '${finalId}' not found in project '${projectId}'`- });- }-- return ca.id;- };-- let projectSshConfig = await projectSshConfigDAL.findOne({ projectId });- if (!projectSshConfig) {- projectSshConfig = await projectSshConfigDAL.transaction(async (tx) => {- await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.SshInit(projectId)]);-- let sshConfig = await projectSshConfigDAL.findOne({ projectId }, tx);- if (sshConfig) return sshConfig;-- sshConfig = await bootstrapSshProject({- projectId,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService,- projectSshConfigDAL,- tx- });- return sshConfig;- });- }-- const userSshCaId = await resolveSshCaId({- requestedId: requestedUserSshCaId,- fallbackId: projectSshConfig?.defaultUserSshCaId,- label: "User"- });-- const hostSshCaId = await resolveSshCaId({- requestedId: requestedHostSshCaId,- fallbackId: projectSshConfig?.defaultHostSshCaId,- label: "Host"- });-- const newSshHost = await sshHostDAL.transaction(async (tx) => {- const host = await sshHostDAL.create(- {- projectId,- hostname,- alias: alias === "" ? null : alias,- userCertTtl,- hostCertTtl,- userSshCaId,- hostSshCaId- },- tx- );-- await createSshLoginMappings({- sshHostId: host.id,- loginMappings,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- groupDAL,- userDAL,- permissionService,- projectId,- actorAuthMethod,- actorOrgId,- tx- });-- const newSshHostWithLoginMappings = await sshHostDAL.findSshHostByIdWithLoginMappings(host.id, tx);- if (!newSshHostWithLoginMappings) {- throw new NotFoundError({ message: `SSH host with ID '${host.id}' not found` });- }-- return newSshHostWithLoginMappings;- });-- return newSshHost;- };-- const updateSshHost = async ({- sshHostId,- hostname,- alias,- userCertTtl,- hostCertTtl,- loginMappings,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TUpdateSshHostDTO) => {- const host = await sshHostDAL.findById(sshHostId);- if (!host) throw new NotFoundError({ message: `SSH host with ID '${sshHostId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: host.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionSshHostActions.Edit,- subject(ProjectPermissionSub.SshHosts, {- hostname: host.hostname- })- );-- const updatedHost = await sshHostDAL.transaction(async (tx) => {- await sshHostDAL.updateById(- sshHostId,- {- hostname,- alias: alias === "" ? null : alias,- userCertTtl,- hostCertTtl- },- tx- );-- if (loginMappings) {- await sshHostLoginUserDAL.delete({ sshHostId: host.id }, tx);- if (loginMappings.length) {- await createSshLoginMappings({- sshHostId: host.id,- loginMappings,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- groupDAL,- userDAL,- permissionService,- projectId: host.projectId,- actorAuthMethod,- actorOrgId,- tx- });- }- }-- const updatedHostWithLoginMappings = await sshHostDAL.findSshHostByIdWithLoginMappings(sshHostId, tx);- if (!updatedHostWithLoginMappings) {- throw new NotFoundError({ message: `SSH host with ID '${sshHostId}' not found` });- }-- return updatedHostWithLoginMappings;- });-- return updatedHost;- };-- const deleteSshHost = async ({ sshHostId, actorId, actorAuthMethod, actor, actorOrgId }: TDeleteSshHostDTO) => {- const host = await sshHostDAL.findSshHostByIdWithLoginMappings(sshHostId);- if (!host) throw new NotFoundError({ message: `SSH host with ID '${sshHostId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: host.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionSshHostActions.Delete,- subject(ProjectPermissionSub.SshHosts, {- hostname: host.hostname- })- );-- await sshHostDAL.deleteById(sshHostId);-- return host;- };-- const getSshHostById = async ({ sshHostId, actorId, actorAuthMethod, actor, actorOrgId }: TGetSshHostDTO) => {- const host = await sshHostDAL.findSshHostByIdWithLoginMappings(sshHostId);- if (!host) {- throw new NotFoundError({- message: `SSH host with ID ${sshHostId} not found`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: host.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionSshHostActions.Read,- subject(ProjectPermissionSub.SshHosts, {- hostname: host.hostname- })- );-- return host;- };-- /**- * Return SSH certificate and corresponding new SSH public-private key pair where- * SSH public key is signed using CA behind SSH certificate with name [templateName].- *- * Note: Used for issuing SSH credentials as part of request against a specific SSH Host.- */- const issueSshHostUserCert = async ({- sshHostId,- loginUser,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TIssueSshHostUserCertDTO) => {- const host = await sshHostDAL.findSshHostByIdWithLoginMappings(sshHostId);- if (!host) {- throw new NotFoundError({- message: `SSH host with ID ${sshHostId} not found`- });- }-- await permissionService.getProjectPermission({- actor,- actorId,- projectId: host.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- const internalPrincipals = await convertActorToPrincipals({- actor,- actorId,- userDAL- });-- const userGroups = await userGroupMembershipDAL.findGroupMembershipsByUserIdInOrg(actorId, actorOrgId);- const userGroupSlugs = userGroups.map((g) => g.groupSlug);-- const mapping = host.loginMappings.find(- (m) =>- m.loginUser === loginUser &&- (m.allowedPrincipals.usernames?.some((allowed) => internalPrincipals.includes(allowed)) ||- m.allowedPrincipals.groups?.some((allowed) => userGroupSlugs.includes(allowed)))- );-- if (!mapping) {- throw new UnauthorizedError({- message: `You are not allowed to login as ${loginUser} on this host`- });- }-- const keyId = `${actor}-${actorId}`;-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: host.userSshCaId });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: host.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- // (dangtony98): will support more algorithms in the future- const keyAlgorithm = SshCertKeyAlgorithm.ED25519;- const { publicKey, privateKey } = await createSshKeyPair(keyAlgorithm);-- // (dangtony98): include the loginUser as a principal on the issued certificate- const principals = [...internalPrincipals, loginUser];-- const { serialNumber, signedPublicKey, ttl } = await createSshCert({- caPrivateKey: decryptedCaPrivateKey.toString("utf8"),- clientPublicKey: publicKey,- keyId,- principals,- requestedTtl: host.userCertTtl,- certType: SshCertType.USER- });-- const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: host.projectId- });-- const encryptedCertificate = secretManagerEncryptor({- plainText: Buffer.from(signedPublicKey, "utf8")- }).cipherTextBlob;-- await sshCertificateDAL.transaction(async (tx) => {- const cert = await sshCertificateDAL.create(- {- sshCaId: host.userSshCaId,- sshHostId: host.id,- serialNumber,- certType: SshCertType.USER,- principals,- keyId,- notBefore: new Date(),- notAfter: new Date(Date.now() + ttl * 1000)- },- tx- );-- await sshCertificateBodyDAL.create(- {- sshCertId: cert.id,- encryptedCertificate- },- tx- );- });-- return {- host,- principals,- serialNumber,- signedPublicKey,- privateKey,- publicKey,- ttl,- keyAlgorithm- };- };-- const issueSshHostHostCert = async ({- sshHostId,- publicKey,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TIssueSshHostHostCertDTO) => {- const host = await sshHostDAL.findSshHostByIdWithLoginMappings(sshHostId);- if (!host) {- throw new NotFoundError({- message: `SSH host with ID ${sshHostId} not found`- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: host.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionSshHostActions.IssueHostCert,- subject(ProjectPermissionSub.SshHosts, {- hostname: host.hostname- })- );-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: host.hostSshCaId });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: host.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const principals = [host.hostname];- const keyId = `host-${host.id}`;-- const { serialNumber, signedPublicKey, ttl } = await createSshCert({- caPrivateKey: decryptedCaPrivateKey.toString("utf8"),- clientPublicKey: publicKey,- keyId,- principals,- requestedTtl: host.hostCertTtl,- certType: SshCertType.HOST- });-- const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: host.projectId- });-- const encryptedCertificate = secretManagerEncryptor({- plainText: Buffer.from(signedPublicKey, "utf8")- }).cipherTextBlob;-- await sshCertificateDAL.transaction(async (tx) => {- const cert = await sshCertificateDAL.create(- {- sshCaId: host.hostSshCaId,- sshHostId: host.id,- serialNumber,- certType: SshCertType.HOST,- principals,- keyId,- notBefore: new Date(),- notAfter: new Date(Date.now() + ttl * 1000)- },- tx- );-- await sshCertificateBodyDAL.create(- {- sshCertId: cert.id,- encryptedCertificate- },- tx- );- });-- return { host, principals, serialNumber, signedPublicKey };- };-- const getSshHostUserCaPk = async (sshHostId: string) => {- const host = await sshHostDAL.findById(sshHostId);- if (!host) {- throw new NotFoundError({- message: `SSH host with ID ${sshHostId} not found`- });- }-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: host.userSshCaId });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: host.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const publicKey = await getSshPublicKey(decryptedCaPrivateKey.toString("utf-8"));-- return publicKey;- };-- const getSshHostHostCaPk = async (sshHostId: string) => {- const host = await sshHostDAL.findById(sshHostId);- if (!host) {- throw new NotFoundError({- message: `SSH host with ID ${sshHostId} not found`- });- }-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: host.hostSshCaId });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: host.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const publicKey = await getSshPublicKey(decryptedCaPrivateKey.toString("utf-8"));-- return publicKey;- };-- return {- listSshHosts,- createSshHost,- updateSshHost,- deleteSshHost,- getSshHostById,- issueSshHostUserCert,- issueSshHostHostCert,- getSshHostUserCaPk,- getSshHostHostCaPk- };-};diff --git a/backend/src/ee/services/ssh-host/ssh-host-types.ts b/backend/src/ee/services/ssh-host/ssh-host-types.tsdeleted file mode 100644index 698f067f26..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-types.ts+++ /dev/null@@ -1,79 +0,0 @@-import { Knex } from "knex";--import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";-import { TSshHostLoginUserMappingDALFactory } from "@app/ee/services/ssh-host/ssh-host-login-user-mapping-dal";-import { TSshHostLoginUserDALFactory } from "@app/ee/services/ssh-host/ssh-login-user-dal";-import { TProjectPermission } from "@app/lib/types";-import { ActorAuthMethod } from "@app/services/auth/auth-type";-import { TUserDALFactory } from "@app/services/user/user-dal";--import { TGroupDALFactory } from "../group/group-dal";--export type TListSshHostsDTO = Omit<TProjectPermission, "projectId">;--export type TLoginMapping = {- loginUser: string;- allowedPrincipals: {- usernames?: string[];- groups?: string[];- };-};--export enum LoginMappingSource {- HOST = "host",- HOST_GROUP = "hostGroup"-}--export type TCreateSshHostDTO = {- hostname: string;- alias?: string;- userCertTtl: string;- hostCertTtl: string;- loginMappings: TLoginMapping[];- userSshCaId?: string;- hostSshCaId?: string;-} & TProjectPermission;--export type TUpdateSshHostDTO = {- sshHostId: string;- hostname?: string;- alias?: string;- userCertTtl?: string;- hostCertTtl?: string;- loginMappings?: TLoginMapping[];-} & Omit<TProjectPermission, "projectId">;--export type TGetSshHostDTO = {- sshHostId: string;-} & Omit<TProjectPermission, "projectId">;--export type TDeleteSshHostDTO = {- sshHostId: string;-} & Omit<TProjectPermission, "projectId">;--export type TIssueSshHostUserCertDTO = {- sshHostId: string;- loginUser: string;-} & Omit<TProjectPermission, "projectId">;--export type TIssueSshHostHostCertDTO = {- sshHostId: string;- publicKey: string;-} & Omit<TProjectPermission, "projectId">;--type BaseCreateSshLoginMappingsDTO = {- loginMappings: TLoginMapping[];- sshHostLoginUserDAL: Pick<TSshHostLoginUserDALFactory, "create" | "transaction">;- sshHostLoginUserMappingDAL: Pick<TSshHostLoginUserMappingDALFactory, "insertMany">;- userDAL: Pick<TUserDALFactory, "find">;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission" | "checkGroupProjectPermission">;- groupDAL: Pick<TGroupDALFactory, "findGroupsByProjectId">;- projectId: string;- actorAuthMethod: ActorAuthMethod;- actorOrgId: string;- tx?: Knex;-};--export type TCreateSshLoginMappingsDTO =- | (BaseCreateSshLoginMappingsDTO & { sshHostId: string; sshHostGroupId?: undefined })- | (BaseCreateSshLoginMappingsDTO & { sshHostGroupId: string; sshHostId?: undefined });diff --git a/backend/src/ee/services/ssh-host/ssh-host-validators.ts b/backend/src/ee/services/ssh-host/ssh-host-validators.tsdeleted file mode 100644index 7b739b9cb7..0000000000--- a/backend/src/ee/services/ssh-host/ssh-host-validators.ts+++ /dev/null@@ -1,15 +0,0 @@-import { isFQDN } from "@app/lib/validator/validate-url";--export const isValidHostname = (value: string): boolean => {- if (typeof value !== "string") return false;- if (value.length > 255) return false;-- // Only allow strict FQDNs, no wildcards or IPs- return isFQDN(value, {- require_tld: true,- allow_underscores: false,- allow_trailing_dot: false,- allow_numeric_tld: true,- allow_wildcard: false- });-};diff --git a/backend/src/ee/services/ssh-host/ssh-login-user-dal.ts b/backend/src/ee/services/ssh-host/ssh-login-user-dal.tsdeleted file mode 100644index 88a9bf59a9..0000000000--- a/backend/src/ee/services/ssh-host/ssh-login-user-dal.ts+++ /dev/null@@ -1,10 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TSshHostLoginUserDALFactory = ReturnType<typeof sshHostLoginUserDALFactory>;--export const sshHostLoginUserDALFactory = (db: TDbClient) => {- const sshHostLoginUserOrm = ormify(db, TableName.SshHostLoginUser);- return sshHostLoginUserOrm;-};diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-dal.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-dal.tsdeleted file mode 100644index c906efa91f..0000000000--- a/backend/src/ee/services/ssh/ssh-certificate-authority-dal.ts+++ /dev/null@@ -1,10 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TSshCertificateAuthorityDALFactory = ReturnType<typeof sshCertificateAuthorityDALFactory>;--export const sshCertificateAuthorityDALFactory = (db: TDbClient) => {- const sshCaOrm = ormify(db, TableName.SshCertificateAuthority);- return sshCaOrm;-};diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-fns.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-fns.tsdeleted file mode 100644index 136c064a4f..0000000000--- a/backend/src/ee/services/ssh/ssh-certificate-authority-fns.ts+++ /dev/null@@ -1,608 +0,0 @@-import { execFile } from "child_process";-import { promises as fs } from "fs";-import { Knex } from "knex";-import os from "os";-import path from "path";-import RE2 from "re2";-import { promisify } from "util";--import { TSshCertificateTemplates } from "@app/db/schemas";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { crypto } from "@app/lib/crypto/cryptography";-import { BadRequestError } from "@app/lib/errors";-import { ms } from "@app/lib/ms";-import { requestMemoKeys } from "@app/lib/request-context/memo-keys";-import { requestMemoize } from "@app/lib/request-context/request-memoizer";-import { CharacterType, characterValidator } from "@app/lib/validator/validate-string";-import { ActorType } from "@app/services/auth/auth-type";-import { KmsDataKey } from "@app/services/kms/kms-types";--import {- isValidHostPattern,- isValidUserPattern-} from "../ssh-certificate-template/ssh-certificate-template-validators";-import {- SshCaKeySource,- SshCaStatus,- SshCertType,- TConvertActorToPrincipalsDTO,- TCreateSshCaHelperDTO,- TCreateSshCertDTO-} from "./ssh-certificate-authority-types";--const execFileAsync = promisify(execFile);--const EXEC_TIMEOUT_MS = 10000; // 10 seconds-/* eslint-disable no-bitwise */-export const createSshCertSerialNumber = () => {- const randomBytes = crypto.randomBytes(8); // 8 bytes = 64 bits- randomBytes[0] &= 0x7f; // Ensure the most significant bit is 0 (to stay within unsigned range)- return BigInt(`0x${randomBytes.toString("hex")}`).toString(10); // Convert to decimal-};--/**- * Return a pair of SSH CA keys based on the specified key algorithm [keyAlgorithm].- * We use this function because the key format generated by `ssh-keygen` is unique.- */-export const createSshKeyPair = async (keyAlgorithm: SshCertKeyAlgorithm) => {- const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-key-"));- const privateKeyFile = path.join(tempDir, "id_key");- const publicKeyFile = `${privateKeyFile}.pub`;-- let keyType: string;- let keyBits: string | null;-- switch (keyAlgorithm) {- case SshCertKeyAlgorithm.RSA_2048:- keyType = "rsa";- keyBits = "2048";- break;- case SshCertKeyAlgorithm.RSA_4096:- keyType = "rsa";- keyBits = "4096";- break;- case SshCertKeyAlgorithm.ECDSA_P256:- keyType = "ecdsa";- keyBits = "256";- break;- case SshCertKeyAlgorithm.ECDSA_P384:- keyType = "ecdsa";- keyBits = "384";- break;- case SshCertKeyAlgorithm.ED25519:- keyType = "ed25519";- keyBits = null;- break;- default:- throw new BadRequestError({- message: "Failed to produce SSH CA key pair generation command due to unrecognized key algorithm"- });- }-- try {- const args = ["-t", keyType];- if (keyBits !== null) {- args.push("-b", keyBits);- }- args.push("-f", privateKeyFile, "-N", "", "-C", "Infisical");-- // Generate the SSH key pair- // The "-N ''" sets an empty passphrase- // The keys are created in the temporary directory- await execFileAsync("ssh-keygen", args, {- timeout: EXEC_TIMEOUT_MS- });-- // Read the generated keys- const publicKey = await fs.readFile(publicKeyFile, "utf8");- const privateKey = await fs.readFile(privateKeyFile, "utf8");-- return { publicKey, privateKey };- } finally {- // Cleanup the temporary directory and all its contents- await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});- }-};--/**- * Return the SSH public key for the given SSH private key.- */-export const getSshPublicKey = async (privateKey: string) => {- const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-key-"));- const privateKeyFile = path.join(tempDir, "id_key");- try {- await fs.writeFile(privateKeyFile, privateKey, { mode: 0o600 });-- // Run ssh-keygen to extract the public key- const { stdout } = await execFileAsync("ssh-keygen", ["-y", "-f", privateKeyFile], {- encoding: "utf8",- timeout: EXEC_TIMEOUT_MS- });- return stdout.trim();- } finally {- // Ensure that files and the temporary directory are cleaned up- await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});- }-};--/**- * Validate the requested SSH certificate type based on the SSH certificate template configuration.- */-export const validateSshCertificateType = (template: TSshCertificateTemplates, certType: SshCertType) => {- if (!template.allowUserCertificates && certType === SshCertType.USER) {- throw new BadRequestError({ message: "Failed to validate user certificate type due to template restriction" });- }-- if (!template.allowHostCertificates && certType === SshCertType.HOST) {- throw new BadRequestError({ message: "Failed to validate host certificate type due to template restriction" });- }-};--/**- * Validate the requested SSH certificate principals based on the SSH certificate template configuration.- */-export const validateSshCertificatePrincipals = (- certType: SshCertType,- template: TSshCertificateTemplates,- principals: string[]-) => {- /**- * Validate and sanitize a principal string- */- const validatePrincipal = (principal: string) => {- const sanitized = principal.trim();-- // basic checks for empty or control characters- if (sanitized.length === 0) {- throw new BadRequestError({- message: "Principal cannot be an empty string."- });- }-- if (new RE2(/\r|\n|\t|\0/).test(sanitized)) {- throw new BadRequestError({- message: `Principal '${sanitized}' contains invalid whitespace or control characters.`- });- }-- // disallow whitespace anywhere- if (new RE2(/\s/).test(sanitized)) {- throw new BadRequestError({- message: `Principal '${sanitized}' cannot contain whitespace.`- });- }-- // restrict allowed characters to letters, digits, dot, underscore, and hyphen- if (- !characterValidator([- CharacterType.AlphaNumeric,- CharacterType.Period,- CharacterType.Underscore,- CharacterType.Hyphen- ])(sanitized)- ) {- throw new BadRequestError({- message: `Principal '${sanitized}' contains invalid characters. Allowed: alphanumeric, '.', '_', '-'.`- });- }-- // disallow leading hyphen to avoid potential argument-like inputs- if (sanitized.startsWith("-")) {- throw new BadRequestError({- message: `Principal '${sanitized}' cannot start with a hyphen.`- });- }-- // length restriction (adjust as needed)- if (sanitized.length > 64) {- throw new BadRequestError({- message: `Principal '${sanitized}' is too long.`- });- }-- return sanitized;- };-- // Sanitize and validate all principals using the helper- const sanitizedPrincipals = principals.map(validatePrincipal);-- switch (certType) {- case SshCertType.USER: {- if (template.allowedUsers.length === 0) {- throw new BadRequestError({- message: "No allowed users are configured in the SSH certificate template."- });- }-- const allowsAllUsers = template.allowedUsers.includes("*") ?? false;-- sanitizedPrincipals.forEach((principal) => {- if (principal === "*") {- throw new BadRequestError({- message: `Principal '*' is not allowed for user certificates.`- });- }- if (allowsAllUsers && !isValidUserPattern(principal)) {- throw new BadRequestError({- message: `Principal '${principal}' does not match a valid user pattern.`- });- }- if (!allowsAllUsers && !template.allowedUsers.includes(principal)) {- throw new BadRequestError({- message: `Principal '${principal}' is not in the list of allowed users.`- });- }- });- break;- }- case SshCertType.HOST: {- if (template.allowedHosts.length === 0) {- throw new BadRequestError({- message: "No allowed hosts are configured in the SSH certificate template."- });- }-- const allowsAllHosts = template.allowedHosts.includes("*") ?? false;-- sanitizedPrincipals.forEach((principal) => {- if (principal.includes("*")) {- throw new BadRequestError({- message: `Principal '${principal}' with wildcards is not allowed for host certificates.`- });- }- if (allowsAllHosts && !isValidHostPattern(principal)) {- throw new BadRequestError({- message: `Principal '${principal}' does not match a valid host pattern.`- });- }-- if (- !allowsAllHosts &&- !template.allowedHosts.some((allowedHost) => {- if (allowedHost.startsWith("*.")) {- const baseDomain = allowedHost.slice(2); // Remove the leading "*."- return principal.endsWith(`.${baseDomain}`);- }- return principal === allowedHost;- })- ) {- throw new BadRequestError({- message: `Principal '${principal}' is not in the list of allowed hosts or domains.`- });- }- });- break;- }- default:- throw new BadRequestError({- message: "Failed to validate SSH certificate principals due to unrecognized requested certificate type"- });- }-};--/**- * Validate the requested SSH certificate TTL based on the SSH certificate template configuration.- */-export const validateSshCertificateTtl = (template: TSshCertificateTemplates, ttl?: string) => {- if (!ttl) {- // use default template ttl- return Math.ceil(ms(template.ttl) / 1000);- }-- if (ms(ttl) > ms(template.maxTTL)) {- throw new BadRequestError({- message: "Failed TTL validation due to TTL being greater than configured max TTL on template"- });- }-- return Math.ceil(ms(ttl) / 1000);-};--/**- * Validate the requested SSH certificate key ID to ensure- * that it only contains alphanumeric characters with no spaces.- */-export const validateSshCertificateKeyId = (keyId: string) => {- const regex = characterValidator([- CharacterType.AlphaNumeric,- CharacterType.Hyphen,- CharacterType.Colon,- CharacterType.Period- ]);- if (!regex(keyId)) {- throw new BadRequestError({- message:- "Failed to validate Key ID because it can only contain alphanumeric characters and hyphens, with no spaces."- });- }-- if (keyId.length > 50) {- throw new BadRequestError({- message: "keyId can only be up to 50 characters long."- });- }-};--/**- * Validate the format of the SSH public key- */-const validateSshPublicKey = async (publicKey: string) => {- const validPrefixes = ["ssh-rsa", "ssh-ed25519", "ecdsa-sha2-nistp256", "ecdsa-sha2-nistp384"];- const startsWithValidPrefix = validPrefixes.some((prefix) => publicKey.startsWith(`${prefix} `));- if (!startsWithValidPrefix) {- throw new BadRequestError({ message: "Failed to validate SSH public key format: unsupported key type." });- }-- // write the key to a temp file and run `ssh-keygen -l -f`- // check to see if OpenSSH can read/interpret the public key- const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-pubkey-"));- const pubKeyFile = path.join(tempDir, "key.pub");-- try {- await fs.writeFile(pubKeyFile, publicKey, { mode: 0o600 });- await execFileAsync("ssh-keygen", ["-l", "-f", pubKeyFile], { timeout: EXEC_TIMEOUT_MS });- } catch (error) {- throw new BadRequestError({- message: "Failed to validate SSH public key format: could not be parsed."- });- } finally {- await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});- }-};--export const getKeyAlgorithmFromFingerprintOutput = (output: string): SshCertKeyAlgorithm | undefined => {- const parts = output.trim().split(" ");- const bitsInt = parseInt(parts[0], 10);- const keyTypeRaw = parts.at(-1)?.replace(/[()]/g, ""); // remove surrounding parentheses-- if (keyTypeRaw === "RSA") {- return bitsInt === 2048 ? SshCertKeyAlgorithm.RSA_2048 : SshCertKeyAlgorithm.RSA_4096;- }-- if (keyTypeRaw === "ECDSA") {- return bitsInt === 256 ? SshCertKeyAlgorithm.ECDSA_P256 : SshCertKeyAlgorithm.ECDSA_P384;- }-- if (keyTypeRaw === "ED25519") {- return SshCertKeyAlgorithm.ED25519;- }-- return undefined;-};--export const normalizeSshPrivateKey = (raw: string): string => {- return `${raw- .replace(/\r\n/g, "\n") // Windows CRLF → LF- .replace(/\r/g, "\n") // Old Mac CR → LF- .replace(/\\n/g, "\n") // Double-escaped \n- .trim()}\n`;-};--/**- * Validate the format of the SSH private key- *- * Returns the SSH public key corresponding to the private key- * and the key algorithm categorization.- */-export const validateSshPrivateKey = async (privateKey: string) => {- const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-privkey-"));- const privateKeyFile = path.join(tempDir, "id_key");-- try {- await fs.writeFile(privateKeyFile, privateKey, {- encoding: "utf8",- mode: 0o600- });-- // This will fail if the private key is malformed or unreadable- const { stdout: publicKey } = await execFileAsync("ssh-keygen", ["-y", "-f", privateKeyFile], {- timeout: EXEC_TIMEOUT_MS- });-- const { stdout: fingerprint } = await execFileAsync("ssh-keygen", ["-lf", privateKeyFile]);- const keyAlgorithm = getKeyAlgorithmFromFingerprintOutput(fingerprint);-- if (!keyAlgorithm) {- throw new BadRequestError({- message: "Failed to validate SSH private key format: The key algorithm is not supported."- });- }-- return {- publicKey,- keyAlgorithm- };- } catch (err) {- throw new BadRequestError({- message: "Failed to validate SSH private key format: could not be parsed."- });- } finally {- await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});- }-};--/**- * Validate that the provided public and private keys are valid and constitute- * a matching SSH key pair.- */-export const validateExternalSshCaKeyPair = async (publicKey: string, privateKey: string) => {- await validateSshPublicKey(publicKey);-- const { publicKey: derivedPublicKey, keyAlgorithm } = await validateSshPrivateKey(privateKey);-- if (publicKey.trim() !== derivedPublicKey.trim()) {- throw new BadRequestError({- message:- "Failed to validate matching SSH key pair: The provided public key does not match the public key derived from the private key."- });- }-- return keyAlgorithm;-};--/**- * Create an SSH certificate for a user or host.- */-export const createSshCert = async ({- template,- caPrivateKey,- clientPublicKey,- keyId,- principals,- requestedTtl, // in ms lib format- certType-}: TCreateSshCertDTO) => {- let ttl: number | undefined;-- if (!template && requestedTtl) {- const parsedTtl = Math.ceil(ms(requestedTtl) / 1000);- if (parsedTtl > 0) ttl = parsedTtl;- }-- if (template) {- // validate if the requested [certType] is allowed under the template configuration- validateSshCertificateType(template, certType);-- // validate if the requested [principals] are valid for the given [certType] under the template configuration- validateSshCertificatePrincipals(certType, template, principals);-- // validate if the requested TTL is valid under the template configuration- ttl = validateSshCertificateTtl(template, requestedTtl);- }-- if (!ttl) {- throw new BadRequestError({- message: "Failed to create SSH certificate due to missing TTL"- });- }-- validateSshCertificateKeyId(keyId);- await validateSshPublicKey(clientPublicKey);-- const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-cert-"));-- const publicKeyFile = path.join(tempDir, "user_key.pub");- const privateKeyFile = path.join(tempDir, "ca_key");- const signedPublicKeyFile = path.join(tempDir, "user_key-cert.pub");-- const serialNumber = createSshCertSerialNumber();-- // Build `ssh-keygen` arguments for signing- // Using an array avoids shell injection issues- const sshKeygenArgs = [- certType === "host" ? "-h" : null, // host certificate if needed- "-s",- privateKeyFile, // path to SSH CA private key- "-I",- keyId, // identity (key ID)- "-n",- principals.join(","), // principals- "-V",- `+${ttl}s`, // validity (TTL in seconds)- "-z",- serialNumber, // serial number- publicKeyFile // public key file to sign- ].filter(Boolean) as string[];-- try {- // Write public and private keys to the temp directory- await fs.writeFile(publicKeyFile, clientPublicKey, { mode: 0o600 });- await fs.writeFile(privateKeyFile, caPrivateKey, { mode: 0o600 });-- // Execute the signing process- await execFileAsync("ssh-keygen", sshKeygenArgs, { encoding: "utf8", timeout: EXEC_TIMEOUT_MS });-- // Read the signed public key from the generated cert file- const signedPublicKey = await fs.readFile(signedPublicKeyFile, "utf8");-- return { serialNumber, signedPublicKey, ttl };- } finally {- // Cleanup the temporary directory and all its contents- await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});- }-};--export const createSshCaHelper = async ({- projectId,- friendlyName,- keyAlgorithm: requestedKeyAlgorithm,- keySource,- externalPk,- externalSk,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService,- tx: outerTx-}: TCreateSshCaHelperDTO) => {- // Function to handle the actual creation logic- const processCreation = async (tx: Knex) => {- let publicKey: string;- let privateKey: string;- let keyAlgorithm: SshCertKeyAlgorithm = requestedKeyAlgorithm;- if (keySource === SshCaKeySource.INTERNAL) {- // generate SSH CA key pair internally- ({ publicKey, privateKey } = await createSshKeyPair(requestedKeyAlgorithm));- } else {- // use external SSH CA key pair- if (!externalPk || !externalSk) {- throw new BadRequestError({- message: "Public and private keys are required when key source is external"- });- }- publicKey = externalPk;- privateKey = externalSk;- keyAlgorithm = await validateExternalSshCaKeyPair(publicKey, privateKey);- }- const ca = await sshCertificateAuthorityDAL.create(- {- projectId,- friendlyName,- status: SshCaStatus.ACTIVE,- keyAlgorithm,- keySource- },- tx- );- const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey(- {- type: KmsDataKey.SecretManager,- projectId- },- tx- );- await sshCertificateAuthoritySecretDAL.create(- {- sshCaId: ca.id,- encryptedPrivateKey: secretManagerEncryptor({ plainText: Buffer.from(privateKey, "utf8") }).cipherTextBlob- },- tx- );- return { ...ca, publicKey };- };-- if (outerTx) {- return processCreation(outerTx);- }-- return sshCertificateAuthorityDAL.transaction(processCreation);-};--/**- * Convert an actor to a list of principals to be included in an SSH certificate.- *- * (dangtony98): This function is only supported for user actors at the moment and returns- * only the email of the associated user. In the future, we will consider other- * actor types and attributes such as group membership slugs and/or metadata to be- * included in the list of principals.- */-export const convertActorToPrincipals = async ({ userDAL, actor, actorId }: TConvertActorToPrincipalsDTO) => {- if (actor !== ActorType.USER) {- throw new BadRequestError({- message: "Failed to convert actor to principals due to unsupported actor type"- });- }-- const user = await requestMemoize(requestMemoKeys.userFindById(actorId), () => userDAL.findById(actorId));-- return [user.username];-};diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-schema.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-schema.tsdeleted file mode 100644index af66e83ca5..0000000000--- a/backend/src/ee/services/ssh/ssh-certificate-authority-schema.ts+++ /dev/null@@ -1,10 +0,0 @@-import { SshCertificateAuthoritiesSchema } from "@app/db/schemas";--export const sanitizedSshCa = SshCertificateAuthoritiesSchema.pick({- id: true,- projectId: true,- friendlyName: true,- status: true,- keyAlgorithm: true,- keySource: true-});diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-secret-dal.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-secret-dal.tsdeleted file mode 100644index 9423a0ff2e..0000000000--- a/backend/src/ee/services/ssh/ssh-certificate-authority-secret-dal.ts+++ /dev/null@@ -1,10 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TSshCertificateAuthoritySecretDALFactory = ReturnType<typeof sshCertificateAuthoritySecretDALFactory>;--export const sshCertificateAuthoritySecretDALFactory = (db: TDbClient) => {- const sshCaSecretOrm = ormify(db, TableName.SshCertificateAuthoritySecret);- return sshCaSecretOrm;-};diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-service.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-service.tsdeleted file mode 100644index 6c35f0ddd6..0000000000--- a/backend/src/ee/services/ssh/ssh-certificate-authority-service.ts+++ /dev/null@@ -1,509 +0,0 @@-import { ForbiddenError } from "@casl/ability";--import { ActionProjectType } from "@app/db/schemas";-import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";-import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";-import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";-import { TSshCertificateBodyDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-body-dal";-import { TSshCertificateDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-dal";-import { TSshCertificateTemplateDALFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-dal";-import { BadRequestError, NotFoundError } from "@app/lib/errors";-import { TKmsServiceFactory } from "@app/services/kms/kms-service";-import { KmsDataKey } from "@app/services/kms/kms-types";--import { SshCertTemplateStatus } from "../ssh-certificate-template/ssh-certificate-template-types";-import { createSshCaHelper, createSshCert, createSshKeyPair, getSshPublicKey } from "./ssh-certificate-authority-fns";-import {- SshCaStatus,- TCreateSshCaDTO,- TDeleteSshCaDTO,- TGetSshCaCertificateTemplatesDTO,- TGetSshCaDTO,- TGetSshCaPublicKeyDTO,- TIssueSshCredsDTO,- TSignSshKeyDTO,- TUpdateSshCaDTO-} from "./ssh-certificate-authority-types";--type TSshCertificateAuthorityServiceFactoryDep = {- sshCertificateAuthorityDAL: Pick<- TSshCertificateAuthorityDALFactory,- "transaction" | "create" | "findById" | "updateById" | "deleteById" | "findOne"- >;- sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create" | "findOne">;- sshCertificateTemplateDAL: Pick<TSshCertificateTemplateDALFactory, "find" | "getById">;- sshCertificateDAL: Pick<TSshCertificateDALFactory, "create" | "transaction">;- sshCertificateBodyDAL: Pick<TSshCertificateBodyDALFactory, "create">;- kmsService: Pick<- TKmsServiceFactory,- "generateKmsKey" | "encryptWithKmsKey" | "decryptWithKmsKey" | "getOrgKmsKeyId" | "createCipherPairWithDataKey"- >;- permissionService: Pick<TPermissionServiceFactory, "getProjectPermission">;-};--export type TSshCertificateAuthorityServiceFactory = ReturnType<typeof sshCertificateAuthorityServiceFactory>;--export const sshCertificateAuthorityServiceFactory = ({- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- sshCertificateTemplateDAL,- sshCertificateDAL,- sshCertificateBodyDAL,- kmsService,- permissionService-}: TSshCertificateAuthorityServiceFactoryDep) => {- /**- * Generates a new SSH CA- */- const createSshCa = async ({- projectId,- friendlyName,- keyAlgorithm: requestedKeyAlgorithm,- publicKey: externalPk,- privateKey: externalSk,- keySource,- actorId,- actorAuthMethod,- actor,- actorOrgId- }: TCreateSshCaDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Create,- ProjectPermissionSub.SshCertificateAuthorities- );-- const newCa = await createSshCaHelper({- projectId,- friendlyName,- keyAlgorithm: requestedKeyAlgorithm,- keySource,- externalPk,- externalSk,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService- });-- return newCa;- };-- /**- * Return SSH CA with id [caId]- */- const getSshCaById = async ({ caId, actor, actorId, actorAuthMethod, actorOrgId }: TGetSshCaDTO) => {- const ca = await sshCertificateAuthorityDAL.findById(caId);- if (!ca) throw new NotFoundError({ message: `SSH CA with ID '${caId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: ca.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Read,- ProjectPermissionSub.SshCertificateAuthorities- );-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: ca.id });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: ca.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const publicKey = await getSshPublicKey(decryptedCaPrivateKey.toString("utf-8"));-- return { ...ca, publicKey };- };-- /**- * Return public key of SSH CA with id [caId]- */- const getSshCaPublicKey = async ({ caId }: TGetSshCaPublicKeyDTO) => {- const ca = await sshCertificateAuthorityDAL.findById(caId);- if (!ca) throw new NotFoundError({ message: `SSH CA with ID '${caId}' not found` });-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: ca.id });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: ca.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const publicKey = await getSshPublicKey(decryptedCaPrivateKey.toString("utf-8"));-- return publicKey;- };-- /**- * Update SSH CA with id [caId]- * Note: Used to enable/disable CA- */- const updateSshCaById = async ({- caId,- friendlyName,- status,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TUpdateSshCaDTO) => {- const ca = await sshCertificateAuthorityDAL.findById(caId);- if (!ca) throw new NotFoundError({ message: `SSH CA with ID '${caId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: ca.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Edit,- ProjectPermissionSub.SshCertificateAuthorities- );-- const updatedCa = await sshCertificateAuthorityDAL.updateById(caId, { friendlyName, status });-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: ca.id });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: ca.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const publicKey = await getSshPublicKey(decryptedCaPrivateKey.toString("utf-8"));-- return { ...updatedCa, publicKey };- };-- /**- * Delete SSH CA with id [caId]- */- const deleteSshCaById = async ({ caId, actor, actorId, actorAuthMethod, actorOrgId }: TDeleteSshCaDTO) => {- const ca = await sshCertificateAuthorityDAL.findById(caId);- if (!ca) throw new NotFoundError({ message: `SSH CA with ID '${caId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: ca.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Delete,- ProjectPermissionSub.SshCertificateAuthorities- );-- const deletedCa = await sshCertificateAuthorityDAL.deleteById(caId);-- return deletedCa;- };-- /**- * Return SSH certificate and corresponding new SSH public-private key pair where- * SSH public key is signed using CA behind SSH certificate with name [templateName].- */- const issueSshCreds = async ({- certificateTemplateId,- keyAlgorithm,- certType,- principals,- ttl: requestedTtl,- keyId: requestedKeyId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TIssueSshCredsDTO) => {- const sshCertificateTemplate = await sshCertificateTemplateDAL.getById(certificateTemplateId);- if (!sshCertificateTemplate) {- throw new NotFoundError({- message: "No SSH certificate template found with specified name"- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshCertificateTemplate.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Create,- ProjectPermissionSub.SshCertificates- );-- if (sshCertificateTemplate.caStatus === SshCaStatus.DISABLED) {- throw new BadRequestError({- message: "SSH CA is disabled"- });- }-- if (sshCertificateTemplate.status === SshCertTemplateStatus.DISABLED) {- throw new BadRequestError({- message: "SSH certificate template is disabled"- });- }-- // set [keyId] depending on if [allowCustomKeyIds] is true or false- const keyId = sshCertificateTemplate.allowCustomKeyIds- ? (requestedKeyId ?? `${actor}-${actorId}`)- : `${actor}-${actorId}`;-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: sshCertificateTemplate.sshCaId });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: sshCertificateTemplate.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- // create user key pair- const { publicKey, privateKey } = await createSshKeyPair(keyAlgorithm);-- const { serialNumber, signedPublicKey, ttl } = await createSshCert({- template: sshCertificateTemplate,- caPrivateKey: decryptedCaPrivateKey.toString("utf8"),- clientPublicKey: publicKey,- keyId,- principals,- requestedTtl,- certType- });-- const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: sshCertificateTemplate.projectId- });-- const encryptedCertificate = secretManagerEncryptor({- plainText: Buffer.from(signedPublicKey, "utf8")- }).cipherTextBlob;-- await sshCertificateDAL.transaction(async (tx) => {- const cert = await sshCertificateDAL.create(- {- sshCaId: sshCertificateTemplate.sshCaId,- sshCertificateTemplateId: sshCertificateTemplate.id,- serialNumber,- certType,- principals,- keyId,- notBefore: new Date(),- notAfter: new Date(Date.now() + ttl * 1000)- },- tx- );-- await sshCertificateBodyDAL.create(- {- sshCertId: cert.id,- encryptedCertificate- },- tx- );- });-- return {- serialNumber,- signedPublicKey,- privateKey,- publicKey,- certificateTemplate: sshCertificateTemplate,- ttl,- keyId- };- };-- /**- * Return SSH certificate by signing SSH public key [publicKey]- * using CA behind SSH certificate template with name [templateName]- */- const signSshKey = async ({- certificateTemplateId,- publicKey,- certType,- principals,- ttl: requestedTtl,- keyId: requestedKeyId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TSignSshKeyDTO) => {- const sshCertificateTemplate = await sshCertificateTemplateDAL.getById(certificateTemplateId);- if (!sshCertificateTemplate) {- throw new NotFoundError({- message: "No SSH certificate template found with specified name"- });- }-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: sshCertificateTemplate.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Create,- ProjectPermissionSub.SshCertificates- );-- if (sshCertificateTemplate.caStatus === SshCaStatus.DISABLED) {- throw new BadRequestError({- message: "SSH CA is disabled"- });- }-- if (sshCertificateTemplate.status === SshCertTemplateStatus.DISABLED) {- throw new BadRequestError({- message: "SSH certificate template is disabled"- });- }-- // set [keyId] depending on if [allowCustomKeyIds] is true or false- const keyId = sshCertificateTemplate.allowCustomKeyIds- ? (requestedKeyId ?? `${actor}-${actorId}`)- : `${actor}-${actorId}`;-- const sshCaSecret = await sshCertificateAuthoritySecretDAL.findOne({ sshCaId: sshCertificateTemplate.sshCaId });-- const { decryptor: secretManagerDecryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: sshCertificateTemplate.projectId- });-- const decryptedCaPrivateKey = secretManagerDecryptor({- cipherTextBlob: sshCaSecret.encryptedPrivateKey- });-- const { serialNumber, signedPublicKey, ttl } = await createSshCert({- template: sshCertificateTemplate,- caPrivateKey: decryptedCaPrivateKey.toString("utf8"),- clientPublicKey: publicKey,- keyId,- principals,- requestedTtl,- certType- });-- const { encryptor: secretManagerEncryptor } = await kmsService.createCipherPairWithDataKey({- type: KmsDataKey.SecretManager,- projectId: sshCertificateTemplate.projectId- });-- const encryptedCertificate = secretManagerEncryptor({- plainText: Buffer.from(signedPublicKey, "utf8")- }).cipherTextBlob;-- await sshCertificateDAL.transaction(async (tx) => {- const cert = await sshCertificateDAL.create(- {- sshCaId: sshCertificateTemplate.sshCaId,- sshCertificateTemplateId: sshCertificateTemplate.id,- serialNumber,- certType,- principals,- keyId,- notBefore: new Date(),- notAfter: new Date(Date.now() + ttl * 1000)- },- tx- );-- await sshCertificateBodyDAL.create(- {- sshCertId: cert.id,- encryptedCertificate- },- tx- );- });-- return { serialNumber, signedPublicKey, certificateTemplate: sshCertificateTemplate, ttl, keyId };- };-- const getSshCaCertificateTemplates = async ({- caId,- actor,- actorId,- actorAuthMethod,- actorOrgId- }: TGetSshCaCertificateTemplatesDTO) => {- const ca = await sshCertificateAuthorityDAL.findById(caId);- if (!ca) throw new NotFoundError({ message: `SSH CA with ID '${caId}' not found` });-- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId: ca.projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Read,- ProjectPermissionSub.SshCertificateTemplates- );-- const certificateTemplates = await sshCertificateTemplateDAL.find({ sshCaId: caId });-- return {- certificateTemplates,- ca- };- };-- return {- issueSshCreds,- signSshKey,- createSshCa,- getSshCaById,- getSshCaPublicKey,- updateSshCaById,- deleteSshCaById,- getSshCaCertificateTemplates- };-};diff --git a/backend/src/ee/services/ssh/ssh-certificate-authority-types.ts b/backend/src/ee/services/ssh/ssh-certificate-authority-types.tsdeleted file mode 100644index d433bd5adf..0000000000--- a/backend/src/ee/services/ssh/ssh-certificate-authority-types.ts+++ /dev/null@@ -1,102 +0,0 @@-import { Knex } from "knex";--import { TSshCertificateTemplates } from "@app/db/schemas";-import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";-import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";-import { TProjectPermission } from "@app/lib/types";-import { ActorType } from "@app/services/auth/auth-type";-import { TKmsServiceFactory } from "@app/services/kms/kms-service";-import { TUserDALFactory } from "@app/services/user/user-dal";--export enum SshCaStatus {- ACTIVE = "active",- DISABLED = "disabled"-}--export enum SshCaKeySource {- INTERNAL = "internal",- EXTERNAL = "external"-}--export enum SshCertType {- USER = "user",- HOST = "host"-}--export type TCreateSshCaDTO = {- friendlyName: string;- keyAlgorithm: SshCertKeyAlgorithm;- publicKey?: string;- privateKey?: string;- keySource: SshCaKeySource;-} & TProjectPermission;--export type TCreateSshCaHelperDTO = {- projectId: string;- friendlyName: string;- keyAlgorithm: SshCertKeyAlgorithm;- keySource: SshCaKeySource;- externalPk?: string;- externalSk?: string;- sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "transaction" | "create">;- sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create">;- kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;- tx?: Knex;-};--export type TGetSshCaDTO = {- caId: string;-} & Omit<TProjectPermission, "projectId">;--export type TGetSshCaPublicKeyDTO = {- caId: string;-};--export type TUpdateSshCaDTO = {- caId: string;- friendlyName?: string;- status?: SshCaStatus;-} & Omit<TProjectPermission, "projectId">;--export type TDeleteSshCaDTO = {- caId: string;-} & Omit<TProjectPermission, "projectId">;--export type TIssueSshCredsDTO = {- certificateTemplateId: string;- keyAlgorithm: SshCertKeyAlgorithm;- certType: SshCertType;- principals: string[];- ttl?: string;- keyId?: string;-} & Omit<TProjectPermission, "projectId">;--export type TSignSshKeyDTO = {- certificateTemplateId: string;- publicKey: string;- certType: SshCertType;- principals: string[];- ttl?: string;- keyId?: string;-} & Omit<TProjectPermission, "projectId">;--export type TGetSshCaCertificateTemplatesDTO = {- caId: string;-} & Omit<TProjectPermission, "projectId">;--export type TCreateSshCertDTO = {- template?: TSshCertificateTemplates;- caPrivateKey: string;- clientPublicKey: string;- keyId: string;- principals: string[];- requestedTtl?: string;- certType: SshCertType;-};--export type TConvertActorToPrincipalsDTO = {- actor: ActorType;- actorId: string;- userDAL: Pick<TUserDALFactory, "findById">;-};diff --git a/backend/src/keystore/keystore.ts b/backend/src/keystore/keystore.tsindex 0c65098dde..46284c3689 100644--- a/backend/src/keystore/keystore.ts+++ b/backend/src/keystore/keystore.ts@@ -22,7 +22,6 @@ export const PgSqlLock = {SecretRotationV2Creation: (folderId: string) => pgAdvisoryLockHashText(`secret-rotation-v2-creation:${folderId}`),CreateProject: (orgId: string) => pgAdvisoryLockHashText(`create-project:${orgId}`),CreateFolder: (envId: string, projectId: string) => pgAdvisoryLockHashText(`create-folder:${envId}-${projectId}`),- SshInit: (projectId: string) => pgAdvisoryLockHashText(`ssh-bootstrap:${projectId}`),InstanceRelayConfigInit: () => pgAdvisoryLockHashText("instance-relay-config-init"),OrgGatewayV2Init: (orgId: string) => pgAdvisoryLockHashText(`org-gateway-v2-init:${orgId}`),OrgRelayConfigInit: (orgId: string) => pgAdvisoryLockHashText(`org-relay-config-init:${orgId}`),@@ -113,12 +112,6 @@ export const KeyStorePrefixes = {GitHubManifestNameLock: (orgId: string, projectId: string | null, name: string) =>`github-manifest-name-lock:${orgId}:${projectId ?? "org"}:${name}` as const,- AiMcpServerOAuth: (sessionId: string) => `ai-mcp-server-oauth:${sessionId}` as const,-- // AI MCP Endpoint OAuth- AiMcpEndpointOAuthClient: (clientId: string) => `ai-mcp-endpoint-oauth-client:${clientId}` as const,- AiMcpEndpointOAuthCode: (clientId: string, code: string) => `ai-mcp-endpoint-oauth-code:${clientId}:${code}` as const,-// OAuth 2.0 authorization server (Infisical as an OAuth provider)OauthAuthorizationCode: (code: string) => `oauth-authorization-code:${code}` as const,@@ -218,9 +211,7 @@ export const KeyStoreTtls = {// How often a billable org's usage is re-emitted for reconciliation (demand-driven from getPlan).LicenseUsageReconcileIntervalInSeconds: 21600, // 6 hoursLicenseUsageLastReportedInSeconds: 604800, // 7 days- AiMcpEndpointOAuthFlowInSeconds: 300, // 5 minutesOauthAuthorizationCodeInSeconds: 600, // 10 minutes- AiMcpServerOAuthSessionInSeconds: 600, // 10 minutesDashboardCacheInSeconds: 600, // 10 minutesProjectEnvironmentOperationMarkerInSeconds: 10,UserMfaUnlockEmailSentInSeconds: 300, // 5 minutesdiff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex c3addfcc5b..33907cde81 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -78,11 +78,6 @@ export enum ApiDocsTags {PkiSigners = "PKI Signers",PkiSubscribers = "PKI Subscribers",PkiAcme = "PKI ACME",- SshCertificates = "SSH Certificates",- SshCertificateAuthorities = "SSH Certificate Authorities",- SshCertificateTemplates = "SSH Certificate Templates",- SshHosts = "SSH Hosts",- SshHostGroups = "SSH Host Groups",KmsKeys = "KMS Keys",KmsEncryption = "KMS Encryption",KmsSigning = "KMS Signing",@@ -1021,23 +1016,6 @@ export const PROJECTS = {LIST_INTEGRATION_AUTHORIZATION: {projectId: "The ID of the project to list integration auths for."},- LIST_SSH_CAS: {- projectId: "The ID of the project to list SSH CAs for."- },- LIST_SSH_HOSTS: {- projectId: "The ID of the project to list SSH hosts for."- },- LIST_SSH_HOST_GROUPS: {- projectId: "The ID of the project to list SSH host groups for."- },- LIST_SSH_CERTIFICATES: {- projectId: "The ID of the project to list SSH certificates for.",- offset: "The offset to start from. If you enter 10, it will start from the 10th SSH certificate.",- limit: "The number of SSH certificates to return."- },- LIST_SSH_CERTIFICATE_TEMPLATES: {- projectId: "The ID of the project to list SSH certificate templates for."- },LIST_CAS: {slug: "The slug of the project to list CAs for.",status: "The status of the CA to filter by.",@@ -1947,180 +1925,6 @@ export const AUDIT_LOG_STREAMS = {}};-export const SSH_CERTIFICATE_AUTHORITIES = {- CREATE: {- projectId: "The ID of the project to create the SSH CA in.",- friendlyName: "A friendly name for the SSH CA.",- keyAlgorithm:- "The type of public key algorithm and size, in bits, of the key pair for the SSH CA; required if keySource is internal.",- publicKey: "The public key for the SSH CA key pair; required if keySource is external.",- privateKey: "The private key for the SSH CA key pair; required if keySource is external.",- keySource: "The source of the SSH CA key pair. This can be one of internal or external."- },- GET: {- sshCaId: "The ID of the SSH CA to get."- },- GET_PUBLIC_KEY: {- sshCaId: "The ID of the SSH CA to get the public key for."- },- UPDATE: {- sshCaId: "The ID of the SSH CA to update.",- friendlyName: "A friendly name for the SSH CA to update to.",- status: "The status of the SSH CA to update to. This can be one of active or disabled."- },- DELETE: {- sshCaId: "The ID of the SSH CA to delete."- },- GET_CERTIFICATE_TEMPLATES: {- sshCaId: "The ID of the SSH CA to get the certificate templates for."- },- SIGN_SSH_KEY: {- certificateTemplateId: "The ID of the SSH certificate template to sign the SSH public key with.",- publicKey: "The SSH public key to sign.",- certType: "The type of certificate to issue. This can be one of user or host.",- principals: "The list of principals (usernames, hostnames) to include in the certificate.",- ttl: "The time to live for the certificate such as 1m, 1h, 1d, ... If not specified, the default TTL for the template will be used.",- keyId: "The key ID to include in the certificate. If not specified, a default key ID will be generated.",- serialNumber: "The serial number of the issued SSH certificate.",- signedKey: "The SSH certificate or signed SSH public key."- },- ISSUE_SSH_CREDENTIALS: {- certificateTemplateId: "The ID of the SSH certificate template to issue the SSH credentials with.",- keyAlgorithm: "The type of public key algorithm and size, in bits, of the key pair for the SSH CA.",- certType: "The type of certificate to issue. This can be one of user or host.",- principals: "The list of principals (usernames, hostnames) to include in the certificate.",- ttl: "The time to live for the certificate such as 1m, 1h, 1d, ... If not specified, the default TTL for the template will be used.",- keyId: "The key ID to include in the certificate. If not specified, a default key ID will be generated.",- serialNumber: "The serial number of the issued SSH certificate.",- signedKey: "The SSH certificate or signed SSH public key.",- privateKey: "The private key corresponding to the issued SSH certificate.",- publicKey: "The public key of the issued SSH certificate."- }-};--export const SSH_CERTIFICATE_TEMPLATES = {- GET: {- certificateTemplateId: "The ID of the SSH certificate template to get."- },- CREATE: {- sshCaId: "The ID of the SSH CA to associate the certificate template with.",- name: "The name of the certificate template.",- ttl: "The default time to live for issued certificates such as 1m, 1h, 1d, 1y, ...",- maxTTL: "The maximum time to live for issued certificates such as 1m, 1h, 1d, 1y, ...",- allowedUsers: "The list of allowed users for certificates issued under this template.",- allowedHosts: "The list of allowed hosts for certificates issued under this template.",- allowUserCertificates: "Whether or not to allow user certificates to be issued under this template.",- allowHostCertificates: "Whether or not to allow host certificates to be issued under this template.",- allowCustomKeyIds: "Whether or not to allow custom key IDs for certificates issued under this template."- },- UPDATE: {- certificateTemplateId: "The ID of the SSH certificate template to update.",- name: "The name of the certificate template.",- ttl: "The default time to live for issued certificates such as 1m, 1h, 1d, 1y, ...",- maxTTL: "The maximum time to live for issued certificates such as 1m, 1h, 1d, 1y, ...",- allowedUsers: "The list of allowed users for certificates issued under this template.",- allowedHosts: "The list of allowed hosts for certificates issued under this template.",- allowUserCertificates: "Whether or not to allow user certificates to be issued under this template.",- allowHostCertificates: "Whether or not to allow host certificates to be issued under this template.",- allowCustomKeyIds: "Whether or not to allow custom key IDs for certificates issued under this template."- },- DELETE: {- certificateTemplateId: "The ID of the SSH certificate template to delete."- }-};--export const SSH_HOST_GROUPS = {- GET: {- sshHostGroupId: "The ID of the SSH host group to get.",- filter: "The filter to apply to the SSH hosts in the SSH host group."- },- CREATE: {- projectId: "The ID of the project to create the SSH host group in.",- name: "The name of the SSH host group.",- loginMappings:- "A list of default login mappings to include on each host in the SSH host group. Each login mapping contains a login user and a list of corresponding allowed principals being usernames of users in the Infisical SSH project."- },- UPDATE: {- sshHostGroupId: "The ID of the SSH host group to update.",- name: "The name of the SSH host group to update to.",- loginMappings:- "A list of default login mappings to include on each host in the SSH host group. Each login mapping contains a login user and a list of corresponding allowed principals being usernames of users in the Infisical SSH project."- },- DELETE: {- sshHostGroupId: "The ID of the SSH host group to delete."- },- LIST_HOSTS: {- offset: "The offset to start from. If you enter 10, it will start from the 10th host",- limit: "The number of hosts to return."- },- ADD_HOST: {- sshHostGroupId: "The ID of the SSH host group to add the host to.",- hostId: "The ID of the SSH host to add to the SSH host group."- },- DELETE_HOST: {- sshHostGroupId: "The ID of the SSH host group to delete the host from.",- hostId: "The ID of the SSH host to delete from the SSH host group."- }-};--export const SSH_HOSTS = {- GET: {- sshHostId: "The ID of the SSH host to get."- },- CREATE: {- projectId: "The ID of the project to create the SSH host in.",- hostname: "The hostname of the SSH host.",- alias: "The alias for the SSH host.",- userCertTtl: "The time to live for user certificates issued under this host.",- hostCertTtl: "The time to live for host certificates issued under this host.",- loginUser: "A login user on the remote machine (e.g. 'ec2-user', 'deploy', 'admin')",- allowedPrincipals: "A list of allowed principals that can log in as the login user.",- loginMappings:- "A list of login mappings for the SSH host. Each login mapping contains a login user and a list of corresponding allowed principals being usernames of users or groups slugs in the Infisical SSH project.",- userSshCaId:- "The ID of the SSH CA to use for user certificates. If not specified, the default user SSH CA will be used if it exists.",- hostSshCaId:- "The ID of the SSH CA to use for host certificates. If not specified, the default host SSH CA will be used if it exists."- },- UPDATE: {- sshHostId: "The ID of the SSH host to update.",- hostname: "The hostname of the SSH host to update to.",- alias: "The alias for the SSH host to update to.",- userCertTtl: "The time to live for user certificates issued under this host to update to.",- hostCertTtl: "The time to live for host certificates issued under this host to update to.",- loginUser: "A login user on the remote machine (e.g. 'ec2-user', 'deploy', 'admin')",- allowedPrincipals: "A list of allowed principals that can log in as the login user.",- loginMappings:- "A list of login mappings for the SSH host. Each login mapping contains a login user and a list of corresponding allowed principals being usernames of users or groups slugs in the Infisical SSH project."- },- DELETE: {- sshHostId: "The ID of the SSH host to delete."- },- ISSUE_SSH_CREDENTIALS: {- sshHostId: "The ID of the SSH host to issue the SSH credentials for.",- loginUser: "The login user to issue the SSH credentials for.",- keyAlgorithm: "The type of public key algorithm and size, in bits, of the key pair for the SSH host.",- serialNumber: "The serial number of the issued SSH certificate.",- signedKey: "The SSH certificate or signed SSH public key.",- privateKey: "The private key corresponding to the issued SSH certificate.",- publicKey: "The public key of the issued SSH certificate."- },- ISSUE_HOST_CERT: {- sshHostId: "The ID of the SSH host to issue the SSH certificate for.",- publicKey: "The SSH public key to issue the SSH certificate for.",- serialNumber: "The serial number of the issued SSH certificate.",- signedKey: "The SSH certificate or signed SSH public key."- },- GET_USER_CA_PUBLIC_KEY: {- sshHostId: "The ID of the SSH host to get the user SSH CA public key for.",- publicKey: "The public key of the user SSH CA linked to the SSH host."- },- GET_HOST_CA_PUBLIC_KEY: {- sshHostId: "The ID of the SSH host to get the host SSH CA public key for.",- publicKey: "The public key of the host SSH CA linked to the SSH host."- }-};-export const CERTIFICATE_AUTHORITIES = {CREATE: {projectSlug: "Slug of the project to create the CA in.",diff --git a/backend/src/lib/pii/index.ts b/backend/src/lib/pii/index.tsdeleted file mode 100644index 2bc2d11729..0000000000--- a/backend/src/lib/pii/index.ts+++ /dev/null@@ -1,83 +0,0 @@-import RE2 from "re2";--export enum PiiEntityType {- EMAIL = "EMAIL",- PHONE = "PHONE",- SSN = "SSN",- CREDIT_CARD = "CREDIT_CARD",- IP_ADDRESS = "IP_ADDRESS"-}--// Precompiled RE2 patterns for PII detection-const PII_PATTERNS: Record<PiiEntityType, RE2> = {- [PiiEntityType.EMAIL]: new RE2("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", "g"),- [PiiEntityType.PHONE]: new RE2(- "\\+[1-9]\\d{0,2}[-.\\s]?(?:\\(?\\d{1,5}\\)?[-.\\s]?){1,6}\\d{2,5}\\b|(?:\\+?1[-.]?)?\\(?\\b[0-9]{3}\\)?[-.\\s]?[0-9]{3}[-.\\s]?[0-9]{4}\\b",- "g"- ),- [PiiEntityType.SSN]: new RE2("\\b[0-9]{3}[-\\s]?[0-9]{2}[-\\s]?[0-9]{4}\\b", "g"),- [PiiEntityType.CREDIT_CARD]: new RE2(- "\\b(?:4[0-9]{3}[-\\s]?[0-9]{4}[-\\s]?[0-9]{4}[-\\s]?[0-9]{4}|4[0-9]{12}|5[1-5][0-9]{2}[-\\s]?[0-9]{4}[-\\s]?[0-9]{4}[-\\s]?[0-9]{4}|3[47][0-9]{2}[-\\s]?[0-9]{6}[-\\s]?[0-9]{5}|6(?:011[-\\s]?[0-9]{4}|5[0-9]{2}[-\\s]?[0-9]{4})[-\\s]?[0-9]{4}[-\\s]?[0-9]{4})\\b",- "g"- ),- [PiiEntityType.IP_ADDRESS]: new RE2(- "(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|:(?::[0-9a-fA-F]{1,4}){1,7}|::(?:[fF]{4}:)?(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)",- "g"- )-};--const REDACTION_PLACEHOLDERS: Record<PiiEntityType, string> = {- [PiiEntityType.EMAIL]: "[REDACTED_EMAIL]",- [PiiEntityType.PHONE]: "[REDACTED_PHONE]",- [PiiEntityType.SSN]: "[REDACTED_SSN]",- [PiiEntityType.CREDIT_CARD]: "[REDACTED_CREDIT_CARD]",- [PiiEntityType.IP_ADDRESS]: "[REDACTED_IP]"-};--/**- * Redacts PII from a string based on the specified entity types- */-export function redactPii(text: string, entityTypes: PiiEntityType[]): string {- if (!text || entityTypes.length === 0) {- return text;- }-- let result = text;- for (const entityType of entityTypes) {- const pattern = PII_PATTERNS[entityType];- const placeholder = REDACTION_PLACEHOLDERS[entityType];- if (pattern && placeholder) {- result = result.replace(pattern, placeholder);- }- }-- return result;-}--/**- * Recursively redacts PII from an object, including nested objects and arrays- */-export function redactPiiFromObject<T>(obj: T, entityTypes: PiiEntityType[]): T {- if (!obj || entityTypes.length === 0) {- return obj;- }-- if (typeof obj === "string") {- return redactPii(obj, entityTypes) as T;- }-- if (Array.isArray(obj)) {- const redactedArray = obj.map((item: unknown) => redactPiiFromObject(item, entityTypes));- return redactedArray as T;- }-- if (typeof obj === "object") {- const result: Record<string, unknown> = {};- for (const [key, value] of Object.entries(obj)) {- result[key] = redactPiiFromObject(value, entityTypes);- }- return result as T;- }-- return obj;-}diff --git a/backend/src/lib/ssh/index.ts b/backend/src/lib/ssh/index.tsnew file mode 100644index 0000000000..efc320336b--- /dev/null+++ b/backend/src/lib/ssh/index.ts@@ -0,0 +1,250 @@+import { execFile } from "child_process";+import { promises as fs } from "fs";+import os from "os";+import path from "path";+import { promisify } from "util";++import { crypto } from "@app/lib/crypto/cryptography";+import { BadRequestError } from "@app/lib/errors";+import { ms } from "@app/lib/ms";+import { CharacterType, characterValidator } from "@app/lib/validator/validate-string";++const execFileAsync = promisify(execFile);++const EXEC_TIMEOUT_MS = 10000; // 10 seconds++export enum SshCertKeyAlgorithm {+ RSA_2048 = "RSA_2048",+ RSA_4096 = "RSA_4096",+ ECDSA_P256 = "EC_prime256v1",+ ECDSA_P384 = "EC_secp384r1",+ ED25519 = "ED25519"+}++export enum SshCertType {+ USER = "user",+ HOST = "host"+}++export type TCreateSshCertDTO = {+ caPrivateKey: string;+ clientPublicKey: string;+ keyId: string;+ principals: string[];+ requestedTtl?: string;+ certType: SshCertType;+};++/* eslint-disable no-bitwise */+const createSshCertSerialNumber = () => {+ const randomBytes = crypto.randomBytes(8); // 8 bytes = 64 bits+ randomBytes[0] &= 0x7f; // Ensure the most significant bit is 0 (to stay within unsigned range)+ return BigInt(`0x${randomBytes.toString("hex")}`).toString(10); // Convert to decimal+};++/**+ * Return a pair of SSH CA keys based on the specified key algorithm [keyAlgorithm].+ * We use this function because the key format generated by `ssh-keygen` is unique.+ */+export const createSshKeyPair = async (keyAlgorithm: SshCertKeyAlgorithm) => {+ const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-key-"));+ const privateKeyFile = path.join(tempDir, "id_key");+ const publicKeyFile = `${privateKeyFile}.pub`;++ let keyType: string;+ let keyBits: string | null;++ switch (keyAlgorithm) {+ case SshCertKeyAlgorithm.RSA_2048:+ keyType = "rsa";+ keyBits = "2048";+ break;+ case SshCertKeyAlgorithm.RSA_4096:+ keyType = "rsa";+ keyBits = "4096";+ break;+ case SshCertKeyAlgorithm.ECDSA_P256:+ keyType = "ecdsa";+ keyBits = "256";+ break;+ case SshCertKeyAlgorithm.ECDSA_P384:+ keyType = "ecdsa";+ keyBits = "384";+ break;+ case SshCertKeyAlgorithm.ED25519:+ keyType = "ed25519";+ keyBits = null;+ break;+ default:+ throw new BadRequestError({+ message: "Failed to produce SSH CA key pair generation command due to unrecognized key algorithm"+ });+ }++ try {+ const args = ["-t", keyType];+ if (keyBits !== null) {+ args.push("-b", keyBits);+ }+ args.push("-f", privateKeyFile, "-N", "", "-C", "Infisical");++ // Generate the SSH key pair+ // The "-N ''" sets an empty passphrase+ // The keys are created in the temporary directory+ await execFileAsync("ssh-keygen", args, {+ timeout: EXEC_TIMEOUT_MS+ });++ // Read the generated keys+ const publicKey = await fs.readFile(publicKeyFile, "utf8");+ const privateKey = await fs.readFile(privateKeyFile, "utf8");++ return { publicKey, privateKey };+ } finally {+ // Cleanup the temporary directory and all its contents+ await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});+ }+};++/**+ * Return the SSH public key for the given SSH private key.+ */+export const getSshPublicKey = async (privateKey: string) => {+ const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-key-"));+ const privateKeyFile = path.join(tempDir, "id_key");+ try {+ await fs.writeFile(privateKeyFile, privateKey, { mode: 0o600 });++ // Run ssh-keygen to extract the public key+ const { stdout } = await execFileAsync("ssh-keygen", ["-y", "-f", privateKeyFile], {+ encoding: "utf8",+ timeout: EXEC_TIMEOUT_MS+ });+ return stdout.trim();+ } finally {+ // Ensure that files and the temporary directory are cleaned up+ await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});+ }+};++/**+ * Validate the requested SSH certificate key ID to ensure+ * that it only contains alphanumeric characters with no spaces.+ */+const validateSshCertificateKeyId = (keyId: string) => {+ const regex = characterValidator([+ CharacterType.AlphaNumeric,+ CharacterType.Hyphen,+ CharacterType.Colon,+ CharacterType.Period+ ]);+ if (!regex(keyId)) {+ throw new BadRequestError({+ message:+ "Failed to validate Key ID because it can only contain alphanumeric characters and hyphens, with no spaces."+ });+ }++ if (keyId.length > 50) {+ throw new BadRequestError({+ message: "keyId can only be up to 50 characters long."+ });+ }+};++/**+ * Validate the format of the SSH public key+ */+const validateSshPublicKey = async (publicKey: string) => {+ const validPrefixes = ["ssh-rsa", "ssh-ed25519", "ecdsa-sha2-nistp256", "ecdsa-sha2-nistp384"];+ const startsWithValidPrefix = validPrefixes.some((prefix) => publicKey.startsWith(`${prefix} `));+ if (!startsWithValidPrefix) {+ throw new BadRequestError({ message: "Failed to validate SSH public key format: unsupported key type." });+ }++ // write the key to a temp file and run `ssh-keygen -l -f`+ // check to see if OpenSSH can read/interpret the public key+ const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-pubkey-"));+ const pubKeyFile = path.join(tempDir, "key.pub");++ try {+ await fs.writeFile(pubKeyFile, publicKey, { mode: 0o600 });+ await execFileAsync("ssh-keygen", ["-l", "-f", pubKeyFile], { timeout: EXEC_TIMEOUT_MS });+ } catch (error) {+ throw new BadRequestError({+ message: "Failed to validate SSH public key format: could not be parsed."+ });+ } finally {+ await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});+ }+};++/**+ * Create an SSH certificate for a user or host.+ */+export const createSshCert = async ({+ caPrivateKey,+ clientPublicKey,+ keyId,+ principals,+ requestedTtl, // in ms lib format+ certType+}: TCreateSshCertDTO) => {+ let ttl: number | undefined;++ if (requestedTtl) {+ const parsedTtl = Math.ceil(ms(requestedTtl) / 1000);+ if (parsedTtl > 0) ttl = parsedTtl;+ }++ if (!ttl) {+ throw new BadRequestError({+ message: "Failed to create SSH certificate due to missing TTL"+ });+ }++ validateSshCertificateKeyId(keyId);+ await validateSshPublicKey(clientPublicKey);++ const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "ssh-cert-"));++ const publicKeyFile = path.join(tempDir, "user_key.pub");+ const privateKeyFile = path.join(tempDir, "ca_key");+ const signedPublicKeyFile = path.join(tempDir, "user_key-cert.pub");++ const serialNumber = createSshCertSerialNumber();++ // Build `ssh-keygen` arguments for signing+ // Using an array avoids shell injection issues+ const sshKeygenArgs = [+ certType === "host" ? "-h" : null, // host certificate if needed+ "-s",+ privateKeyFile, // path to SSH CA private key+ "-I",+ keyId, // identity (key ID)+ "-n",+ principals.join(","), // principals+ "-V",+ `+${ttl}s`, // validity (TTL in seconds)+ "-z",+ serialNumber, // serial number+ publicKeyFile // public key file to sign+ ].filter(Boolean) as string[];++ try {+ // Write public and private keys to the temp directory+ await fs.writeFile(publicKeyFile, clientPublicKey, { mode: 0o600 });+ await fs.writeFile(privateKeyFile, caPrivateKey, { mode: 0o600 });++ // Execute the signing process+ await execFileAsync("ssh-keygen", sshKeygenArgs, { encoding: "utf8", timeout: EXEC_TIMEOUT_MS });++ // Read the signed public key from the generated cert file+ const signedPublicKey = await fs.readFile(signedPublicKeyFile, "utf8");++ return { serialNumber, signedPublicKey, ttl };+ } finally {+ // Cleanup the temporary directory and all its contents+ await fs.rm(tempDir, { recursive: true, force: true }).catch(() => {});+ }+};diff --git a/backend/src/server/app.ts b/backend/src/server/app.tsindex dd4b0b91d4..0661affe0c 100644--- a/backend/src/server/app.ts+++ b/backend/src/server/app.ts@@ -13,7 +13,7 @@ import type { FastifyRateLimitOptions } from "@fastify/rate-limit";import ratelimiter from "@fastify/rate-limit";import { fastifyRequestContext } from "@fastify/request-context";import websocket from "@fastify/websocket";-import fastify, { FastifyInstance, FastifyRequest } from "fastify";+import fastify from "fastify";import { Cluster, Redis } from "ioredis";import { Knex } from "knex";@@ -112,37 +112,19 @@ export const main = async ({await server.register(fastifyEtag);- // Dynamic CORS: MCP OAuth routes need permissive CORS for browser-based flows (MCP Inspector)- await server.register(- cors,- // eslint-disable-next-line @typescript-eslint/no-unused-vars- (_instance: FastifyInstance) =>- (req: FastifyRequest, callback: (err: Error | null, options: FastifyCorsOptions) => void) => {- const isMcpOAuthRoute =- req.url.startsWith("/.well-known/oauth-protected-resource") ||- req.url.startsWith("/.well-known/oauth-authorization-server") ||- req.url.startsWith("/mcp-endpoints/") ||- (req.url.includes("/ai/mcp/endpoints/") && req.url.includes("/oauth/"));-- if (isMcpOAuthRoute) {- callback(null, { origin: true, credentials: false });- return;+ await server.register<FastifyCorsOptions>(cors, {+ credentials: true,+ ...(appCfg.CORS_ALLOWED_ORIGINS?.length+ ? {+ origin: [...appCfg.CORS_ALLOWED_ORIGINS, ...(appCfg.SITE_URL ? [appCfg.SITE_URL] : [])]}-- // Default CORS config for other routes- const defaultOrigin = appCfg.CORS_ALLOWED_ORIGINS?.length- ? [...appCfg.CORS_ALLOWED_ORIGINS, ...(appCfg.SITE_URL ? [appCfg.SITE_URL] : [])]- : appCfg.SITE_URL || true;-- callback(null, {- credentials: true,- origin: defaultOrigin,- ...(appCfg.CORS_ALLOWED_HEADERS?.length && {- allowedHeaders: appCfg.CORS_ALLOWED_HEADERS- })- });- }- );+ : {+ origin: appCfg.SITE_URL || true+ }),+ ...(appCfg.CORS_ALLOWED_HEADERS?.length && {+ allowedHeaders: appCfg.CORS_ALLOWED_HEADERS+ })+ });await server.register(registerResponseSchemaHooks);// pull ip based on various proxy headersdiff --git a/backend/src/server/config/rateLimiter.ts b/backend/src/server/config/rateLimiter.tsindex 78bd4c9434..536238fb2d 100644--- a/backend/src/server/config/rateLimiter.ts+++ b/backend/src/server/config/rateLimiter.ts@@ -92,13 +92,6 @@ export const userEngagementLimit: RateLimitOptions = {keyGenerator: (req) => req.realIp};-export const publicSshCaLimit: RateLimitOptions = {- timeWindow: 60 * 1000,- hook: "preValidation",- max: 30, // conservative default- keyGenerator: (req) => req.realIp-};-export const invalidateCacheLimit: RateLimitOptions = {timeWindow: 60 * 1000,hook: "preValidation",diff --git a/backend/src/server/plugins/auth/inject-identity.test.ts b/backend/src/server/plugins/auth/inject-identity.test.tsindex 26f5fd8fe6..3b316d1a5e 100644--- a/backend/src/server/plugins/auth/inject-identity.test.ts+++ b/backend/src/server/plugins/auth/inject-identity.test.ts@@ -56,13 +56,6 @@ describe("extractAuth — OAuth access token classification", () => {expect(result.authMode).toBe(AuthMode.JWT);});- test("the MCP marker takes precedence over the OAuth marker", async () => {- const token = sign({ ...baseAccessClaims, mcp: { endpointId: "ep-1" }, oauthClientId: "oauth_client_abc" });- const result = await extractAuth(makeReq(`Bearer ${token}`), AUTH_SECRET);-- expect(result.authMode).toBe(AuthMode.MCP_JWT);- });-test("a service token is still detected by its st. prefix, never as OAuth", async () => {const result = await extractAuth(makeReq("Bearer st.some-service-token"), AUTH_SECRET);diff --git a/backend/src/server/plugins/auth/inject-identity.ts b/backend/src/server/plugins/auth/inject-identity.tsindex 376d281e74..ae4d8e6d28 100644--- a/backend/src/server/plugins/auth/inject-identity.ts+++ b/backend/src/server/plugins/auth/inject-identity.ts@@ -25,7 +25,7 @@ import { getServerCfg } from "@app/services/super-admin/super-admin-service";export type TAuthMode =| {- authMode: AuthMode.JWT | AuthMode.MCP_JWT | AuthMode.OAUTH;+ authMode: AuthMode.JWT | AuthMode.OAUTH;actor: ActorType.USER;userId: string;tokenVersionId: string; // the session id of token used@@ -134,14 +134,6 @@ export const extractAuth = async (req: FastifyRequest, jwtSecret: string) => {switch (decodedToken.authTokenType) {case AuthTokenType.ACCESS_TOKEN: {- if (decodedToken?.mcp) {- return {- authMode: AuthMode.MCP_JWT,- token: decodedToken as AuthModeJwtTokenPayload,- actor: ActorType.USER- } as const;- }-if (decodedToken?.oauthClientId) {return {authMode: AuthMode.OAUTH,@@ -234,10 +226,6 @@ export const injectIdentity = fp(return;}- if (pathname === "/api/v1/ai/mcp/servers/oauth/callback") {- return;- }-if (pathname === "/api/v1/oauth/token") {return;}@@ -295,28 +283,6 @@ export const injectIdentity = fp(fireIdentifyForUser(user);break;}- case AuthMode.MCP_JWT: {- const { user, tokenVersionId, orgId, orgName, rootOrgId, parentOrgId } =- await server.services.authToken.fnValidateJwtIdentity(token);- requestContext.set(RequestContextKey.OrgId, orgId);- requestContext.set(RequestContextKey.OrgName, orgName);- requestContext.set(RequestContextKey.UserAuthInfo, { userId: user.id, email: user.email || "" });- req.auth = {- authMode: AuthMode.MCP_JWT,- user,- userId: user.id,- tokenVersionId,- actor,- orgId,- rootOrgId,- parentOrgId,- authMethod: token.authMethod,- isMfaVerified: token.isMfaVerified,- token- };- fireIdentifyForUser(user);- break;- }case AuthMode.OAUTH: {const { user, tokenVersionId, orgId, orgName, rootOrgId, parentOrgId } =await server.services.authToken.fnValidateJwtIdentity(token);diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.tsindex e08377bd7f..ed4ed2e899 100644--- a/backend/src/server/routes/index.ts+++ b/backend/src/server/routes/index.ts@@ -6,11 +6,6 @@ import { Knex } from "knex";import { monitorEventLoopDelay } from "perf_hooks";import { z } from "zod";-import {- registerMcpEndpointAuthServerMetadataRouter,- registerMcpEndpointMetadataRouter,- registerRfc9728ProtectedResourceMetadataRouter-} from "@app/ee/routes/ai/mcp-endpoint-metadata-router";import { registerCertificateEstRouter } from "@app/ee/routes/est/certificate-est-router";import { registerPkiScepRouter } from "@app/ee/routes/scep/pki-scep-router";import { registerV1EERoutes } from "@app/ee/routes/v1";@@ -28,16 +23,6 @@ import { accessApprovalRequestReviewerDALFactory } from "@app/ee/services/accessimport { accessApprovalRequestServiceFactory } from "@app/ee/services/access-approval-request/access-approval-request-service";import { agentProxyCaServiceFactory } from "@app/ee/services/agent-proxy-ca/agent-proxy-ca-service";import { orgAgentProxyConfigDALFactory } from "@app/ee/services/agent-proxy-ca/org-agent-proxy-config-dal";-import { aiMcpActivityLogDALFactory } from "@app/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-dal";-import { aiMcpActivityLogServiceFactory } from "@app/ee/services/ai-mcp-activity-log/ai-mcp-activity-log-service";-import { aiMcpEndpointDALFactory } from "@app/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-dal";-import { aiMcpEndpointServerDALFactory } from "@app/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-dal";-import { aiMcpEndpointServerToolDALFactory } from "@app/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-server-tool-dal";-import { aiMcpEndpointServiceFactory } from "@app/ee/services/ai-mcp-endpoint/ai-mcp-endpoint-service";-import { aiMcpServerDALFactory } from "@app/ee/services/ai-mcp-server/ai-mcp-server-dal";-import { aiMcpServerServiceFactory } from "@app/ee/services/ai-mcp-server/ai-mcp-server-service";-import { aiMcpServerToolDALFactory } from "@app/ee/services/ai-mcp-server/ai-mcp-server-tool-dal";-import { aiMcpServerUserCredentialDALFactory } from "@app/ee/services/ai-mcp-server/ai-mcp-server-user-credential-dal";import { assumePrivilegeServiceFactory } from "@app/ee/services/assume-privilege/assume-privilege-service";import { clickhouseAuditLogDALFactory } from "@app/ee/services/audit-log/audit-log-clickhouse-dal";import { auditLogDALFactory } from "@app/ee/services/audit-log/audit-log-dal";@@ -202,20 +187,6 @@ import { secretScanningServiceFactory } from "@app/ee/services/secret-scanning/simport { secretScanningV2DALFactory } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-dal";import { secretScanningV2QueueServiceFactory } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-queue";import { secretScanningV2ServiceFactory } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-service";-import { sshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";-import { sshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";-import { sshCertificateAuthorityServiceFactory } from "@app/ee/services/ssh/ssh-certificate-authority-service";-import { sshCertificateBodyDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-body-dal";-import { sshCertificateDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-dal";-import { sshCertificateTemplateDALFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-dal";-import { sshCertificateTemplateServiceFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-service";-import { sshHostDALFactory } from "@app/ee/services/ssh-host/ssh-host-dal";-import { sshHostLoginUserMappingDALFactory } from "@app/ee/services/ssh-host/ssh-host-login-user-mapping-dal";-import { sshHostServiceFactory } from "@app/ee/services/ssh-host/ssh-host-service";-import { sshHostLoginUserDALFactory } from "@app/ee/services/ssh-host/ssh-login-user-dal";-import { sshHostGroupDALFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-dal";-import { sshHostGroupMembershipDALFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-membership-dal";-import { sshHostGroupServiceFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-service";import { subOrgServiceFactory } from "@app/ee/services/sub-org/sub-org-service";import { trustedIpDALFactory } from "@app/ee/services/trusted-ip/trusted-ip-dal";import { trustedIpServiceFactory } from "@app/ee/services/trusted-ip/trusted-ip-service";@@ -464,7 +435,6 @@ import { projectCleanupQueueFactory } from "@app/services/project/project-cleanuimport { projectDALFactory } from "@app/services/project/project-dal";import { projectQueueFactory } from "@app/services/project/project-queue";import { projectServiceFactory } from "@app/services/project/project-service";-import { projectSshConfigDALFactory } from "@app/services/project/project-ssh-config-dal";import { projectBotDALFactory } from "@app/services/project-bot/project-bot-dal";import { projectBotServiceFactory } from "@app/services/project-bot/project-bot-service";import { projectEnvDALFactory } from "@app/services/project-env/project-env-dal";@@ -621,7 +591,6 @@ export const registerRoutes = async (const projectDAL = projectDALFactory(db);const projectAccessRequestDAL = projectAccessRequestDALFactory(db);- const projectSshConfigDAL = projectSshConfigDALFactory(db);const projectMembershipDAL = projectMembershipDALFactory(db);const projectEnvDAL = projectEnvDALFactory(db);const projectKeyDAL = projectKeyDALFactory(db);@@ -725,17 +694,6 @@ export const registerRoutes = async (const dynamicSecretLeaseDAL = dynamicSecretLeaseDALFactory(db);const emailDomainDAL = emailDomainDALFactory(db);- const sshCertificateDAL = sshCertificateDALFactory(db);- const sshCertificateBodyDAL = sshCertificateBodyDALFactory(db);- const sshCertificateAuthorityDAL = sshCertificateAuthorityDALFactory(db);- const sshCertificateAuthoritySecretDAL = sshCertificateAuthoritySecretDALFactory(db);- const sshCertificateTemplateDAL = sshCertificateTemplateDALFactory(db);- const sshHostDAL = sshHostDALFactory(db);- const sshHostLoginUserDAL = sshHostLoginUserDALFactory(db);- const sshHostLoginUserMappingDAL = sshHostLoginUserMappingDALFactory(db);- const sshHostGroupDAL = sshHostGroupDALFactory(db);- const sshHostGroupMembershipDAL = sshHostGroupMembershipDALFactory(db);-const kmsDAL = kmskeyDALFactory(db);const internalKmsDAL = internalKmsDALFactory(db);const internalKmsKeyVersionDAL = internalKmsKeyVersionDALFactory(db);@@ -1683,54 +1641,6 @@ export const registerRoutes = async (const orgGatewayConfigV2DAL = orgGatewayConfigV2DalFactory(db);- const aiMcpServerDAL = aiMcpServerDALFactory(db);-- const sshCertificateAuthorityService = sshCertificateAuthorityServiceFactory({- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- sshCertificateTemplateDAL,- sshCertificateDAL,- sshCertificateBodyDAL,- kmsService,- permissionService- });-- const sshCertificateTemplateService = sshCertificateTemplateServiceFactory({- sshCertificateTemplateDAL,- sshCertificateAuthorityDAL,- permissionService- });-- const sshHostService = sshHostServiceFactory({- userDAL,- groupDAL,- userGroupMembershipDAL,- projectDAL,- projectSshConfigDAL,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- sshCertificateDAL,- sshCertificateBodyDAL,- sshHostDAL,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- permissionService,- kmsService- });-- const sshHostGroupService = sshHostGroupServiceFactory({- projectDAL,- sshHostDAL,- sshHostGroupDAL,- sshHostGroupMembershipDAL,- sshHostLoginUserDAL,- sshHostLoginUserMappingDAL,- userDAL,- permissionService,- licenseService,- groupDAL- });-const certificateAuthorityCrlService = certificateAuthorityCrlServiceFactory({certificateAuthorityDAL,certificateAuthorityCrlDAL,@@ -1918,7 +1828,6 @@ export const registerRoutes = async (appConnectionDAL,dynamicSecretDAL,identityKubernetesAuthDAL,- aiMcpServerDAL,pkiDiscoveryConfigDAL,resourceAuthMethodService});@@ -2189,7 +2098,6 @@ export const registerRoutes = async (const projectService = projectServiceFactory({permissionService,projectDAL,- projectSshConfigDAL,projectQueue: projectQueueService,userDAL,projectEnvDAL,@@ -2202,12 +2110,6 @@ export const registerRoutes = async (certificateDAL,pkiAlertDAL,pkiCollectionDAL,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- sshCertificateDAL,- sshCertificateTemplateDAL,- sshHostDAL,- sshHostGroupDAL,keyStore,kmsService,certificateTemplateDAL,@@ -3846,46 +3748,6 @@ export const registerRoutes = async (appConnectionDAL});- const aiMcpServerToolDAL = aiMcpServerToolDALFactory(db);- const aiMcpServerUserCredentialDAL = aiMcpServerUserCredentialDALFactory(db);- const aiMcpActivityLogDAL = aiMcpActivityLogDALFactory(db);- const aiMcpEndpointDAL = aiMcpEndpointDALFactory(db);- const aiMcpEndpointServerDAL = aiMcpEndpointServerDALFactory(db);- const aiMcpEndpointServerToolDAL = aiMcpEndpointServerToolDALFactory(db);-- const aiMcpServerService = aiMcpServerServiceFactory({- aiMcpServerDAL,- aiMcpServerToolDAL,- aiMcpServerUserCredentialDAL,- kmsService,- keyStore,- permissionService,- gatewayV2DAL,- gatewayV2Service- });-- const aiMcpActivityLogService = aiMcpActivityLogServiceFactory({- aiMcpActivityLogDAL,- permissionService- });-- const aiMcpEndpointService = aiMcpEndpointServiceFactory({- aiMcpEndpointDAL,- aiMcpEndpointServerDAL,- aiMcpEndpointServerToolDAL,- aiMcpServerDAL,- aiMcpServerToolDAL,- aiMcpServerUserCredentialDAL,- aiMcpServerService,- kmsService,- keyStore,- authTokenService: tokenService,- aiMcpActivityLogService,- userDAL,- permissionService,- gatewayV2Service- });-const migrationService = externalMigrationServiceFactory({externalMigrationQueue,userDAL,@@ -4035,10 +3897,6 @@ export const registerRoutes = async (certificateV3: certificateV3Service,certificateRequest: certificateRequestService,certificateEstV3: certificateEstV3Service,- sshCertificateAuthority: sshCertificateAuthorityService,- sshCertificateTemplate: sshCertificateTemplateService,- sshHost: sshHostService,- sshHostGroup: sshHostGroupService,certificateAuthority: certificateAuthorityService,internalCertificateAuthority: internalCertificateAuthorityService,caSigningConfig: caSigningConfigService,@@ -4142,9 +4000,6 @@ export const registerRoutes = async (identityProject: identityProjectService,convertor: convertorService,pkiAlertV2: pkiAlertV2Service,- aiMcpServer: aiMcpServerService,- aiMcpEndpoint: aiMcpEndpointService,- aiMcpActivityLog: aiMcpActivityLogService,approvalPolicy: approvalPolicyService,appConnectionCredentialRotation: appConnectionCredentialRotationService,caAutoRenewalQueue@@ -4292,13 +4147,6 @@ export const registerRoutes = async (// register special routesawait server.register(registerCertificateEstRouter, { prefix: "/.well-known/est" });await server.register(registerPkiScepRouter, { prefix: "/scep" });- await server.register(registerMcpEndpointMetadataRouter, { prefix: "/mcp-endpoints" });- await server.register(registerMcpEndpointAuthServerMetadataRouter, {- prefix: "/.well-known/oauth-authorization-server"- });- await server.register(registerRfc9728ProtectedResourceMetadataRouter, {- prefix: "/.well-known/oauth-protected-resource"- });// register routes for v1await server.register(diff --git a/backend/src/server/routes/v1/deprecated-project-router.ts b/backend/src/server/routes/v1/deprecated-project-router.tsindex dc00d8fede..7832364c93 100644--- a/backend/src/server/routes/v1/deprecated-project-router.ts+++ b/backend/src/server/routes/v1/deprecated-project-router.ts@@ -4,7 +4,6 @@ import {IntegrationsSchema,ProjectRolesSchema,ProjectSlackConfigsSchema,- ProjectSshConfigsSchema,ProjectType,SortDirection} from "@app/db/schemas";@@ -391,107 +390,6 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProvider}});- server.route({- method: "GET",- url: "/:workspaceId/ssh-config",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- workspaceId: z.string().trim()- }),- response: {- 200: ProjectSshConfigsSchema.pick({- id: true,- createdAt: true,- updatedAt: true,- projectId: true,- defaultUserSshCaId: true,- defaultHostSshCaId: true- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshConfig = await server.services.project.getProjectSshConfig({- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- actorOrgId: req.permission.orgId,- projectId: req.params.workspaceId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshConfig.projectId,- event: {- type: EventType.GET_PROJECT_SSH_CONFIG,- metadata: {- id: sshConfig.id,- projectId: sshConfig.projectId- }- }- });-- return sshConfig;- }- });-- server.route({- method: "PATCH",- url: "/:workspaceId/ssh-config",- config: {- rateLimit: writeLimit- },- schema: {- params: z.object({- workspaceId: z.string().trim()- }),- body: z.object({- defaultUserSshCaId: z.string().optional(),- defaultHostSshCaId: z.string().optional()- }),- response: {- 200: ProjectSshConfigsSchema.pick({- id: true,- createdAt: true,- updatedAt: true,- projectId: true,- defaultUserSshCaId: true,- defaultHostSshCaId: true- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshConfig = await server.services.project.updateProjectSshConfig({- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- actorOrgId: req.permission.orgId,- projectId: req.params.workspaceId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshConfig.projectId,- event: {- type: EventType.UPDATE_PROJECT_SSH_CONFIG,- metadata: {- id: sshConfig.id,- projectId: sshConfig.projectId,- defaultUserSshCaId: sshConfig.defaultUserSshCaId,- defaultHostSshCaId: sshConfig.defaultHostSshCaId- }- }- });-- return sshConfig;- }- });-server.route({method: "GET",url: "/:workspaceId/workflow-integration-config/:integration",diff --git a/backend/src/server/routes/v1/organization-router.ts b/backend/src/server/routes/v1/organization-router.tsindex fe32eb66c2..e420a46ab1 100644--- a/backend/src/server/routes/v1/organization-router.ts+++ b/backend/src/server/routes/v1/organization-router.ts@@ -381,7 +381,6 @@ export const registerOrgRouter = async (server: FastifyZodProvider) => {secretsProductEnabled: z.boolean().optional(),pkiProductEnabled: z.boolean().optional(),kmsProductEnabled: z.boolean().optional(),- sshProductEnabled: z.boolean().optional(),scannerProductEnabled: z.boolean().optional(),shareSecretsProductEnabled: z.boolean().optional(),maxSharedSecretLifetime: zdiff --git a/backend/src/server/routes/v1/project-router.ts b/backend/src/server/routes/v1/project-router.tsindex a4a4db1bf9..1dda6a838e 100644--- a/backend/src/server/routes/v1/project-router.ts+++ b/backend/src/server/routes/v1/project-router.ts@@ -10,7 +10,6 @@ import {ProjectMembershipsSchema,ProjectRolesSchema,ProjectSlackConfigsSchema,- ProjectSshConfigsSchema,ProjectType,SecretFoldersSchema,SortDirection@@ -18,12 +17,6 @@ import {import { ProjectMicrosoftTeamsConfigsSchema } from "@app/db/schemas/project-microsoft-teams-configs";import { EventType } from "@app/ee/services/audit-log/audit-log-types";import { InfisicalProjectTemplate } from "@app/ee/services/project-template/project-template-types";-import { sanitizedSshCa } from "@app/ee/services/ssh/ssh-certificate-authority-schema";-import { sanitizedSshCertificate } from "@app/ee/services/ssh-certificate/ssh-certificate-schema";-import { sanitizedSshCertificateTemplate } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-schema";-import { loginMappingSchema, sanitizedSshHost } from "@app/ee/services/ssh-host/ssh-host-schema";-import { LoginMappingSource } from "@app/ee/services/ssh-host/ssh-host-types";-import { sanitizedSshHostGroup } from "@app/ee/services/ssh-host-group/ssh-host-group-schema";import { ApiDocsTags, PROJECTS } from "@app/lib/api-docs";import { CharacterType, characterValidator } from "@app/lib/validator/validate-string";import { re2Validator } from "@app/lib/zod";@@ -813,109 +806,6 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {}});- server.route({- method: "GET",- url: "/:projectId/ssh-config",- config: {- rateLimit: readLimit- },- schema: {- operationId: "getProjectSshConfig",- params: z.object({- projectId: z.string().trim()- }),- response: {- 200: ProjectSshConfigsSchema.pick({- id: true,- createdAt: true,- updatedAt: true,- projectId: true,- defaultUserSshCaId: true,- defaultHostSshCaId: true- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshConfig = await server.services.project.getProjectSshConfig({- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- actorOrgId: req.permission.orgId,- projectId: req.params.projectId- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshConfig.projectId,- event: {- type: EventType.GET_PROJECT_SSH_CONFIG,- metadata: {- id: sshConfig.id,- projectId: sshConfig.projectId- }- }- });-- return sshConfig;- }- });-- server.route({- method: "PATCH",- url: "/:projectId/ssh-config",- config: {- rateLimit: writeLimit- },- schema: {- operationId: "updateProjectSshConfig",- params: z.object({- projectId: z.string().trim()- }),- body: z.object({- defaultUserSshCaId: z.string().optional(),- defaultHostSshCaId: z.string().optional()- }),- response: {- 200: ProjectSshConfigsSchema.pick({- id: true,- createdAt: true,- updatedAt: true,- projectId: true,- defaultUserSshCaId: true,- defaultHostSshCaId: true- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const sshConfig = await server.services.project.updateProjectSshConfig({- actorId: req.permission.id,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- actorOrgId: req.permission.orgId,- projectId: req.params.projectId,- ...req.body- });-- await server.services.auditLog.createAuditLog({- ...req.auditLogInfo,- projectId: sshConfig.projectId,- event: {- type: EventType.UPDATE_PROJECT_SSH_CONFIG,- metadata: {- id: sshConfig.id,- projectId: sshConfig.projectId,- defaultUserSshCaId: sshConfig.defaultUserSshCaId,- defaultHostSshCaId: sshConfig.defaultHostSshCaId- }- }- });-- return sshConfig;- }- });-server.route({method: "GET",url: "/:projectId/workflow-integration-config/:integration",@@ -1798,187 +1688,4 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {return { certificateTemplates };}});-- server.route({- method: "GET",- url: "/:projectId/ssh-certificates",- config: {- rateLimit: readLimit- },- schema: {- operationId: "listProjectSshCertificates",- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_CAS.projectId)- }),- querystring: z.object({- offset: z.coerce.number().default(0).describe(PROJECTS.LIST_SSH_CERTIFICATES.offset),- limit: z.coerce.number().default(25).describe(PROJECTS.LIST_SSH_CERTIFICATES.limit)- }),- response: {- 200: z.object({- certificates: z.array(sanitizedSshCertificate),- totalCount: z.number()- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { certificates, totalCount } = await server.services.project.listProjectSshCertificates({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId,- offset: req.query.offset,- limit: req.query.limit- });-- return { certificates, totalCount };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-certificate-templates",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- operationId: "listProjectSshCertificateTemplates",- tags: [ApiDocsTags.SshCertificateTemplates],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_CERTIFICATE_TEMPLATES.projectId)- }),- response: {- 200: z.object({- certificateTemplates: z.array(sanitizedSshCertificateTemplate)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { certificateTemplates } = await server.services.project.listProjectSshCertificateTemplates({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { certificateTemplates };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-cas",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- operationId: "listProjectSshCertificateAuthorities",- tags: [ApiDocsTags.SshCertificateAuthorities],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_CAS.projectId)- }),- response: {- 200: z.object({- cas: z.array(sanitizedSshCa)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const cas = await server.services.project.listProjectSshCas({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { cas };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-hosts",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- operationId: "listProjectSshHosts",- tags: [ApiDocsTags.SshHosts],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_HOSTS.projectId)- }),- response: {- 200: z.object({- hosts: z.array(- sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- )- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const hosts = await server.services.project.listProjectSshHosts({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { hosts };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-host-groups",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- operationId: "listProjectSshHostGroups",- tags: [ApiDocsTags.SshHostGroups],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_HOST_GROUPS.projectId)- }),- response: {- 200: z.object({- groups: z.array(- sanitizedSshHostGroup.extend({- loginMappings: loginMappingSchema.array(),- hostCount: z.number()- })- )- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const groups = await server.services.project.listProjectSshHostGroups({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { groups };- }- });};diff --git a/backend/src/server/routes/v2/deprecated-project-router.ts b/backend/src/server/routes/v2/deprecated-project-router.tsindex e2fe563240..71121d0784 100644--- a/backend/src/server/routes/v2/deprecated-project-router.ts+++ b/backend/src/server/routes/v2/deprecated-project-router.ts@@ -9,12 +9,6 @@ import {} from "@app/db/schemas";import { EventType } from "@app/ee/services/audit-log/audit-log-types";import { InfisicalProjectTemplate } from "@app/ee/services/project-template/project-template-types";-import { sanitizedSshCa } from "@app/ee/services/ssh/ssh-certificate-authority-schema";-import { sanitizedSshCertificate } from "@app/ee/services/ssh-certificate/ssh-certificate-schema";-import { sanitizedSshCertificateTemplate } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-schema";-import { loginMappingSchema, sanitizedSshHost } from "@app/ee/services/ssh-host/ssh-host-schema";-import { LoginMappingSource } from "@app/ee/services/ssh-host/ssh-host-types";-import { sanitizedSshHostGroup } from "@app/ee/services/ssh-host-group/ssh-host-group-schema";import { ApiDocsTags, PROJECTS } from "@app/lib/api-docs";import { projectCreationLimit, readLimit, writeLimit } from "@app/server/config/rateLimiter";import { slugSchema } from "@app/server/lib/schemas";@@ -548,182 +542,4 @@ export const registerDeprecatedProjectRouter = async (server: FastifyZodProviderreturn { certificateTemplates };}});-- server.route({- method: "GET",- url: "/:projectId/ssh-certificates",- config: {- rateLimit: readLimit- },- schema: {- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_CAS.projectId)- }),- querystring: z.object({- offset: z.coerce.number().default(0).describe(PROJECTS.LIST_SSH_CERTIFICATES.offset),- limit: z.coerce.number().default(25).describe(PROJECTS.LIST_SSH_CERTIFICATES.limit)- }),- response: {- 200: z.object({- certificates: z.array(sanitizedSshCertificate),- totalCount: z.number()- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { certificates, totalCount } = await server.services.project.listProjectSshCertificates({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId,- offset: req.query.offset,- limit: req.query.limit- });-- return { certificates, totalCount };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-certificate-templates",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateTemplates],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_CERTIFICATE_TEMPLATES.projectId)- }),- response: {- 200: z.object({- certificateTemplates: z.array(sanitizedSshCertificateTemplate)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const { certificateTemplates } = await server.services.project.listProjectSshCertificateTemplates({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { certificateTemplates };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-cas",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshCertificateAuthorities],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_CAS.projectId)- }),- response: {- 200: z.object({- cas: z.array(sanitizedSshCa)- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const cas = await server.services.project.listProjectSshCas({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { cas };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-hosts",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHosts],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_HOSTS.projectId)- }),- response: {- 200: z.object({- hosts: z.array(- sanitizedSshHost.extend({- loginMappings: loginMappingSchema- .extend({- source: z.nativeEnum(LoginMappingSource)- })- .array()- })- )- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const hosts = await server.services.project.listProjectSshHosts({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { hosts };- }- });-- server.route({- method: "GET",- url: "/:projectId/ssh-host-groups",- config: {- rateLimit: readLimit- },- schema: {- hide: false,- tags: [ApiDocsTags.SshHostGroups],- params: z.object({- projectId: z.string().trim().describe(PROJECTS.LIST_SSH_HOST_GROUPS.projectId)- }),- response: {- 200: z.object({- groups: z.array(- sanitizedSshHostGroup.extend({- loginMappings: loginMappingSchema.array(),- hostCount: z.number()- })- )- })- }- },- onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),- handler: async (req) => {- const groups = await server.services.project.listProjectSshHostGroups({- actorId: req.permission.id,- actorOrgId: req.permission.orgId,- actorAuthMethod: req.permission.authMethod,- actor: req.permission.type,- projectId: req.params.projectId- });-- return { groups };- }- });};diff --git a/backend/src/services/app-connection/app-connection-fns.ts b/backend/src/services/app-connection/app-connection-fns.tsindex 64d70dd751..b815b83412 100644--- a/backend/src/services/app-connection/app-connection-fns.ts+++ b/backend/src/services/app-connection/app-connection-fns.ts@@ -439,8 +439,6 @@ export const listAppConnectionOptions = (projectType?: ProjectType) => {return PKI_APP_CONNECTIONS.includes(option.app);case ProjectType.KMS:return false;- case ProjectType.SSH:- return false;case ProjectType.PAM:return false;default:diff --git a/backend/src/services/auth/auth-type.ts b/backend/src/services/auth/auth-type.tsindex 7f9ccc5f8a..4a986a89d7 100644--- a/backend/src/services/auth/auth-type.ts+++ b/backend/src/services/auth/auth-type.ts@@ -42,7 +42,6 @@ export enum AuthMode {API_KEY = "apiKey",IDENTITY_ACCESS_TOKEN = "identityAccessToken",SCIM_TOKEN = "scimToken",- MCP_JWT = "mcpJwt",// Delegated OAuth 2.0 access tokens issued via the authorization code flow. These are NOT// first-party dashboard sessions: a route must explicitly opt into AuthMode.OAUTH to accept them.OAUTH = "oauth",@@ -102,9 +101,6 @@ export type AuthModeJwtTokenPayload = {subOrganizationId?: string;isMfaVerified?: boolean;mfaMethod?: MfaMethod;- mcp?: {- endpointId: string;- };// Present only on delegated OAuth 2.0 access tokens. Its presence marks the token as// AuthMode.OAUTH so the default JWT middleware will not accept it as a first-party session.oauthClientId?: string;diff --git a/backend/src/services/license-client/dual-read/feature-mapping/pki-security.ts b/backend/src/services/license-client/dual-read/feature-mapping/pki-security.tsindex d525b9b3f7..0ccdb07244 100644--- a/backend/src/services/license-client/dual-read/feature-mapping/pki-security.ts+++ b/backend/src/services/license-client/dual-read/feature-mapping/pki-security.ts@@ -31,11 +31,6 @@ export const pkiSecurityMappings: TFeatureMapping[] = [v1Field: "pkiCodeSigning",extractV1: (p) => p.pkiCodeSigning},- {- v2Key: "ssh_host_groups",- v1Field: "sshHostGroups",- extractV1: (p) => p.sshHostGroups- },{v2Key: "hsm",v1Field: "hsm",diff --git a/backend/src/services/org/org-schema.ts b/backend/src/services/org/org-schema.tsindex 86ef6232d4..545d364d26 100644--- a/backend/src/services/org/org-schema.ts+++ b/backend/src/services/org/org-schema.ts@@ -25,7 +25,6 @@ export const sanitizedOrganizationSchema = OrganizationsSchema.pick({secretsProductEnabled: true,pkiProductEnabled: true,kmsProductEnabled: true,- sshProductEnabled: true,scannerProductEnabled: true,shareSecretsProductEnabled: true,maxSharedSecretLifetime: true,diff --git a/backend/src/services/org/org-service.ts b/backend/src/services/org/org-service.tsindex 61df87286c..6dc11758a3 100644--- a/backend/src/services/org/org-service.ts+++ b/backend/src/services/org/org-service.ts@@ -444,7 +444,6 @@ export const orgServiceFactory = ({secretsProductEnabled,pkiProductEnabled,kmsProductEnabled,- sshProductEnabled,scannerProductEnabled,shareSecretsProductEnabled,maxSharedSecretLifetime,@@ -650,7 +649,6 @@ export const orgServiceFactory = ({secretsProductEnabled,pkiProductEnabled,kmsProductEnabled,- sshProductEnabled,scannerProductEnabled,shareSecretsProductEnabled,maxSharedSecretLifetime,diff --git a/backend/src/services/org/org-types.ts b/backend/src/services/org/org-types.tsindex c98ae63d5e..3ffc3b0d3a 100644--- a/backend/src/services/org/org-types.ts+++ b/backend/src/services/org/org-types.ts@@ -96,7 +96,6 @@ export type TUpdateOrgDTO = {secretsProductEnabled: boolean;pkiProductEnabled: boolean;kmsProductEnabled: boolean;- sshProductEnabled: boolean;scannerProductEnabled: boolean;shareSecretsProductEnabled: boolean;maxSharedSecretLifetime: number;diff --git a/backend/src/services/project-role/project-role-fns.ts b/backend/src/services/project-role/project-role-fns.tsindex f8157acbe1..1d9e1aa169 100644--- a/backend/src/services/project-role/project-role-fns.ts+++ b/backend/src/services/project-role/project-role-fns.ts@@ -6,8 +6,7 @@ import {projectAdminPermissions,projectMemberPermissions,projectNoAccessPermissions,- projectViewerPermission,- sshHostBootstrapPermissions+ projectViewerPermission} from "@app/ee/services/permission/default-roles";import { TGetPredefinedRolesDTO } from "@app/services/project-role/project-role-types";@@ -33,17 +32,6 @@ export const getPredefinedRoles = ({ projectId, projectType, roleFilter }: TGetPcreatedAt: new Date(),updatedAt: new Date()},- {- id: uuidv4(),- projectId,- name: "SSH Host Bootstrapper",- slug: ProjectMembershipRole.SshHostBootstrapper,- permissions: sshHostBootstrapPermissions,- description: "Create and issue SSH Hosts in a project",- createdAt: new Date(),- updatedAt: new Date(),- type: ProjectType.SSH- },{id: uuidv4(),projectId,diff --git a/backend/src/services/project/project-fns.ts b/backend/src/services/project/project-fns.tsindex fca0074d73..9f09695626 100644--- a/backend/src/services/project/project-fns.ts+++ b/backend/src/services/project/project-fns.ts@@ -1,13 +1,10 @@import { ProjectVersion, TProjects } from "@app/db/schemas";-import { createSshCaHelper } from "@app/ee/services/ssh/ssh-certificate-authority-fns";-import { SshCaKeySource } from "@app/ee/services/ssh/ssh-certificate-authority-types";-import { SshCertKeyAlgorithm } from "@app/ee/services/ssh-certificate/ssh-certificate-types";import { crypto } from "@app/lib/crypto/cryptography";import { NotFoundError } from "@app/lib/errors";import { TKmsServiceFactory } from "@app/services/kms/kms-service";import { TProjectDALFactory } from "@app/services/project/project-dal";-import { AddUserToWsDTO, TBootstrapSshProjectDTO } from "./project-types";+import { AddUserToWsDTO } from "./project-types";export const assignWorkspaceKeysToMembers = ({ members, decryptKey, userPrivateKey }: AddUserToWsDTO) => {if (!decryptKey.sender.publicKey) {@@ -105,49 +102,3 @@ export const getProjectKmsCertificateKeyId = async ({return keyId;};--/**- * Bootstraps an SSH project.- * - Creates a user and host SSH CA- * - Creates a project SSH config with the user and host SSH CA as defaults- */-export const bootstrapSshProject = async ({- projectId,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService,- projectSshConfigDAL,- tx-}: TBootstrapSshProjectDTO) => {- const userSshCa = await createSshCaHelper({- projectId,- friendlyName: "User CA",- keyAlgorithm: SshCertKeyAlgorithm.ED25519,- keySource: SshCaKeySource.INTERNAL,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService,- tx- });-- const hostSshCa = await createSshCaHelper({- projectId,- friendlyName: "Host CA",- keyAlgorithm: SshCertKeyAlgorithm.ED25519,- keySource: SshCaKeySource.INTERNAL,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService,- tx- });-- const sshConfig = await projectSshConfigDAL.create(- {- projectId,- defaultHostSshCaId: hostSshCa.id,- defaultUserSshCaId: userSshCa.id- },- tx- );- return sshConfig;-};diff --git a/backend/src/services/project/project-service.ts b/backend/src/services/project/project-service.tsindex 78850c3c9b..047cce245e 100644--- a/backend/src/services/project/project-service.ts+++ b/backend/src/services/project/project-service.ts@@ -32,7 +32,6 @@ import {ProjectPermissionPkiTemplateActions,ProjectPermissionSecretActions,ProjectPermissionSet,- ProjectPermissionSshHostActions,ProjectPermissionSub} from "@app/ee/services/permission/project-permission";import {@@ -43,12 +42,6 @@ import {InfisicalProjectTemplate,TProjectTemplateServiceFactory} from "@app/ee/services/project-template/project-template-types";-import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";-import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";-import { TSshCertificateDALFactory } from "@app/ee/services/ssh-certificate/ssh-certificate-dal";-import { TSshCertificateTemplateDALFactory } from "@app/ee/services/ssh-certificate-template/ssh-certificate-template-dal";-import { TSshHostDALFactory } from "@app/ee/services/ssh-host/ssh-host-dal";-import { TSshHostGroupDALFactory } from "@app/ee/services/ssh-host-group/ssh-host-group-dal";import { KeyStorePrefixes, KeyStoreTtls, PgSqlLock, TKeyStoreFactory } from "@app/keystore/keystore";import { withCache } from "@app/lib/cache/with-cache";import { getProcessedPermissionRules } from "@app/lib/casl/permission-filter-utils";@@ -98,9 +91,7 @@ import { TUserDALFactory } from "../user/user-dal";import { WorkflowIntegration, WorkflowIntegrationStatus } from "../workflow-integration/workflow-integration-types";import { TProjectAccessRequestDALFactory } from "./project-access-request-dal";import { TProjectDALFactory } from "./project-dal";-import { bootstrapSshProject } from "./project-fns";import { TProjectQueueFactory } from "./project-queue";-import { TProjectSshConfigDALFactory } from "./project-ssh-config-dal";import {ProjectFilterType,TCreateProjectDTO,@@ -111,7 +102,6 @@ import {TGetDashboardStatsDTO,TGetProjectDTO,TGetProjectKmsKey,- TGetProjectSshConfig,TGetProjectWorkflowIntegrationConfig,TListProjectAlertsDTO,TListProjectCasDTO,@@ -119,10 +109,6 @@ import {TListProjectCertsDTO,TListProjectPkiSubscribersDTO,TListProjectsDTO,- TListProjectSshCasDTO,- TListProjectSshCertificatesDTO,- TListProjectSshCertificateTemplatesDTO,- TListProjectSshHostsDTO,TLoadProjectKmsBackupDTO,TProjectAccessRequestDTO,TSearchProjectsDTO,@@ -132,7 +118,6 @@ import {TUpdateProjectDTO,TUpdateProjectKmsDTO,TUpdateProjectNameDTO,- TUpdateProjectSshConfig,TUpdateProjectVersionLimitDTO,TUpdateProjectWorkflowIntegration,TUpgradeProjectDTO@@ -146,7 +131,6 @@ export const DEFAULT_PROJECT_ENVS = [type TProjectServiceFactoryDep = {projectDAL: TProjectDALFactory;- projectSshConfigDAL: Pick<TProjectSshConfigDALFactory, "transaction" | "create" | "findOne" | "updateById">;projectQueue: TProjectQueueFactory;userDAL: TUserDALFactory;folderDAL: Pick<TSecretFolderDALFactory, "insertMany" | "findByProjectId">;@@ -187,12 +171,6 @@ type TProjectServiceFactoryDep = {certificateTemplateDAL: Pick<TCertificateTemplateDALFactory, "getCertTemplatesByProjectId">;pkiAlertDAL: Pick<TPkiAlertDALFactory, "find">;pkiCollectionDAL: Pick<TPkiCollectionDALFactory, "find">;- sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "find" | "findOne" | "create" | "transaction">;- sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create">;- sshCertificateDAL: Pick<TSshCertificateDALFactory, "find" | "countSshCertificatesInProject">;- sshCertificateTemplateDAL: Pick<TSshCertificateTemplateDALFactory, "find">;- sshHostDAL: Pick<TSshHostDALFactory, "find" | "findSshHostsWithLoginMappings">;- sshHostGroupDAL: Pick<TSshHostGroupDALFactory, "find" | "findSshHostGroupsWithLoginMappings">;permissionService: TPermissionServiceFactory;licenseService: Pick<TLicenseServiceFactory, "getPlan" | "invalidateGetPlan">;smtpService: Pick<TSmtpService, "sendMail">;@@ -233,7 +211,6 @@ const PROJECT_ACCESS_REQUEST_PRODUCT_LABELS: Partial<Record<ProjectType, string>export const projectServiceFactory = ({projectDAL,- projectSshConfigDAL,projectQueue,permissionService,orgDAL,@@ -248,12 +225,6 @@ export const projectServiceFactory = ({pkiCollectionDAL,pkiAlertDAL,pkiSubscriberDAL,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- sshCertificateDAL,- sshCertificateTemplateDAL,- sshHostDAL,- sshHostGroupDAL,keyStore,kmsService,projectSlackConfigDAL,@@ -308,10 +279,6 @@ export const projectServiceFactory = ({throw new ForbiddenRequestError({ message: "You don't have permission to create a project" });}- if (type === ProjectType.AI) {- throw new BadRequestError({ message: "Agent Sentinel projects are not supported" });- }-const results = await (trx || projectDAL).transaction(async (tx) => {await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.CreateProject(organization.id)]);@@ -387,17 +354,6 @@ export const projectServiceFactory = ({throw err;}- if (type === ProjectType.SSH) {- await bootstrapSshProject({- projectId: project.id,- sshCertificateAuthorityDAL,- sshCertificateAuthoritySecretDAL,- kmsService,- projectSshConfigDAL,- tx- });- }-// set default environments and root folder for provided environmentslet envs: TProjectEnvironments[] = [];let creatorAddedViaTemplate = false;@@ -1707,184 +1663,6 @@ export const projectServiceFactory = ({};};- /**- * Return list of SSH CAs for project- */- const listProjectSshCas = async ({- actorId,- actorOrgId,- actorAuthMethod,- actor,- projectId- }: TListProjectSshCasDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Read,- ProjectPermissionSub.SshCertificateAuthorities- );-- const cas = await sshCertificateAuthorityDAL.find(- {- projectId- },- { sort: [["updatedAt", "desc"]] }- );-- return cas;- };-- /**- * Return list of SSH hosts for project- */- const listProjectSshHosts = async ({- actorId,- actorOrgId,- actorAuthMethod,- actor,- projectId- }: TListProjectSshHostsDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- const allowedHosts = [];-- // (dangtony98): room to optimize- const hosts = await sshHostDAL.findSshHostsWithLoginMappings(projectId);-- for (const host of hosts) {- const canRead = permission.can(- ProjectPermissionSshHostActions.Read,- subject(ProjectPermissionSub.SshHosts, {- hostname: host.hostname- })- );-- if (canRead) {- allowedHosts.push(host);- }- }-- return allowedHosts;- };-- /**- * Return list of SSH host groups for project- */- const listProjectSshHostGroups = async ({- actorId,- actorOrgId,- actorAuthMethod,- actor,- projectId- }: TListProjectSshHostsDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SshHostGroups);-- const sshHostGroups = await sshHostGroupDAL.findSshHostGroupsWithLoginMappings(projectId);-- return sshHostGroups;- };-- /**- * Return list of SSH certificates for project- */- const listProjectSshCertificates = async ({- limit = 25,- offset = 0,- actorId,- actorOrgId,- actorAuthMethod,- actor,- projectId- }: TListProjectSshCertificatesDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SshCertificates);-- const cas = await sshCertificateAuthorityDAL.find({- projectId- });-- const certificates = await sshCertificateDAL.find(- {- $in: {- sshCaId: cas.map((ca) => ca.id)- }- },- { offset, limit, sort: [["updatedAt", "desc"]] }- );-- const count = await sshCertificateDAL.countSshCertificatesInProject(projectId);-- return { certificates, totalCount: count };- };-- /**- * Return list of SSH certificate templates for project- */- const listProjectSshCertificateTemplates = async ({- actorId,- actorOrgId,- actorAuthMethod,- actor,- projectId- }: TListProjectSshCertificateTemplatesDTO) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(- ProjectPermissionActions.Read,- ProjectPermissionSub.SshCertificateTemplates- );-- const cas = await sshCertificateAuthorityDAL.find({- projectId- });-- const certificateTemplates = await sshCertificateTemplateDAL.find({- $in: {- sshCaId: cas.map((ca) => ca.id)- }- });-- return { certificateTemplates };- };-const updateProjectKmsKey = async ({projectId,kms,@@ -1989,115 +1767,6 @@ export const projectServiceFactory = ({return { secretManagerKmsKey: kmsKey };};- const getProjectSshConfig = async ({- actorId,- actor,- actorOrgId,- actorAuthMethod,- projectId- }: TGetProjectSshConfig) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.Settings);-- const projectSshConfig = await projectSshConfigDAL.findOne({- projectId- });-- if (!projectSshConfig) {- throw new NotFoundError({- message: `Project SSH config with ID '${projectId}' not found`- });- }-- return projectSshConfig;- };-- const updateProjectSshConfig = async ({- actorId,- actor,- actorOrgId,- actorAuthMethod,- projectId,- defaultUserSshCaId,- defaultHostSshCaId- }: TUpdateProjectSshConfig) => {- const { permission } = await permissionService.getProjectPermission({- actor,- actorId,- projectId,- actorAuthMethod,- actorOrgId,- actionProjectType: ActionProjectType.SSH- });-- ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);-- let projectSshConfig = await projectSshConfigDAL.findOne({- projectId- });-- if (!projectSshConfig) {- throw new NotFoundError({- message: `Project SSH config with ID '${projectId}' not found`- });- }-- projectSshConfig = await projectSshConfigDAL.transaction(async (tx) => {- if (defaultUserSshCaId) {- const userSshCa = await sshCertificateAuthorityDAL.findOne(- {- id: defaultUserSshCaId,- projectId- },- tx- );-- if (!userSshCa) {- throw new NotFoundError({- message: "User SSH CA must exist and belong to this project"- });- }- }-- if (defaultHostSshCaId) {- const hostSshCa = await sshCertificateAuthorityDAL.findOne(- {- id: defaultHostSshCaId,- projectId- },- tx- );-- if (!hostSshCa) {- throw new NotFoundError({- message: "Host SSH CA must exist and belong to this project"- });- }- }-- const updatedProjectSshConfig = await projectSshConfigDAL.updateById(- projectSshConfig.id,- {- defaultUserSshCaId,- defaultHostSshCaId- },- tx- );-- return updatedProjectSshConfig;- });-- return projectSshConfig;- };-const getProjectWorkflowIntegrationConfig = async ({actorId,actor,@@ -2673,12 +2342,7 @@ export const projectServiceFactory = ({listProjectAlerts,listProjectPkiCollections,listProjectCertificateTemplates,- listProjectSshCas,- listProjectSshHosts,- listProjectSshHostGroups,listProjectPkiSubscribers,- listProjectSshCertificates,- listProjectSshCertificateTemplates,updateVersionLimit,updateAuditLogsRetention,updateProjectKmsKey,@@ -2688,8 +2352,6 @@ export const projectServiceFactory = ({getProjectWorkflowIntegrationConfig,updateProjectWorkflowIntegration,deleteProjectWorkflowIntegration,- getProjectSshConfig,- updateProjectSshConfig,requestProjectAccess,getMyPendingProjectAccessRequests,searchProjects,diff --git a/backend/src/services/project/project-ssh-config-dal.ts b/backend/src/services/project/project-ssh-config-dal.tsdeleted file mode 100644index 5085bd4385..0000000000--- a/backend/src/services/project/project-ssh-config-dal.ts+++ /dev/null@@ -1,11 +0,0 @@-import { TDbClient } from "@app/db";-import { TableName } from "@app/db/schemas";-import { ormify } from "@app/lib/knex";--export type TProjectSshConfigDALFactory = ReturnType<typeof projectSshConfigDALFactory>;--export const projectSshConfigDALFactory = (db: TDbClient) => {- const projectSshConfigOrm = ormify(db, TableName.ProjectSshConfig);-- return projectSshConfigOrm;-};diff --git a/backend/src/services/project/project-types.ts b/backend/src/services/project/project-types.tsindex 14662bf188..26fafb2188 100644--- a/backend/src/services/project/project-types.ts+++ b/backend/src/services/project/project-types.ts@@ -1,11 +1,7 @@import { Knex } from "knex";import { ProjectType, SortDirection, TProjectKeys } from "@app/db/schemas";-import { TSshCertificateAuthorityDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-dal";-import { TSshCertificateAuthoritySecretDALFactory } from "@app/ee/services/ssh/ssh-certificate-authority-secret-dal";import { OrgServiceActor, TProjectPermission } from "@app/lib/types";-import { TKmsServiceFactory } from "@app/services/kms/kms-service";-import { TProjectSshConfigDALFactory } from "@app/services/project/project-ssh-config-dal";import { ActorAuthMethod, ActorType } from "../auth/auth-type";import { WorkflowIntegration } from "../workflow-integration/workflow-integration-types";@@ -193,21 +189,7 @@ export type TGetProjectKmsKey = TProjectPermission;export type TListProjectCertificateTemplatesDTO = TProjectPermission;-export type TListProjectSshCasDTO = TProjectPermission;-export type TListProjectSshHostsDTO = TProjectPermission;-export type TListProjectSshCertificateTemplatesDTO = TProjectPermission;export type TListProjectPkiSubscribersDTO = TProjectPermission;-export type TListProjectSshCertificatesDTO = {- offset: number;- limit: number;-} & TProjectPermission;--export type TUpdateProjectSshConfig = {- defaultUserSshCaId?: string;- defaultHostSshCaId?: string;-} & TProjectPermission;--export type TGetProjectSshConfig = TProjectPermission;export type TGetProjectWorkflowIntegrationConfig = TProjectPermission & {integration: WorkflowIntegration;@@ -240,15 +222,6 @@ export type TDeleteProjectWorkflowIntegration = {integration: WorkflowIntegration;} & TProjectPermission;-export type TBootstrapSshProjectDTO = {- projectId: string;- sshCertificateAuthorityDAL: Pick<TSshCertificateAuthorityDALFactory, "transaction" | "create">;- sshCertificateAuthoritySecretDAL: Pick<TSshCertificateAuthoritySecretDALFactory, "create">;- projectSshConfigDAL: Pick<TProjectSshConfigDALFactory, "create">;- kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;- tx?: Knex;-};-export enum SearchProjectSortBy {NAME = "name"}diff --git a/backend/src/services/role/project/project-role-factory.ts b/backend/src/services/role/project/project-role-factory.tsindex ce74c47fdb..6cd0908755 100644--- a/backend/src/services/role/project/project-role-factory.ts+++ b/backend/src/services/role/project/project-role-factory.ts@@ -7,8 +7,7 @@ import {projectAdminPermissions,projectMemberPermissions,projectNoAccessPermissions,- projectViewerPermission,- sshHostBootstrapPermissions+ projectViewerPermission} from "@app/ee/services/permission/default-roles";import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";import {@@ -148,17 +147,6 @@ export const newProjectRoleFactory = ({updatedAt: new Date(),projectId},- {- id: uuidv4(),- name: "SSH Host Bootstrapper",- slug: ProjectMembershipRole.SshHostBootstrapper,- permissions: sshHostBootstrapPermissions,- description: "Create and issue SSH Hosts in a project",- createdAt: new Date(),- updatedAt: new Date(),- projectId,- type: ProjectType.SSH- },{id: uuidv4(),name: "Cryptographic Operator",diff --git a/backend/src/services/telemetry/telemetry-dal.ts b/backend/src/services/telemetry/telemetry-dal.tsindex 4a084cb62f..df98dc424e 100644--- a/backend/src/services/telemetry/telemetry-dal.ts+++ b/backend/src/services/telemetry/telemetry-dal.ts@@ -57,9 +57,6 @@ export const telemetryDALFactory = (db: TDbClient) => {customProjectRoles,customOrgRoles,kmipClients,- sshHosts,- sshCertificateAuthorities,- sshCertificates,pamResources,pamAccounts,accessApprovalPolicies,@@ -108,9 +105,6 @@ export const telemetryDALFactory = (db: TDbClient) => {return parseInt(result || "0", 10);})(),countTable(db, TableName.KmipClient),- countTable(db, TableName.SshHost),- countTable(db, TableName.SshCertificateAuthority),- countTable(db, TableName.SshCertificate),countTable(db, TableName.PamResource),countTable(db, TableName.PamAccount),countTable(db, TableName.AccessApprovalPolicy),@@ -253,9 +247,6 @@ export const telemetryDALFactory = (db: TDbClient) => {customProjectRoles,customOrgRoles,kmipClients,- sshHosts,- sshCertificateAuthorities,- sshCertificates,pamResources,pamAccounts,accessApprovalPolicies,diff --git a/backend/src/services/telemetry/telemetry-types.ts b/backend/src/services/telemetry/telemetry-types.tsindex f29df29639..8dbe911ace 100644--- a/backend/src/services/telemetry/telemetry-types.ts+++ b/backend/src/services/telemetry/telemetry-types.ts@@ -61,10 +61,6 @@ export enum PostHogEventTypes {TelemetryInstanceStats = "Self Hosted Instance Stats",SecretRequestCreated = "Secret Request Created",SecretRequestDeleted = "Secret Request Deleted",- SignSshKey = "Sign SSH Key",- IssueSshCreds = "Issue SSH Credentials",- IssueSshHostUserCert = "Issue SSH Host User Certificate",- IssueSshHostHostCert = "Issue SSH Host Host Certificate",SignCert = "Sign PKI Certificate",IssueCert = "Issue PKI Certificate",InvalidateCache = "Invalidate Cache",@@ -573,9 +569,6 @@ export type TTelemetryInstanceStatsEvent = {customProjectRoles: number;customOrgRoles: number;kmipClients: number;- sshHosts: number;- sshCertificateAuthorities: number;- sshCertificates: number;pamResources: number;pamAccounts: number;accessApprovalPolicies: number;@@ -607,44 +600,6 @@ export type TSecretRequestDeletedEvent = {};};-export type TSignSshKeyEvent = {- event: PostHogEventTypes.SignSshKey;- properties: {- certificateTemplateId: string;- principals: string[];- userAgent?: string;- };-};--export type TIssueSshCredsEvent = {- event: PostHogEventTypes.IssueSshCreds;- properties: {- certificateTemplateId: string;- principals: string[];- userAgent?: string;- };-};--export type TIssueSshHostUserCertEvent = {- event: PostHogEventTypes.IssueSshHostUserCert;- properties: {- sshHostId: string;- hostname: string;- principals: string[];- userAgent?: string;- };-};--export type TIssueSshHostHostCertEvent = {- event: PostHogEventTypes.IssueSshHostHostCert;- properties: {- sshHostId: string;- hostname: string;- principals: string[];- userAgent?: string;- };-};-export type TSignCertificateEvent = {event: PostHogEventTypes.SignCert;properties: {@@ -2084,10 +2039,6 @@ export type TPostHogEvent = {| TTelemetryInstanceStatsEvent| TSecretRequestCreatedEvent| TSecretRequestDeletedEvent- | TSignSshKeyEvent- | TIssueSshCredsEvent- | TIssueSshHostUserCertEvent- | TIssueSshHostHostCertEvent| TSignCertificateEvent| TIssueCertificateEvent| TInvalidateCacheEventdiff --git a/docs/api-reference/endpoints/ssh/ca/create.mdx b/docs/api-reference/endpoints/ssh/ca/create.mdxdeleted file mode 100644index b053d0133c..0000000000--- a/docs/api-reference/endpoints/ssh/ca/create.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Create"-openapi: "POST /api/v1/ssh/ca"----diff --git a/docs/api-reference/endpoints/ssh/ca/delete.mdx b/docs/api-reference/endpoints/ssh/ca/delete.mdxdeleted file mode 100644index 989fd1c4b4..0000000000--- a/docs/api-reference/endpoints/ssh/ca/delete.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Delete"-openapi: "DELETE /api/v1/ssh/ca/{sshCaId}"----diff --git a/docs/api-reference/endpoints/ssh/ca/list-certificate-templates.mdx b/docs/api-reference/endpoints/ssh/ca/list-certificate-templates.mdxdeleted file mode 100644index 632a9f8c06..0000000000--- a/docs/api-reference/endpoints/ssh/ca/list-certificate-templates.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List templates"-openapi: "GET /api/v1/ssh/ca/{sshCaId}/certificate-templates"----diff --git a/docs/api-reference/endpoints/ssh/ca/list.mdx b/docs/api-reference/endpoints/ssh/ca/list.mdxdeleted file mode 100644index c31dd40995..0000000000--- a/docs/api-reference/endpoints/ssh/ca/list.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List"-openapi: "GET /api/v2/workspace/{projectId}/ssh-cas"----diff --git a/docs/api-reference/endpoints/ssh/ca/public-key.mdx b/docs/api-reference/endpoints/ssh/ca/public-key.mdxdeleted file mode 100644index 1f9b570d18..0000000000--- a/docs/api-reference/endpoints/ssh/ca/public-key.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Retrieve public key"-openapi: "GET /api/v1/ssh/ca/{sshCaId}/public-key"----diff --git a/docs/api-reference/endpoints/ssh/ca/read.mdx b/docs/api-reference/endpoints/ssh/ca/read.mdxdeleted file mode 100644index 9f5eda90a7..0000000000--- a/docs/api-reference/endpoints/ssh/ca/read.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Retrieve"-openapi: "GET /api/v1/ssh/ca/{sshCaId}"----diff --git a/docs/api-reference/endpoints/ssh/ca/update.mdx b/docs/api-reference/endpoints/ssh/ca/update.mdxdeleted file mode 100644index 8ec2dc7adb..0000000000--- a/docs/api-reference/endpoints/ssh/ca/update.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Update"-openapi: "PATCH /api/v1/ssh/ca/{sshCaId}"----diff --git a/docs/api-reference/endpoints/ssh/certificate-templates/create.mdx b/docs/api-reference/endpoints/ssh/certificate-templates/create.mdxdeleted file mode 100644index 6e3beef1af..0000000000--- a/docs/api-reference/endpoints/ssh/certificate-templates/create.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Create"-openapi: "POST /api/v1/ssh/certificate-templates"----diff --git a/docs/api-reference/endpoints/ssh/certificate-templates/delete.mdx b/docs/api-reference/endpoints/ssh/certificate-templates/delete.mdxdeleted file mode 100644index 1fa7762763..0000000000--- a/docs/api-reference/endpoints/ssh/certificate-templates/delete.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Delete"-openapi: "DELETE /api/v1/ssh/certificate-templates/{certificateTemplateId}"----diff --git a/docs/api-reference/endpoints/ssh/certificate-templates/list.mdx b/docs/api-reference/endpoints/ssh/certificate-templates/list.mdxdeleted file mode 100644index 4331db1de2..0000000000--- a/docs/api-reference/endpoints/ssh/certificate-templates/list.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List"-openapi: "GET /api/v2/workspace/{projectId}/ssh-certificate-templates"----diff --git a/docs/api-reference/endpoints/ssh/certificate-templates/read.mdx b/docs/api-reference/endpoints/ssh/certificate-templates/read.mdxdeleted file mode 100644index 13a356688c..0000000000--- a/docs/api-reference/endpoints/ssh/certificate-templates/read.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Retrieve"-openapi: "GET /api/v1/ssh/certificate-templates/{certificateTemplateId}"----diff --git a/docs/api-reference/endpoints/ssh/certificate-templates/update.mdx b/docs/api-reference/endpoints/ssh/certificate-templates/update.mdxdeleted file mode 100644index f566d75356..0000000000--- a/docs/api-reference/endpoints/ssh/certificate-templates/update.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Update"-openapi: "PATCH /api/v1/ssh/certificate-templates/{certificateTemplateId}"----diff --git a/docs/api-reference/endpoints/ssh/certificates/issue-credentials.mdx b/docs/api-reference/endpoints/ssh/certificates/issue-credentials.mdxdeleted file mode 100644index 4a6da70b35..0000000000--- a/docs/api-reference/endpoints/ssh/certificates/issue-credentials.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Issue SSH Credentials"-openapi: "POST /api/v1/ssh/certificates/issue"----diff --git a/docs/api-reference/endpoints/ssh/certificates/sign-key.mdx b/docs/api-reference/endpoints/ssh/certificates/sign-key.mdxdeleted file mode 100644index 0843b34a2e..0000000000--- a/docs/api-reference/endpoints/ssh/certificates/sign-key.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Sign SSH Public Key"-openapi: "POST /api/v1/ssh/certificates/sign"----diff --git a/docs/api-reference/endpoints/ssh/groups/add-host.mdx b/docs/api-reference/endpoints/ssh/groups/add-host.mdxdeleted file mode 100644index 77257cd401..0000000000--- a/docs/api-reference/endpoints/ssh/groups/add-host.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Add Host"-openapi: "POST /api/v1/ssh/host-groups/{sshHostGroupId}/hosts/{hostId}"----diff --git a/docs/api-reference/endpoints/ssh/groups/create.mdx b/docs/api-reference/endpoints/ssh/groups/create.mdxdeleted file mode 100644index be4755d8ed..0000000000--- a/docs/api-reference/endpoints/ssh/groups/create.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Create"-openapi: "POST /api/v1/ssh/host-groups"----diff --git a/docs/api-reference/endpoints/ssh/groups/delete.mdx b/docs/api-reference/endpoints/ssh/groups/delete.mdxdeleted file mode 100644index 19205f2ebb..0000000000--- a/docs/api-reference/endpoints/ssh/groups/delete.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Delete"-openapi: "DELETE /api/v1/ssh/host-groups/{sshHostGroupId}"----diff --git a/docs/api-reference/endpoints/ssh/groups/list-hosts.mdx b/docs/api-reference/endpoints/ssh/groups/list-hosts.mdxdeleted file mode 100644index 2db1fd11f6..0000000000--- a/docs/api-reference/endpoints/ssh/groups/list-hosts.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List Hosts"-openapi: "GET /api/v1/ssh/host-groups/{sshHostGroupId}/hosts"----diff --git a/docs/api-reference/endpoints/ssh/groups/list.mdx b/docs/api-reference/endpoints/ssh/groups/list.mdxdeleted file mode 100644index 089ab40961..0000000000--- a/docs/api-reference/endpoints/ssh/groups/list.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List"-openapi: "GET /api/v2/workspace/{projectId}/ssh-host-groups"----diff --git a/docs/api-reference/endpoints/ssh/groups/read.mdx b/docs/api-reference/endpoints/ssh/groups/read.mdxdeleted file mode 100644index 060a75bce8..0000000000--- a/docs/api-reference/endpoints/ssh/groups/read.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Retrieve"-openapi: "GET /api/v1/ssh/host-groups/{sshHostGroupId}"----diff --git a/docs/api-reference/endpoints/ssh/groups/remove-host.mdx b/docs/api-reference/endpoints/ssh/groups/remove-host.mdxdeleted file mode 100644index b1de7f4ae6..0000000000--- a/docs/api-reference/endpoints/ssh/groups/remove-host.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Remove Host"-openapi: "DELETE /api/v1/ssh/host-groups/{sshHostGroupId}/hosts/{hostId}"----diff --git a/docs/api-reference/endpoints/ssh/groups/update.mdx b/docs/api-reference/endpoints/ssh/groups/update.mdxdeleted file mode 100644index 3e23bf4f91..0000000000--- a/docs/api-reference/endpoints/ssh/groups/update.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Update"-openapi: "PATCH /api/v1/ssh/host-groups/{sshHostGroupId}"----diff --git a/docs/api-reference/endpoints/ssh/hosts/create.mdx b/docs/api-reference/endpoints/ssh/hosts/create.mdxdeleted file mode 100644index 5860b6b497..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/create.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Create"-openapi: "POST /api/v1/ssh/hosts"----diff --git a/docs/api-reference/endpoints/ssh/hosts/delete.mdx b/docs/api-reference/endpoints/ssh/hosts/delete.mdxdeleted file mode 100644index c52129b332..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/delete.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Delete"-openapi: "DELETE /api/v1/ssh/hosts/{sshHostId}"----diff --git a/docs/api-reference/endpoints/ssh/hosts/issue-host-cert.mdx b/docs/api-reference/endpoints/ssh/hosts/issue-host-cert.mdxdeleted file mode 100644index bb843e4669..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/issue-host-cert.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Issue Host Certificate"-openapi: "POST /api/v1/ssh/hosts/{sshHostId}/issue-host-cert"----diff --git a/docs/api-reference/endpoints/ssh/hosts/issue-user-cert.mdx b/docs/api-reference/endpoints/ssh/hosts/issue-user-cert.mdxdeleted file mode 100644index a16e03a65c..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/issue-user-cert.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Issue User Certificate"-openapi: "POST /api/v1/ssh/hosts/{sshHostId}/issue-user-cert"----diff --git a/docs/api-reference/endpoints/ssh/hosts/list-my.mdx b/docs/api-reference/endpoints/ssh/hosts/list-my.mdxdeleted file mode 100644index 6ccc4e325a..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/list-my.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List My Hosts"-openapi: "GET /api/v1/ssh/hosts"----diff --git a/docs/api-reference/endpoints/ssh/hosts/list.mdx b/docs/api-reference/endpoints/ssh/hosts/list.mdxdeleted file mode 100644index 3f61123e04..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/list.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "List"-openapi: "GET /api/v2/workspace/{projectId}/ssh-hosts"----diff --git a/docs/api-reference/endpoints/ssh/hosts/read-host-ca-pk.mdx b/docs/api-reference/endpoints/ssh/hosts/read-host-ca-pk.mdxdeleted file mode 100644index 15ca53e9d6..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/read-host-ca-pk.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Read Host CA Public Key"-openapi: "GET /api/v1/ssh/hosts/{sshHostId}/host-ca-public-key"----diff --git a/docs/api-reference/endpoints/ssh/hosts/read-user-ca-pk.mdx b/docs/api-reference/endpoints/ssh/hosts/read-user-ca-pk.mdxdeleted file mode 100644index a6f31e93f4..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/read-user-ca-pk.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Read User CA Public Key"-openapi: "GET /api/v1/ssh/hosts/{sshHostId}/user-ca-public-key"----diff --git a/docs/api-reference/endpoints/ssh/hosts/read.mdx b/docs/api-reference/endpoints/ssh/hosts/read.mdxdeleted file mode 100644index 112296a5a2..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/read.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Retrieve"-openapi: "GET /api/v1/ssh/hosts/{sshHostId}"----diff --git a/docs/api-reference/endpoints/ssh/hosts/update.mdx b/docs/api-reference/endpoints/ssh/hosts/update.mdxdeleted file mode 100644index d5555b8131..0000000000--- a/docs/api-reference/endpoints/ssh/hosts/update.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "Update"-openapi: "PATCH /api/v1/ssh/hosts/{sshHostId}"----diff --git a/docs/docs.json b/docs/docs.jsonindex 959bd1b90a..c5186d4a40 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -4413,6 +4413,38 @@"source": "/documentation/platform/agent-proxy/connecting-agents","destination": "/documentation/platform/agent-proxy/standalone-agent-proxy#the-two-commands"},+ {+ "source": "/documentation/platform/ssh",+ "destination": "/documentation/platform/pam/overview"+ },+ {+ "source": "/documentation/platform/ssh/concepts/ssh-certificates",+ "destination": "/documentation/platform/pam/guides/ssh-certificate-auth"+ },+ {+ "source": "/documentation/platform/ssh/:slug*",+ "destination": "/documentation/platform/pam/accounts/ssh"+ },+ {+ "source": "/api-reference/endpoints/ssh/:slug*",+ "destination": "/documentation/platform/pam/overview"+ },+ {+ "source": "/cli/commands/ssh",+ "destination": "/cli/commands/pam"+ },+ {+ "source": "/documentation/platform/agent-sentinel",+ "destination": "/documentation/platform/agent-proxy/overview"+ },+ {+ "source": "/documentation/platform/agent-sentinel/activity-logs",+ "destination": "/documentation/platform/agent-proxy/activity-logs"+ },+ {+ "source": "/documentation/platform/agent-sentinel/:slug*",+ "destination": "/documentation/platform/agent-proxy/overview"+ },{"source": "/documentation/platform/kms/hsm-integration","destination": "/self-hosting/guides/hsm-integration"diff --git a/docs/documentation/getting-started/introduction.mdx b/docs/documentation/getting-started/introduction.mdxindex 5799abd512..8995587f00 100644--- a/docs/documentation/getting-started/introduction.mdx+++ b/docs/documentation/getting-started/introduction.mdx@@ -8,7 +8,7 @@ description: "The open source platform for managing secrets, certificates, and s[Infisical](https://infisical.com) is the [open source](https://github.com/Infisical/infisical), all-in-one platform for secrets, certificates, and privileged access management.-It provides modern security workflows — including secrets rotation, dynamic credentials, access approvals, and SSH certificate-based access — all within one platform designed for developers, infrastructure, and security teams.+It provides modern security workflows — including secrets rotation, dynamic credentials, access approvals, and privileged access management — all within one platform designed for developers, infrastructure, and security teams.Start managing secrets securely with [Infisical Cloud](https://app.infisical.com) or learn how to [host Infisical](/self-hosting/overview) yourself.@@ -40,7 +40,7 @@ Infisical addresses this challenge by providing an all-in-one platform and workf- Securely store and manage application secrets from development to production.- Scan code and pipelines for exposed credentials.- Automate X.509 certificate issuance and renewal.-- Manage SSH access using short-lived, policy-driven certificates.+- Govern privileged access to infrastructure with policy-driven sessions.- Encrypt and decrypt sensitive data with centralized key control.- Audit every access, credential use, and change.diff --git a/docs/documentation/platform/agent-sentinel/activity-logs.mdx b/docs/documentation/platform/agent-sentinel/activity-logs.mdxdeleted file mode 100644index 80bd55c059..0000000000--- a/docs/documentation/platform/agent-sentinel/activity-logs.mdx+++ /dev/null@@ -1,93 +0,0 @@-----title: "Activity Logs"-sidebarTitle: "Activity Logs"-description: "Monitor and audit AI tool usage with detailed activity logs."------## Concept--Activity Logs provide complete visibility into how AI agents are using tools through your MCP endpoints. Every tool invocation is logged with detailed information including timestamps, the endpoint used, which tool was called, who initiated the request, and the full request/response payloads.--<CardGroup cols={2}>- <Card title="Security Auditing" icon="shield">- Identify unusual patterns of tool usage, verify authorized access, and detect potential data exfiltration attempts.- </Card>- <Card title="Compliance Reporting" icon="file-certificate">- Meet SOC 2 requirements, support internal security reviews, and enable incident investigation with complete audit trails.- </Card>- <Card title="Debugging & Support" icon="bug">- Examine request payloads, review response errors, and trace the sequence of tool calls when issues arise.- </Card>- <Card title="Usage Analytics" icon="chart-line">- Identify frequently used tools, track usage trends over time, and measure active users per endpoint.- </Card>-</CardGroup>--## What Gets Logged--Every tool invocation through an MCP endpoint creates a log entry containing:--| Field | Description |-|-------|-------------|-| **Timestamp** | When the tool was invoked |-| **Endpoint** | The MCP endpoint used |-| **Tool** | The name of the tool that was called |-| **User** | The user who initiated the request |-| **Request** | The full request payload sent to the tool |-| **Response** | The full response returned by the tool |--## Viewing Activity Logs--<Tabs>- <Tab title="Infisical UI">- <Steps>- <Step title="Navigate to Activity Logs">- Head to your Agent Sentinel project and select **Activity Logs** from the sidebar.-- - </Step>- <Step title="Filter by time range">- Use the time range selector to filter logs. You can also adjust the timezone using the timezone dropdown.- </Step>- <Step title="Apply filters">- Click **Filter** to apply additional filters:-- - **Endpoint**: Filter by specific MCP endpoint- - **Tool**: Filter by specific tool- - **User**: Filter by specific user- - **Server**: Filter by specific MCP server- </Step>- <Step title="View log details">- Click on any log entry to expand it and view the full details:-- - **Request**: The JSON payload sent to the tool- - **Response**: The JSON response returned by the tool-- - </Step>- </Steps>- </Tab>-</Tabs>--## FAQ--<AccordionGroup>- <Accordion title="Can I export activity logs?">- Yes, activity logs can be exported for external analysis or long-term storage. Enterprise plans include log streaming to external SIEM systems.- </Accordion>- <Accordion title="Are sensitive data in requests/responses masked?">- Infisical supports PII filtering to automatically detect and mask sensitive data in request and response payloads. When enabled on an MCP endpoint, the following PII types can be redacted:-- - **Email addresses** → `[REDACTED_EMAIL]`- - **Phone numbers** → `[REDACTED_PHONE]`- - **Social Security Numbers** → `[REDACTED_SSN]`- - **Credit card numbers** → `[REDACTED_CREDIT_CARD]`- - **IP addresses (IPv4 and IPv6)** → `[REDACTED_IP]`-- You can configure PII filtering separately for requests and responses, and select which PII types to detect. See [MCP Endpoints - PII Filtering](/documentation/platform/agent-sentinel/mcp-endpoints#pii-filtering) for configuration details.- </Accordion>- <Accordion title="Do failed tool invocations get logged?">- Yes, all tool invocations are logged regardless of success or failure. Failed invocations include error details in the response payload.- </Accordion>-</AccordionGroup>-diff --git a/docs/documentation/platform/agent-sentinel/concepts/mcp-overview.mdx b/docs/documentation/platform/agent-sentinel/concepts/mcp-overview.mdxdeleted file mode 100644index 96b01493ca..0000000000--- a/docs/documentation/platform/agent-sentinel/concepts/mcp-overview.mdx+++ /dev/null@@ -1,52 +0,0 @@-----title: "Model Context Protocol"-sidebarTitle: "What is MCP?"-description: "Learn what the Model Context Protocol is and how Infisical helps you manage it securely."------## What is the Model Context Protocol?--The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard that enables AI assistants and agents to securely connect to external data sources and tools. It provides a unified way for AI systems to interact with services like Notion, GitHub, Slack, databases, and more.--Think of MCP as a universal adapter between AI systems and the tools they need. Instead of building custom integrations for each AI platform and each tool, MCP provides a standardized protocol that any AI client can use to connect to any MCP-compatible server.--## How Does MCP Work?--MCP follows a client-server architecture:--- **MCP Clients**: AI applications like Claude, ChatGPT, or custom AI agents that need to access external tools.-- **MCP Servers**: Services that expose tools and capabilities through the MCP protocol. These can be first-party servers (like Notion's official MCP server) or custom servers you build.--When an AI assistant needs to perform an action—like searching Notion, creating a GitHub issue, or querying a database—it communicates with the appropriate MCP server using the standardized protocol.--## Why Do You Need Agent Sentinel?--While MCP provides the protocol for AI-tool communication, it doesn't solve the governance and security challenges that organizations face:--### The Challenge--- **Credential Sprawl**: Each user connecting AI tools to MCP servers manages their own credentials, creating security blind spots.-- **No Visibility**: Organizations have no insight into what tools AI agents are using or what data they're accessing.-- **Ungoverned Access**: Without centralized control, AI agents may access tools and data they shouldn't.-- **Compliance Risk**: Audit requirements demand logging and monitoring of AI system activities.--### The Solution--Infisical Agent Sentinel acts as a secure gateway between AI clients and MCP servers:--```mermaid-graph LR- A[AI Client] --> B[Infisical MCP Endpoint]- B --> C[Notion]- B --> D[GitHub]- B --> E[Slack]-```--This architecture provides:--1. **Centralized Credential Management**: Store and manage MCP server credentials in one place. Choose between **shared credentials** (one credential for all users) or **personal credentials** (each user authenticates individually) based on your security and compliance needs.-2. **Tool Governance**: Control exactly which tools from each MCP server are available through your endpoints.-3. **Complete Audit Trail**: Every tool invocation is logged with full request/response details, user attribution, and timestamps.-4. **Access Control**: Leverage Infisical's existing access control mechanisms to manage who can use which endpoints.--Learn more about [credential modes](/documentation/platform/agent-sentinel/mcp-servers#credential-modes) when configuring MCP servers.diff --git a/docs/documentation/platform/agent-sentinel/mcp-endpoints.mdx b/docs/documentation/platform/agent-sentinel/mcp-endpoints.mdxdeleted file mode 100644index 1db0473ddb..0000000000--- a/docs/documentation/platform/agent-sentinel/mcp-endpoints.mdx+++ /dev/null@@ -1,248 +0,0 @@-----title: "MCP Endpoints"-sidebarTitle: "MCP Endpoints"-description: "Learn how to create and manage MCP endpoints for AI clients."------## Concept--MCP Endpoints are the entry points that AI clients (like Claude, ChatGPT, or custom agents) use to access your configured MCP Servers. Instead of connecting AI clients directly to individual MCP servers, you connect them to an Infisical MCP Endpoint which acts as a secure gateway.--This architecture provides several benefits:--<CardGroup cols={2}>- <Card title="Federation" icon="object-group">- Combine tools from multiple MCP servers behind a single endpoint.- </Card>- <Card title="Tool Selection" icon="list-check">- Control exactly which tools are available through each endpoint.- </Card>- <Card title="Access Control" icon="lock">- Manage who can use each endpoint.- </Card>- <Card title="Centralized Logging" icon="scroll">- All tool invocations are logged regardless of which MCP server they target.- </Card>- <Card title="PII Filtering" icon="user-shield">- Automatically redact sensitive data from requests and responses.- </Card>- <Card title="Auth Delegation" icon="key">- Handle OAuth and token-based authentication for connected servers.- </Card>-</CardGroup>--## How It Works--```mermaid-graph LR- A[AI Client<br/>Claude, ChatGPT, etc.] --> B[MCP Endpoint<br/>Infisical]- B --> C[MCP Server 1<br/>Notion]- B --> D[MCP Server 2<br/>GitHub]-```--When you create an MCP endpoint, Infisical generates a unique URL that you can add to your AI client's MCP configuration. The AI client connects to this URL and can access all enabled tools from the connected MCP servers.--## Guide to Creating an MCP Endpoint--In the following steps, we explore how to create an MCP endpoint and connect it to an AI client.--<Tabs>- <Tab title="Infisical UI">- <Steps>- <Step title="Navigate to MCP Endpoints">- Head to your Agent Sentinel project and select **MCP Endpoints** from the sidebar, then click **Create Endpoint**.-- - </Step>- <Step title="Configure endpoint details">- Enter the following details for your endpoint:-- - **Name**: A friendly name to identify this endpoint (e.g., "Engineering Team Endpoint")- - **Description (Optional)**: A description of the endpoint's purpose- - **Connected Servers**: A selection of the MCP servers to make available through this endpoint-- - </Step>- <Step title="Configure tool selection">- After creating the endpoint, you'll be taken to the endpoint details page. Here you can configure which tools from each connected server are available through this endpoint.-- For each connected MCP server, you'll see a list of available tools. Toggle tools on or off to control what AI clients can access.-- -- <Note>- By default, no tools are enabled. You must explicitly enable the tools you want to make available.- </Note>- </Step>- <Step title="Copy the endpoint URL">- The endpoint details page displays the **Endpoint URL**. Copy this URL—you'll need it to configure your AI client.-- - </Step>- </Steps>- </Tab>-</Tabs>--## Connecting AI Clients--Once you have your endpoint URL, you can connect AI clients to it.--<Tabs>- <Tab title="Claude">- Add the endpoint to your Claude MCP configuration:-- 1. Open Claude settings- 2. Navigate to the MCP section- 3. Add a new server with your Infisical endpoint URL- 4. Click **Connect**-- When connecting for the first time, Claude will open an authorization page where you grant access to the endpoint. You can configure:-- - **Access Duration**: How long the AI client can use the endpoint (e.g., 30 days)-- After authorization, Claude can use all enabled tools from your endpoint.- </Tab>- <Tab title="Other AI Clients">- Any MCP-compatible AI client can connect to your endpoint using the endpoint URL.-- The general process is:- 1. Locate the MCP server configuration in your AI client- 2. Add your Infisical endpoint URL as a new server- 3. Complete the authorization flow when prompted-- Refer to your AI client's documentation for specific configuration steps.- </Tab>-</Tabs>--## Personal Credentials Authentication--When an MCP endpoint includes servers configured with **Personal Credentials** mode, users must authenticate with each of those servers before they can connect to the endpoint.--### Authentication Flow--When a user connects to an endpoint with servers requiring personal credentials:--1. **Authentication Prompt**: After authorizing access to the endpoint, users are shown a list of all MCP servers that require their personal credentials.----2. **Authenticate Each Server**: Users must authenticate with each server in the list. The authentication method depends on how the server was configured:- - **OAuth**: Users are redirected to the service (e.g., GitHub, Notion) to authorize access- - **Bearer Token**: Users enter their personal access token directly----3. **Re-authentication**: Users can update their credentials for servers they've already authenticated with by clicking the **Re-authenticate** button. This is useful when tokens expire or when users want to switch accounts.--4. **Complete All Authentications**: Users must authenticate with **all** servers requiring personal credentials before they can proceed. The connection will only be established once all required authentications are complete.----## Access Control with Permission Conditions--MCP endpoints support granular role-based access control through permission conditions. This allows you to restrict access to specific endpoints based on their name.--### Example Use Cases--- **Team-specific endpoints**: Create a role that only allows access to endpoints matching `engineering-*`-- **Environment separation**: Restrict production endpoints (`prod-*`) to senior team members--### Configuring Permission Conditions--When creating or editing a project role, you can add conditions to MCP endpoint permissions:--1. Navigate to **Access Control** > **Roles**-2. Edit or create a role-3. Under **MCP Endpoints** permissions, click **Add Condition**-4. Select the **Endpoint Name** property-5. Choose an operator (`equal`, `not equal`, `glob match`, or `in`)-6. Enter the value(s) to match--### Supported Operators--| Operator | Description | Example |-| ------------ | ------------------- | ------------------------------ |-| `equal` | Exact match | `engineering-tools` |-| `not equal` | Does not match | `prod-endpoint` |-| `glob match` | Pattern matching | `prod-*`, `*-internal` |-| `in` | Matches any in list | `["endpoint-1", "endpoint-2"]` |--## PII Filtering--MCP Endpoints support automatic PII (Personally Identifiable Information) filtering to redact sensitive data from requests sent to MCP servers and responses returned to AI clients. This helps maintain compliance and prevent accidental exposure of sensitive information through AI tool interactions.--### Supported PII Types--| Type | Description | Redacted As |-|------|-------------|-------------|-| Email | Email addresses | `[REDACTED_EMAIL]` |-| Phone | Phone numbers (US format) | `[REDACTED_PHONE]` |-| SSN | Social Security Numbers | `[REDACTED_SSN]` |-| Credit Card | Credit card numbers | `[REDACTED_CREDIT_CARD]` |-| IP Address | IPv4 and IPv6 addresses | `[REDACTED_IP]` |--### Configuring PII Filters--<Tabs>- <Tab title="Infisical UI">- <Steps>- <Step title="Navigate to Endpoint Details">- Open your MCP endpoint and locate the **Filters** section in the left column.-- - </Step>- <Step title="Open Filter Configuration">- Click the edit icon to open the PII filter configuration modal.-- - </Step>- <Step title="Configure Filtering Options">- Configure the following options:-- - **Filter Requests**: Enable to redact PII from requests sent to MCP servers- - **Filter Responses**: Enable to redact PII from responses returned to AI clients- - **PII Detection**: Select which types of PII to detect and redact- </Step>- <Step title="Save Configuration">- Click **Save** to apply your PII filter settings. Changes take effect immediately for new tool invocations.- </Step>- </Steps>- </Tab>-</Tabs>--## FAQ--<AccordionGroup>- <Accordion title="How does PII filtering work?">- When PII filtering is enabled, Infisical scans request and/or response payloads using pattern matching to detect sensitive data. Detected PII is replaced with redaction placeholders (e.g., `[REDACTED_EMAIL]`) before the data is passed through. The original data is never stored or logged when filtering is enabled.- </Accordion>- <Accordion title="Can I filter requests and responses separately?">- Yes, you can enable PII filtering independently for requests (data sent to MCP servers) and responses (data returned to AI clients). This gives you granular control over where redaction is applied.- </Accordion>- <Accordion title="What PII types are supported?">- Infisical currently supports detection and redaction of: email addresses, phone numbers (US format), Social Security Numbers, credit card numbers, and IP addresses (both IPv4 and IPv6).- </Accordion>- <Accordion title="Can I select different PII types for requests and responses?">- No. The selected PII types apply to both request and response filtering. If you need different filtering rules, consider creating separate endpoints.- </Accordion>- <Accordion title="Can I connect the same MCP server to multiple endpoints?">- Yes, you can connect an MCP server to as many endpoints as needed. Each endpoint can have different tools enabled, allowing you to create different access profiles.- </Accordion>- <Accordion title="What happens when I disable a tool?">- When you disable a tool, AI clients connected to the endpoint will no longer be able to use it. The tool won't appear in the client's available tools list.- </Accordion>- <Accordion title="How long does endpoint authorization last?">- When an AI client connects to an endpoint, the user chooses an access duration (e.g., 30 days). After this period, the client will need to re-authorize.- </Accordion>- <Accordion title="Can I revoke an AI client's access?">- Yes, you can revoke access by managing authorized sessions in the endpoint settings. This immediately disconnects the AI client.- </Accordion>- <Accordion title="What if an MCP server requires personal credentials?">- If a connected MCP server uses personal credentials, users will be prompted to authenticate when they first connect to the endpoint. The authentication method depends on how the server was configured:-- - **OAuth servers**: Users complete an OAuth authorization flow- - **Bearer Token servers**: Users enter their personal access token directly-- This is a one-time process per server, and users can re-authenticate at any time if needed.- </Accordion>-</AccordionGroup>diff --git a/docs/documentation/platform/agent-sentinel/mcp-servers.mdx b/docs/documentation/platform/agent-sentinel/mcp-servers.mdxdeleted file mode 100644index 1cca5426cb..0000000000--- a/docs/documentation/platform/agent-sentinel/mcp-servers.mdx+++ /dev/null@@ -1,176 +0,0 @@-----title: "MCP Servers"-sidebarTitle: "MCP Servers"-description: "Learn how to connect and manage MCP servers in Infisical."------## Concept--MCP Servers are external services that expose tools and capabilities through the Model Context Protocol. By connecting MCP servers to Infisical, you can centrally manage access to tools like Notion, GitHub, Slack, and more.--When you add an MCP server to Infisical, the platform discovers all available tools from that server and allows you to make them accessible through [MCP Endpoints](/documentation/platform/agent-sentinel/mcp-endpoints).--## Supported MCP Servers--Infisical supports connecting to any remote MCP server that implements the Model Context Protocol over HTTP with OAuth or Bearer Token authentication. Popular MCP servers include:--- **Notion** - Search, create, and manage Notion pages and databases-- **GitHub** - Manage repositories, issues, pull requests, and more-- **Slack** - Send messages, manage channels, and interact with workspaces-- **Google Drive** - Access and manage files and documents-- **Linear** - Manage issues and projects--<Note>- Infisical connects to MCP servers over HTTP using the standard remote MCP protocol.-</Note>--## Authentication--MCP servers require authentication to access their tools. Infisical supports two authentication methods:--<CardGroup cols={2}>- <Card title="OAuth" icon="key">- The server uses OAuth 2.0 for authentication. Users are redirected to the service to authorize access.-- **Best for:** Services with full OAuth support like Notion, GitHub, Google.- </Card>- <Card title="Bearer Token" icon="ticket">- Users provide their own API token or access token directly.-- **Best for:** Services where users have existing API tokens, or services without OAuth support.- </Card>-</CardGroup>--Some MCP servers with OAuth support **Dynamic Client Registration**, which means Infisical can automatically register as an OAuth client. For servers that don't support this (like GitHub), you'll need to manually create an OAuth application and provide the client credentials.--## Credential Modes--When adding an MCP server, you choose how credentials are managed:--<CardGroup cols={2}>- <Card title="Shared Credentials" icon="users">- You (the administrator) authorize the MCP server once, and all users who access tools through this server use your credentials.-- **Best for:** Shared service accounts, servers without per-user permissions, simplified management.- </Card>- <Card title="Personal Credentials" icon="user-lock">- Each user must authenticate with the MCP server individually before using its tools. Their credentials are stored securely by Infisical.-- **Best for:** Per-user audit trails, user-specific permissions, compliance requirements.- </Card>-</CardGroup>--<Note>- When using **Personal Credentials** mode, the administrator setting up the MCP server must still authenticate during setup. This initial authentication is required to fetch and discover the available tools from the server.-</Note>--## Gateway Support--By default, Infisical connects directly to MCP servers over the internet. For MCP servers hosted on private networks (internal APIs, self-hosted services), you can route connections through a [Gateway](/documentation/platform/gateways/overview).--<Note>- OAuth is not supported when using a gateway. Only Bearer Token authentication is available.-</Note>--Gateways enable you to:-- Connect to MCP servers on private networks without exposing them to the internet-- Access self-hosted MCP servers within VPCs or on-premises infrastructure-- Maintain network isolation while enabling AI tool access--## Guide to Adding an MCP Server--In the following steps, we explore how to add an MCP server to your Agent Sentinel project.--<Tabs>- <Tab title="Infisical UI">- <Steps>- <Step title="Navigate to MCP Servers">- Head to your Agent Sentinel project and select **MCP Servers** from the sidebar, then click **Add MCP Server**.-- - </Step>- <Step title="Configure server details">- Enter the following details for your MCP server:-- - **Name**: A friendly name to identify this server (e.g., "Notion", "GitHub")- - **URL**: The MCP server endpoint URL (e.g., `https://mcp.notion.com/mcp`)- - **Gateway** (optional): Select a gateway to route connections through a private network. Leave as "Internet Gateway" for public MCP servers- - **Credential Mode**: Choose between **Shared Credentials** or **Personal Credentials**-- - </Step>- <Step title="Configure authentication">- Choose the authentication method for your MCP server:-- <AccordionGroup>- <Accordion title="OAuth Authentication">- - For servers with Dynamic Client Registration (e.g., Notion): Click **Authorize** to complete the OAuth flow- - For servers without Dynamic Client Registration (e.g., GitHub): Enter the **Client ID** and **Client Secret**, then click **Authorize**-- - </Accordion>- <Accordion title="Bearer Token Authentication">- - Select **Bearer Token** as the authentication method- - Users will be prompted to enter their personal access token when connecting to endpoints that include this server-- - </Accordion>- </AccordionGroup>- </Step>- <Step title="Review available tools">- After authorization, Infisical discovers and displays all tools available from the MCP server.-- You can view each tool's name and description. These tools can now be enabled in [MCP Endpoints](/documentation/platform/agent-sentinel/mcp-endpoints).-- - </Step>- </Steps>- </Tab>-</Tabs>--## FAQ--<AccordionGroup>- <Accordion title="What MCP server URLs should I use?">- Each MCP server provider publishes their endpoint URL. Common examples:- - **Notion**: `https://mcp.notion.com/mcp`- - **GitHub**: `https://api.githubcopilot.com/mcp/`-- Check the service's MCP documentation for the correct URL.- </Accordion>- <Accordion title="How do I create OAuth credentials for GitHub?">- 1. Go to GitHub Settings → Developer settings → OAuth Apps- 2. Click "New OAuth App"- 3. Set the Authorization callback URL to your Infisical instance- 4. Copy the Client ID and generate a Client Secret- 5. Use these credentials when adding the GitHub MCP server- </Accordion>- <Accordion title="Can I change the credential mode after adding a server?">- Yes, you can update the credential mode by editing the MCP server configuration. Note that changing from shared to personal credentials will require users to re-authenticate.- </Accordion>- <Accordion title="What happens if the MCP server goes offline?">- If an MCP server becomes unavailable, tool invocations through endpoints connected to that server will fail. The Activity Logs will capture these failures for troubleshooting.- </Accordion>- <Accordion title="When should I use Bearer Token vs OAuth?">- Use **OAuth** when:- - The MCP server supports OAuth 2.0- - You want automatic token refresh- - The service has a native OAuth integration-- Use **Bearer Token** when:- - Users already have API tokens they want to use- - The MCP server doesn't support OAuth- - You need a simpler authentication flow- </Accordion>- <Accordion title="When should I use a gateway for MCP servers?">- Use a gateway when your MCP server is:- - Hosted on a private network (VPC, on-premises)- - Not accessible from the public internet- - A self-hosted service that should not be exposed externally-- For public MCP servers like Notion or GitHub, use the default "Internet Gateway" option.- </Accordion>- <Accordion title="Can I use OAuth with a gateway?">- No, only Bearer Token authentication is supported when using a gateway. If you choose Personal Credentials mode, each user can provide their own token when connecting to an MCP endpoint.- </Accordion>-</AccordionGroup>diff --git a/docs/documentation/platform/agent-sentinel/overview.mdx b/docs/documentation/platform/agent-sentinel/overview.mdxdeleted file mode 100644index cf107c4c3c..0000000000--- a/docs/documentation/platform/agent-sentinel/overview.mdx+++ /dev/null@@ -1,29 +0,0 @@-----title: "Agent Sentinel"-sidebarTitle: "Overview"-description: "Manage MCP endpoints, connect MCP servers, and configure AI tools with secure governance."------Infisical Agent Sentinel enables organizations to securely connect AI agents and assistants to external tools through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io). It provides a centralized control plane for managing which tools AI systems can access, how they authenticate, and complete visibility into every tool invocation.--As AI agents become more capable and autonomous, organizations need robust infrastructure to govern their access to external systems. Agent Sentinel solves this by acting as a secure gateway between AI clients (like Claude, ChatGPT, or custom agents) and the MCP servers that provide tools.--## Core Capabilities--<CardGroup cols={2}>- <Card title="MCP Servers" icon="server" href="/documentation/platform/agent-sentinel/mcp-servers">- Connect to remote MCP servers like Notion, GitHub, and Slack with flexible credential management.- </Card>- <Card title="MCP Endpoints" icon="link" href="/documentation/platform/agent-sentinel/mcp-endpoints">- Create secure connection URLs for AI clients with granular tool selection.- </Card>- <Card title="Activity Logs" icon="list" href="/documentation/platform/agent-sentinel/activity-logs">- Monitor and audit every tool invocation with detailed request/response logging.- </Card>- <Card title="Tool Governance" icon="shield-check">- Fine-grained control over which tools are available through each endpoint.- </Card>- <Card title="PII Filtering" icon="user-shield" href="/documentation/platform/agent-sentinel/mcp-endpoints#pii-filtering">- Automatically redact sensitive data like emails, phone numbers, and credit cards from AI tool interactions.- </Card>-</CardGroup>diff --git a/docs/documentation/platform/organization.mdx b/docs/documentation/platform/organization.mdxindex 9747f11bcf..cc8d574c0a 100644--- a/docs/documentation/platform/organization.mdx+++ b/docs/documentation/platform/organization.mdx@@ -46,7 +46,7 @@ To manage access at scale, Infisical also supports [user groups](/documentation/Note that Infisical distinguishes between organization-level and project-level access control:- [Organization-level access control](/documentation/platform/access-controls/role-based-access-controls#organization-level-access-controls): Roles and permissions governing access to organization-level resources and controls such as billing, member management, and identity provider configuration.-- [Project-level access control](/documentation/platform/access-controls/role-based-access-controls#project-level-access-controls): Roles and permissions governing access to resources and workflows within a specific project (e.g., secrets, certificates, SSH hosts).+- [Project-level access control](/documentation/platform/access-controls/role-based-access-controls#project-level-access-controls): Roles and permissions governing access to resources and workflows within a specific project (e.g., secrets, certificates, KMS keys).diff --git a/docs/images/platform/ai/mcp/mcp-activity-logs-details.png b/docs/images/platform/ai/mcp/mcp-activity-logs-details.pngdeleted file mode 100644index a568d68bb6..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-activity-logs-details.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-activity-logs.png b/docs/images/platform/ai/mcp/mcp-activity-logs.pngdeleted file mode 100644index d2e5cb111a..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-activity-logs.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-create.png b/docs/images/platform/ai/mcp/mcp-endpoints-create.pngdeleted file mode 100644index 56bc4562e1..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-create.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-bearer.png b/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-bearer.pngdeleted file mode 100644index d087b782fa..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-bearer.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-complete.png b/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-complete.pngdeleted file mode 100644index db0d6c66a0..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-complete.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-incomplete.png b/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-incomplete.pngdeleted file mode 100644index 94b1dd16f6..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-finalize-personal-incomplete.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-list.png b/docs/images/platform/ai/mcp/mcp-endpoints-list.pngdeleted file mode 100644index 4e479ee9ca..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-list.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-tools.png b/docs/images/platform/ai/mcp/mcp-endpoints-tools.pngdeleted file mode 100644index 49a0313d18..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-tools.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-endpoints-url.png b/docs/images/platform/ai/mcp/mcp-endpoints-url.pngdeleted file mode 100644index 1a1c76e83d..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-endpoints-url.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-pii-filters-config.png b/docs/images/platform/ai/mcp/mcp-pii-filters-config.pngdeleted file mode 100644index e5543e7025..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-pii-filters-config.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-pii-filters-section.png b/docs/images/platform/ai/mcp/mcp-pii-filters-section.pngdeleted file mode 100644index f3051faadb..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-pii-filters-section.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-servers-add-bearer.png b/docs/images/platform/ai/mcp/mcp-servers-add-bearer.pngdeleted file mode 100644index b66ca9f60e..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-servers-add-bearer.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-servers-add.png b/docs/images/platform/ai/mcp/mcp-servers-add.pngdeleted file mode 100644index b54a11f9c9..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-servers-add.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-servers-auth.png b/docs/images/platform/ai/mcp/mcp-servers-auth.pngdeleted file mode 100644index c2f18a050a..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-servers-auth.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-servers-list.png b/docs/images/platform/ai/mcp/mcp-servers-list.pngdeleted file mode 100644index c55f63b375..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-servers-list.png and /dev/null differdiff --git a/docs/images/platform/ai/mcp/mcp-servers-tools.png b/docs/images/platform/ai/mcp/mcp-servers-tools.pngdeleted file mode 100644index 107d927006..0000000000Binary files a/docs/images/platform/ai/mcp/mcp-servers-tools.png and /dev/null differdiff --git a/docs/internals/permissions/overview.mdx b/docs/internals/permissions/overview.mdxindex 5ae4d0e695..e3473a1065 100644--- a/docs/internals/permissions/overview.mdx+++ b/docs/internals/permissions/overview.mdx@@ -16,7 +16,7 @@ Infisical's permission system operates at two distinct levels, providing compreh### Project Permissions-Project permissions control access to resources within a specific project, including secrets management, PKI, KMS, and SSH certificate functionality.+Project permissions control access to resources within a specific project, including secrets management, PKI, and KMS functionality.For a comprehensive list of all project-level subjects, actions, and detailed descriptions, please refer to the [Project Permissions](/internals/permissions/project-permissions) documentation.@@ -34,7 +34,6 @@ Permission inversion allows you to explicitly deny actions instead of allowing t- secret-folders- secret-imports- dynamic-secrets-- mcp-endpointsWhen a permission is inverted, it changes from an "allow" rule to a "deny" rule. For example:@@ -65,7 +64,6 @@ Conditions allow you to create more granular permissions by specifying criteria- secret-folders- secret-imports- dynamic-secrets-- mcp-endpoints### Properties@@ -76,12 +74,6 @@ Conditions can be applied to the following properties:- `secretName`: Control access based on secret names- `secretTags`: Control access based on tags (only supports $in operator)-### MCP Endpoint Properties--For `mcp-endpoints`, conditions can be applied to:--- `name`: Control access based on endpoint name (supports `$eq`, `$ne`, `$glob`, `$in`)-### OperatorsThe following operators are available for conditions:diff --git a/docs/internals/permissions/project-permissions.mdx b/docs/internals/permissions/project-permissions.mdxindex 020f274679..6f67251dc3 100644--- a/docs/internals/permissions/project-permissions.mdx+++ b/docs/internals/permissions/project-permissions.mdx@@ -12,7 +12,7 @@ Each permission consists of:- **Subject**: The resource the permission applies to (e.g., secrets, members, settings)- **Action**: The operation that can be performed (e.g., read, create, edit, delete)-Some project-level resources—specifically `secrets`, `secret-folders`, `secret-imports`, `dynamic-secrets`, `secret-syncs`, `secret-rotation`, `honey-tokens`, `identity`, `app-connections`, `mcp-endpoints`, and `pam-accounts`—support conditional permissions and permission inversion for more granular access control. Conditions allow you to specify criteria (like environment, secret path, tags, app connection ID, identity ID, resource name, or endpoint name) that must be met for the permission to apply.+Some project-level resources—specifically `secrets`, `secret-folders`, `secret-imports`, `dynamic-secrets`, `secret-syncs`, `secret-rotation`, `honey-tokens`, `identity`, `app-connections`, and `pam-accounts`—support conditional permissions and permission inversion for more granular access control. Conditions allow you to specify criteria (like environment, secret path, tags, app connection ID, identity ID, resource name, or endpoint name) that must be met for the permission to apply.## Available Project Permissions@@ -431,20 +431,6 @@ Supports conditions and permission inversion.| `read-configs` | View Secret Scanning Project Configuration || `update-configs` | Update Secret Scanning Project Configuration |-### Agent Sentinel--#### Subject: `mcp-endpoints`--Supports conditions and permission inversion.--| Action | Description | Condition keys |-| --------- | ----------------------------------- | ----- |-| `read` | View MCP endpoints | `name` |-| `create` | Create new MCP endpoints | `name` |-| `edit` | Modify MCP endpoint configurations | `name` |-| `delete` | Remove MCP endpoints | `name` |-| `connect` | Connect AI clients to MCP endpoints | `name` |-### Privileged Access Management (PAM)#### Subject: `pam-resources`diff --git a/frontend/CLAUDE.md b/frontend/CLAUDE.mdindex f49f6495fe..c46ecfc3d2 100644--- a/frontend/CLAUDE.md+++ b/frontend/CLAUDE.md@@ -28,13 +28,13 @@ Each page directory has a `route.tsx` that defines its route:createFileRoute(path)({ component, validateSearch: zodValidator(schema), beforeLoad })```-Route middleware chain: root → `authenticate` → `inject-org-details` → org-layout → product-specific layouts (secret-manager-layout, cert-manager-layout, kms-layout, ssh-layout, etc.).+Route middleware chain: root → `authenticate` → `inject-org-details` → org-layout → product-specific layouts (secret-manager-layout, cert-manager-layout, kms-layout, etc.).Middleware pages in `src/pages/middlewares/`: `authenticate.tsx` (auth guard + redirect), `inject-org-details.tsx` (org context), `restrict-login-signup.tsx` (prevents auth pages when logged in).### Pages / Views / Components Hierarchy-- **`src/pages/`** — Route-level components organized by product feature (secret-manager, cert-manager, kms, ssh, pam, organization, project, admin, auth, ai). Each has `route.tsx` + page component + local `components/`.+- **`src/pages/`** — Route-level components organized by product feature (secret-manager, cert-manager, kms, pam, secret-scanning, organization, project, admin, auth). Each has `route.tsx` + page component + local `components/`.- **`src/views/`** — Reusable page-level UI composed into multiple pages. Pages import views with configuration props.- **`src/components/v3/`** — Latest shared UI component library (preferred). Contains `generic/` (Accordion, Alert, Button, Dialog, Select, Table, etc.) and `platform/` (domain-specific components). **Always use v3 components for new code.** Only use v2 components when a v3 equivalent does not exist.- **`src/components/v2/`** — Legacy shared UI components built on Radix UI primitives + Tailwind. Uses `cva` (class-variance-authority) for variants and `tailwind-merge` for class conflict resolution. Being superseded by v3 — do not use for new features if a v3 alternative exists.@@ -78,7 +78,7 @@ Tailwind CSS v4 with PostCSS. Dark theme configured via CSS custom properties in### Layouts-13 layout components in `src/layouts/` — `AdminLayout`, `OrganizationLayout`, `SecretManagerLayout`, `CertManagerLayout`, `KmsLayout`, `SshLayout`, `PamLayout`, etc. Layouts handle sidebar navigation and page chrome for their product area.+9 layout components in `src/layouts/` — `AdminLayout`, `OrganizationLayout`, `SecretManagerLayout`, `PkiManagerLayout`, `KmsLayout`, `PamLayout`, etc. Layouts handle sidebar navigation and page chrome for their product area.## Conventionsdiff --git a/frontend/src/components/v2/PageHeader/PageHeader.tsx b/frontend/src/components/v2/PageHeader/PageHeader.tsxindex a119481dce..6e4d7ad085 100644--- a/frontend/src/components/v2/PageHeader/PageHeader.tsx+++ b/frontend/src/components/v2/PageHeader/PageHeader.tsx@@ -19,11 +19,9 @@ const SCOPE_BADGE: Record<NonNullable<Props["scope"]>, { icon: LucideIcon; classorg: { className: "text-org", icon: OrgIcon },[ProjectType.SecretManager]: { className: "text-project", icon: ProjectIcon },[ProjectType.CertificateManager]: { className: "text-project", icon: ProjectIcon },- [ProjectType.SSH]: { className: "text-project", icon: ProjectIcon },[ProjectType.KMS]: { className: "text-project", icon: ProjectIcon },[ProjectType.PAM]: { className: "text-product-pam", icon: ProjectIcon },[ProjectType.SecretScanning]: { className: "text-project", icon: ProjectIcon },- [ProjectType.AI]: { className: "text-project", icon: ProjectIcon },namespace: { className: "text-sub-org", icon: SubOrgIcon },instance: { className: "text-neutral", icon: InstanceIcon }};diff --git a/frontend/src/const/routes.ts b/frontend/src/const/routes.tsindex b811ff9cd6..1997dacf01 100644--- a/frontend/src/const/routes.ts+++ b/frontend/src/const/routes.ts@@ -400,16 +400,6 @@ export const ROUTE_PATHS = Object.freeze({"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing")},- Ssh: {- SshCaByIDPage: setRoute(- "/organizations/$orgId/projects/ssh/$projectId/ca/$caId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId"- ),- SshHostGroupDetailsByIDPage: setRoute(- "/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId"- )- },SecretScanning: {DataSourceByIdPage: setRoute("/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/$type/$dataSourceId",diff --git a/frontend/src/context/ProjectPermissionContext/index.tsx b/frontend/src/context/ProjectPermissionContext/index.tsxindex e65b00e79f..8360e1f99a 100644--- a/frontend/src/context/ProjectPermissionContext/index.tsx+++ b/frontend/src/context/ProjectPermissionContext/index.tsx@@ -15,7 +15,6 @@ export {ProjectPermissionIdentityActions,ProjectPermissionInsightsActions,ProjectPermissionKmipActions,- ProjectPermissionMcpEndpointActions,ProjectPermissionMemberActions,ProjectPermissionPkiCertificateInstallationActions,ProjectPermissionPkiDiscoveryActions,@@ -23,6 +22,5 @@ export {ProjectPermissionPkiSyncActions,ProjectPermissionPkiTemplateActions,ProjectPermissionProxiedServiceActions,- ProjectPermissionSshHostActions,ProjectPermissionSub} from "./types";diff --git a/frontend/src/context/ProjectPermissionContext/types.ts b/frontend/src/context/ProjectPermissionContext/types.tsindex 802d832e7a..238283a4e7 100644--- a/frontend/src/context/ProjectPermissionContext/types.ts+++ b/frontend/src/context/ProjectPermissionContext/types.ts@@ -137,14 +137,6 @@ export enum ProjectPermissionGroupActions {AssignRole = "assign-role"}-export enum ProjectPermissionSshHostActions {- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete",- IssueHostCert = "issue-host-cert"-}-export enum ProjectPermissionPkiSubscriberActions {Read = "read",Create = "create",@@ -271,14 +263,6 @@ export enum ProjectPermissionCommitsActions {PerformRollback = "perform-rollback"}-export enum ProjectPermissionMcpEndpointActions {- Read = "read",- Create = "create",- Edit = "edit",- Delete = "delete",- Connect = "connect"-}-export enum ProjectPermissionHoneyTokenActions {Read = "read",ReadCredentials = "read-credentials",@@ -341,7 +325,6 @@ export type ConditionalProjectPermissionSubject =| ProjectPermissionSub.Secrets| ProjectPermissionSub.DynamicSecrets| ProjectPermissionSub.Identity- | ProjectPermissionSub.SshHosts| ProjectPermissionSub.PkiSubscribers| ProjectPermissionSub.CertificateTemplates| ProjectPermissionSub.CertificateAuthorities@@ -353,7 +336,6 @@ export type ConditionalProjectPermissionSubject =| ProjectPermissionSub.SecretRotation| ProjectPermissionSub.SecretEventSubscriptions| ProjectPermissionSub.AppConnections- | ProjectPermissionSub.McpEndpoints| ProjectPermissionSub.Member| ProjectPermissionSub.Groups| ProjectPermissionSub.Commits@@ -423,11 +405,6 @@ export enum ProjectPermissionSub {CertificateAuthorities = "certificate-authorities",Certificates = "certificates",CertificateTemplates = "certificate-templates",- SshCertificateAuthorities = "ssh-certificate-authorities",- SshCertificateTemplates = "ssh-certificate-templates",- SshCertificates = "ssh-certificates",- SshHosts = "ssh-hosts",- SshHostGroups = "ssh-host-groups",PkiAlerts = "pki-alerts",PkiCollections = "pki-collections",CertificateInventoryViews = "certificate-inventory-views",@@ -449,9 +426,6 @@ export enum ProjectPermissionSub {SecretEventSubscriptions = "secret-event-subscriptions",AppConnections = "app-connections",HsmConnectors = "hsm-connectors",- McpEndpoints = "mcp-endpoints",- McpServers = "mcp-servers",- McpActivityLogs = "mcp-activity-logs",HoneyTokens = "honey-tokens",ProxiedServices = "proxied-services",ApprovalRequests = "approval-requests",@@ -538,10 +512,6 @@ export type SecretRotationSubjectFields = {connectionId?: string;};-export type SshHostSubjectFields = {- hostname: string;-};-export type PkiSubscriberSubjectFields = {name: string;};@@ -555,10 +525,6 @@ export type CertificatePolicySubjectFields = {name: string;};-export type McpEndpointSubjectFields = {- name: string;-};-export type ProjectPermissionSet =| [ProjectPermissionSecretActions,@@ -656,17 +622,6 @@ export type ProjectPermissionSet =| (ForcedSubject<ProjectPermissionSub.CertificateTemplates> & PkiTemplateSubjectFields))]- | [ProjectPermissionActions, ProjectPermissionSub.SshCertificateAuthorities]- | [ProjectPermissionActions, ProjectPermissionSub.SshCertificateTemplates]- | [ProjectPermissionActions, ProjectPermissionSub.SshCertificates]- | [ProjectPermissionActions, ProjectPermissionSub.SshHostGroups]- | [- ProjectPermissionSshHostActions,- (- | ProjectPermissionSub.SshHosts- | (ForcedSubject<ProjectPermissionSub.SshHosts> & SshHostSubjectFields)- )- ]| [ProjectPermissionPkiSubscriberActions,(@@ -745,15 +700,6 @@ export type ProjectPermissionSet =| (ForcedSubject<ProjectPermissionSub.ProxiedServices> & ProxiedServiceSubjectFields))]- | [- ProjectPermissionMcpEndpointActions,- (- | ProjectPermissionSub.McpEndpoints- | (ForcedSubject<ProjectPermissionSub.McpEndpoints> & McpEndpointSubjectFields)- )- ]- | [ProjectPermissionActions, ProjectPermissionSub.McpServers]- | [ProjectPermissionActions, ProjectPermissionSub.McpActivityLogs]| [ProjectPermissionProjectFolderGrantActions,(diff --git a/frontend/src/context/index.tsx b/frontend/src/context/index.tsxindex e697b987e2..a5c3efe691 100644--- a/frontend/src/context/index.tsx+++ b/frontend/src/context/index.tsx@@ -29,14 +29,12 @@ export {ProjectPermissionIdentityActions,ProjectPermissionInsightsActions,ProjectPermissionKmipActions,- ProjectPermissionMcpEndpointActions,ProjectPermissionMemberActions,ProjectPermissionPkiCertificateInstallationActions,ProjectPermissionPkiDiscoveryActions,ProjectPermissionPkiSubscriberActions,ProjectPermissionPkiSyncActions,ProjectPermissionPkiTemplateActions,- ProjectPermissionSshHostActions,ProjectPermissionSub,useProjectPermission} from "./ProjectPermissionContext";diff --git a/frontend/src/helpers/project.ts b/frontend/src/helpers/project.tsindex 1a21fcb29d..ce30d48c30 100644--- a/frontend/src/helpers/project.ts+++ b/frontend/src/helpers/project.ts@@ -1,12 +1,4 @@-import {- FileKeyIcon,- KeyIcon,- LockIcon,- LucideIcon,- RadarIcon,- TerminalIcon,- UsersIcon-} from "lucide-react";+import { FileKeyIcon, KeyIcon, LockIcon, LucideIcon, RadarIcon, UsersIcon } from "lucide-react";import { apiRequest } from "@app/config/request";import { createWorkspace } from "@app/hooks/api/projects/queries";@@ -158,10 +150,8 @@ export const getProjectTitle = (type: ProjectType) => {[ProjectType.SecretManager]: "Secrets Management",[ProjectType.KMS]: "KMS",[ProjectType.CertificateManager]: "Certificate Manager",- [ProjectType.SSH]: "SSH",[ProjectType.SecretScanning]: "Secret Scanning",- [ProjectType.PAM]: "Privileged Access Manager",- [ProjectType.AI]: "AI"+ [ProjectType.PAM]: "Privileged Access Manager"};return titleConvert[type] || type;};@@ -212,7 +202,6 @@ export const getProjectLucideIcon = (type: ProjectType): LucideIcon => {[ProjectType.SecretManager]: KeyIcon,[ProjectType.KMS]: LockIcon,[ProjectType.CertificateManager]: FileKeyIcon,- [ProjectType.SSH]: TerminalIcon,[ProjectType.SecretScanning]: RadarIcon,[ProjectType.PAM]: UsersIcon};diff --git a/frontend/src/helpers/roles.ts b/frontend/src/helpers/roles.tsindex 56872d04a3..48427fac75 100644--- a/frontend/src/helpers/roles.ts+++ b/frontend/src/helpers/roles.ts@@ -29,8 +29,6 @@ export const formatProjectRoleName = (role: string, customRoleName?: string) =>return "No Access";case ProjectMembershipRole.Custom:return customRoleName ?? role;- case ProjectMembershipRole.SshHostBootstrapper:- return "SSH Host Bootstrapper";case ProjectMembershipRole.KmsCryptographicOperator:return "Cryptographic Operator";default:diff --git a/frontend/src/hooks/api/aiMcpActivityLogs/index.ts b/frontend/src/hooks/api/aiMcpActivityLogs/index.tsdeleted file mode 100644index 96a2e2e00d..0000000000--- a/frontend/src/hooks/api/aiMcpActivityLogs/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { aiMcpActivityLogKeys, useListAiMcpActivityLogs } from "./queries";-export type { TAiMcpActivityLog, TListAiMcpActivityLogsFilter } from "./types";diff --git a/frontend/src/hooks/api/aiMcpActivityLogs/queries.tsx b/frontend/src/hooks/api/aiMcpActivityLogs/queries.tsxdeleted file mode 100644index 1a029f2e21..0000000000--- a/frontend/src/hooks/api/aiMcpActivityLogs/queries.tsx+++ /dev/null@@ -1,52 +0,0 @@-import { useInfiniteQuery } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";-import { onRequestError } from "@app/hooks/api/reactQuery";-import { TReactQueryOptions } from "@app/types/reactQuery";--import { TAiMcpActivityLog, TListAiMcpActivityLogsFilter } from "./types";--export const aiMcpActivityLogKeys = {- all: ["aiMcpActivityLogs"] as const,- list: (projectId: string, filters: TListAiMcpActivityLogsFilter) =>- [...aiMcpActivityLogKeys.all, "list", projectId, filters] as const-};--export const useListAiMcpActivityLogs = (- filters: TListAiMcpActivityLogsFilter,- options: TReactQueryOptions["options"] = {}-) => {- return useInfiniteQuery({- initialPageParam: 0,- queryKey: aiMcpActivityLogKeys.list(filters.projectId, filters),- queryFn: async ({ pageParam }) => {- try {- const { data } = await apiRequest.get<{ activityLogs: TAiMcpActivityLog[] }>(- "/api/v1/ai/mcp/activity-logs",- {- params: {- projectId: filters.projectId,- offset: pageParam,- limit: filters.limit,- startDate: filters.startDate.toISOString(),- endDate: filters.endDate.toISOString(),- ...(filters.endpointName ? { endpointName: filters.endpointName } : {}),- ...(filters.serverName ? { serverName: filters.serverName } : {}),- ...(filters.toolName ? { toolName: filters.toolName } : {}),- ...(filters.actor ? { actor: filters.actor } : {})- }- }- );- return data.activityLogs;- } catch (error) {- onRequestError(error);- return [];- }- },- getNextPageParam: (lastPage, pages) =>- lastPage.length !== 0 ? pages.length * filters.limit : undefined,- placeholderData: (prev) => prev,- enabled: Boolean(filters.projectId),- ...options- });-};diff --git a/frontend/src/hooks/api/aiMcpActivityLogs/types.ts b/frontend/src/hooks/api/aiMcpActivityLogs/types.tsdeleted file mode 100644index 2ffb488a40..0000000000--- a/frontend/src/hooks/api/aiMcpActivityLogs/types.ts+++ /dev/null@@ -1,27 +0,0 @@-export type TAiMcpActivityLog = {- id: string;- projectId: string;- endpointName: string;- serverName: string;- toolName: string;- actor: string;- request: unknown;- response: unknown;- createdAt: string;- updatedAt: string;-};--export type TListAiMcpActivityLogsFilter = {- projectId: string;- endpointName?: string;- serverName?: string;- toolName?: string;- actor?: string;- startDate: Date;- endDate: Date;- limit: number;-};--export type TListAiMcpActivityLogsDTO = {- projectId: string;-};diff --git a/frontend/src/hooks/api/aiMcpEndpoints/index.ts b/frontend/src/hooks/api/aiMcpEndpoints/index.tsdeleted file mode 100644index 86a46e391f..0000000000--- a/frontend/src/hooks/api/aiMcpEndpoints/index.ts+++ /dev/null@@ -1,20 +0,0 @@-export {- useBulkUpdateEndpointTools,- useCreateAiMcpEndpoint,- useDeleteAiMcpEndpoint,- useDisableEndpointTool,- useEnableEndpointTool,- useFinalizeMcpEndpointOAuth,- useInitiateServerOAuth,- useSaveUserServerCredential,- useUpdateAiMcpEndpoint,- useVerifyServerBearerToken-} from "./mutations";-export {- aiMcpEndpointKeys,- useGetAiMcpEndpointById,- useGetServersRequiringAuth,- useListAiMcpEndpoints,- useListEndpointTools-} from "./queries";-export * from "./types";diff --git a/frontend/src/hooks/api/aiMcpEndpoints/mutations.tsx b/frontend/src/hooks/api/aiMcpEndpoints/mutations.tsxdeleted file mode 100644index 9f45a79117..0000000000--- a/frontend/src/hooks/api/aiMcpEndpoints/mutations.tsx+++ /dev/null@@ -1,185 +0,0 @@-import { useMutation, useQueryClient } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { aiMcpEndpointKeys } from "./queries";-import {- TAiMcpEndpoint,- TAiMcpEndpointToolConfig,- TBulkUpdateEndpointToolsDTO,- TCreateAiMcpEndpointDTO,- TDeleteAiMcpEndpointDTO,- TDisableEndpointToolDTO,- TEnableEndpointToolDTO,- TFinalizeMcpEndpointOAuthDTO,- TInitiateServerOAuthDTO,- TSaveUserServerCredentialDTO,- TUpdateAiMcpEndpointDTO,- TVerifyServerBearerTokenDTO,- TVerifyServerBearerTokenResponse-} from "./types";--export const useCreateAiMcpEndpoint = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async (dto: TCreateAiMcpEndpointDTO) => {- const { data } = await apiRequest.post<{ endpoint: TAiMcpEndpoint }>(- "/api/v1/ai/mcp/endpoints",- dto- );- return data.endpoint;- },- onSuccess: (_, variables) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.list(variables.projectId)- });- }- });-};--export const useUpdateAiMcpEndpoint = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async ({ endpointId, ...dto }: TUpdateAiMcpEndpointDTO) => {- const { data } = await apiRequest.patch<{ endpoint: TAiMcpEndpoint }>(- `/api/v1/ai/mcp/endpoints/${endpointId}`,- dto- );- return data.endpoint;- },- onSuccess: (data) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.list(data.projectId)- });- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.byId(data.id)- });- }- });-};--export const useDeleteAiMcpEndpoint = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async ({ endpointId }: TDeleteAiMcpEndpointDTO) => {- const { data } = await apiRequest.delete<{ endpoint: TAiMcpEndpoint }>(- `/api/v1/ai/mcp/endpoints/${endpointId}`- );- return data.endpoint;- },- onSuccess: (data) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.list(data.projectId)- });- }- });-};--export const useEnableEndpointTool = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async ({ endpointId, serverToolId }: TEnableEndpointToolDTO) => {- const { data } = await apiRequest.post<{ tool: TAiMcpEndpointToolConfig }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/tools/${serverToolId}`- );- return data.tool;- },- onSuccess: (_, variables) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.tools(variables.endpointId)- });- }- });-};--export const useDisableEndpointTool = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async ({ endpointId, serverToolId }: TDisableEndpointToolDTO) => {- await apiRequest.delete(`/api/v1/ai/mcp/endpoints/${endpointId}/tools/${serverToolId}`);- },- onSuccess: (_, variables) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.tools(variables.endpointId)- });- }- });-};--export const useBulkUpdateEndpointTools = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async ({ endpointId, tools }: TBulkUpdateEndpointToolsDTO) => {- const { data } = await apiRequest.patch<{ tools: TAiMcpEndpointToolConfig[] }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/tools/bulk`,- { tools }- );- return data.tools;- },- onSuccess: (_, variables) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.tools(variables.endpointId)- });- }- });-};--export const useFinalizeMcpEndpointOAuth = () => {- return useMutation({- mutationFn: async ({ endpointId, ...body }: TFinalizeMcpEndpointOAuthDTO) => {- const { data } = await apiRequest.post<{ callbackUrl: string }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/oauth/finalize`,- body- );- return data;- }- });-};--export const useInitiateServerOAuth = () => {- return useMutation({- mutationFn: async ({ endpointId, serverId }: TInitiateServerOAuthDTO) => {- const { data } = await apiRequest.post<{ authUrl: string; sessionId: string }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/servers/${serverId}/oauth/initiate`- );- return data;- }- });-};--export const useVerifyServerBearerToken = () => {- return useMutation({- mutationFn: async ({ endpointId, serverId, accessToken }: TVerifyServerBearerTokenDTO) => {- const { data } = await apiRequest.post<TVerifyServerBearerTokenResponse>(- `/api/v1/ai/mcp/endpoints/${endpointId}/servers/${serverId}/verify-token`,- { accessToken }- );- return data;- }- });-};--export const useSaveUserServerCredential = () => {- const queryClient = useQueryClient();-- return useMutation({- mutationFn: async ({ endpointId, serverId, ...body }: TSaveUserServerCredentialDTO) => {- const { data } = await apiRequest.post<{ success: boolean }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/servers/${serverId}/credentials`,- body- );- return data;- },- onSuccess: (_, variables) => {- queryClient.invalidateQueries({- queryKey: aiMcpEndpointKeys.serversRequiringAuth(variables.endpointId)- });- }- });-};diff --git a/frontend/src/hooks/api/aiMcpEndpoints/queries.tsx b/frontend/src/hooks/api/aiMcpEndpoints/queries.tsxdeleted file mode 100644index 2f5dff5035..0000000000--- a/frontend/src/hooks/api/aiMcpEndpoints/queries.tsx+++ /dev/null@@ -1,75 +0,0 @@-import { useQuery } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import {- TAiMcpEndpoint,- TAiMcpEndpointToolConfig,- TAiMcpEndpointWithServerIds,- TListAiMcpEndpointsDTO,- TServerAuthStatus-} from "./types";--export const aiMcpEndpointKeys = {- all: ["aiMcpEndpoints"] as const,- list: (projectId: string) => [...aiMcpEndpointKeys.all, "list", projectId] as const,- byId: (endpointId: string) => [...aiMcpEndpointKeys.all, "byId", endpointId] as const,- tools: (endpointId: string) => [...aiMcpEndpointKeys.all, "tools", endpointId] as const,- serversRequiringAuth: (endpointId: string) =>- [...aiMcpEndpointKeys.all, "serversRequiringAuth", endpointId] as const-};--export const useListAiMcpEndpoints = ({ projectId }: TListAiMcpEndpointsDTO) => {- return useQuery({- queryKey: aiMcpEndpointKeys.list(projectId),- queryFn: async () => {- const { data } = await apiRequest.get<{- endpoints: TAiMcpEndpoint[];- totalCount: number;- }>("/api/v1/ai/mcp/endpoints", {- params: { projectId }- });- return data;- },- enabled: Boolean(projectId)- });-};--export const useGetAiMcpEndpointById = ({ endpointId }: { endpointId: string }) => {- return useQuery({- queryKey: aiMcpEndpointKeys.byId(endpointId),- queryFn: async () => {- const { data } = await apiRequest.get<{ endpoint: TAiMcpEndpointWithServerIds }>(- `/api/v1/ai/mcp/endpoints/${endpointId}`- );- return data.endpoint;- },- enabled: Boolean(endpointId)- });-};--export const useListEndpointTools = ({ endpointId }: { endpointId: string }) => {- return useQuery({- queryKey: aiMcpEndpointKeys.tools(endpointId),- queryFn: async () => {- const { data } = await apiRequest.get<{ tools: TAiMcpEndpointToolConfig[] }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/tools`- );- return data.tools;- },- enabled: Boolean(endpointId)- });-};--export const useGetServersRequiringAuth = ({ endpointId }: { endpointId: string }) => {- return useQuery({- queryKey: aiMcpEndpointKeys.serversRequiringAuth(endpointId),- queryFn: async () => {- const { data } = await apiRequest.get<{ servers: TServerAuthStatus[] }>(- `/api/v1/ai/mcp/endpoints/${endpointId}/servers-requiring-auth`- );- return data.servers;- },- enabled: Boolean(endpointId)- });-};diff --git a/frontend/src/hooks/api/aiMcpEndpoints/types.ts b/frontend/src/hooks/api/aiMcpEndpoints/types.tsdeleted file mode 100644index 23facf1151..0000000000--- a/frontend/src/hooks/api/aiMcpEndpoints/types.ts+++ /dev/null@@ -1,121 +0,0 @@-export type TAiMcpEndpoint = {- id: string;- name: string;- description: string | null;- status: string | null;- piiRequestFiltering?: boolean;- piiResponseFiltering?: boolean;- piiEntityTypes?: string[] | null;- projectId: string;- createdAt: string;- updatedAt: string;- connectedServers: number;- activeTools: number;-};--export type TAiMcpEndpointWithServerIds = TAiMcpEndpoint & {- serverIds: string[];-};--export type TCreateAiMcpEndpointDTO = {- projectId: string;- name: string;- description?: string;- serverIds?: string[];-};--export type TUpdateAiMcpEndpointDTO = {- endpointId: string;- name?: string;- description?: string;- serverIds?: string[];- piiRequestFiltering?: boolean;- piiResponseFiltering?: boolean;- piiEntityTypes?: string[];-};--export type TDeleteAiMcpEndpointDTO = {- endpointId: string;-};--export type TListAiMcpEndpointsDTO = {- projectId: string;-};--export type TGetAiMcpEndpointDTO = {- endpointId: string;-};--export type TAiMcpEndpointToolConfig = {- id: string;- aiMcpEndpointId: string;- aiMcpServerToolId: string;- isEnabled: boolean;-};--export type TListEndpointToolsDTO = {- endpointId: string;-};--export type TEnableEndpointToolDTO = {- endpointId: string;- serverToolId: string;-};--export type TDisableEndpointToolDTO = {- endpointId: string;- serverToolId: string;-};--export type TBulkUpdateEndpointToolsDTO = {- endpointId: string;- tools: Array<{- serverToolId: string;- isEnabled: boolean;- }>;-};--export type TFinalizeMcpEndpointOAuthDTO = {- endpointId: string;- response_type: string;- client_id: string;- code_challenge: string;- code_challenge_method: string;- redirect_uri: string;- resource?: string;- expireIn: string;-};--// Personal credentials types-export type TServerAuthStatus = {- id: string;- name: string;- url: string;- hasCredentials: boolean;- authMethod: string;-};--export type TInitiateServerOAuthDTO = {- endpointId: string;- serverId: string;-};--export type TSaveUserServerCredentialDTO = {- endpointId: string;- serverId: string;- accessToken: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;-};--export type TVerifyServerBearerTokenDTO = {- endpointId: string;- serverId: string;- accessToken: string;-};--export type TVerifyServerBearerTokenResponse = {- valid: boolean;- message?: string;-};diff --git a/frontend/src/hooks/api/aiMcpServers/index.ts b/frontend/src/hooks/api/aiMcpServers/index.tsdeleted file mode 100644index f69ae91af2..0000000000--- a/frontend/src/hooks/api/aiMcpServers/index.ts+++ /dev/null@@ -1,15 +0,0 @@-export {- useCreateAiMcpServer,- useDeleteAiMcpServer,- useInitiateOAuth,- useSyncAiMcpServerTools,- useUpdateAiMcpServer-} from "./mutations";-export {- aiMcpServerKeys,- useGetAiMcpServerById,- useGetOAuthStatus,- useListAiMcpServers,- useListAiMcpServerTools-} from "./queries";-export * from "./types";diff --git a/frontend/src/hooks/api/aiMcpServers/mutations.tsx b/frontend/src/hooks/api/aiMcpServers/mutations.tsxdeleted file mode 100644index 2d58586f50..0000000000--- a/frontend/src/hooks/api/aiMcpServers/mutations.tsx+++ /dev/null@@ -1,105 +0,0 @@-import { useMutation, useQueryClient } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { aiMcpServerKeys } from "./queries";-import {- TAiMcpServer,- TAiMcpServerTool,- TCreateAiMcpServerDTO,- TDeleteAiMcpServerDTO,- TInitiateOAuthDTO,- TInitiateOAuthResponse,- TSyncAiMcpServerToolsDTO,- TUpdateAiMcpServerDTO-} from "./types";--export const useCreateAiMcpServer = () => {- const queryClient = useQueryClient();-- return useMutation<TAiMcpServer, object, TCreateAiMcpServerDTO>({- mutationFn: async (data) => {- const { data: response } = await apiRequest.post<{- server: TAiMcpServer;- }>("/api/v1/ai/mcp/servers", data);- return response.server;- },- onSuccess: (_, { projectId }) => {- queryClient.invalidateQueries({- queryKey: aiMcpServerKeys.list({ projectId })- });- }- });-};--export const useUpdateAiMcpServer = () => {- const queryClient = useQueryClient();-- return useMutation<TAiMcpServer, object, TUpdateAiMcpServerDTO>({- mutationFn: async ({ serverId, ...data }) => {- const { data: response } = await apiRequest.patch<{- server: TAiMcpServer;- }>(`/api/v1/ai/mcp/servers/${serverId}`, data);- return response.server;- },- onSuccess: (server, { serverId }) => {- queryClient.invalidateQueries({- queryKey: aiMcpServerKeys.list({ projectId: server.projectId })- });- queryClient.invalidateQueries({- queryKey: aiMcpServerKeys.getById(serverId)- });- }- });-};--export const useDeleteAiMcpServer = () => {- const queryClient = useQueryClient();-- return useMutation<TAiMcpServer, object, TDeleteAiMcpServerDTO>({- mutationFn: async ({ serverId }) => {- const { data: response } = await apiRequest.delete<{- server: TAiMcpServer;- }>(`/api/v1/ai/mcp/servers/${serverId}`);- return response.server;- },- onSuccess: (server, { serverId }) => {- queryClient.invalidateQueries({- queryKey: aiMcpServerKeys.list({ projectId: server.projectId })- });- queryClient.removeQueries({- queryKey: aiMcpServerKeys.getById(serverId)- });- }- });-};--export const useInitiateOAuth = () => {- return useMutation<TInitiateOAuthResponse, object, TInitiateOAuthDTO>({- mutationFn: async (data) => {- const { data: response } = await apiRequest.post<TInitiateOAuthResponse>(- "/api/v1/ai/mcp/servers/oauth/initiate",- data- );- return response;- }- });-};--export const useSyncAiMcpServerTools = () => {- const queryClient = useQueryClient();-- return useMutation<{ tools: TAiMcpServerTool[] }, object, TSyncAiMcpServerToolsDTO>({- mutationFn: async ({ serverId }) => {- const { data: response } = await apiRequest.post<{- tools: TAiMcpServerTool[];- }>(`/api/v1/ai/mcp/servers/${serverId}/tools/sync`);- return response;- },- onSuccess: (_, { serverId }) => {- queryClient.invalidateQueries({- queryKey: aiMcpServerKeys.tools(serverId)- });- }- });-};diff --git a/frontend/src/hooks/api/aiMcpServers/queries.tsx b/frontend/src/hooks/api/aiMcpServers/queries.tsxdeleted file mode 100644index 664f436fba..0000000000--- a/frontend/src/hooks/api/aiMcpServers/queries.tsx+++ /dev/null@@ -1,91 +0,0 @@-import { useQuery, UseQueryOptions } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import {- TAiMcpServer,- TAiMcpServerTool,- TGetOAuthStatusDTO,- TListAiMcpServersDTO,- TListAiMcpServerToolsDTO,- TOAuthStatusResponse-} from "./types";--export const aiMcpServerKeys = {- all: ["ai-mcp-servers"] as const,- list: (params: { projectId: string }) => [...aiMcpServerKeys.all, "list", params] as const,- getById: (serverId: string) => [...aiMcpServerKeys.all, "get-by-id", serverId] as const,- oauthStatus: (sessionId: string) => [...aiMcpServerKeys.all, "oauth-status", sessionId] as const,- tools: (serverId: string) => [...aiMcpServerKeys.all, "tools", serverId] as const-};--export const useListAiMcpServers = ({- projectId,- limit = 100,- offset = 0-}: TListAiMcpServersDTO) => {- return useQuery({- queryKey: aiMcpServerKeys.list({ projectId }),- queryFn: async () => {- const { data } = await apiRequest.get<{- servers: TAiMcpServer[];- totalCount: number;- }>("/api/v1/ai/mcp/servers", {- params: { projectId, limit, offset }- });- return data;- },- enabled: Boolean(projectId)- });-};--export const useGetAiMcpServerById = (- serverId: string,- options?: Omit<UseQueryOptions<TAiMcpServer>, "queryKey" | "queryFn">-) => {- return useQuery({- queryKey: aiMcpServerKeys.getById(serverId),- queryFn: async () => {- const { data } = await apiRequest.get<{- server: TAiMcpServer;- }>(`/api/v1/ai/mcp/servers/${serverId}`);- return data.server;- },- enabled: Boolean(serverId),- ...options- });-};--export const useListAiMcpServerTools = ({ serverId }: TListAiMcpServerToolsDTO) => {- return useQuery({- queryKey: aiMcpServerKeys.tools(serverId),- queryFn: async () => {- const { data } = await apiRequest.get<{- tools: TAiMcpServerTool[];- }>(`/api/v1/ai/mcp/servers/${serverId}/tools`);- return data;- },- enabled: Boolean(serverId)- });-};--export const useGetOAuthStatus = (- { sessionId }: TGetOAuthStatusDTO,- { enabled = true, refetchInterval }: { enabled?: boolean; refetchInterval?: number | false }-) => {- return useQuery({- queryKey: aiMcpServerKeys.oauthStatus(sessionId),- queryFn: async () => {- const { data } = await apiRequest.get<TOAuthStatusResponse>(- `/api/v1/ai/mcp/servers/oauth/status/${sessionId}`- );- return data;- },- enabled: Boolean(sessionId) && enabled,- refetchInterval,- // Keep polling even when window loses focus (user is in OAuth popup)- refetchIntervalInBackground: true,- // Don't use React Query's retry mechanism - we want continuous polling, not 3 retries then stop- retry: false- });-};diff --git a/frontend/src/hooks/api/aiMcpServers/types.ts b/frontend/src/hooks/api/aiMcpServers/types.tsdeleted file mode 100644index a13fb0c54e..0000000000--- a/frontend/src/hooks/api/aiMcpServers/types.ts+++ /dev/null@@ -1,140 +0,0 @@-export enum AiMcpServerCredentialMode {- SHARED = "shared",- PERSONAL = "personal"-}--export enum AiMcpServerAuthMethod {- BASIC = "basic",- BEARER = "bearer",- OAUTH = "oauth"-}--export enum AiMcpServerStatus {- ACTIVE = "active",- INACTIVE = "inactive",- UNINITIALIZED = "uninitialized"-}--// Basic auth credentials-export type TBasicAuthCredentials = {- authMethod: AiMcpServerAuthMethod.BASIC;- credentials: {- username: string;- password: string;- };-};--// Bearer token credentials-export type TBearerAuthCredentials = {- authMethod: AiMcpServerAuthMethod.BEARER;- credentials: {- token: string;- };-};--// OAuth credentials (obtained after OAuth flow)-export type TOAuthCredentials = {- authMethod: AiMcpServerAuthMethod.OAUTH;- credentials: {- accessToken: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;- };-};--export type TAiMcpServerCredentials =- | TBasicAuthCredentials- | TBearerAuthCredentials- | TOAuthCredentials;--export type TAiMcpServer = {- id: string;- name: string;- url: string;- description?: string;- status: AiMcpServerStatus;- credentialMode: AiMcpServerCredentialMode;- authMethod: AiMcpServerAuthMethod;- gatewayId?: string;- projectId: string;- toolsCount?: number;- createdAt: string;- updatedAt: string;-};--// Create MCP Server DTOs-export type TCreateAiMcpServerDTO = {- projectId: string;- name: string;- url: string;- description?: string;- credentialMode: AiMcpServerCredentialMode;- oauthClientId?: string;- oauthClientSecret?: string;- gatewayId?: string;-} & TAiMcpServerCredentials;--// OAuth initiate DTO-export type TInitiateOAuthDTO = {- projectId: string;- url: string;- clientId?: string;- clientSecret?: string;- gatewayId?: string;-};--export type TInitiateOAuthResponse = {- authUrl: string;- sessionId: string;-};--// OAuth status DTO-export type TGetOAuthStatusDTO = {- sessionId: string;-};--export type TOAuthStatusResponse = {- authorized: boolean;- accessToken?: string;- refreshToken?: string;- expiresAt?: number;- tokenType?: string;- clientId?: string;- clientSecret?: string;-};--// List MCP Servers DTO-export type TListAiMcpServersDTO = {- projectId: string;- limit?: number;- offset?: number;-};--// Delete MCP Server DTO-export type TDeleteAiMcpServerDTO = {- serverId: string;-};--export type TUpdateAiMcpServerDTO = {- serverId: string;- name?: string;- description?: string;- gatewayId?: string | null;-};--export type TAiMcpServerTool = {- id: string;- name: string;- description?: string;- inputSchema?: Record<string, unknown>;- aiMcpServerId: string;-};--export type TListAiMcpServerToolsDTO = {- serverId: string;-};--export type TSyncAiMcpServerToolsDTO = {- serverId: string;-};diff --git a/frontend/src/hooks/api/auditLogs/constants.tsx b/frontend/src/hooks/api/auditLogs/constants.tsxindex 907749292f..aa54ee1cd9 100644--- a/frontend/src/hooks/api/auditLogs/constants.tsx+++ b/frontend/src/hooks/api/auditLogs/constants.tsx@@ -387,33 +387,6 @@ export const eventToNameMap: { [K in EventType]: string } = {[EventType.APPROVAL_REQUEST_GRANT_GET]: "Get Approval Request Grant",[EventType.APPROVAL_REQUEST_GRANT_REVOKE]: "Revoke Approval Request Grant",[EventType.PAM_ACCESS_POLICY_BYPASSED]: "PAM Access Policy Bypassed",-- // MCP Endpoints- [EventType.MCP_ENDPOINT_CREATE]: "Create MCP Endpoint",- [EventType.MCP_ENDPOINT_UPDATE]: "Update MCP Endpoint",- [EventType.MCP_ENDPOINT_DELETE]: "Delete MCP Endpoint",- [EventType.MCP_ENDPOINT_GET]: "Get MCP Endpoint",- [EventType.MCP_ENDPOINT_LIST]: "List MCP Endpoints",- [EventType.MCP_ENDPOINT_LIST_TOOLS]: "List MCP Endpoint Tools",- [EventType.MCP_ENDPOINT_ENABLE_TOOL]: "Enable MCP Endpoint Tool",- [EventType.MCP_ENDPOINT_DISABLE_TOOL]: "Disable MCP Endpoint Tool",- [EventType.MCP_ENDPOINT_BULK_UPDATE_TOOLS]: "Bulk Update MCP Endpoint Tools",- [EventType.MCP_ENDPOINT_OAUTH_CLIENT_REGISTER]: "Register MCP OAuth Client",- [EventType.MCP_ENDPOINT_OAUTH_AUTHORIZE]: "Authorize MCP OAuth Client",- [EventType.MCP_ENDPOINT_CONNECT]: "Connect to MCP Endpoint",- [EventType.MCP_ENDPOINT_SAVE_USER_CREDENTIAL]: "Save MCP Server User Credential",-- // MCP Servers- [EventType.MCP_SERVER_CREATE]: "Create MCP Server",- [EventType.MCP_SERVER_UPDATE]: "Update MCP Server",- [EventType.MCP_SERVER_DELETE]: "Delete MCP Server",- [EventType.MCP_SERVER_GET]: "Get MCP Server",- [EventType.MCP_SERVER_LIST]: "List MCP Servers",- [EventType.MCP_SERVER_LIST_TOOLS]: "List MCP Server Tools",- [EventType.MCP_SERVER_SYNC_TOOLS]: "Sync MCP Server Tools",-- // MCP Activity Logs- [EventType.MCP_ACTIVITY_LOG_LIST]: "List MCP Activity Logs",[EventType.CREATE_DYNAMIC_SECRET]: "Create Dynamic Secret",[EventType.UPDATE_DYNAMIC_SECRET]: "Update Dynamic Secret",[EventType.DELETE_DYNAMIC_SECRET]: "Delete Dynamic Secret",@@ -468,16 +441,6 @@ export const userAgentTypeToNameMap: { [K in UserAgentType]: string } = {[UserAgentType.OTHER]: "Other"};-const sharedProjectEvents = [- EventType.ADD_PROJECT_MEMBER,- EventType.REMOVE_PROJECT_MEMBER,- EventType.GET_PROJECT_MEMBER_PERMISSION_AUDIT,- EventType.GET_PROJECT_IDENTITY_PERMISSION_AUDIT,- EventType.CREATE_PROJECT_ROLE,- EventType.UPDATE_PROJECT_ROLE,- EventType.DELETE_PROJECT_ROLE-];-export const projectToEventsMap: Partial<Record<ProjectType, EventType[]>> = {[ProjectType.PAM]: [EventType.PAM_SESSION_START,@@ -517,32 +480,5 @@ export const projectToEventsMap: Partial<Record<ProjectType, EventType[]>> = {EventType.PAM_DISCOVERY_SOURCE_DELETE,EventType.PAM_DISCOVERY_SCAN,EventType.PAM_DISCOVERED_ACCOUNT_IMPORT- ],- [ProjectType.AI]: [- ...sharedProjectEvents,- // MCP Endpoints- EventType.MCP_ENDPOINT_CREATE,- EventType.MCP_ENDPOINT_UPDATE,- EventType.MCP_ENDPOINT_DELETE,- EventType.MCP_ENDPOINT_GET,- EventType.MCP_ENDPOINT_LIST,- EventType.MCP_ENDPOINT_LIST_TOOLS,- EventType.MCP_ENDPOINT_ENABLE_TOOL,- EventType.MCP_ENDPOINT_DISABLE_TOOL,- EventType.MCP_ENDPOINT_BULK_UPDATE_TOOLS,- EventType.MCP_ENDPOINT_OAUTH_CLIENT_REGISTER,- EventType.MCP_ENDPOINT_OAUTH_AUTHORIZE,- EventType.MCP_ENDPOINT_CONNECT,- EventType.MCP_ENDPOINT_SAVE_USER_CREDENTIAL,- // MCP Servers- EventType.MCP_SERVER_CREATE,- EventType.MCP_SERVER_UPDATE,- EventType.MCP_SERVER_DELETE,- EventType.MCP_SERVER_GET,- EventType.MCP_SERVER_LIST,- EventType.MCP_SERVER_LIST_TOOLS,- EventType.MCP_SERVER_SYNC_TOOLS,- // MCP Activity Logs- EventType.MCP_ACTIVITY_LOG_LIST]};diff --git a/frontend/src/hooks/api/auditLogs/enums.tsx b/frontend/src/hooks/api/auditLogs/enums.tsxindex ac5ef86f22..7bafbb061b 100644--- a/frontend/src/hooks/api/auditLogs/enums.tsx+++ b/frontend/src/hooks/api/auditLogs/enums.tsx@@ -378,33 +378,6 @@ export enum EventType {APPROVAL_REQUEST_GRANT_REVOKE = "approval-request-grant-revoke",PAM_ACCESS_POLICY_BYPASSED = "pam-access-policy-bypassed",- // MCP Endpoints- MCP_ENDPOINT_CREATE = "mcp-endpoint-create",- MCP_ENDPOINT_UPDATE = "mcp-endpoint-update",- MCP_ENDPOINT_DELETE = "mcp-endpoint-delete",- MCP_ENDPOINT_GET = "mcp-endpoint-get",- MCP_ENDPOINT_LIST = "mcp-endpoint-list",- MCP_ENDPOINT_LIST_TOOLS = "mcp-endpoint-list-tools",- MCP_ENDPOINT_ENABLE_TOOL = "mcp-endpoint-enable-tool",- MCP_ENDPOINT_DISABLE_TOOL = "mcp-endpoint-disable-tool",- MCP_ENDPOINT_BULK_UPDATE_TOOLS = "mcp-endpoint-bulk-update-tools",- MCP_ENDPOINT_OAUTH_CLIENT_REGISTER = "mcp-endpoint-oauth-client-register",- MCP_ENDPOINT_OAUTH_AUTHORIZE = "mcp-endpoint-oauth-authorize",- MCP_ENDPOINT_CONNECT = "mcp-endpoint-connect",- MCP_ENDPOINT_SAVE_USER_CREDENTIAL = "mcp-endpoint-save-user-credential",-- // MCP Servers- MCP_SERVER_CREATE = "mcp-server-create",- MCP_SERVER_UPDATE = "mcp-server-update",- MCP_SERVER_DELETE = "mcp-server-delete",- MCP_SERVER_GET = "mcp-server-get",- MCP_SERVER_LIST = "mcp-server-list",- MCP_SERVER_LIST_TOOLS = "mcp-server-list-tools",- MCP_SERVER_SYNC_TOOLS = "mcp-server-sync-tools",-- // MCP Activity Logs- MCP_ACTIVITY_LOG_LIST = "mcp-activity-log-list",-// Dynamic SecretsCREATE_DYNAMIC_SECRET = "create-dynamic-secret",UPDATE_DYNAMIC_SECRET = "update-dynamic-secret",diff --git a/frontend/src/hooks/api/ca/constants.tsx b/frontend/src/hooks/api/ca/constants.tsxindex 46aeac93fc..b485648570 100644--- a/frontend/src/hooks/api/ca/constants.tsx+++ b/frontend/src/hooks/api/ca/constants.tsx@@ -1,6 +1,4 @@import { AppConnection } from "../appConnections/enums";-import { SshCaStatus } from "../sshCa";-import { SshCertTemplateStatus } from "../sshCertificateTemplates";import { AcmeDnsProvider, CaCapability, CaStatus, CaType, InternalCaType } from "./enums";export const caTypeToNameMap: { [K in InternalCaType]: string } = {@@ -87,7 +85,7 @@ export const caSupportsCapability = (caType: CaType, capability: CaCapability):return capabilities.includes(capability);};-export const getCaStatusBadgeVariant = (status: CaStatus | SshCaStatus | SshCertTemplateStatus) => {+export const getCaStatusBadgeVariant = (status: CaStatus) => {switch (status) {case CaStatus.ACTIVE:return "success";diff --git a/frontend/src/hooks/api/sshCa/constants.tsx b/frontend/src/hooks/api/dynamicSecret/constants.tssimilarity index 76%rename from frontend/src/hooks/api/sshCa/constants.tsxrename to frontend/src/hooks/api/dynamicSecret/constants.tsindex 05380a239c..51bbed8a61 100644--- a/frontend/src/hooks/api/sshCa/constants.tsx+++ b/frontend/src/hooks/api/dynamicSecret/constants.ts@@ -1,23 +1,3 @@-export enum SshCaStatus {- ACTIVE = "active",- DISABLED = "disabled"-}--export enum SshCertType {- USER = "user",- HOST = "host"-}--export const sshCertTypeToNameMap: { [K in SshCertType]: string } = {- [SshCertType.USER]: "User",- [SshCertType.HOST]: "Host"-};--export enum SshCaKeySource {- INTERNAL = "internal",- EXTERNAL = "external"-}-export enum SshCertKeyAlgorithm {RSA_2048 = "RSA_2048",RSA_4096 = "RSA_4096",diff --git a/frontend/src/hooks/api/gateways-v2/types.ts b/frontend/src/hooks/api/gateways-v2/types.tsindex 5f7a30ac90..0be7b0ba06 100644--- a/frontend/src/hooks/api/gateways-v2/types.ts+++ b/frontend/src/hooks/api/gateways-v2/types.ts@@ -77,13 +77,6 @@ export type TGatewayConnectedKubernetesAuth = {identityName: string;};-export type TGatewayConnectedMcpServer = {- id: string;- name: string;- projectId: string;- projectName: string;-};-export type TGatewayConnectedPkiDiscoveryConfig = {id: string;name: string;@@ -95,6 +88,5 @@ export type TGatewayConnectedResources = {appConnections: TGatewayConnectedAppConnection[];dynamicSecrets: TGatewayConnectedDynamicSecret[];kubernetesAuths: TGatewayConnectedKubernetesAuth[];- mcpServers: TGatewayConnectedMcpServer[];pkiDiscoveryConfigs: TGatewayConnectedPkiDiscoveryConfig[];};diff --git a/frontend/src/hooks/api/index.tsx b/frontend/src/hooks/api/index.tsxindex 342bc5a769..cc36b4a4dd 100644--- a/frontend/src/hooks/api/index.tsx+++ b/frontend/src/hooks/api/index.tsx@@ -1,9 +1,6 @@export * from "./accessApproval";export * from "./accountRecovery";export * from "./admin";-export * from "./aiMcpActivityLogs";-export * from "./aiMcpEndpoints";-export * from "./aiMcpServers";export * from "./alerts";export * from "./approvalGrants";export * from "./approvalPolicies";@@ -70,10 +67,6 @@ export * from "./secretSharing";export * from "./secretValidationRules";export * from "./serverDetails";export * from "./serviceTokens";-export * from "./sshCa";-export * from "./sshCertificateTemplates";-export * from "./sshHost";-export * from "./sshHostGroup";export * from "./ssoConfig";export * from "./subOrganizations";export * from "./subscriptions";diff --git a/frontend/src/hooks/api/organization/queries.tsx b/frontend/src/hooks/api/organization/queries.tsxindex cbfeefe9f0..5cdda578fe 100644--- a/frontend/src/hooks/api/organization/queries.tsx+++ b/frontend/src/hooks/api/organization/queries.tsx@@ -165,7 +165,6 @@ export const useUpdateOrg = () => {secretsProductEnabled,pkiProductEnabled,kmsProductEnabled,- sshProductEnabled,scannerProductEnabled,shareSecretsProductEnabled,maxSharedSecretLifetime,@@ -189,7 +188,6 @@ export const useUpdateOrg = () => {secretsProductEnabled,pkiProductEnabled,kmsProductEnabled,- sshProductEnabled,scannerProductEnabled,shareSecretsProductEnabled,maxSharedSecretLifetime,diff --git a/frontend/src/hooks/api/organization/types.ts b/frontend/src/hooks/api/organization/types.tsindex e7708f730f..70affa2548 100644--- a/frontend/src/hooks/api/organization/types.ts+++ b/frontend/src/hooks/api/organization/types.ts@@ -30,7 +30,6 @@ export type Organization = {secretsProductEnabled: boolean;pkiProductEnabled: boolean;kmsProductEnabled: boolean;- sshProductEnabled: boolean;scannerProductEnabled: boolean;shareSecretsProductEnabled: boolean;maxSharedSecretLifetime: number;@@ -59,7 +58,6 @@ export type UpdateOrgDTO = {secretsProductEnabled?: boolean;pkiProductEnabled?: boolean;kmsProductEnabled?: boolean;- sshProductEnabled?: boolean;scannerProductEnabled?: boolean;shareSecretsProductEnabled?: boolean;maxSharedSecretViewLimit?: number | null;diff --git a/frontend/src/hooks/api/projects/index.tsx b/frontend/src/hooks/api/projects/index.tsxindex db7f51995a..e34daa78b0 100644--- a/frontend/src/hooks/api/projects/index.tsx+++ b/frontend/src/hooks/api/projects/index.tsx@@ -5,8 +5,7 @@ export {useLeaveProject,useMigrateProjectToV3,useRequestProjectAccess,- useUpdateGroupWorkspaceRole,- useUpdateProjectSshConfig+ useUpdateGroupWorkspaceRole} from "./mutations";export {useCreateWorkspace,@@ -16,7 +15,6 @@ export {useDeleteWsEnvironment,useGetMembershipPermissionAudit,useGetMyPendingProjectAccessRequests,- useGetProjectSshConfig,useGetUpgradeProjectStatus,useGetUserProjects,useGetUserProjectsByType,@@ -35,11 +33,6 @@ export {useListWorkspacePkiAlerts,useListWorkspacePkiCollections,useListWorkspacePkiSubscribers,- useListWorkspaceSshCas,- useListWorkspaceSshCertificates,- useListWorkspaceSshCertificateTemplates,- useListWorkspaceSshHostGroups,- useListWorkspaceSshHosts,useRestoreEnvironment,useSearchProjects,useUpdateProject,diff --git a/frontend/src/hooks/api/projects/mutations.tsx b/frontend/src/hooks/api/projects/mutations.tsxindex f365a873cb..d117cbc6c5 100644--- a/frontend/src/hooks/api/projects/mutations.tsx+++ b/frontend/src/hooks/api/projects/mutations.tsx@@ -9,11 +9,7 @@ import { pkiApplicationKeys } from "../pkiApplications/queries";import { secretInsightsKeys } from "../secretInsights/queries";import { userKeys } from "../users/query-keys";import { projectKeys } from "./query-keys";-import {- TProjectSshConfig,- TUpdateProjectSshConfigDTO,- TUpdateWorkspaceGroupRoleDTO-} from "./types";+import { TUpdateWorkspaceGroupRoleDTO } from "./types";const invalidateAuditForProject = (queryClient: ReturnType<typeof useQueryClient>,@@ -184,20 +180,3 @@ export const useEnableSecretBlindIndex = () => {}});};--export const useUpdateProjectSshConfig = () => {- const queryClient = useQueryClient();- return useMutation<TProjectSshConfig, object, TUpdateProjectSshConfigDTO>({- mutationFn: ({ projectId, defaultUserSshCaId, defaultHostSshCaId }) => {- return apiRequest.patch(`/api/v1/projects/${projectId}/ssh-config`, {- defaultUserSshCaId,- defaultHostSshCaId- });- },- onSuccess: (_, { projectId }) => {- queryClient.invalidateQueries({- queryKey: projectKeys.getProjectSshConfig(projectId)- });- }- });-};diff --git a/frontend/src/hooks/api/projects/queries.tsx b/frontend/src/hooks/api/projects/queries.tsxindex 59d08c9a24..c918d20304 100644--- a/frontend/src/hooks/api/projects/queries.tsx+++ b/frontend/src/hooks/api/projects/queries.tsx@@ -14,10 +14,6 @@ import { TPkiAlert } from "../pkiAlerts/types";import { pkiApplicationKeys } from "../pkiApplications/queries";import { TPkiCollection } from "../pkiCollections/types";import { TPkiSubscriber } from "../pkiSubscriber/types";-import { TSshCertificate, TSshCertificateAuthority } from "../sshCa/types";-import { TSshCertificateTemplate } from "../sshCertificateTemplates/types";-import { TSshHost } from "../sshHost/types";-import { TSshHostGroup } from "../sshHostGroup/types";import { userKeys } from "../users/query-keys";import { TWorkspaceUser } from "../users/types";import {@@ -38,7 +34,6 @@ import {TGetMembershipPermissionAuditResponse,TGetUpgradeProjectStatusDTO,TMyPendingProjectAccessRequestsResponse,- TProjectSshConfig,TSearchProjectsDTO,TUpdateWorkspaceUserRoleDTO,UpdateAuditLogsRetentionDTO,@@ -769,67 +764,6 @@ export const useListWorkspaceCertificateTemplates = ({ projectId }: { projectId:});};-export const useListWorkspaceSshCertificates = ({- offset,- limit,- projectId-}: {- offset: number;- limit: number;- projectId: string;-}) => {- return useQuery({- queryKey: projectKeys.specificProjectSshCertificates({- offset,- limit,- projectId- }),- queryFn: async () => {- const params = new URLSearchParams({- offset: String(offset),- limit: String(limit)- });-- const { data } = await apiRequest.get<{- certificates: TSshCertificate[];- totalCount: number;- }>(`/api/v1/projects/${projectId}/ssh-certificates`, {- params- });- return data;- },- enabled: Boolean(projectId)- });-};--export const useListWorkspaceSshCas = (projectId: string) => {- return useQuery({- queryKey: projectKeys.getProjectSshCas(projectId),- queryFn: async () => {- const {- data: { cas }- } = await apiRequest.get<{ cas: Omit<TSshCertificateAuthority, "publicKey">[] }>(- `/api/v1/projects/${projectId}/ssh-cas`- );- return cas;- },- enabled: Boolean(projectId)- });-};--export const useListWorkspaceSshHosts = (projectId: string) => {- return useQuery({- queryKey: projectKeys.getProjectSshHosts(projectId),- queryFn: async () => {- const {- data: { hosts }- } = await apiRequest.get<{ hosts: TSshHost[] }>(`/api/v1/projects/${projectId}/ssh-hosts`);- return hosts;- },- enabled: Boolean(projectId)- });-};-export const useListWorkspacePkiSubscribers = (projectId: string) => {return useQuery({queryKey: projectKeys.getProjectPkiSubscribers(projectId),@@ -845,34 +779,6 @@ export const useListWorkspacePkiSubscribers = (projectId: string) => {});};-export const useListWorkspaceSshHostGroups = (projectId: string) => {- return useQuery({- queryKey: projectKeys.getProjectSshHostGroups(projectId),- queryFn: async () => {- const {- data: { groups }- } = await apiRequest.get<{ groups: (TSshHostGroup & { hostCount: number })[] }>(- `/api/v1/projects/${projectId}/ssh-host-groups`- );- return groups;- },- enabled: Boolean(projectId)- });-};--export const useListWorkspaceSshCertificateTemplates = (projectId: string) => {- return useQuery({- queryKey: projectKeys.getProjectSshCertificateTemplates(projectId),- queryFn: async () => {- const { data } = await apiRequest.get<{ certificateTemplates: TSshCertificateTemplate[] }>(- `/api/v1/projects/${projectId}/ssh-certificate-templates`- );- return data;- },- enabled: Boolean(projectId)- });-};-export const useGetWorkspaceWorkflowIntegrationConfig = ({projectId,integration@@ -900,17 +806,3 @@ export const useGetWorkspaceWorkflowIntegrationConfig = ({enabled: Boolean(projectId)});};--export const useGetProjectSshConfig = (projectId: string) => {- return useQuery({- queryKey: projectKeys.getProjectSshConfig(projectId),- queryFn: async () => {- const { data } = await apiRequest.get<TProjectSshConfig>(- `/api/v1/projects/${projectId}/ssh-config`- );-- return data;- },- enabled: Boolean(projectId)- });-};diff --git a/frontend/src/hooks/api/projects/query-keys.tsx b/frontend/src/hooks/api/projects/query-keys.tsxindex cbdeaa3930..0267cabd2e 100644--- a/frontend/src/hooks/api/projects/query-keys.tsx+++ b/frontend/src/hooks/api/projects/query-keys.tsx@@ -145,23 +145,5 @@ export const projectKeys = {getProjectWorkflowIntegrationConfig: (projectId: string,integration: WorkflowIntegrationPlatform- ) => [{ projectId, integration }, "project-workflow-integration-config"] as const,- getProjectSshCas: (projectId: string) => [{ projectId }, "project-ssh-cas"] as const,- allProjectSshCertificates: (projectId: string) =>- [{ projectId }, "project-ssh-certificates"] as const,- getProjectSshHosts: (projectId: string) => [{ projectId }, "project-ssh-hosts"] as const,- getProjectSshHostGroups: (projectId: string) =>- [{ projectId }, "project-ssh-host-groups"] as const,- specificProjectSshCertificates: ({- offset,- limit,- projectId- }: {- offset: number;- limit: number;- projectId: string;- }) => [...projectKeys.allProjectSshCertificates(projectId), { offset, limit }] as const,- getProjectSshCertificateTemplates: (projectId: string) =>- [{ projectId }, "project-ssh-certificate-templates"] as const,- getProjectSshConfig: (projectId: string) => [{ projectId }, "project-ssh-config"] as const+ ) => [{ projectId, integration }, "project-workflow-integration-config"] as const};diff --git a/frontend/src/hooks/api/projects/types.ts b/frontend/src/hooks/api/projects/types.tsindex 2ffcd08a97..bb8f168dd1 100644--- a/frontend/src/hooks/api/projects/types.ts+++ b/frontend/src/hooks/api/projects/types.ts@@ -12,10 +12,8 @@ export enum ProjectType {SecretManager = "secret-manager",CertificateManager = "cert-manager",KMS = "kms",- SSH = "ssh",SecretScanning = "secret-scanning",- PAM = "pam",- AI = "ai"+ PAM = "pam"}export enum ProjectUserMembershipTemporaryMode {@@ -206,21 +204,6 @@ export type TSearchProjectsDTO = {orderDirection?: OrderByDirection;};-export type TProjectSshConfig = {- id: string;- createdAt: string;- updatedAt: string;- projectId: string;- defaultUserSshCaId: string | null;- defaultHostSshCaId: string | null;-};--export type TUpdateProjectSshConfigDTO = {- projectId: string;- defaultUserSshCaId?: string;- defaultHostSshCaId?: string;-};-export type TPermissionAuditSourceType = "role" | "group_role" | "additional_privilege";export type TPermissionAuditSource = {diff --git a/frontend/src/hooks/api/roles/types.ts b/frontend/src/hooks/api/roles/types.tsindex 3a6f72ff0b..56aba5f80d 100644--- a/frontend/src/hooks/api/roles/types.ts+++ b/frontend/src/hooks/api/roles/types.ts@@ -4,7 +4,6 @@ export enum ProjectMembershipRole {Custom = "custom",Viewer = "viewer",NoAccess = "no-access",- SshHostBootstrapper = "ssh-host-bootstrapper",KmsCryptographicOperator = "cryptographic-operator"}diff --git a/frontend/src/hooks/api/sshCa/index.tsx b/frontend/src/hooks/api/sshCa/index.tsxdeleted file mode 100644index 8fc57654b0..0000000000--- a/frontend/src/hooks/api/sshCa/index.tsx+++ /dev/null@@ -1,9 +0,0 @@-export { SshCaStatus } from "./constants";-export {- useCreateSshCa,- useDeleteSshCa,- useIssueSshCreds,- useSignSshKey,- useUpdateSshCa-} from "./mutations";-export { useGetSshCaById, useGetSshCaCertTemplates } from "./queries";diff --git a/frontend/src/hooks/api/sshCa/mutations.tsx b/frontend/src/hooks/api/sshCa/mutations.tsxdeleted file mode 100644index fc6c43ef40..0000000000--- a/frontend/src/hooks/api/sshCa/mutations.tsx+++ /dev/null@@ -1,101 +0,0 @@-import { useMutation, useQueryClient } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { projectKeys } from "../projects/query-keys";-import {- TCreateSshCaDTO,- TDeleteSshCaDTO,- TIssueSshCredsDTO,- TIssueSshCredsResponse,- TSignSshKeyDTO,- TSignSshKeyResponse,- TSshCertificateAuthority,- TUpdateSshCaDTO-} from "./types";--export const sshCaKeys = {- getSshCaById: (caId: string) => [{ caId }, "ssh-ca"]-};--export const useCreateSshCa = () => {- const queryClient = useQueryClient();- return useMutation<TSshCertificateAuthority, object, TCreateSshCaDTO>({- mutationFn: async (body) => {- const {- data: { ca }- } = await apiRequest.post<{ ca: TSshCertificateAuthority }>("/api/v1/ssh/ca/", body);- return ca;- },- onSuccess: ({ projectId }) => {- queryClient.invalidateQueries({ queryKey: projectKeys.getProjectSshCas(projectId) });- }- });-};--export const useUpdateSshCa = () => {- const queryClient = useQueryClient();- return useMutation<TSshCertificateAuthority, object, TUpdateSshCaDTO>({- mutationFn: async ({ caId, ...body }) => {- const {- data: { ca }- } = await apiRequest.patch<{ ca: TSshCertificateAuthority }>(`/api/v1/ssh/ca/${caId}`, body);- return ca;- },- onSuccess: ({ projectId }, { caId }) => {- queryClient.invalidateQueries({ queryKey: projectKeys.getProjectSshCas(projectId) });- queryClient.invalidateQueries({ queryKey: sshCaKeys.getSshCaById(caId) });- }- });-};--export const useDeleteSshCa = () => {- const queryClient = useQueryClient();- return useMutation<TSshCertificateAuthority, object, TDeleteSshCaDTO>({- mutationFn: async ({ caId }) => {- const {- data: { ca }- } = await apiRequest.delete<{ ca: TSshCertificateAuthority }>(`/api/v1/ssh/ca/${caId}`);- return ca;- },- onSuccess: ({ projectId }) => {- queryClient.invalidateQueries({ queryKey: projectKeys.getProjectSshCas(projectId) });- }- });-};--export const useSignSshKey = () => {- const queryClient = useQueryClient();- return useMutation<TSignSshKeyResponse, object, TSignSshKeyDTO>({- mutationFn: async (body) => {- const { data } = await apiRequest.post<TSignSshKeyResponse>(- "/api/v1/ssh/certificates/sign",- body- );- return data;- },- onSuccess: (_, { projectId }) => {- queryClient.invalidateQueries({- queryKey: projectKeys.allProjectSshCertificates(projectId)- });- }- });-};--export const useIssueSshCreds = () => {- const queryClient = useQueryClient();- return useMutation<TIssueSshCredsResponse, object, TIssueSshCredsDTO>({- mutationFn: async (body) => {- const { data } = await apiRequest.post<TIssueSshCredsResponse>(- "/api/v1/ssh/certificates/issue",- body- );- return data;- },- onSuccess: (_, { projectId }) => {- queryClient.invalidateQueries({- queryKey: projectKeys.allProjectSshCertificates(projectId)- });- }- });-};diff --git a/frontend/src/hooks/api/sshCa/queries.tsx b/frontend/src/hooks/api/sshCa/queries.tsxdeleted file mode 100644index b85bbcb359..0000000000--- a/frontend/src/hooks/api/sshCa/queries.tsx+++ /dev/null@@ -1,37 +0,0 @@-import { useQuery } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { TSshCertificateTemplate } from "../sshCertificateTemplates/types";-import { TSshCertificateAuthority } from "./types";--export const sshCaKeys = {- getSshCaById: (caId: string) => [{ caId }, "ssh-ca"],- getSshCaCertTemplates: (caId: string) => [{ caId }, "ssh-ca-cert-templates"]-};--export const useGetSshCaById = (caId: string) => {- return useQuery({- queryKey: sshCaKeys.getSshCaById(caId),- queryFn: async () => {- const {- data: { ca }- } = await apiRequest.get<{ ca: TSshCertificateAuthority }>(`/api/v1/ssh/ca/${caId}`);- return ca;- },- enabled: Boolean(caId)- });-};--export const useGetSshCaCertTemplates = (caId: string) => {- return useQuery({- queryKey: sshCaKeys.getSshCaCertTemplates(caId),- queryFn: async () => {- const { data } = await apiRequest.get<{- certificateTemplates: TSshCertificateTemplate[];- }>(`/api/v1/ssh/ca/${caId}/certificate-templates`);- return data;- },- enabled: Boolean(caId)- });-};diff --git a/frontend/src/hooks/api/sshCa/types.ts b/frontend/src/hooks/api/sshCa/types.tsdeleted file mode 100644index f145332900..0000000000--- a/frontend/src/hooks/api/sshCa/types.ts+++ /dev/null@@ -1,84 +0,0 @@-import { SshCaKeySource, SshCaStatus, SshCertKeyAlgorithm, SshCertType } from "./constants";--export type TSshCertificate = {- id: string;- sshCaId: string;- sshCertificateTemplateId: string;- serialNumber: string;- certType: SshCertType;- principals: string[];- keyId: string;- notBefore: string;- notAfter: string;-};--export type TSshCertificateAuthority = {- id: string;- projectId: string;- status: SshCaStatus;- friendlyName: string;- keyAlgorithm: SshCertKeyAlgorithm;- keySource: SshCaKeySource;- createdAt: string;- updatedAt: string;- publicKey: string;-};--export type TCreateSshCaDTO =- | {- projectId: string;- friendlyName?: string;- keySource: SshCaKeySource.INTERNAL;- keyAlgorithm: SshCertKeyAlgorithm;- }- | {- projectId: string;- friendlyName?: string;- keySource: SshCaKeySource.EXTERNAL;- keyAlgorithm: SshCertKeyAlgorithm;- publicKey: string;- privateKey: string;- };--export type TUpdateSshCaDTO = {- caId: string;- friendlyName?: string;- status?: SshCaStatus;-};--export type TDeleteSshCaDTO = {- caId: string;-};--export type TSignSshKeyDTO = {- projectId: string;- certificateTemplateId: string;- publicKey?: string;- certType: SshCertType;- principals: string[];- ttl?: string;- keyId?: string;-};--export type TSignSshKeyResponse = {- serialNumber: string;- signedKey: string;-};--export type TIssueSshCredsDTO = {- projectId: string;- certificateTemplateId: string;- keyAlgorithm: SshCertKeyAlgorithm;- certType: SshCertType;- principals: string[];- ttl?: string;- keyId?: string;-};--export type TIssueSshCredsResponse = {- serialNumber: string;- signedKey: string;- privateKey: string;- publicKey: string;- keyAlgorithm: SshCertKeyAlgorithm;-};diff --git a/frontend/src/hooks/api/sshCertificateTemplates/index.tsx b/frontend/src/hooks/api/sshCertificateTemplates/index.tsxdeleted file mode 100644index 9efe99c819..0000000000--- a/frontend/src/hooks/api/sshCertificateTemplates/index.tsx+++ /dev/null@@ -1,7 +0,0 @@-export {- useCreateSshCertTemplate,- useDeleteSshCertTemplate,- useUpdateSshCertTemplate-} from "./mutations";-export { useGetSshCertTemplate } from "./queries";-export * from "./types";diff --git a/frontend/src/hooks/api/sshCertificateTemplates/mutations.tsx b/frontend/src/hooks/api/sshCertificateTemplates/mutations.tsxdeleted file mode 100644index 73e109f216..0000000000--- a/frontend/src/hooks/api/sshCertificateTemplates/mutations.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { useMutation, useQueryClient } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { sshCaKeys } from "../sshCa/queries";-import {- TCreateSshCertificateTemplateDTO,- TDeleteSshCertificateTemplateDTO,- TSshCertificateTemplate,- TUpdateSshCertificateTemplateDTO-} from "./types";--export const useCreateSshCertTemplate = () => {- const queryClient = useQueryClient();- return useMutation<TSshCertificateTemplate, object, TCreateSshCertificateTemplateDTO>({- mutationFn: async (data) => {- const { data: certificateTemplate } = await apiRequest.post<TSshCertificateTemplate>(- "/api/v1/ssh/certificate-templates",- data- );- return certificateTemplate;- },- onSuccess: ({ sshCaId }) => {- queryClient.invalidateQueries({ queryKey: sshCaKeys.getSshCaCertTemplates(sshCaId) });- }- });-};--export const useUpdateSshCertTemplate = () => {- const queryClient = useQueryClient();- return useMutation<TSshCertificateTemplate, object, TUpdateSshCertificateTemplateDTO>({- mutationFn: async (data) => {- const { data: certificateTemplate } = await apiRequest.patch<TSshCertificateTemplate>(- `/api/v1/ssh/certificate-templates/${data.id}`,- data- );-- return certificateTemplate;- },- onSuccess: ({ sshCaId }) => {- queryClient.invalidateQueries({ queryKey: sshCaKeys.getSshCaCertTemplates(sshCaId) });- }- });-};--export const useDeleteSshCertTemplate = () => {- const queryClient = useQueryClient();- return useMutation<TSshCertificateTemplate, object, TDeleteSshCertificateTemplateDTO>({- mutationFn: async (data) => {- const { data: certificateTemplate } = await apiRequest.delete<TSshCertificateTemplate>(- `/api/v1/ssh/certificate-templates/${data.id}`- );- return certificateTemplate;- },- onSuccess: ({ sshCaId }) => {- queryClient.invalidateQueries({ queryKey: sshCaKeys.getSshCaCertTemplates(sshCaId) });- }- });-};diff --git a/frontend/src/hooks/api/sshCertificateTemplates/queries.tsx b/frontend/src/hooks/api/sshCertificateTemplates/queries.tsxdeleted file mode 100644index b9b5359169..0000000000--- a/frontend/src/hooks/api/sshCertificateTemplates/queries.tsx+++ /dev/null@@ -1,22 +0,0 @@-import { useQuery } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { TSshCertificateTemplate } from "./types";--export const certTemplateKeys = {- getSshCertTemplateById: (id: string) => [{ id }, "ssh-cert-template"]-};--export const useGetSshCertTemplate = (id: string) => {- return useQuery({- queryKey: certTemplateKeys.getSshCertTemplateById(id),- queryFn: async () => {- const { data: certificateTemplate } = await apiRequest.get<TSshCertificateTemplate>(- `/api/v1/ssh/certificate-templates/${id}`- );- return certificateTemplate;- },- enabled: Boolean(id)- });-};diff --git a/frontend/src/hooks/api/sshCertificateTemplates/types.ts b/frontend/src/hooks/api/sshCertificateTemplates/types.tsdeleted file mode 100644index 4099b4b8ad..0000000000--- a/frontend/src/hooks/api/sshCertificateTemplates/types.ts+++ /dev/null@@ -1,47 +0,0 @@-export enum SshCertTemplateStatus {- ACTIVE = "active",- DISABLED = "disabled"-}--export type TSshCertificateTemplate = {- id: string;- sshCaId: string;- status: SshCertTemplateStatus;- name: string;- ttl: string;- maxTTL: string;- allowedUsers: string[];- allowedHosts: string[];- allowUserCertificates: boolean;- allowHostCertificates: boolean;- allowCustomKeyIds: boolean;-};--export type TCreateSshCertificateTemplateDTO = {- sshCaId: string;- name: string;- ttl: string;- maxTTL: string;- allowedUsers: string[];- allowedHosts: string[];- allowUserCertificates: boolean;- allowHostCertificates: boolean;- allowCustomKeyIds: boolean;-};--export type TUpdateSshCertificateTemplateDTO = {- id: string;- status?: SshCertTemplateStatus;- name?: string;- ttl?: string;- maxTTL?: string;- allowedUsers?: string[];- allowedHosts?: string[];- allowUserCertificates?: boolean;- allowHostCertificates?: boolean;- allowCustomKeyIds?: boolean;-};--export type TDeleteSshCertificateTemplateDTO = {- id: string;-};diff --git a/frontend/src/hooks/api/sshHost/index.tsx b/frontend/src/hooks/api/sshHost/index.tsxdeleted file mode 100644index a4e4da4e16..0000000000--- a/frontend/src/hooks/api/sshHost/index.tsx+++ /dev/null@@ -1,2 +0,0 @@-export { useCreateSshHost, useDeleteSshHost, useUpdateSshHost } from "./mutations";-export { fetchSshHostUserCaPublicKey, useGetSshHostById } from "./queries";diff --git a/frontend/src/hooks/api/sshHost/mutations.tsx b/frontend/src/hooks/api/sshHost/mutations.tsxdeleted file mode 100644index 0c1b67103a..0000000000--- a/frontend/src/hooks/api/sshHost/mutations.tsx+++ /dev/null@@ -1,45 +0,0 @@-import { useMutation, useQueryClient } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { projectKeys } from "../projects/query-keys";-import { TCreateSshHostDTO, TDeleteSshHostDTO, TSshHost, TUpdateSshHostDTO } from "./types";--export const useCreateSshHost = () => {- const queryClient = useQueryClient();- return useMutation<TSshHost, object, TCreateSshHostDTO>({- mutationFn: async (body) => {- const { data: host } = await apiRequest.post("/api/v1/ssh/hosts", body);- return host;- },- onSuccess: ({ projectId }) => {- queryClient.invalidateQueries({ queryKey: projectKeys.getProjectSshHosts(projectId) });- }- });-};--export const useUpdateSshHost = () => {- const queryClient = useQueryClient();- return useMutation<TSshHost, object, TUpdateSshHostDTO>({- mutationFn: async ({ sshHostId, ...body }) => {- const { data: host } = await apiRequest.patch(`/api/v1/ssh/hosts/${sshHostId}`, body);- return host;- },- onSuccess: ({ projectId }) => {- queryClient.invalidateQueries({ queryKey: projectKeys.getProjectSshHosts(projectId) });- }- });-};--export const useDeleteSshHost = () => {- const queryClient = useQueryClient();- return useMutation<TSshHost, object, TDeleteSshHostDTO>({- mutationFn: async ({ sshHostId }) => {- const { data: host } = await apiRequest.delete(`/api/v1/ssh/hosts/${sshHostId}`);- return host;- },- onSuccess: ({ projectId }) => {- queryClient.invalidateQueries({ queryKey: projectKeys.getProjectSshHosts(projectId) });- }- });-};diff --git a/frontend/src/hooks/api/sshHost/queries.tsx b/frontend/src/hooks/api/sshHost/queries.tsxdeleted file mode 100644index 33974e0de7..0000000000--- a/frontend/src/hooks/api/sshHost/queries.tsx+++ /dev/null@@ -1,28 +0,0 @@-import { useQuery } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { TSshHost } from "./types";--export const sshHostKeys = {- getSshHostById: (sshHostId: string) => [{ sshHostId }, "ssh-host"],- getSshHostUserCaPublicKey: (sshHostId: string) => [{ sshHostId }, "ssh-host-user-ca-public-key"]-};--export const useGetSshHostById = (sshHostId: string) => {- return useQuery({- queryKey: sshHostKeys.getSshHostById(sshHostId),- queryFn: async () => {- const { data: sshHost } = await apiRequest.get<TSshHost>(`/api/v1/ssh/hosts/${sshHostId}`);- return sshHost;- },- enabled: Boolean(sshHostId)- });-};--export const fetchSshHostUserCaPublicKey = async (sshHostId: string): Promise<string> => {- const { data } = await apiRequest.get<string>(- `/api/v1/ssh/hosts/${sshHostId}/user-ca-public-key`- );- return data;-};diff --git a/frontend/src/hooks/api/sshHost/types.ts b/frontend/src/hooks/api/sshHost/types.tsdeleted file mode 100644index ba44bdde37..0000000000--- a/frontend/src/hooks/api/sshHost/types.ts+++ /dev/null@@ -1,45 +0,0 @@-export enum LoginMappingSource {- HOST = "host",- HOST_GROUP = "hostGroup"-}--export type TLoginMapping = {- loginUser: string;- allowedPrincipals: {- usernames?: string[];- groups?: string[];- };- source: LoginMappingSource;-};--export type TSshHost = {- id: string;- projectId: string;- hostname: string;- alias: string | null;- userCertTtl: string;- hostCertTtl: string;- loginMappings: TLoginMapping[];-};--export type TCreateSshHostDTO = {- projectId: string;- hostname: string;- alias?: string;- userCertTtl?: string;- hostCertTtl?: string;- loginMappings: Omit<TLoginMapping, "source">[];-};--export type TUpdateSshHostDTO = {- sshHostId: string;- hostname?: string;- alias?: string;- userCertTtl?: string;- hostCertTtl?: string;- loginMappings?: Omit<TLoginMapping, "source">[];-};--export type TDeleteSshHostDTO = {- sshHostId: string;-};diff --git a/frontend/src/hooks/api/sshHostGroup/index.tsx b/frontend/src/hooks/api/sshHostGroup/index.tsxdeleted file mode 100644index b131e1611d..0000000000--- a/frontend/src/hooks/api/sshHostGroup/index.tsx+++ /dev/null@@ -1,8 +0,0 @@-export {- useAddHostToSshHostGroup,- useCreateSshHostGroup,- useDeleteSshHostGroup,- useRemoveHostFromSshHostGroup,- useUpdateSshHostGroup-} from "./mutations";-export { useGetSshHostGroupById, useListSshHostGroupHosts } from "./queries";diff --git a/frontend/src/hooks/api/sshHostGroup/mutations.tsx b/frontend/src/hooks/api/sshHostGroup/mutations.tsxdeleted file mode 100644index fa9eebb07e..0000000000--- a/frontend/src/hooks/api/sshHostGroup/mutations.tsx+++ /dev/null@@ -1,105 +0,0 @@-import { useMutation, useQueryClient } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { projectKeys } from "../projects/query-keys";-import { sshHostGroupKeys } from "./queries";-import {- TCreateSshHostGroupDTO,- TDeleteSshHostGroupDTO,- TSshHostGroup,- TUpdateSshHostGroupDTO-} from "./types";--export const useCreateSshHostGroup = () => {- const queryClient = useQueryClient();- return useMutation<TSshHostGroup, object, TCreateSshHostGroupDTO>({- mutationFn: async (body) => {- const { data: hostGroup } = await apiRequest.post("/api/v1/ssh/host-groups", body);- return hostGroup;- },- onSuccess: ({ projectId, id }) => {- queryClient.invalidateQueries({- queryKey: projectKeys.getProjectSshHostGroups(projectId)- });- queryClient.invalidateQueries({- queryKey: sshHostGroupKeys.getSshHostGroupById(id)- });- }- });-};--export const useUpdateSshHostGroup = () => {- const queryClient = useQueryClient();- return useMutation<TSshHostGroup, object, TUpdateSshHostGroupDTO>({- mutationFn: async ({ sshHostGroupId, ...body }) => {- const { data: hostGroup } = await apiRequest.patch(- `/api/v1/ssh/host-groups/${sshHostGroupId}`,- body- );- return hostGroup;- },- onSuccess: ({ projectId }, { sshHostGroupId }) => {- queryClient.invalidateQueries({- queryKey: projectKeys.getProjectSshHostGroups(projectId)- });- queryClient.invalidateQueries({- queryKey: projectKeys.getProjectSshHosts(projectId)- });- queryClient.invalidateQueries({- queryKey: sshHostGroupKeys.getSshHostGroupById(sshHostGroupId)- });- }- });-};--export const useDeleteSshHostGroup = () => {- const queryClient = useQueryClient();- return useMutation<TSshHostGroup, object, TDeleteSshHostGroupDTO>({- mutationFn: async ({ sshHostGroupId }) => {- const { data: hostGroup } = await apiRequest.delete(- `/api/v1/ssh/host-groups/${sshHostGroupId}`- );- return hostGroup;- },- onSuccess: ({ projectId }, { sshHostGroupId }) => {- queryClient.invalidateQueries({- queryKey: projectKeys.getProjectSshHostGroups(projectId)- });- queryClient.invalidateQueries({- queryKey: projectKeys.getProjectSshHosts(projectId)- });- queryClient.invalidateQueries({- queryKey: sshHostGroupKeys.getSshHostGroupById(sshHostGroupId)- });- }- });-};--export const useAddHostToSshHostGroup = () => {- const queryClient = useQueryClient();- return useMutation<void, object, { sshHostGroupId: string; sshHostId: string }>({- mutationFn: async ({ sshHostGroupId, sshHostId }) => {- await apiRequest.post(`/api/v1/ssh/host-groups/${sshHostGroupId}/hosts/${sshHostId}`);- },- onSuccess: (_, { sshHostGroupId }) => {- queryClient.invalidateQueries({- queryKey: sshHostGroupKeys.forSshHostGroupHosts(sshHostGroupId)- });- }- });-};--export const useRemoveHostFromSshHostGroup = () => {- const queryClient = useQueryClient();- return useMutation<void, object, { sshHostGroupId: string; sshHostId: string }>({- mutationFn: async ({ sshHostGroupId, sshHostId }) => {- await apiRequest.delete(`/api/v1/ssh/host-groups/${sshHostGroupId}/hosts/${sshHostId}`);- },- onSuccess: (_, { sshHostGroupId }) => {- queryClient.invalidateQueries({- queryKey: sshHostGroupKeys.forSshHostGroupHosts(sshHostGroupId)- });- }- });-};diff --git a/frontend/src/hooks/api/sshHostGroup/queries.tsx b/frontend/src/hooks/api/sshHostGroup/queries.tsxdeleted file mode 100644index 8be42dd7b2..0000000000--- a/frontend/src/hooks/api/sshHostGroup/queries.tsx+++ /dev/null@@ -1,60 +0,0 @@-import { useQuery } from "@tanstack/react-query";--import { apiRequest } from "@app/config/request";--import { EHostGroupMembershipFilter, TListSshHostGroupHostsResponse, TSshHostGroup } from "./types";--export const sshHostGroupKeys = {- getSshHostGroupById: (sshHostGroupId: string) => [{ sshHostGroupId }, "ssh-host-group"],- allSshHostGroupHosts: () => ["ssh-host-group-hosts"] as const,- forSshHostGroupHosts: (sshHostGroupId: string) =>- [...sshHostGroupKeys.allSshHostGroupHosts(), sshHostGroupId] as const,- specificSshHostGroupHosts: ({- sshHostGroupId,- filter- }: {- sshHostGroupId: string;- filter?: EHostGroupMembershipFilter;- }) => [...sshHostGroupKeys.forSshHostGroupHosts(sshHostGroupId), { filter }] as const-};--export const useGetSshHostGroupById = (sshHostGroupId: string) => {- return useQuery({- queryKey: sshHostGroupKeys.getSshHostGroupById(sshHostGroupId),- queryFn: async () => {- const { data: sshHostGroup } = await apiRequest.get<TSshHostGroup>(- `/api/v1/ssh/host-groups/${sshHostGroupId}`- );- return sshHostGroup;- },- enabled: Boolean(sshHostGroupId)- });-};--export const useListSshHostGroupHosts = ({- sshHostGroupId,- filter-}: {- sshHostGroupId: string;- filter?: EHostGroupMembershipFilter;-}) => {- return useQuery({- queryKey: sshHostGroupKeys.specificSshHostGroupHosts({ sshHostGroupId, filter }),- queryFn: async () => {- const params = new URLSearchParams({- ...(filter ? { filter } : {})- });-- const { data } = await apiRequest.get<TListSshHostGroupHostsResponse>(- `/api/v1/ssh/host-groups/${sshHostGroupId}/hosts`,- {- params- }- );- return data;- },- enabled: Boolean(sshHostGroupId),- staleTime: 0,- gcTime: 0- });-};diff --git a/frontend/src/hooks/api/sshHostGroup/types.ts b/frontend/src/hooks/api/sshHostGroup/types.tsdeleted file mode 100644index 6e193c8b65..0000000000--- a/frontend/src/hooks/api/sshHostGroup/types.ts+++ /dev/null@@ -1,34 +0,0 @@-import { TLoginMapping, TSshHost } from "../sshHost/types";--export type TSshHostGroup = {- id: string;- projectId: string;- name: string;- loginMappings: Omit<TLoginMapping, "source">[];-};--export type TCreateSshHostGroupDTO = {- projectId: string;- name: string;- loginMappings: Omit<TLoginMapping, "source">[];-};--export type TUpdateSshHostGroupDTO = {- sshHostGroupId: string;- name?: string;- loginMappings?: Omit<TLoginMapping, "source">[];-};--export type TDeleteSshHostGroupDTO = {- sshHostGroupId: string;-};--export type TListSshHostGroupHostsResponse = {- hosts: (TSshHost & { joinedGroupAt: string; isPartOfGroup: boolean })[];- totalCount: number;-};--export enum EHostGroupMembershipFilter {- GROUP_MEMBERS = "group-members",- NON_GROUP_MEMBERS = "non-group-members"-}diff --git a/frontend/src/hooks/api/subscriptions/types.ts b/frontend/src/hooks/api/subscriptions/types.tsindex a52d41a0fa..008f67dbc6 100644--- a/frontend/src/hooks/api/subscriptions/types.ts+++ b/frontend/src/hooks/api/subscriptions/types.ts@@ -38,7 +38,6 @@ export type SubscriptionPlan = {workspacesUsed: number;environmentLimit: number;samlSSO: boolean;- sshHostGroups: boolean;secretAccessInsights: boolean;auditReports: boolean;hsm: boolean;diff --git a/frontend/src/layouts/AILayout/AILayout.tsx b/frontend/src/layouts/AILayout/AILayout.tsxdeleted file mode 100644index 7703a3241f..0000000000--- a/frontend/src/layouts/AILayout/AILayout.tsx+++ /dev/null@@ -1,18 +0,0 @@-import { Outlet } from "@tanstack/react-router";--import { useProjectPermission } from "@app/context";--import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";--export const AILayout = () => {- const { assumedPrivilegeDetails } = useProjectPermission();-- return (- <div className="flex h-full w-full flex-col overflow-x-hidden">- {assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}- <div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">- <Outlet />- </div>- </div>- );-};diff --git a/frontend/src/layouts/AILayout/index.ts b/frontend/src/layouts/AILayout/index.tsdeleted file mode 100644index 9d881930c3..0000000000--- a/frontend/src/layouts/AILayout/index.ts+++ /dev/null@@ -1 +0,0 @@-export { AILayout } from "./AILayout";diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AINav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AINav.tsxdeleted file mode 100644index b9bb9edf9d..0000000000--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AINav.tsx+++ /dev/null@@ -1,21 +0,0 @@-import { FileText, Settings, Shield, Terminal } from "lucide-react";--import { ProjectNavList } from "./ProjectNavLink";-import { MCP_SUBMENU, PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";-import type { NavItem, Submenu } from "./types";--export const AINav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {- const items: NavItem[] = [- { label: "MCP", icon: Terminal, pathSuffix: "overview", submenu: MCP_SUBMENU },- {- label: "Access Control",- icon: Shield,- pathSuffix: "access-management",- activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,- submenu: PROJECT_ACCESS_CONTROL_SUBMENU- },- { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },- { label: "Settings", icon: Settings, pathSuffix: "settings" }- ];- return <ProjectNavList items={items} onSubmenuOpen={onSubmenuOpen} />;-};diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsxindex 307dd6c844..9aa9c4f24c 100644--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx@@ -8,18 +8,15 @@ import { useOrganization, useProject } from "@app/context";import { hasIntermediateProjectsView, projectTypeToUrlSlug } from "@app/helpers/project";import { ProjectType } from "@app/hooks/api/projects/types";-import { AINav } from "./AINav";import { CertManagerNav } from "./CertManagerNav";import { KmsNav } from "./KmsNav";import { PamNav } from "./PamNav";import { SecretManagerNav } from "./SecretManagerNav";import { SecretScanningNav } from "./SecretScanningNav";-import { SshNav } from "./SshNav";import {CERT_APPROVALS_SUBMENU,CERT_CERTIFICATES_SUBMENU,CERT_INTEGRATIONS_SUBMENU,- MCP_SUBMENU,PROJECT_ACCESS_CONTROL_SUBMENU,SECRET_SCANNING_SETTINGS_SUBMENU,SM_SETTINGS_SUBMENU@@ -35,9 +32,7 @@ const PROJECT_NAV_COMPONENT: Record<[ProjectType.SecretManager]: SecretManagerNav,[ProjectType.KMS]: KmsNav,[ProjectType.CertificateManager]: CertManagerNav,- [ProjectType.SSH]: SshNav,[ProjectType.PAM]: PamNav,- [ProjectType.AI]: AINav,[ProjectType.SecretScanning]: SecretScanningNav};@@ -69,7 +64,6 @@ export const ProjectNav = () => {Boolean(pathname.match(/\/groups\/|\/identities\/|\/members\/|\/roles\//));const isOnIntegrations = pathname.includes("/integrations");const isOnProjectSettings = /\/settings(\/|\?|$)/.test(pathname);- const isOnMcpOverview = currentProject.type === ProjectType.AI && pathname.includes("/overview");const isCertManager = currentProject.type === ProjectType.CertificateManager;const isOnCertPolicies = isCertManager && pathname.includes("/policies");const isOnCertApprovals = isCertManager && pathname.includes("/approvals");@@ -88,7 +82,6 @@ export const ProjectNav = () => {return SM_SETTINGS_SUBMENU;if (isOnProjectSettings && currentProject.type === ProjectType.SecretScanning)return SECRET_SCANNING_SETTINGS_SUBMENU;- if (isOnMcpOverview) return MCP_SUBMENU;if (isOnCertPolicies) return CERT_CERTIFICATES_SUBMENU;if (isOnCertApprovals) return CERT_APPROVALS_SUBMENU;return null;diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SshNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SshNav.tsxdeleted file mode 100644index 2d632f111b..0000000000--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/SshNav.tsx+++ /dev/null@@ -1,58 +0,0 @@-import { FileText, Server, Settings, Shield, ShieldCheck } from "lucide-react";--import { ProjectPermissionCan } from "@app/components/permissions";-import { SidebarMenu } from "@app/components/v3";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";--import { ProjectNavLink } from "./ProjectNavLink";-import { PROJECT_ACCESS_CONTROL_SUBMENU } from "./submenus";-import type { NavItem, Submenu } from "./types";--export const SshNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {- const items: NavItem[] = [- { label: "Hosts", icon: Server, pathSuffix: "overview", activeMatch: /\/ssh-host-groups\// },- {- label: "Certificate Authorities",- icon: ShieldCheck,- pathSuffix: "cas",- activeMatch: /\/ca\//,- permissionCheck: true- },- {- label: "Access Control",- icon: Shield,- pathSuffix: "access-management",- activeMatch: /\/groups\/|\/identities\/|\/members\/|\/roles\//,- submenu: PROJECT_ACCESS_CONTROL_SUBMENU- },- { label: "Audit Logs", icon: FileText, pathSuffix: "audit-logs" },- { label: "Settings", icon: Settings, pathSuffix: "settings" }- ];-- return (- <SidebarMenu>- {items- .filter((i) => !i.hidden)- .map((item) => {- if (item.permissionCheck) {- return (- <ProjectPermissionCan- key={item.label}- I={ProjectPermissionActions.Read}- a={ProjectPermissionSub.SshCertificateAuthorities}- >- {(isAllowed) => (isAllowed ? <ProjectNavLink item={item} /> : null)}- </ProjectPermissionCan>- );- }- return (- <ProjectNavLink- key={item.label}- item={item}- onSubmenuOpen={item.submenu ? onSubmenuOpen : undefined}- />- );- })}- </SidebarMenu>- );-};diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.tsindex 6186eba27a..424937d436 100644--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts@@ -5,7 +5,6 @@ import {Cog,FileCheck,FileKey,- FileText,HardDrive,IdCardLanyard,Layers,@@ -14,7 +13,6 @@ import {Plug,ScanSearch,Search,- Server,Shield,Tag,User,@@ -131,16 +129,3 @@ export const SECRET_SCANNING_SETTINGS_SUBMENU: Submenu = {{ label: "Scanning Settings", icon: ScanSearch, tab: "scanning-settings" }]};--// --- AI submenus -----export const MCP_SUBMENU: Submenu = {- title: "MCP",- pathSuffix: "overview",- defaultTab: "mcp-endpoints",- items: [- { label: "MCP Endpoints", icon: Server, tab: "mcp-endpoints" },- { label: "MCP Servers", icon: HardDrive, tab: "mcp-servers" },- { label: "Activity Logs", icon: FileText, tab: "activity-logs" }- ]-};diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.tsindex f7837dda11..9bf958623f 100644--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts@@ -3,11 +3,9 @@ import { ProjectType } from "@app/hooks/api/projects/types";export const PROJECT_TYPE_PATH: Record<ProjectType, string> = {[ProjectType.SecretManager]: "secret-management",[ProjectType.CertificateManager]: "cert-manager",- [ProjectType.SSH]: "ssh",[ProjectType.KMS]: "kms",[ProjectType.PAM]: "pam",- [ProjectType.SecretScanning]: "secret-scanning",- [ProjectType.AI]: "ai"+ [ProjectType.SecretScanning]: "secret-scanning"};export type SubmenuItem = {@@ -37,8 +35,6 @@ export type NavItem = {badgeVariant?: "warning" | "danger" | "pam";hidden?: boolean;submenu?: Submenu;- /** For SSH CA permission gating */- permissionCheck?: boolean;/** Query params to append to the link and use for active state matching */search?: Record<string, string>;/** When true, this item is also active when the path matches but search keys are absent from the URL */diff --git a/frontend/src/layouts/SshLayout/SshLayout.tsx b/frontend/src/layouts/SshLayout/SshLayout.tsxdeleted file mode 100644index 20abd7f598..0000000000--- a/frontend/src/layouts/SshLayout/SshLayout.tsx+++ /dev/null@@ -1,18 +0,0 @@-import { Outlet } from "@tanstack/react-router";--import { useProjectPermission } from "@app/context";--import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";--export const SshLayout = () => {- const { assumedPrivilegeDetails } = useProjectPermission();-- return (- <div className="flex h-full w-full flex-col overflow-x-hidden">- {assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}- <div className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4">- <Outlet />- </div>- </div>- );-};diff --git a/frontend/src/layouts/SshLayout/index.tsx b/frontend/src/layouts/SshLayout/index.tsxdeleted file mode 100644index 3652c45cb3..0000000000--- a/frontend/src/layouts/SshLayout/index.tsx+++ /dev/null@@ -1 +0,0 @@-export { SshLayout } from "./SshLayout";diff --git a/frontend/src/lib/fn/permission.ts b/frontend/src/lib/fn/permission.tsindex 67c97a9e06..91e42e33ea 100644--- a/frontend/src/lib/fn/permission.ts+++ b/frontend/src/lib/fn/permission.ts@@ -142,7 +142,6 @@ const PERMISSION_DISPLAY_NAMES: Record<string, string> = {[ProjectPermissionSub.SecretApproval]: "Secret Approval Policies",[ProjectPermissionSub.SecretApprovalRequest]: "Secret Approval Requests",[ProjectPermissionSub.Identity]: "Machine Identity Management",- [ProjectPermissionSub.SshHosts]: "SSH Hosts",[ProjectPermissionSub.PkiSubscribers]: "PKI Subscribers",[ProjectPermissionSub.CertificateTemplates]: "Certificate Templates",[ProjectPermissionSub.CertificateAuthorities]: "Certificate Authorities",@@ -150,7 +149,6 @@ const PERMISSION_DISPLAY_NAMES: Record<string, string> = {[ProjectPermissionSub.CertificateProfiles]: "Certificate Profiles",[ProjectPermissionSub.CertificatePolicies]: "Certificate Policies",[ProjectPermissionSub.AppConnections]: "App Connections",- [ProjectPermissionSub.McpEndpoints]: "MCP Endpoints",[ProjectPermissionSub.HoneyTokens]: "Honey Tokens",[ProjectPermissionSub.ProxiedServices]: "Proxied Services",[ProjectPermissionSub.Role]: "Roles",diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/MCPEndpointDetailPage.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/MCPEndpointDetailPage.tsxdeleted file mode 100644index 903dcd0a00..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/MCPEndpointDetailPage.tsx+++ /dev/null@@ -1,213 +0,0 @@-import { useState } from "react";-import { Helmet } from "react-helmet";-import {- faBan,- faChevronLeft,- faEllipsisV,- faNetworkWired-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { useNavigate, useParams } from "@tanstack/react-router";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button,- ContentLoader,- DeleteActionModal,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState-} from "@app/components/v2";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context";-import { useDeleteAiMcpEndpoint, useGetAiMcpEndpointById } from "@app/hooks/api";--import { EditMCPEndpointModal } from "../MCPPage/components/MCPEndpointsTab/EditMCPEndpointModal";-import {- MCPEndpointConnectedServersSection,- MCPEndpointConnectionSection,- MCPEndpointDetailsSection,- MCPEndpointFiltersSection,- MCPEndpointToolSelectionSection-} from "./components";--const PageContent = () => {- const navigate = useNavigate();- const params = useParams({- strict: false- }) as { endpointId?: string; projectId?: string; orgId?: string };-- const { endpointId, projectId, orgId } = params;-- const [isEditModalOpen, setIsEditModalOpen] = useState(false);- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);-- const { data: mcpEndpoint, isPending } = useGetAiMcpEndpointById({- endpointId: endpointId!- });-- const deleteEndpoint = useDeleteAiMcpEndpoint();-- if (isPending) {- return (- <div className="flex h-full w-full items-center justify-center">- <ContentLoader />- </div>- );- }-- if (!mcpEndpoint) {- return (- <div className="flex h-full w-full items-center justify-center px-20">- <EmptyState- className="max-w-2xl rounded-md text-center"- icon={faBan}- title={`Could not find MCP Endpoint with ID ${endpointId}`}- />- </div>- );- }-- const handleBack = () => {- navigate({- to: "/organizations/$orgId/projects/ai/$projectId/overview",- params: { orgId: orgId!, projectId: projectId! }- });- };-- const handleDeleteConfirm = async () => {- if (!mcpEndpoint) return;-- try {- await deleteEndpoint.mutateAsync({ endpointId: mcpEndpoint.id });- createNotification({- text: `MCP endpoint "${mcpEndpoint.name}" deleted successfully`,- type: "success"- });- handleBack();- } catch (error) {- console.error("Failed to delete MCP endpoint:", error);- createNotification({- text: "Failed to delete MCP endpoint",- type: "error"- });- }- };-- return (- <div className="container mx-auto flex max-w-7xl flex-col px-6 py-6 text-mineshaft-50">- <button- type="button"- onClick={handleBack}- className="mb-4 flex w-fit items-center gap-1 text-sm text-bunker-300 hover:text-primary-400"- >- <FontAwesomeIcon icon={faChevronLeft} className="text-xs" />- MCP Endpoints- </button>-- <div className="mb-6 flex items-center justify-between">- <div className="flex items-center gap-4">- <div className="flex h-12 w-12 items-center justify-center rounded-lg bg-mineshaft-700">- <FontAwesomeIcon icon={faNetworkWired} className="text-xl text-primary" />- </div>- <div>- <h1 className="text-2xl font-semibold text-mineshaft-100">{mcpEndpoint.name}</h1>- <p className="text-sm text-bunker-300">MCP Endpoint</p>- </div>- </div>- <div className="flex items-center gap-3">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="outline" size="sm" colorSchema="secondary">- <FontAwesomeIcon icon={faEllipsisV} />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" sideOffset={6}>- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Edit}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={() => setIsEditModalOpen(true)}- isDisabled={!isAllowed}- >- Edit Endpoint- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Delete}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={() => setIsDeleteModalOpen(true)}- className="text-red-500"- isDisabled={!isAllowed}- >- Delete Endpoint- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </div>- </div>-- <div className="flex gap-6">- {/* Left Column - Details, Filters, Connection, Connected Servers */}- <div className="flex w-96 flex-col gap-4">- <MCPEndpointDetailsSection- endpoint={mcpEndpoint}- onEdit={() => setIsEditModalOpen(true)}- />- <MCPEndpointFiltersSection endpoint={mcpEndpoint} />- <MCPEndpointConnectionSection endpoint={mcpEndpoint} />- <MCPEndpointConnectedServersSection- endpointId={mcpEndpoint.id}- projectId={mcpEndpoint.projectId}- serverIds={mcpEndpoint.serverIds}- />- </div>-- {/* Right Column - Usage Statistics & Tool Selection */}- <div className="flex flex-1 flex-col gap-4">- <MCPEndpointToolSelectionSection- endpointId={mcpEndpoint.id}- projectId={mcpEndpoint.projectId}- serverIds={mcpEndpoint.serverIds}- />- </div>- </div>-- <EditMCPEndpointModal- isOpen={isEditModalOpen}- onOpenChange={setIsEditModalOpen}- endpoint={mcpEndpoint}- />-- <DeleteActionModal- isOpen={isDeleteModalOpen}- title={`Delete MCP Endpoint ${mcpEndpoint.name}?`}- onChange={(isOpen) => setIsDeleteModalOpen(isOpen)}- deleteKey={mcpEndpoint.name}- onDeleteApproved={handleDeleteConfirm}- />- </div>- );-};--export const MCPEndpointDetailPage = () => {- return (- <>- <Helmet>- <title>MCP Endpoint | Infisical</title>- <link rel="icon" href="/infisical.ico" />- </Helmet>- <PageContent />- </>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointConnectedServersSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointConnectedServersSection.tsxdeleted file mode 100644index d3367bc8c4..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointConnectedServersSection.tsx+++ /dev/null@@ -1,202 +0,0 @@-import { useState } from "react";-import { faCheck, faPencil, faServer, faTimes } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { Checkbox, IconButton, Spinner } from "@app/components/v2";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context";-import { useListAiMcpServers, useUpdateAiMcpEndpoint } from "@app/hooks/api";--type Props = {- endpointId: string;- projectId: string;- serverIds: string[];-};--export const MCPEndpointConnectedServersSection = ({ endpointId, projectId, serverIds }: Props) => {- const [isEditing, setIsEditing] = useState(false);- const [selectedServerIds, setSelectedServerIds] = useState<string[]>(serverIds);-- const { data: serversData, isLoading: isLoadingServers } = useListAiMcpServers({ projectId });- const updateEndpoint = useUpdateAiMcpEndpoint();-- const servers = serversData?.servers || [];- const connectedServers = servers.filter((server) => serverIds.includes(server.id));-- const handleServerToggle = (serverId: string) => {- setSelectedServerIds((current) =>- current.includes(serverId) ? current.filter((id) => id !== serverId) : [...current, serverId]- );- };-- const handleStartEdit = () => {- setSelectedServerIds(serverIds);- setIsEditing(true);- };-- const handleCancel = () => {- setSelectedServerIds(serverIds);- setIsEditing(false);- };-- const handleSave = async () => {- try {- await updateEndpoint.mutateAsync({- endpointId,- serverIds: selectedServerIds- });-- createNotification({- text: "Connected servers updated successfully",- type: "success"- });-- setIsEditing(false);- } catch (error) {- console.error("Failed to update connected servers:", error);- createNotification({- text: "Failed to update connected servers",- type: "error"- });- }- };-- return (- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">MCP Servers</h3>- {isEditing ? (- <div className="flex items-center gap-1">- <IconButton- ariaLabel="Cancel"- variant="plain"- size="sm"- onClick={handleCancel}- isDisabled={updateEndpoint.isPending}- >- <FontAwesomeIcon- icon={faTimes}- className="text-bunker-300 hover:text-mineshaft-100"- />- </IconButton>- <IconButton- ariaLabel="Save"- variant="plain"- size="sm"- onClick={handleSave}- isDisabled={updateEndpoint.isPending}- >- {updateEndpoint.isPending ? (- <Spinner size="xs" />- ) : (- <FontAwesomeIcon- icon={faCheck}- className="text-primary-500 hover:text-primary-400"- />- )}- </IconButton>- </div>- ) : (- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Edit}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <IconButton- ariaLabel="Edit connected servers"- variant="plain"- size="sm"- onClick={handleStartEdit}- isDisabled={!isAllowed}- >- <FontAwesomeIcon- icon={faPencil}- className="text-bunker-300 hover:text-mineshaft-100"- />- </IconButton>- )}- </ProjectPermissionCan>- )}- </div>- <div className="space-y-2">- {isEditing && (- <>- {isLoadingServers && <p className="text-sm text-bunker-400">Loading servers...</p>}- {!isLoadingServers && servers.length === 0 && (- <div className="flex flex-col items-center py-4 text-center">- <FontAwesomeIcon icon={faServer} className="mb-2 text-2xl text-bunker-400" />- <p className="text-sm text-bunker-400">No MCP servers available</p>- <p className="text-xs text-bunker-500">- Add MCP servers first to connect them to this endpoint- </p>- </div>- )}- {!isLoadingServers &&- servers.map((server) => (- <div- key={server.id}- className="flex items-start gap-3 rounded-md p-2 transition-colors hover:bg-mineshaft-700"- >- <Checkbox- id={`server-${server.id}`}- className="mt-0.5"- isChecked={selectedServerIds.includes(server.id)}- onCheckedChange={() => handleServerToggle(server.id)}- isDisabled={updateEndpoint.isPending}- />- <label- htmlFor={`server-${server.id}`}- className="flex flex-1 cursor-pointer items-start gap-2"- >- <FontAwesomeIcon icon={faServer} className="mt-0.5 text-sm text-bunker-400" />- <div className="flex-1">- <p className="text-sm text-mineshaft-200">{server.name}</p>- {server.description && (- <p className="text-xs text-bunker-400">{server.description}</p>- )}- </div>- </label>- <div- className={`mt-1 h-2 w-2 rounded-full ${- server.status === "active" ? "bg-emerald-500" : "bg-red-500"- }`}- />- </div>- ))}- {selectedServerIds.length > 0 && (- <p className="mt-1 text-xs text-bunker-400">- {selectedServerIds.length} server{selectedServerIds.length !== 1 ? "s" : ""}{" "}- selected- </p>- )}- </>- )}- {!isEditing && connectedServers.length === 0 && (- <p className="py-2 text-sm text-bunker-400">No servers connected</p>- )}- {!isEditing &&- connectedServers.length > 0 &&- connectedServers.map((server) => (- <div- key={server.id}- className="flex items-center gap-3 rounded-md p-2 transition-colors hover:bg-mineshaft-700"- >- <FontAwesomeIcon icon={faServer} className="text-sm text-bunker-400" />- <div className="flex-1">- <p className="text-sm text-mineshaft-200">{server.name}</p>- {server.description && (- <p className="text-xs text-bunker-400">{server.description}</p>- )}- </div>- <div- className={`h-2 w-2 rounded-full ${- server.status === "active" ? "bg-emerald-500" : "bg-red-500"- }`}- />- </div>- ))}- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointConnectionSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointConnectionSection.tsxdeleted file mode 100644index 68c85e00fe..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointConnectionSection.tsx+++ /dev/null@@ -1,282 +0,0 @@-import { useEffect, useState } from "react";-import { faCheck, faCopy, faKey, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- GenericFieldLabel,- IconButton,- Input,- Modal,- ModalContent,- Tooltip-} from "@app/components/v2";-import { useToggle } from "@app/hooks";-import { TAiMcpEndpointWithServerIds } from "@app/hooks/api";--type Props = {- endpoint: TAiMcpEndpointWithServerIds;-};--type AuthToken = {- id: string;- name: string;- token: string;- createdAt: string;-};--const STORAGE_KEY_PREFIX = "mcp_endpoint_tokens_";--const SHOW_AUTH_TOKENS_SECTION = false;--export const MCPEndpointConnectionSection = ({ endpoint }: Props) => {- const [isCopied, setIsCopied] = useToggle(false);- const [isCreateModalOpen, setIsCreateModalOpen] = useToggle(false);- const [tokenName, setTokenName] = useState("");- const [authTokens, setAuthTokens] = useState<AuthToken[]>([]);- const [copiedTokenId, setCopiedTokenId] = useState<string | null>(null);- const [hasLoaded, setHasLoaded] = useState(false);-- const endpointUrl = `${window.location.origin}/api/v1/ai/mcp/endpoints/${endpoint.id}/connect`;- const storageKey = `${STORAGE_KEY_PREFIX}${endpoint.id}`;-- // Load tokens from localStorage on mount- useEffect(() => {- const stored = localStorage.getItem(storageKey);- if (stored) {- try {- setAuthTokens(JSON.parse(stored));- } catch (e) {- console.error("Failed to parse stored tokens", e);- }- }- setHasLoaded(true);- }, [storageKey]);-- // Save tokens to localStorage whenever they change (after initial load)- useEffect(() => {- if (hasLoaded) {- localStorage.setItem(storageKey, JSON.stringify(authTokens));- }- }, [authTokens, storageKey, hasLoaded]);-- const handleCopy = () => {- navigator.clipboard.writeText(endpointUrl);- setIsCopied.on();- createNotification({- text: "Endpoint URL copied to clipboard",- type: "info"- });- setTimeout(() => setIsCopied.off(), 2000);- };-- const generateToken = () => {- const prefix = "mcp_";- const randomPart =- Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);- return `${prefix}${randomPart}`;- };-- const handleCreateToken = () => {- if (!tokenName.trim()) {- createNotification({- text: "Please enter a token name",- type: "error"- });- return;- }-- const newToken: AuthToken = {- id: Math.random().toString(36).substring(2, 15),- name: tokenName.trim(),- token: generateToken(),- createdAt: new Date().toISOString()- };-- setAuthTokens([newToken, ...authTokens]);- setTokenName("");- setIsCreateModalOpen.off();-- createNotification({- text: "Authentication token created successfully",- type: "success"- });- };-- const handleDeleteToken = (tokenId: string) => {- setAuthTokens(authTokens.filter((t) => t.id !== tokenId));- createNotification({- text: "Authentication token deleted",- type: "info"- });- };-- const handleCopyToken = (token: string, tokenId: string) => {- navigator.clipboard.writeText(token);- setCopiedTokenId(tokenId);- createNotification({- text: "Token copied to clipboard",- type: "info"- });- setTimeout(() => setCopiedTokenId(null), 2000);- };-- const formatDate = (dateString: string) => {- const date = new Date(dateString);- return date.toLocaleDateString("en-US", {- year: "numeric",- month: "2-digit",- day: "2-digit",- hour: "2-digit",- minute: "2-digit",- hour12: true- });- };-- const truncateToken = (token: string) => {- if (token.length <= 12) return token;- return `${token.substring(0, 12)}...`;- };-- return (- <>- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Connection</h3>- </div>- <div className="space-y-3">- <GenericFieldLabel label="Endpoint">- <div className="flex items-center gap-2">- <div className="flex-1 overflow-hidden rounded border border-mineshaft-500 bg-mineshaft-700">- <code className="block overflow-x-auto px-3 py-2 font-mono text-sm whitespace-nowrap text-mineshaft-200">- {endpointUrl}- </code>- </div>- <Tooltip content={isCopied ? "Copied!" : "Copy URL"}>- <IconButton- ariaLabel="Copy endpoint URL"- variant="outline_bg"- size="sm"- onClick={handleCopy}- >- <FontAwesomeIcon icon={isCopied ? faCheck : faCopy} />- </IconButton>- </Tooltip>- </div>- </GenericFieldLabel>-- {SHOW_AUTH_TOKENS_SECTION && (- <div className="space-y-3 border-t border-mineshaft-500 pt-3">- <div className="flex items-center justify-between">- <div className="flex items-center gap-2 text-sm text-mineshaft-300">- <FontAwesomeIcon icon={faKey} className="text-xs" />- <span>Authentication Tokens</span>- </div>- <Button- variant="outline_bg"- size="xs"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={setIsCreateModalOpen.on}- >- Create- </Button>- </div>-- {authTokens.length > 0 && (- <div className="space-y-2">- {authTokens.map((token) => (- <div- key={token.id}- className="flex items-center justify-between rounded border border-mineshaft-600 bg-mineshaft-800 px-3 py-2.5"- >- <div className="min-w-0 flex-1">- <div className="flex items-center justify-between">- <h4 className="truncate text-sm font-medium text-mineshaft-100">- {token.name}- </h4>- <Tooltip content="Delete token">- <IconButton- ariaLabel="Delete token"- variant="plain"- size="xs"- onClick={() => handleDeleteToken(token.id)}- className="text-red-500 hover:text-red-400"- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>- </Tooltip>- </div>- <p className="mt-0.5 text-xs text-mineshaft-400">- Created {formatDate(token.createdAt)}- </p>- <div className="mt-1.5 flex items-center gap-2">- <code className="font-mono text-xs text-mineshaft-300">- {truncateToken(token.token)}- </code>- <Tooltip content={copiedTokenId === token.id ? "Copied!" : "Copy token"}>- <button- type="button"- onClick={() => handleCopyToken(token.token, token.id)}- className="text-mineshaft-400 transition-colors hover:text-mineshaft-200"- >- <FontAwesomeIcon- icon={copiedTokenId === token.id ? faCheck : faCopy}- className="text-xs"- />- </button>- </Tooltip>- </div>- </div>- </div>- ))}- </div>- )}-- {authTokens.length === 0 && (- <p className="py-2 text-xs text-mineshaft-400 italic">- No authentication tokens created yet- </p>- )}- </div>- )}- </div>- </div>-- <Modal- isOpen={isCreateModalOpen}- onOpenChange={(open) => !open && setIsCreateModalOpen.off()}- >- <ModalContent- title="Create Authentication Token"- subTitle="Create a new token for MCP clients without OAuth support"- >- <form- onSubmit={(e) => {- e.preventDefault();- handleCreateToken();- }}- >- <FormControl label="Token Name" isRequired>- <Input- value={tokenName}- onChange={(e) => setTokenName(e.target.value)}- placeholder="e.g., Production AI Agent"- autoFocus- />- </FormControl>- <div className="mt-6 flex items-center gap-2">- <Button type="submit" colorSchema="primary" isDisabled={!tokenName.trim()}>- Create Token- </Button>- <Button variant="outline_bg" onClick={setIsCreateModalOpen.off}>- Cancel- </Button>- </div>- </form>- </ModalContent>- </Modal>- </>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsxdeleted file mode 100644index 21155f6442..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsx+++ /dev/null@@ -1,174 +0,0 @@-import { useEffect, useState } from "react";-import { faEdit } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { format } from "date-fns";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- GenericFieldLabel,- IconButton,- Input,- Select,- SelectItem,- Switch-} from "@app/components/v2";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context";-import { TAiMcpEndpointWithServerIds } from "@app/hooks/api";--type Props = {- endpoint: TAiMcpEndpointWithServerIds;- onEdit: VoidFunction;-};--type RateLimitSettings = {- enabled: boolean;- limit: number;- timeUnit: "minute" | "hour" | "day";-};--const RATE_LIMIT_STORAGE_KEY_PREFIX = "mcp_endpoint_rate_limit_";--const getStatusLabel = (status: string | null) => {- const labels: Record<string, string> = {- active: "Active",- inactive: "Inactive"- };- return labels[status || "inactive"] || "Unknown";-};--const getStatusColor = (status: string | null) => {- const colors: Record<string, string> = {- active: "bg-emerald-500",- inactive: "bg-red-500"- };- return colors[status || "inactive"] || "bg-red-500";-};--const SHOW_RATE_LIMITING_SECTION = false;--export const MCPEndpointDetailsSection = ({ endpoint, onEdit }: Props) => {- const [rateLimitSettings, setRateLimitSettings] = useState<RateLimitSettings>({- enabled: false,- limit: 100,- timeUnit: "hour"- });- const [hasLoadedRateLimit, setHasLoadedRateLimit] = useState(false);-- const rateLimitStorageKey = `${RATE_LIMIT_STORAGE_KEY_PREFIX}${endpoint.id}`;-- // Load rate limit settings from localStorage on mount- useEffect(() => {- const stored = localStorage.getItem(rateLimitStorageKey);- if (stored) {- try {- setRateLimitSettings(JSON.parse(stored));- } catch (e) {- console.error("Failed to parse stored rate limit settings", e);- }- }- setHasLoadedRateLimit(true);- }, [rateLimitStorageKey]);-- // Save rate limit settings to localStorage whenever they change- useEffect(() => {- if (hasLoadedRateLimit) {- localStorage.setItem(rateLimitStorageKey, JSON.stringify(rateLimitSettings));- }- }, [rateLimitSettings, rateLimitStorageKey, hasLoadedRateLimit]);-- const handleRateLimitToggle = (checked: boolean) => {- setRateLimitSettings((prev) => ({ ...prev, enabled: checked }));- createNotification({- text: `Rate limiting ${checked ? "enabled" : "disabled"}`,- type: "success"- });- };-- const handleRateLimitChange = (limit: string) => {- const numLimit = parseInt(limit, 10);- if (!Number.isNaN(numLimit) && numLimit > 0) {- setRateLimitSettings((prev) => ({ ...prev, limit: numLimit }));- }- };-- const handleTimeUnitChange = (timeUnit: string) => {- setRateLimitSettings((prev) => ({- ...prev,- timeUnit: timeUnit as "minute" | "hour" | "day"- }));- };-- return (- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Details</h3>- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Edit}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <IconButton- variant="plain"- colorSchema="secondary"- ariaLabel="Edit endpoint details"- onClick={onEdit}- isDisabled={!isAllowed}- >- <FontAwesomeIcon icon={faEdit} />- </IconButton>- )}- </ProjectPermissionCan>- </div>- <div className="space-y-3">- <GenericFieldLabel label="Name">{endpoint.name}</GenericFieldLabel>- <GenericFieldLabel label="Description">- {endpoint.description || <span className="text-bunker-400">No description</span>}- </GenericFieldLabel>- <GenericFieldLabel label="Status">- <div className="flex items-center gap-2">- <div className={`h-2 w-2 rounded-full ${getStatusColor(endpoint.status)}`} />- {getStatusLabel(endpoint.status)}- </div>- </GenericFieldLabel>- <GenericFieldLabel label="Created">- {format(new Date(endpoint.createdAt), "yyyy-MM-dd, hh:mm aaa")}- </GenericFieldLabel>- {SHOW_RATE_LIMITING_SECTION && (- <div className="border-t border-mineshaft-500 pt-3">- <div className="flex items-start justify-between">- <div className="flex flex-col gap-0.5">- <div className="flex items-center gap-2">- <span className="text-sm font-medium text-mineshaft-200">Rate Limiting</span>- </div>- <span className="text-xs text-bunker-400">Limit tool invocations per user</span>- </div>- <Switch- id={`rate-limiting-${endpoint.id}`}- isChecked={rateLimitSettings.enabled}- onCheckedChange={handleRateLimitToggle}- />- </div>-- {rateLimitSettings.enabled && (- <div className="mt-3 grid grid-cols-2 gap-3">- <Input- type="number"- value={rateLimitSettings.limit.toString()}- onChange={(e) => handleRateLimitChange(e.target.value)}- min={1}- placeholder="100"- />- <Select value={rateLimitSettings.timeUnit} onValueChange={handleTimeUnitChange}>- <SelectItem value="minute">per minute</SelectItem>- <SelectItem value="hour">per hour</SelectItem>- <SelectItem value="day">per day</SelectItem>- </Select>- </div>- )}- </div>- )}- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointFiltersSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointFiltersSection.tsxdeleted file mode 100644index f15fbafe6f..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointFiltersSection.tsx+++ /dev/null@@ -1,104 +0,0 @@-import { useState } from "react";-import { faEdit } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { ProjectPermissionCan } from "@app/components/permissions";-import { GenericFieldLabel, IconButton, Tooltip } from "@app/components/v2";-import { Badge } from "@app/components/v3";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context";-import { TAiMcpEndpointWithServerIds } from "@app/hooks/api";--import { PiiFilterConfigModal } from "./PiiFilterConfigModal";--type Props = {- endpoint: TAiMcpEndpointWithServerIds;-};--const PII_ENTITY_LABELS: Record<string, string> = {- EMAIL: "Email",- PHONE: "Phone",- SSN: "SSN",- CREDIT_CARD: "Credit Card",- IP_ADDRESS: "IP Address"-};--export const MCPEndpointFiltersSection = ({ endpoint }: Props) => {- const [isConfigModalOpen, setIsConfigModalOpen] = useState(false);-- const piiEntityTypes = endpoint.piiEntityTypes || [];- const displayedTypes = piiEntityTypes.slice(0, 3);- const remainingTypes = piiEntityTypes.slice(3);- const remainingCount = remainingTypes.length;-- return (- <>- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Filters</h3>- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Edit}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <IconButton- variant="plain"- colorSchema="secondary"- ariaLabel="Edit filter settings"- onClick={() => setIsConfigModalOpen(true)}- isDisabled={!isAllowed}- >- <FontAwesomeIcon icon={faEdit} />- </IconButton>- )}- </ProjectPermissionCan>- </div>- <div className="space-y-3">- <GenericFieldLabel label="Requests">- <div className="flex items-center gap-2">- <div- className={`h-2 w-2 rounded-full ${endpoint.piiRequestFiltering ? "bg-emerald-500" : "bg-red-500"}`}- />- {endpoint.piiRequestFiltering ? "Enabled" : "Disabled"}- </div>- </GenericFieldLabel>- <GenericFieldLabel label="Responses">- <div className="flex items-center gap-2">- <div- className={`h-2 w-2 rounded-full ${endpoint.piiResponseFiltering ? "bg-emerald-500" : "bg-red-500"}`}- />- {endpoint.piiResponseFiltering ? "Enabled" : "Disabled"}- </div>- </GenericFieldLabel>- <GenericFieldLabel label="Identifiers">- {piiEntityTypes.length > 0 ? (- <div className="flex flex-wrap items-center gap-1">- {displayedTypes.map((type) => (- <Badge key={type} variant="info">- {PII_ENTITY_LABELS[type] || type}- </Badge>- ))}- {remainingCount > 0 && (- <Tooltip- content={remainingTypes.map((t) => PII_ENTITY_LABELS[t] || t).join(", ")}- >- <span className="cursor-default text-xs text-bunker-400">- +{remainingCount}- </span>- </Tooltip>- )}- </div>- ) : (- <span className="text-bunker-400">No identifiers selected</span>- )}- </GenericFieldLabel>- </div>- </div>-- <PiiFilterConfigModal- isOpen={isConfigModalOpen}- onOpenChange={setIsConfigModalOpen}- endpoint={endpoint}- />- </>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointToolSelectionSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointToolSelectionSection.tsxdeleted file mode 100644index c7534c2f44..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointToolSelectionSection.tsx+++ /dev/null@@ -1,285 +0,0 @@-import { useMemo, useState } from "react";-import {- faChevronDown,- faChevronUp,- faInfoCircle,- faMagnifyingGlass,- faServer-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { Input, Switch, Tooltip } from "@app/components/v2";-import {- ProjectPermissionMcpEndpointActions,- ProjectPermissionSub,- useProjectPermission-} from "@app/context";-import {- TAiMcpEndpointToolConfig,- TAiMcpServerTool,- useBulkUpdateEndpointTools,- useDisableEndpointTool,- useEnableEndpointTool,- useListAiMcpServers,- useListAiMcpServerTools,- useListEndpointTools-} from "@app/hooks/api";--type Props = {- endpointId: string;- projectId: string;- serverIds: string[];-};--type ServerToolsSectionProps = {- serverId: string;- serverName: string;- serverStatus: string;- searchQuery: string;- toolConfigs: TAiMcpEndpointToolConfig[];- onToolToggle: (serverToolId: string, isEnabled: boolean) => void;- onToggleAllTools: (tools: TAiMcpServerTool[], enableAll: boolean) => void;- isUpdating: boolean;- canEdit: boolean;-};--const ServerToolsSection = ({- serverId,- serverName,- serverStatus,- searchQuery,- toolConfigs,- onToolToggle,- onToggleAllTools,- isUpdating,- canEdit-}: ServerToolsSectionProps) => {- const [isExpanded, setIsExpanded] = useState(false);-- const { data: toolsData } = useListAiMcpServerTools({ serverId });- const tools = toolsData?.tools || [];-- // Create a set of enabled tool IDs for quick lookup- // Presence in the list = enabled, absence = disabled- const enabledToolIds = useMemo(() => {- return new Set(toolConfigs.map((config) => config.aiMcpServerToolId));- }, [toolConfigs]);-- // Filter tools based on search query- const filteredTools = tools.filter(- (tool) =>- tool.name.toLowerCase().includes(searchQuery.toLowerCase()) ||- (tool.description && tool.description.toLowerCase().includes(searchQuery.toLowerCase()))- );-- // Count enabled tools- const enabledCount = tools.filter((tool) => enabledToolIds.has(tool.id)).length;- const totalCount = tools.length;-- // Count enabled filtered tools for the toggle all switch- const enabledFilteredCount = filteredTools.filter((tool) => enabledToolIds.has(tool.id)).length;- const allFilteredEnabled =- filteredTools.length > 0 && enabledFilteredCount === filteredTools.length;-- // Check if tool is enabled- const isToolEnabled = (toolId: string) => {- return enabledToolIds.has(toolId);- };-- const handleToggleAll = () => {- // If all filtered tools are enabled, disable them all; otherwise enable them all- const shouldEnableAll = !allFilteredEnabled;- onToggleAllTools(filteredTools, shouldEnableAll);- };-- if (filteredTools.length === 0 && searchQuery) {- return null; // Hide section if no tools match search- }-- return (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-800">- <button- type="button"- onClick={() => setIsExpanded(!isExpanded)}- className="flex w-full items-center justify-between px-4 py-3 text-left hover:bg-mineshaft-700"- >- <div className="flex items-center gap-3">- <FontAwesomeIcon icon={faServer} className="text-sm text-bunker-400" />- <span className="text-sm text-mineshaft-200">{serverName}</span>- <div- className={`h-2 w-2 rounded-full ${- serverStatus === "active" ? "bg-emerald-500" : "bg-red-500"- }`}- />- </div>- <div className="flex items-center gap-3">- <span className="rounded-full bg-primary/20 px-2 py-0.5 text-xs font-medium text-primary">- {enabledCount}/{totalCount} Enabled- </span>- <FontAwesomeIcon- icon={isExpanded ? faChevronUp : faChevronDown}- className="text-xs text-bunker-400"- />- </div>- </button>-- {isExpanded && filteredTools.length > 0 && (- <div className="border-t border-mineshaft-600">- <div className="grid grid-cols-[1fr_auto] items-center gap-2 border-b border-mineshaft-600 bg-mineshaft-700 px-4 py-2">- <span className="text-sm text-bunker-300">Enable all tools</span>- <Tooltip content={allFilteredEnabled ? "Disable all tools" : "Enable all tools"}>- <div>- <Switch- id={`toggle-all-${serverId}`}- isChecked={allFilteredEnabled}- onCheckedChange={handleToggleAll}- isDisabled={isUpdating || !canEdit}- />- </div>- </Tooltip>- </div>- <div className="grid grid-cols-[1fr_auto] items-center gap-2 border-b border-mineshaft-600 px-4 py-2 text-xs font-medium tracking-wider text-bunker-300 uppercase">- <span>Tool Name</span>- <span>Enabled</span>- </div>- <div className="divide-y divide-mineshaft-600">- {filteredTools.map((tool) => (- <div key={tool.id} className="grid grid-cols-[1fr_auto] items-center gap-2 px-4 py-3">- <div className="flex items-center gap-2">- <span className="font-mono text-sm text-mineshaft-200">{tool.name}</span>- {tool.description && (- <Tooltip content={tool.description}>- <FontAwesomeIcon- icon={faInfoCircle}- className="text-xs text-bunker-400 hover:text-bunker-300"- />- </Tooltip>- )}- </div>- <Switch- id={`tool-${tool.id}`}- isChecked={isToolEnabled(tool.id)}- onCheckedChange={(checked) => onToolToggle(tool.id, checked)}- isDisabled={isUpdating || !canEdit}- />- </div>- ))}- </div>- </div>- )}-- {isExpanded && tools.length === 0 && (- <div className="border-t border-mineshaft-600 px-4 py-4 text-center text-sm text-bunker-400">- No tools available from this server- </div>- )}- </div>- );-};--export const MCPEndpointToolSelectionSection = ({ endpointId, projectId, serverIds }: Props) => {- const [searchQuery, setSearchQuery] = useState("");-- const { permission } = useProjectPermission();- const canEdit = permission.can(- ProjectPermissionMcpEndpointActions.Edit,- ProjectPermissionSub.McpEndpoints- );-- const { data: serversData } = useListAiMcpServers({ projectId });- const { data: toolConfigs = [] } = useListEndpointTools({ endpointId });- const enableTool = useEnableEndpointTool();- const disableTool = useDisableEndpointTool();- const bulkUpdateTools = useBulkUpdateEndpointTools();-- const connectedServers =- serversData?.servers.filter((server) => serverIds.includes(server.id)) || [];-- const handleToolToggle = async (serverToolId: string, isEnabled: boolean) => {- try {- if (isEnabled) {- await enableTool.mutateAsync({ endpointId, serverToolId });- } else {- await disableTool.mutateAsync({ endpointId, serverToolId });- }- } catch (error) {- console.error("Failed to update tool:", error);- createNotification({- text: "Failed to update tool configuration",- type: "error"- });- }- };-- const handleToggleAllTools = async (tools: TAiMcpServerTool[], enableAll: boolean) => {- try {- await bulkUpdateTools.mutateAsync({- endpointId,- tools: tools.map((tool) => ({- serverToolId: tool.id,- isEnabled: enableAll- }))- });- } catch (error) {- console.error("Failed to update tools:", error);- createNotification({- text: "Failed to update tool configuration",- type: "error"- });- }- };-- const isUpdating = enableTool.isPending || disableTool.isPending || bulkUpdateTools.isPending;-- return (- <div className="flex w-full flex-col gap-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-4">- <div>- <h3 className="text-lg font-medium text-mineshaft-100">Tool Selection</h3>- <p className="mt-1 text-sm text-bunker-300">- Control which tools from connected MCP servers are available through this endpoint- </p>- </div>-- <div className="relative">- <FontAwesomeIcon- icon={faMagnifyingGlass}- className="absolute top-1/2 left-3 z-10 -translate-y-1/2 text-bunker-400"- />- <Input- value={searchQuery}- onChange={(e) => setSearchQuery(e.target.value)}- placeholder="Search tools..."- className="pl-10"- />- </div>-- <div className="space-y-3">- {connectedServers.length === 0 ? (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-800 px-4 py-8 text-center">- <FontAwesomeIcon icon={faServer} className="mb-2 text-2xl text-bunker-400" />- <p className="text-sm text-bunker-400">No MCP servers connected to this endpoint</p>- <p className="mt-1 text-xs text-bunker-400">- Connect servers to configure available tools- </p>- </div>- ) : (- connectedServers.map((server) => (- <ServerToolsSection- key={server.id}- serverId={server.id}- serverName={server.name}- serverStatus={server.status}- searchQuery={searchQuery}- toolConfigs={toolConfigs}- onToolToggle={handleToolToggle}- onToggleAllTools={handleToggleAllTools}- isUpdating={isUpdating}- canEdit={canEdit}- />- ))- )}- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsxdeleted file mode 100644index 04111f08c6..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsx+++ /dev/null@@ -1,164 +0,0 @@-import { useMemo } from "react";-import { faChartLine, faTools, faUsers } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { TAiMcpActivityLog, useListEndpointTools } from "@app/hooks/api";--type Props = {- endpointId: string;- endpointName: string;-};--type StatCardProps = {- icon: typeof faChartLine;- label: string;- value: string | number;- subtitle?: string;- trend?: {- value: number;- label: string;- };-};--const StatCard = ({ icon, label, value, subtitle, trend }: StatCardProps) => {- return (- <div className="flex flex-col gap-1.5">- <div className="flex items-center gap-2 text-bunker-300">- <FontAwesomeIcon icon={icon} className="text-sm" />- <span className="text-xs tracking-wide uppercase">{label}</span>- </div>- <div className="flex flex-col">- <div className="text-2xl font-semibold text-mineshaft-100">{value}</div>- {subtitle && <div className="text-xs text-bunker-300">{subtitle}</div>}- {trend && (- <div className={`text-xs ${trend.value >= 0 ? "text-emerald-500" : "text-red-500"}`}>- {trend.value >= 0 ? "+" : ""}- {trend.value} {trend.label}- </div>- )}- </div>- </div>- );-};--export const MCPEndpointUsageStatisticsSection = ({ endpointId, endpointName }: Props) => {- const activityLogs: TAiMcpActivityLog[] = [];- const { data: endpointTools = [] } = useListEndpointTools({ endpointId });-- const statistics = useMemo(() => {- // Filter logs for this specific endpoint- const endpointLogs = activityLogs.filter((log) => log.endpointName === endpointName);-- // Total requests- const totalRequests = endpointLogs.length;-- // Get unique tools used (from activity logs)- const uniqueTools = new Set(endpointLogs.map((log) => log.toolName));- const activeToolsCount = uniqueTools.size;-- // Total enabled tools for the endpoint- const totalEnabledTools = endpointTools.length;-- // Get unique actors (users)- const uniqueActors = new Set(endpointLogs.map((log) => log.actor));- const uniqueUsersCount = uniqueActors.size;-- // Calculate weekly trends (last 7 days)- const now = new Date();- const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);- const fourteenDaysAgo = new Date(now.getTime() - 14 * 24 * 60 * 60 * 1000);-- const lastWeekLogs = endpointLogs.filter((log) => new Date(log.createdAt) >= sevenDaysAgo);- const previousWeekLogs = endpointLogs.filter(- (log) => new Date(log.createdAt) >= fourteenDaysAgo && new Date(log.createdAt) < sevenDaysAgo- );-- // Calculate request trend- const lastWeekRequests = lastWeekLogs.length;- const previousWeekRequests = previousWeekLogs.length;-- let requestTrend: number | null = null;- let requestTrendLabel = "";-- if (previousWeekRequests > 0) {- // Show percentage change when there's a baseline- requestTrend = Math.round(- ((lastWeekRequests - previousWeekRequests) / previousWeekRequests) * 100- );- requestTrendLabel = "% from last week";- } else if (lastWeekRequests > 0) {- // Show absolute count when starting from zero- requestTrend = lastWeekRequests;- requestTrendLabel = "this week";- }-- // Calculate new users this week- const lastWeekActors = new Set(lastWeekLogs.map((log) => log.actor));- const previousActors = new Set(- endpointLogs.filter((log) => new Date(log.createdAt) < sevenDaysAgo).map((log) => log.actor)- );- const newUsersThisWeek = Array.from(lastWeekActors).filter(- (actor) => !previousActors.has(actor)- ).length;-- // Calculate active tools- const lastWeekTools = new Set(lastWeekLogs.map((log) => log.toolName));- const previousWeekTools = new Set(previousWeekLogs.map((log) => log.toolName));- const activeToolsThisWeek = lastWeekTools.size;- const activeToolsPreviousWeek = previousWeekTools.size;-- return {- totalRequests,- requestTrend,- requestTrendLabel,- activeToolsCount,- activeToolsThisWeek,- activeToolsPreviousWeek,- uniqueUsersCount,- newUsersThisWeek,- totalEnabledTools- };- }, [activityLogs, endpointName, endpointTools]);-- return (- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Usage Statistics</h3>- </div>- <div className="grid grid-cols-3 gap-4">- <StatCard- icon={faChartLine}- label="Total Requests"- value={statistics.totalRequests.toLocaleString()}- trend={- statistics.requestTrend !== null- ? {- value: statistics.requestTrend,- label: statistics.requestTrendLabel- }- : undefined- }- />- <StatCard- icon={faTools}- label="Active Tools"- value={statistics.activeToolsCount}- subtitle={`of ${statistics.totalEnabledTools} total`}- />- <StatCard- icon={faUsers}- label="Unique Users"- value={statistics.uniqueUsersCount}- trend={- statistics.newUsersThisWeek > 0- ? {- value: statistics.newUsersThisWeek,- label: "new this week"- }- : undefined- }- />- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/PiiFilterConfigModal.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/PiiFilterConfigModal.tsxdeleted file mode 100644index a83677a6e8..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/PiiFilterConfigModal.tsx+++ /dev/null@@ -1,142 +0,0 @@-import { useEffect, useRef, useState } from "react";--import { createNotification } from "@app/components/notifications";-import {- Button,- FilterableSelect,- Modal,- ModalClose,- ModalContent,- Switch-} from "@app/components/v2";-import { TAiMcpEndpointWithServerIds, useUpdateAiMcpEndpoint } from "@app/hooks/api";--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- endpoint: TAiMcpEndpointWithServerIds;-};--const PII_ENTITY_OPTIONS = [- { value: "EMAIL", label: "Email" },- { value: "PHONE", label: "Phone" },- { value: "SSN", label: "SSN" },- { value: "CREDIT_CARD", label: "Credit Card" },- { value: "IP_ADDRESS", label: "IP Address" }-];--export const PiiFilterConfigModal = ({ isOpen, onOpenChange, endpoint }: Props) => {- const modalContainer = useRef<HTMLDivElement>(null);- const updateEndpoint = useUpdateAiMcpEndpoint();-- const [piiRequestFiltering, setPiiRequestFiltering] = useState(- endpoint.piiRequestFiltering ?? false- );- const [piiResponseFiltering, setPiiResponseFiltering] = useState(- endpoint.piiResponseFiltering ?? false- );- const [selectedEntityTypes, setSelectedEntityTypes] = useState<- Array<{ value: string; label: string }>- >([]);-- // Sync state when endpoint changes or modal opens- useEffect(() => {- if (isOpen) {- setPiiRequestFiltering(endpoint.piiRequestFiltering ?? false);- setPiiResponseFiltering(endpoint.piiResponseFiltering ?? false);- const existingTypes = (endpoint.piiEntityTypes || [])- .map((type) => PII_ENTITY_OPTIONS.find((opt) => opt.value === type))- .filter((opt): opt is { value: string; label: string } => opt !== undefined);- setSelectedEntityTypes(existingTypes);- }- }, [isOpen, endpoint]);-- const handleSave = async () => {- try {- await updateEndpoint.mutateAsync({- endpointId: endpoint.id,- piiRequestFiltering,- piiResponseFiltering,- piiEntityTypes: selectedEntityTypes.map((opt) => opt.value)- });- createNotification({- text: "PII filter settings updated successfully",- type: "success"- });- onOpenChange(false);- } catch (error) {- console.error("Failed to update PII filter settings:", error);- createNotification({- text: "Failed to update PII filter settings",- type: "error"- });- }- };-- return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent ref={modalContainer} title="Configure PII Filters">- <div className="space-y-6">- <div className="space-y-4">- <div className="flex items-center justify-between">- <div>- <p className="text-sm font-medium text-mineshaft-200">Filter Requests</p>- <p className="text-xs text-bunker-400">- Redact PII from requests sent to MCP servers- </p>- </div>- <Switch- id="pii-request-filtering"- isChecked={piiRequestFiltering}- onCheckedChange={setPiiRequestFiltering}- />- </div>-- <div className="flex items-center justify-between">- <div>- <p className="text-sm font-medium text-mineshaft-200">Filter Responses</p>- <p className="text-xs text-bunker-400">- Redact PII from responses returned to clients- </p>- </div>- <Switch- id="pii-response-filtering"- isChecked={piiResponseFiltering}- onCheckedChange={setPiiResponseFiltering}- />- </div>- </div>-- <div className="border-t border-mineshaft-600 pt-4">- <p className="mb-3 text-sm font-medium text-mineshaft-200">PII Detection</p>- <FilterableSelect- isMulti- menuPortalTarget={modalContainer.current}- menuPlacement="bottom"- placeholder="Select PII types to detect..."- options={PII_ENTITY_OPTIONS}- value={selectedEntityTypes}- onChange={(newValue) =>- setSelectedEntityTypes(newValue as Array<{ value: string; label: string }>)- }- />- <p className="mt-2 text-xs text-bunker-400">- Select the types of personally identifiable information to redact- </p>- </div>-- <div className="flex justify-end gap-2 pt-2">- <ModalClose asChild>- <Button variant="plain" colorSchema="secondary">- Cancel- </Button>- </ModalClose>- <Button onClick={handleSave} isLoading={updateEndpoint.isPending}>- Save- </Button>- </div>- </div>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/index.ts b/frontend/src/pages/ai/MCPEndpointDetailPage/components/index.tsdeleted file mode 100644index dfbfb6f37a..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/index.ts+++ /dev/null@@ -1,6 +0,0 @@-export { MCPEndpointConnectedServersSection } from "./MCPEndpointConnectedServersSection";-export { MCPEndpointConnectionSection } from "./MCPEndpointConnectionSection";-export { MCPEndpointDetailsSection } from "./MCPEndpointDetailsSection";-export { MCPEndpointFiltersSection } from "./MCPEndpointFiltersSection";-export { MCPEndpointToolSelectionSection } from "./MCPEndpointToolSelectionSection";-export { MCPEndpointUsageStatisticsSection } from "./MCPEndpointUsageStatisticsSection";diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/index.ts b/frontend/src/pages/ai/MCPEndpointDetailPage/index.tsdeleted file mode 100644index b0db7aec80..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/index.ts+++ /dev/null@@ -1 +0,0 @@-export { MCPEndpointDetailPage } from "./MCPEndpointDetailPage";diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/route.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/route.tsxdeleted file mode 100644index 53dee2e5de..0000000000--- a/frontend/src/pages/ai/MCPEndpointDetailPage/route.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { MCPEndpointDetailPage } from "./MCPEndpointDetailPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId"-)({- component: MCPEndpointDetailPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "MCP Endpoints",- link: linkOptions({- to: "/organizations/$orgId/projects/ai/$projectId/overview",- params: { orgId: params.orgId, projectId: params.projectId }- })- },- {- label: "Endpoint Details"- }- ]- };- }-});diff --git a/frontend/src/pages/ai/MCPPage/MCPPage.tsx b/frontend/src/pages/ai/MCPPage/MCPPage.tsxdeleted file mode 100644index 7bce3c14a5..0000000000--- a/frontend/src/pages/ai/MCPPage/MCPPage.tsx+++ /dev/null@@ -1,51 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";-import { useSearch } from "@tanstack/react-router";--import { ContentLoader, PageHeader } from "@app/components/v2";-import { useProject } from "@app/context";-import { ProjectType } from "@app/hooks/api/projects/types";--import { MCPActivityLogsTab } from "./components/MCPActivityLogsTab";-import { MCPEndpointsTab } from "./components/MCPEndpointsTab";-import { MCPServersTab } from "./components/MCPServersTab";--enum TabSections {- MCPEndpoints = "mcp-endpoints",- MCPServers = "mcp-servers",- ActivityLogs = "activity-logs"-}--export const MCPPage = () => {- const { t } = useTranslation();- const { currentProject } = useProject();- const { selectedTab } = useSearch({- from: "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview"- });-- const activeTab = (selectedTab as TabSections) || TabSections.MCPEndpoints;-- if (!currentProject) {- return <ContentLoader />;- }-- return (- <div className="mx-auto flex h-full flex-col justify-between bg-bunker-800 text-white">- <Helmet>- <title>{t("common.head-title", { title: "MCP Management" })}</title>- </Helmet>- <div className="mx-auto mb-6 w-full max-w-8xl">- <PageHeader- scope={ProjectType.AI}- title="MCP Management"- description="Manage MCP endpoints, connect MCP servers, and configure tools with secure governance"- />- <div>- {activeTab === TabSections.MCPEndpoints && <MCPEndpointsTab />}- {activeTab === TabSections.MCPServers && <MCPServersTab />}- {activeTab === TabSections.ActivityLogs && <MCPActivityLogsTab />}- </div>- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsDateFilter.tsx b/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsDateFilter.tsxdeleted file mode 100644index 77f094b7e3..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsDateFilter.tsx+++ /dev/null@@ -1,345 +0,0 @@-import { useState } from "react";-import { Controller, useForm } from "react-hook-form";-import { faCalendar, faChevronRight } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import ms from "ms";-import { twMerge } from "tailwind-merge";--import {- Button,- DatePicker,- DropdownMenu,- DropdownMenuContent,- DropdownMenuTrigger,- FormControl,- Input,- Select,- SelectItem-} from "@app/components/v2";-import { formatDateTime, Timezone } from "@app/helpers/datetime";--import {- mcpActivityLogDateFilterFormSchema,- MCPActivityLogDateFilterType,- TMCPActivityLogDateFilterFormData-} from "./types";--type Props = {- setFilter: (data: TMCPActivityLogDateFilterFormData) => void;- filter: TMCPActivityLogDateFilterFormData;- setTimezone: (timezone: Timezone) => void;- timezone: Timezone;-};--const RELATIVE_VALUES = ["5m", "30m", "1h", "3h", "12h"];--const RELATIVE_OPTIONS = [- { label: "Minutes", unit: "m", values: [5, 10, 15, 30, 45] },- { label: "Hours", unit: "h", values: [1, 2, 3, 6, 8, 12] },- { label: "Days", unit: "d", values: [1, 2, 3, 4, 5, 6] },- { label: "Weeks", unit: "w", values: [1, 2, 3, 4] }-];--export const MCPActivityLogsDateFilter = ({ setFilter, filter, timezone, setTimezone }: Props) => {- const [isStartDatePickerOpen, setIsStartDatePickerOpen] = useState(false);- const [isEndDatePickerOpen, setIsEndDatePickerOpen] = useState(false);- const [isPopupOpen, setIsPopOpen] = useState(false);-- const { control, watch, handleSubmit, formState } = useForm<TMCPActivityLogDateFilterFormData>({- resolver: zodResolver(mcpActivityLogDateFilterFormSchema),- values: filter- });- const selectType = watch("type");- const isCustomRelative =- filter.type === MCPActivityLogDateFilterType.Relative &&- !RELATIVE_VALUES.includes(filter.relativeModeValue || "");-- const onSubmit = (data: TMCPActivityLogDateFilterFormData) => {- const endDate = data.type === MCPActivityLogDateFilterType.Relative ? new Date() : data.endDate;- const startDate =- data.type === MCPActivityLogDateFilterType.Relative && data.relativeModeValue- ? new Date(Number(new Date()) - ms(data.relativeModeValue))- : data.startDate;- setFilter({- ...data,- startDate,- endDate- });- setIsPopOpen(false);- };-- return (- <>- <DropdownMenu open={isPopupOpen} onOpenChange={(el) => setIsPopOpen(el)}>- <div className="flex items-center">- {filter.type === MCPActivityLogDateFilterType.Relative ? (- <>- {RELATIVE_VALUES.map((el) => (- <Button- variant="outline_bg"- className={twMerge(- "w-[3.82rem] rounded-none px-3 py-2 font-normal first:rounded-l-md",- filter.type === MCPActivityLogDateFilterType.Relative &&- filter.relativeModeValue === el &&- "border-primary/40 bg-primary/10"- )}- key={`${el}-relative`}- onClick={() =>- setFilter({- relativeModeValue: el,- type: MCPActivityLogDateFilterType.Relative,- endDate: new Date(),- startDate: new Date(Number(new Date()) - ms(el))- })- }- >- {el}- </Button>- ))}- </>- ) : (- <div className="flex w-[19.1rem] items-center justify-between rounded-l-md border border-transparent bg-mineshaft-600 px-5 py-2 text-sm text-bunker-200">- <div>- {formatDateTime({- timezone,- timestamp: filter.startDate,- dateFormat: "yyyy/MM/dd HH:mm"- })}- </div>- <div>- <FontAwesomeIcon className="text-bunker-300" size="sm" icon={faChevronRight} />- </div>- <div>- {formatDateTime({- timezone,- timestamp: filter.endDate,- dateFormat: "yyyy/MM/dd HH:mm"- })}- </div>- </div>- )}- <DropdownMenuTrigger asChild>- <Button- variant="outline_bg"- className={twMerge(- "w-32 rounded-none rounded-r-md px-3 py-2 font-normal",- (filter.type === MCPActivityLogDateFilterType.Absolute || isCustomRelative) &&- "border-primary/40 bg-primary/10"- )}- >- <span>Custom</span> <FontAwesomeIcon className="ml-1" icon={faCalendar} />- {filter.type === MCPActivityLogDateFilterType.Relative && isCustomRelative && (- <span className="ml-1">({filter.relativeModeValue})</span>- )}- </Button>- </DropdownMenuTrigger>- </div>- <DropdownMenuContent- className="min-w-[434px]! bg-mineshaft-800 p-4"- align="end"- sideOffset={8}- >- <form onSubmit={handleSubmit(onSubmit)}>- <Controller- control={control}- name="type"- render={({ field }) => (- <div className="mb-7">- <Button- onClick={() => field.onChange(MCPActivityLogDateFilterType.Absolute)}- variant="outline_bg"- className={twMerge(- "h-8 rounded-r-none font-normal",- field.value === MCPActivityLogDateFilterType.Absolute &&- "border-primary/40 bg-primary/10"- )}- >- Absolute- </Button>- <Button- onClick={() => field.onChange(MCPActivityLogDateFilterType.Relative)}- variant="outline_bg"- className={twMerge(- "h-8 rounded-l-none font-normal",- field.value === MCPActivityLogDateFilterType.Relative &&- "border-primary/40 bg-primary/10"- )}- >- Relative- </Button>- </div>- )}- />- {selectType === MCPActivityLogDateFilterType.Relative && (- <Controller- control={control}- name="relativeModeValue"- render={({ field, fieldState: { error } }) => {- const duration = field.value?.substring(0, field.value.length - 1);- const unitOfTime = field.value?.at(-1);- return (- <div className="flex flex-col gap-4">- {RELATIVE_OPTIONS.map(({ label, unit, values }) => (- <div key={unit} className="flex items-center gap-2">- <div className="w-16">{label}</div>- {values.map((v) => {- const value = `${v}${unit}`;- return (- <Button- key={value}- variant="outline_bg"- onClick={() => field.onChange(value)}- className={twMerge(- "h-8 w-12",- field.value === value && "border-primary/40 bg-primary/10"- )}- >- {v}- </Button>- );- })}- </div>- ))}- <div className="flex flex-col gap-1">- <div className="flex items-center gap-2">- <FormControl- className="mb-0 w-28"- label="Duration"- isError={Boolean(error)}- >- <Input- type="number"- value={duration}- onChange={(val) => {- const durationVal = val.target.value- ? Number(val.target.value)- : undefined;- field.onChange(`${durationVal}${unitOfTime}`);- }}- max={60}- min={1}- />- </FormControl>- <FormControl className="mb-0 w-36" label="Unit of Time">- <Select- value={unitOfTime}- onValueChange={(val) => field.onChange(`${duration}${val}`)}- className="w-full"- position="popper"- >- {RELATIVE_OPTIONS.map((opt) => (- <SelectItem key={opt.unit} value={opt.unit}>- {opt.label}- </SelectItem>- ))}- </Select>- </FormControl>- </div>- {error && (- <span className="text-opacity-90 text-xs text-red-600">- {error.message}- </span>- )}- </div>- </div>- );- }}- />- )}- {selectType === MCPActivityLogDateFilterType.Absolute && (- <div className="flex h-10 w-full items-center justify-between gap-2">- <Controller- name="startDate"- control={control}- render={({ field: { onChange, ...field }, fieldState: { error } }) => {- return (- <FormControl- className="relative top-2"- errorText={error?.message}- isError={Boolean(error)}- label="Start Date"- >- <DatePicker- value={field.value || undefined}- onChange={onChange}- timezone={timezone}- dateFormat="P"- buttonClassName="w-44 h-8 font-normal"- popUpProps={{- open: isStartDatePickerOpen,- onOpenChange: setIsStartDatePickerOpen- }}- popUpContentProps={{}}- />- </FormControl>- );- }}- />- <FontAwesomeIcon- icon={faChevronRight}- size="xs"- className="mt-6 text-mineshaft-400"- />- <Controller- name="endDate"- control={control}- render={({ field: { onChange, ...field }, fieldState: { error } }) => {- return (- <FormControl- className="relative top-2"- errorText={error?.message}- isError={Boolean(error)}- label="End Date"- >- <DatePicker- value={field.value || undefined}- onChange={onChange}- dateFormat="P"- buttonClassName="w-44 h-8 font-normal"- timezone={timezone}- popUpProps={{- open: isEndDatePickerOpen,- onOpenChange: setIsEndDatePickerOpen- }}- popUpContentProps={{}}- />- </FormControl>- );- }}- />- </div>- )}- <div className="mt-8 w-full justify-end">- <Button- size="sm"- type="submit"- className="h-9 w-24 font-normal"- variant="outline_bg"- isDisabled={!formState.isDirty}- >- Apply- </Button>- </div>- </form>- </DropdownMenuContent>- </DropdownMenu>- <Select- value={timezone}- onValueChange={(val) => setTimezone(val as Timezone)}- className="w-[10.6rem] border border-mineshaft-500! bg-mineshaft-600! capitalize"- dropdownContainerClassName="max-w-none"- position="popper"- dropdownContainerStyle={{- width: "100%"- }}- >- {Object.values(Timezone).map((tz) => (- <SelectItem value={tz} className="capitalize" key={tz}>- {tz} Timezone- </SelectItem>- ))}- </Select>- </>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsFilter.tsx b/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsFilter.tsxdeleted file mode 100644index 14f23a70b8..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsFilter.tsx+++ /dev/null@@ -1,223 +0,0 @@-import { Controller, useForm } from "react-hook-form";-import { faFilterCircleXmark } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";--import {- Button,- DropdownMenu,- DropdownMenuContent,- DropdownMenuTrigger,- FormControl,- Input-} from "@app/components/v2";-import { Badge } from "@app/components/v3";--import { mcpActivityLogFilterFormSchema, TMCPActivityLogFilterFormData } from "./types";--type Props = {- filter: TMCPActivityLogFilterFormData;- setFilter: (filter: TMCPActivityLogFilterFormData) => void;-};--type FilterItemProps = {- label: string;- onClear: () => void;- children: React.ReactNode;-};--const FilterItem = ({ label, onClear, children }: FilterItemProps) => {- return (- <div className="flex flex-col justify-between">- <div className="flex items-center pr-1">- <p className="text-xs opacity-60">{label}</p>- <Button- onClick={() => onClear()}- variant="link"- className="ml-auto font-normal text-mineshaft-400 transition-all duration-75 hover:text-mineshaft-300"- size="xs"- >- Clear- </Button>- </div>- <div>{children}</div>- </div>- );-};--const getActiveFilterCount = (filter: TMCPActivityLogFilterFormData): number => {- let count = 0;- if (filter.endpointName) count += 1;- if (filter.serverName) count += 1;- if (filter.toolName) count += 1;- if (filter.actor) count += 1;- return count;-};--export const MCPActivityLogsFilter = ({ filter, setFilter }: Props) => {- const { control, handleSubmit, setValue, formState } = useForm<TMCPActivityLogFilterFormData>({- resolver: zodResolver(mcpActivityLogFilterFormSchema),- values: filter- });-- const activeFilterCount = getActiveFilterCount(filter);-- return (- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="outline_bg" colorSchema="primary" className="relative">- <FontAwesomeIcon icon={faFilterCircleXmark} className="mr-2" />- Filter- {activeFilterCount > 0 && (- <Badge className="absolute -top-2 -right-2" variant="info">- {activeFilterCount}- </Badge>- )}- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="mt-4 overflow-visible py-4">- <form onSubmit={handleSubmit(setFilter)}>- <div className="flex max-w-96 min-w-80 flex-col font-inter">- <div className="mb-3 flex items-center border-b border-b-mineshaft-500 px-3 pb-2">- <div className="flex w-full items-center justify-between">- <div className="flex items-center gap-2">- <span>Filters</span>- <Badge isSquare variant="info">- {activeFilterCount}- </Badge>- </div>- <Button- onClick={() => {- setFilter({- endpointName: undefined,- serverName: undefined,- toolName: undefined,- actor: undefined- });- }}- variant="link"- className="text-mineshaft-400"- size="xs"- >- Clear filters- </Button>- </div>- </div>-- <div className="space-y-3 px-3">- <FilterItem- label="Endpoint"- onClear={() => {- setValue("endpointName", undefined, { shouldDirty: true });- }}- >- <Controller- control={control}- name="endpointName"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="w-full"- >- <Input- value={value || ""}- onChange={(e) => onChange(e.target.value || undefined)}- placeholder="Filter by endpoint name"- className="bg-mineshaft-800"- />- </FormControl>- )}- />- </FilterItem>-- <FilterItem- label="Server"- onClear={() => {- setValue("serverName", undefined, { shouldDirty: true });- }}- >- <Controller- control={control}- name="serverName"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="w-full"- >- <Input- value={value || ""}- onChange={(e) => onChange(e.target.value || undefined)}- placeholder="Filter by server name"- className="bg-mineshaft-800"- />- </FormControl>- )}- />- </FilterItem>-- <FilterItem- label="Tool"- onClear={() => {- setValue("toolName", undefined, { shouldDirty: true });- }}- >- <Controller- control={control}- name="toolName"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="w-full"- >- <Input- value={value || ""}- onChange={(e) => onChange(e.target.value || undefined)}- placeholder="Filter by tool name"- className="bg-mineshaft-800"- />- </FormControl>- )}- />- </FilterItem>-- <FilterItem- label="User"- onClear={() => {- setValue("actor", undefined, { shouldDirty: true });- }}- >- <Controller- control={control}- name="actor"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- errorText={error?.message}- isError={Boolean(error)}- className="w-full"- >- <Input- value={value || ""}- onChange={(e) => onChange(e.target.value || undefined)}- placeholder="Filter by user"- className="bg-mineshaft-800"- />- </FormControl>- )}- />- </FilterItem>- </div>-- <div className="mt-4 px-3">- <Button size="xs" type="submit" isDisabled={!formState.isDirty}>- Apply- </Button>- </div>- </div>- </form>- </DropdownMenuContent>- </DropdownMenu>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsTab.tsx b/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsTab.tsxdeleted file mode 100644index 8699f6e948..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsTab.tsx+++ /dev/null@@ -1,126 +0,0 @@-import { Fragment, useState } from "react";-import { faFile } from "@fortawesome/free-solid-svg-icons";-import ms from "ms";--import {- Button,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Th,- THead,- Tr-} from "@app/components/v2";-import { useProject } from "@app/context";-import { Timezone } from "@app/helpers/datetime";-import { useListAiMcpActivityLogs } from "@app/hooks/api";--import { MCPActivityLogsDateFilter } from "./MCPActivityLogsDateFilter";-import { MCPActivityLogsFilter } from "./MCPActivityLogsFilter";-import { MCPActivityLogsTableRow } from "./MCPActivityLogsTableRow";-import {- MCPActivityLogDateFilterType,- TMCPActivityLogDateFilterFormData,- TMCPActivityLogFilterFormData-} from "./types";--const MCP_ACTIVITY_LOG_LIMIT = 30;--export const MCPActivityLogsTab = () => {- const { currentProject } = useProject();- const [timezone, setTimezone] = useState<Timezone>(Timezone.Local);- const [logFilter, setLogFilter] = useState<TMCPActivityLogFilterFormData>({- endpointName: undefined,- serverName: undefined,- toolName: undefined,- actor: undefined- });- const [dateFilter, setDateFilter] = useState<TMCPActivityLogDateFilterFormData>({- startDate: new Date(Number(new Date()) - ms("1h")),- endDate: new Date(),- type: MCPActivityLogDateFilterType.Relative,- relativeModeValue: "1h"- });-- const { data, isPending, isFetchingNextPage, hasNextPage, fetchNextPage } =- useListAiMcpActivityLogs({- projectId: currentProject?.id || "",- limit: MCP_ACTIVITY_LOG_LIMIT,- startDate: dateFilter.startDate,- endDate: dateFilter.endDate,- endpointName: logFilter.endpointName,- serverName: logFilter.serverName,- toolName: logFilter.toolName,- actor: logFilter.actor- });-- // Flatten pages into a single array- const activityLogs = data?.pages?.flat() ?? [];- const isEmpty = !isPending && activityLogs.length === 0;-- return (- <div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex flex-wrap items-center justify-between gap-y-2">- <div>- <div className="flex items-center gap-x-2 whitespace-nowrap">- <p className="text-xl font-medium text-mineshaft-100">Activity Logs</p>- </div>- </div>- <div className="flex flex-wrap items-center gap-2 lg:justify-end">- <MCPActivityLogsDateFilter- filter={dateFilter}- setFilter={setDateFilter}- timezone={timezone}- setTimezone={setTimezone}- />- <MCPActivityLogsFilter filter={logFilter} setFilter={setLogFilter} />- </div>- </div>- <div className="space-y-2">- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-8" />- <Th className="w-48">Timestamp</Th>- <Th className="w-56">Endpoint</Th>- <Th className="w-48">Tool</Th>- <Th>User</Th>- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={5} innerKey="mcp-activity-logs" />}- {!isPending &&- activityLogs.map((log) => (- <Fragment key={`mcp-activity-log-${log.id}`}>- <MCPActivityLogsTableRow activityLog={log} />- </Fragment>- ))}- {isEmpty && (- <Tr>- <td colSpan={5}>- <EmptyState title="No activity logs found" icon={faFile} />- </td>- </Tr>- )}- </TBody>- </Table>- </TableContainer>- {!isEmpty && (- <Button- className="mt-4 px-4 py-3 text-sm"- isFullWidth- variant="outline_bg"- isLoading={isFetchingNextPage}- isDisabled={isFetchingNextPage || !hasNextPage}- onClick={() => fetchNextPage()}- >- {hasNextPage ? "Load More" : "End of logs"}- </Button>- )}- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsTableRow.tsx b/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsTableRow.tsxdeleted file mode 100644index 52ce0022bf..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/MCPActivityLogsTableRow.tsx+++ /dev/null@@ -1,78 +0,0 @@-import { faCaretDown, faCaretRight } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { Td, Tr } from "@app/components/v2";-import { useToggle } from "@app/hooks";-import { TAiMcpActivityLog } from "@app/hooks/api";--type Props = {- activityLog: TAiMcpActivityLog;-};--const formatTimestamp = (dateString: string): string => {- const date = new Date(dateString);- const year = date.getFullYear();- const month = String(date.getMonth() + 1).padStart(2, "0");- const day = String(date.getDate()).padStart(2, "0");- const hours = String(date.getHours()).padStart(2, "0");- const minutes = String(date.getMinutes()).padStart(2, "0");- const seconds = String(date.getSeconds()).padStart(2, "0");- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;-};--const ToolBadge = ({ tool }: { tool: string }) => (- <span className="inline-flex items-center rounded bg-mineshaft-600 px-2 py-0.5 font-mono text-xs text-mineshaft-200">- {tool}- </span>-);--export const MCPActivityLogsTableRow = ({ activityLog }: Props) => {- const [isOpen, setIsOpen] = useToggle();-- return (- <>- <Tr- className="h-10 cursor-pointer border-x-0 border-t-0 border-b hover:bg-mineshaft-700"- role="button"- tabIndex={0}- onClick={() => setIsOpen.toggle()}- onKeyDown={(evt) => {- if (evt.key === "Enter") setIsOpen.toggle();- }}- isHoverable- >- <Td className="flex items-center gap-2 pr-0 align-top">- <FontAwesomeIcon icon={isOpen ? faCaretDown : faCaretRight} />- </Td>- <Td className="align-top font-mono text-sm whitespace-nowrap text-mineshaft-300">- {formatTimestamp(activityLog.createdAt)}- </Td>- <Td className="align-top text-mineshaft-200">{activityLog.endpointName}</Td>- <Td className="align-top">- <ToolBadge tool={activityLog.toolName} />- </Td>- <Td className="align-top text-mineshaft-300">{activityLog.actor}</Td>- </Tr>- {isOpen && (- <Tr className={`log-${activityLog.id} h-10 border-x-0 border-t-0 border-b`}>- <Td colSpan={5} className="px-3 py-4">- <div className="grid grid-cols-2 gap-4">- <div>- <h4 className="mb-2 text-sm font-medium text-mineshaft-200">Request</h4>- <div className="h-80 thin-scrollbar overflow-auto rounded-md border border-mineshaft-600 bg-bunker-800 p-3 font-mono text-xs leading-5 whitespace-pre-wrap text-mineshaft-300">- {JSON.stringify(activityLog.request, null, 2)}- </div>- </div>- <div>- <h4 className="mb-2 text-sm font-medium text-mineshaft-200">Response</h4>- <div className="h-80 thin-scrollbar overflow-auto rounded-md border border-mineshaft-600 bg-bunker-800 p-3 font-mono text-xs leading-5 whitespace-pre-wrap text-mineshaft-300">- {JSON.stringify(activityLog.response, null, 2)}- </div>- </div>- </div>- </Td>- </Tr>- )}- </>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/index.ts b/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/index.tsdeleted file mode 100644index 1007b1e9fd..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/index.ts+++ /dev/null@@ -1 +0,0 @@-export { MCPActivityLogsTab } from "./MCPActivityLogsTab";diff --git a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/types.ts b/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/types.tsdeleted file mode 100644index 8932462eec..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPActivityLogsTab/types.ts+++ /dev/null@@ -1,46 +0,0 @@-import { z } from "zod";--export type TMCPActivityLog = {- id: string;- projectId: string;- endpointName: string;- serverName: string;- toolName: string;- actor: string;- request: unknown;- response: unknown;- createdAt: string;- updatedAt: string;-};--export enum MCPActivityLogDateFilterType {- Relative = "relative",- Absolute = "absolute"-}--export const mcpActivityLogFilterFormSchema = z.object({- endpointName: z.string().optional(),- serverName: z.string().optional(),- toolName: z.string().optional(),- actor: z.string().optional()-});--export const mcpActivityLogDateFilterFormSchema = z- .object({- startDate: z.date(),- endDate: z.date(),- type: z.nativeEnum(MCPActivityLogDateFilterType),- relativeModeValue: z.string().optional()- })- .superRefine((el, ctx) => {- if (el.type === MCPActivityLogDateFilterType.Absolute && el.startDate > el.endDate) {- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: ["endDate"],- message: "End date cannot be before start date"- });- }- });--export type TMCPActivityLogFilterFormData = z.infer<typeof mcpActivityLogFilterFormSchema>;-export type TMCPActivityLogDateFilterFormData = z.infer<typeof mcpActivityLogDateFilterFormSchema>;diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/AddMCPEndpointForm.schema.ts b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/AddMCPEndpointForm.schema.tsdeleted file mode 100644index 54ebbe8d8e..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/AddMCPEndpointForm.schema.ts+++ /dev/null@@ -1,9 +0,0 @@-import { z } from "zod";--export const AddMCPEndpointFormSchema = z.object({- name: z.string().trim().min(1, "Name is required").max(64, "Name cannot exceed 64 characters"),- description: z.string().trim().max(256, "Description cannot exceed 256 characters").optional(),- serverIds: z.array(z.string().uuid()).default([])-});--export type TAddMCPEndpointForm = z.infer<typeof AddMCPEndpointFormSchema>;diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/AddMCPEndpointModal.tsx b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/AddMCPEndpointModal.tsxdeleted file mode 100644index 734544d2f5..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/AddMCPEndpointModal.tsx+++ /dev/null@@ -1,230 +0,0 @@-import { Controller, useForm } from "react-hook-form";-import { faServer } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import { useNavigate, useParams } from "@tanstack/react-router";--import { createNotification } from "@app/components/notifications";-import {- Button,- Checkbox,- FormControl,- Input,- Modal,- ModalContent,- TextArea-} from "@app/components/v2";-import { useProject } from "@app/context";-import { useCreateAiMcpEndpoint, useListAiMcpServers } from "@app/hooks/api";--import { AddMCPEndpointFormSchema, TAddMCPEndpointForm } from "./AddMCPEndpointForm.schema";--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;-};--export const AddMCPEndpointModal = ({ isOpen, onOpenChange }: Props) => {- const navigate = useNavigate();- const { orgId } = useParams({ strict: false }) as { orgId?: string };- const { currentProject } = useProject();- const createEndpoint = useCreateAiMcpEndpoint();-- // Fetch available MCP servers for selection- const { data: serversData, isLoading: isLoadingServers } = useListAiMcpServers({- projectId: currentProject?.id || ""- });-- const servers = serversData?.servers || [];-- const {- control,- handleSubmit,- reset,- watch,- setValue,- formState: { isSubmitting }- } = useForm<TAddMCPEndpointForm>({- resolver: zodResolver(AddMCPEndpointFormSchema),- defaultValues: {- name: "",- description: "",- serverIds: []- }- });-- const selectedServerIds = watch("serverIds");-- const handleClose = () => {- reset();- onOpenChange(false);- };-- const handleServerToggle = (serverId: string) => {- const current = selectedServerIds || [];- if (current.includes(serverId)) {- setValue(- "serverIds",- current.filter((id) => id !== serverId)- );- } else {- setValue("serverIds", [...current, serverId]);- }- };-- const onSubmit = async (data: TAddMCPEndpointForm) => {- if (!currentProject?.id) {- createNotification({- text: "No project selected",- type: "error"- });- return;- }-- try {- const endpoint = await createEndpoint.mutateAsync({- projectId: currentProject.id,- name: data.name,- description: data.description || undefined,- serverIds: data.serverIds- });-- createNotification({- text: `Successfully created MCP endpoint "${data.name}"`,- type: "success"- });-- reset();- onOpenChange(false);-- if (orgId) {- navigate({- to: "/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId",- params: { orgId, projectId: currentProject.id, endpointId: endpoint.id }- });- }- } catch (error) {- console.error("Failed to create MCP endpoint:", error);- createNotification({- text: "Failed to create MCP endpoint",- type: "error"- });- }- };-- return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- title="Create MCP Endpoint"- subTitle="Aggregate multiple MCP servers into a single connection URL for AI clients"- className="max-w-2xl"- onClose={handleClose}- >- <form onSubmit={handleSubmit(onSubmit)}>- <Controller- control={control}- name="name"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Endpoint Name"- isRequired- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="production-ai-proxy" />- </FormControl>- )}- />-- <Controller- control={control}- name="description"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Description"- isOptional- isError={Boolean(error)}- errorText={error?.message}- >- <TextArea- {...field}- placeholder="Enter endpoint description"- className="resize-none!"- rows={3}- />- </FormControl>- )}- />-- <div className="mt-4">- <FormControl label="Connected Servers" isOptional>- <div className="rounded-md border border-mineshaft-600 bg-mineshaft-900 p-3">- {isLoadingServers && <p className="text-sm text-bunker-400">Loading servers...</p>}- {!isLoadingServers && servers.length === 0 && (- <div className="flex flex-col items-center py-4 text-center">- <FontAwesomeIcon icon={faServer} className="mb-2 text-2xl text-bunker-400" />- <p className="text-sm text-bunker-400">No MCP servers available</p>- <p className="text-xs text-bunker-500">- Add MCP servers first to connect them to this endpoint- </p>- </div>- )}- {!isLoadingServers && servers.length > 0 && (- <div className="space-y-2">- {servers.map((server) => (- <div- key={server.id}- className="flex items-start gap-3 rounded-md p-2 transition-colors hover:bg-mineshaft-700"- >- <Checkbox- id={`server-${server.id}`}- className="mt-0.5"- isChecked={selectedServerIds?.includes(server.id)}- onCheckedChange={() => handleServerToggle(server.id)}- />- <label- htmlFor={`server-${server.id}`}- className="flex flex-1 cursor-pointer items-start gap-2"- >- <FontAwesomeIcon- icon={faServer}- className="mt-0.5 text-sm text-bunker-400"- />- <div className="flex-1">- <p className="text-sm text-mineshaft-200">{server.name}</p>- {server.description && (- <p className="text-xs text-bunker-400">{server.description}</p>- )}- </div>- </label>- </div>- ))}- </div>- )}- {selectedServerIds && selectedServerIds.length > 0 && (- <p className="mt-2 text-xs text-bunker-400">- {selectedServerIds.length} server{selectedServerIds.length !== 1 ? "s" : ""}{" "}- selected- </p>- )}- </div>- </FormControl>- </div>-- <div className="mt-6 flex justify-end gap-4">- <Button onClick={handleClose} colorSchema="secondary" type="button">- Cancel- </Button>- <Button- type="submit"- colorSchema="primary"- isLoading={isSubmitting || createEndpoint.isPending}- >- Create Endpoint- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/index.ts b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/index.tsdeleted file mode 100644index 305b842e9d..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/AddMCPEndpointModal/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./AddMCPEndpointModal";diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/EditMCPEndpointModal.tsx b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/EditMCPEndpointModal.tsxdeleted file mode 100644index 0f25a89c4a..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/EditMCPEndpointModal.tsx+++ /dev/null@@ -1,240 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { faServer } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- Checkbox,- FormControl,- Input,- Modal,- ModalContent,- TextArea-} from "@app/components/v2";-import {- TAiMcpEndpoint,- useGetAiMcpEndpointById,- useListAiMcpServers,- useUpdateAiMcpEndpoint-} from "@app/hooks/api";--const EditMCPEndpointFormSchema = z.object({- name: z.string().trim().min(1, "Name is required").max(64, "Name must be 64 characters or less"),- description: z.string().trim().max(256, "Description must be 256 characters or less").optional(),- serverIds: z.array(z.string().uuid()).default([])-});--type TEditMCPEndpointForm = z.infer<typeof EditMCPEndpointFormSchema>;--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- endpoint: TAiMcpEndpoint | null;-};--export const EditMCPEndpointModal = ({ isOpen, onOpenChange, endpoint }: Props) => {- const updateEndpoint = useUpdateAiMcpEndpoint();-- // Fetch full endpoint details including serverIds- const { data: endpointDetails } = useGetAiMcpEndpointById({- endpointId: endpoint?.id || ""- });-- // Fetch available MCP servers for selection- const { data: serversData, isLoading: isLoadingServers } = useListAiMcpServers({- projectId: endpoint?.projectId || ""- });-- const servers = serversData?.servers || [];-- const {- control,- handleSubmit,- reset,- watch,- setValue,- formState: { isSubmitting }- } = useForm<TEditMCPEndpointForm>({- resolver: zodResolver(EditMCPEndpointFormSchema),- defaultValues: {- name: "",- description: "",- serverIds: []- }- });-- const selectedServerIds = watch("serverIds");-- // Reset form when endpoint details change- useEffect(() => {- if (endpointDetails) {- reset({- name: endpointDetails.name,- description: endpointDetails.description || "",- serverIds: endpointDetails.serverIds || []- });- }- }, [endpointDetails, reset]);-- const handleClose = () => {- reset();- onOpenChange(false);- };-- const handleServerToggle = (serverId: string) => {- const current = selectedServerIds || [];- if (current.includes(serverId)) {- setValue(- "serverIds",- current.filter((id) => id !== serverId)- );- } else {- setValue("serverIds", [...current, serverId]);- }- };-- const onSubmit = async (data: TEditMCPEndpointForm) => {- if (!endpoint) return;-- try {- await updateEndpoint.mutateAsync({- endpointId: endpoint.id,- name: data.name,- description: data.description || undefined,- serverIds: data.serverIds- });-- createNotification({- text: `Successfully updated MCP endpoint "${data.name}"`,- type: "success"- });-- handleClose();- } catch (error) {- console.error("Failed to update MCP endpoint:", error);- createNotification({- text: "Failed to update MCP endpoint",- type: "error"- });- }- };-- return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- title="Edit MCP Endpoint"- subTitle="Update the endpoint details and connected servers"- className="max-w-2xl"- onClose={handleClose}- >- <form onSubmit={handleSubmit(onSubmit)}>- <Controller- control={control}- name="name"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Endpoint Name"- isRequired- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="production-ai-proxy" />- </FormControl>- )}- />-- <Controller- control={control}- name="description"- render={({ field, fieldState: { error } }) => (- <FormControl label="Description" isError={Boolean(error)} errorText={error?.message}>- <TextArea- {...field}- placeholder="Optional description for this endpoint"- className="resize-none!"- rows={3}- />- </FormControl>- )}- />-- <div className="mt-4">- <FormControl label="Connected Servers" isOptional>- <div className="rounded-md border border-mineshaft-600 bg-mineshaft-900 p-3">- {isLoadingServers && <p className="text-sm text-bunker-400">Loading servers...</p>}- {!isLoadingServers && servers.length === 0 && (- <div className="flex flex-col items-center py-4 text-center">- <FontAwesomeIcon icon={faServer} className="mb-2 text-2xl text-bunker-400" />- <p className="text-sm text-bunker-400">No MCP servers available</p>- <p className="text-xs text-bunker-500">- Add MCP servers first to connect them to this endpoint- </p>- </div>- )}- {!isLoadingServers && servers.length > 0 && (- <div className="space-y-2">- {servers.map((server) => (- <div- key={server.id}- className="flex items-start gap-3 rounded-md p-2 transition-colors hover:bg-mineshaft-700"- >- <Checkbox- id={`edit-server-${server.id}`}- className="mt-0.5"- isChecked={selectedServerIds?.includes(server.id)}- onCheckedChange={() => handleServerToggle(server.id)}- />- <label- htmlFor={`edit-server-${server.id}`}- className="flex flex-1 cursor-pointer items-start gap-2"- >- <FontAwesomeIcon- icon={faServer}- className="mt-0.5 text-sm text-bunker-400"- />- <div className="flex-1">- <p className="text-sm text-mineshaft-200">{server.name}</p>- {server.description && (- <p className="text-xs text-bunker-400">{server.description}</p>- )}- </div>- </label>- <span className="mt-0.5 text-xs text-bunker-400">- {server.toolsCount ?? 0} tools- </span>- </div>- ))}- </div>- )}- {selectedServerIds && selectedServerIds.length > 0 && (- <p className="mt-2 text-xs text-bunker-400">- {selectedServerIds.length} server{selectedServerIds.length !== 1 ? "s" : ""}{" "}- selected- </p>- )}- </div>- </FormControl>- </div>-- <div className="mt-6 flex justify-end gap-4">- <Button onClick={handleClose} colorSchema="secondary" type="button">- Cancel- </Button>- <Button- type="submit"- colorSchema="primary"- isLoading={isSubmitting || updateEndpoint.isPending}- isDisabled={isSubmitting || updateEndpoint.isPending}- >- Save Changes- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointList.tsx b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointList.tsxdeleted file mode 100644index c3a4754a65..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointList.tsx+++ /dev/null@@ -1,67 +0,0 @@-import {- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";-import { useProject } from "@app/context";-import { TAiMcpEndpoint, useListAiMcpEndpoints } from "@app/hooks/api";--import { MCPEndpointRow } from "./MCPEndpointRow";--interface Props {- onEditEndpoint: (endpoint: TAiMcpEndpoint) => void;- onDeleteEndpoint: (endpoint: TAiMcpEndpoint) => void;-}--export const MCPEndpointList = ({ onEditEndpoint, onDeleteEndpoint }: Props) => {- const { currentProject } = useProject();-- const { data, isLoading } = useListAiMcpEndpoints({- projectId: currentProject?.id || ""- });-- const endpoints = data?.endpoints;-- return (- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Status</Th>- <Th>Connected Servers</Th>- <Th>Active Tools</Th>- <Th className="w-16" />- </Tr>- </THead>- <TBody>- {isLoading && <TableSkeleton columns={5} innerKey="mcp-endpoints" />}- {!isLoading && (!endpoints || endpoints.length === 0) && (- <Tr>- <Td colSpan={5}>- <EmptyState title="No MCP Endpoints" />- </Td>- </Tr>- )}- {!isLoading &&- endpoints &&- endpoints.length > 0 &&- endpoints.map((endpoint) => (- <MCPEndpointRow- key={endpoint.id}- endpoint={endpoint}- onEditEndpoint={onEditEndpoint}- onDeleteEndpoint={onDeleteEndpoint}- />- ))}- </TBody>- </Table>- </TableContainer>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointRow.tsx b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointRow.tsxdeleted file mode 100644index f40e774514..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointRow.tsx+++ /dev/null@@ -1,158 +0,0 @@-import { useCallback } from "react";-import { faCheck, faCopy, faEdit, faEllipsisV, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { useNavigate, useParams } from "@tanstack/react-router";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- Td,- Tooltip,- Tr-} from "@app/components/v2";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context";-import { useToggle } from "@app/hooks";-import { TAiMcpEndpoint } from "@app/hooks/api";--interface Props {- endpoint: TAiMcpEndpoint;- onEditEndpoint: (endpoint: TAiMcpEndpoint) => void;- onDeleteEndpoint: (endpoint: TAiMcpEndpoint) => void;-}--const getStatusBadge = (status: string | null) => {- const statusConfig: Record<string, { color: string; label: string }> = {- active: {- color: "bg-emerald-500",- label: "Active"- },- inactive: {- color: "bg-red-500",- label: "Inactive"- }- };-- const config = statusConfig[status || "inactive"] || statusConfig.inactive;-- return (- <div className="flex items-center gap-2">- <div className={`h-2 w-2 rounded-full ${config.color}`} />- <span className="text-sm text-mineshaft-300">{config.label}</span>- </div>- );-};--export const MCPEndpointRow = ({ endpoint, onEditEndpoint, onDeleteEndpoint }: Props) => {- const navigate = useNavigate();- const { orgId, projectId } = useParams({- strict: false- }) as { orgId?: string; projectId?: string };-- const [isIdCopied, setIsIdCopied] = useToggle(false);-- const handleCopyId = useCallback(() => {- setIsIdCopied.on();- navigator.clipboard.writeText(endpoint.id);-- createNotification({- text: "Endpoint ID copied to clipboard",- type: "info"- });-- setTimeout(() => setIsIdCopied.off(), 2000);- }, [setIsIdCopied, endpoint.id]);-- const handleRowClick = () => {- if (orgId && projectId) {- navigate({- to: "/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId",- params: { orgId, projectId, endpointId: endpoint.id }- });- }- };-- return (- <Tr- className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"- onClick={handleRowClick}- >- <Td>- <span className="text-mineshaft-300">{endpoint.name}</span>- </Td>- <Td>{getStatusBadge(endpoint.status)}</Td>- <Td>- <span className="text-sm text-mineshaft-300">{endpoint.connectedServers}</span>- </Td>- <Td>- <span className="text-sm text-mineshaft-300">{endpoint.activeTools}</span>- </Td>- <Td className="text-right">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div- className="flex cursor-pointer justify-end hover:text-primary-400 data-[state=open]:text-primary-400"- role="button"- tabIndex={0}- onClick={(e) => e.stopPropagation()}- onKeyDown={(e) => e.stopPropagation()}- >- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsisV} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="p-1">- <DropdownMenuItem- icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} className="w-3" />}- onClick={(e) => {- e.stopPropagation();- handleCopyId();- }}- >- Copy Endpoint ID- </DropdownMenuItem>- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Edit}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- onEditEndpoint(endpoint);- }}- icon={<FontAwesomeIcon icon={faEdit} className="w-3" />}- isDisabled={!isAllowed}- >- Edit Endpoint- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Delete}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- onDeleteEndpoint(endpoint);- }}- icon={<FontAwesomeIcon icon={faTrash} className="w-3" />}- className="text-red-500 hover:text-red-400"- isDisabled={!isAllowed}- >- Delete Endpoint- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsx b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsxdeleted file mode 100644index abcfeeb7a6..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/MCPEndpointsTab.tsx+++ /dev/null@@ -1,120 +0,0 @@-import { useState } from "react";-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { ProjectPermissionMcpEndpointActions, ProjectPermissionSub } from "@app/context";-import { TAiMcpEndpoint, useDeleteAiMcpEndpoint } from "@app/hooks/api";--import { AddMCPEndpointModal } from "./AddMCPEndpointModal";-import { EditMCPEndpointModal } from "./EditMCPEndpointModal";-import { MCPEndpointList } from "./MCPEndpointList";--export const MCPEndpointsTab = () => {- const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);- const [isEditModalOpen, setIsEditModalOpen] = useState(false);- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);- const [selectedEndpoint, setSelectedEndpoint] = useState<TAiMcpEndpoint | null>(null);-- const deleteEndpoint = useDeleteAiMcpEndpoint();-- const handleCreateEndpoint = () => {- setIsCreateModalOpen(true);- };-- const handleEditEndpoint = (endpoint: TAiMcpEndpoint) => {- setSelectedEndpoint(endpoint);- setIsEditModalOpen(true);- };-- const handleDeleteEndpoint = (endpoint: TAiMcpEndpoint) => {- setSelectedEndpoint(endpoint);- setIsDeleteModalOpen(true);- };-- const handleDeleteConfirm = async () => {- if (!selectedEndpoint) return;-- try {- await deleteEndpoint.mutateAsync({ endpointId: selectedEndpoint.id });- createNotification({- text: `MCP endpoint "${selectedEndpoint.name}" deleted successfully`,- type: "success"- });- } catch (error) {- console.error("Failed to delete MCP endpoint:", error);- createNotification({- text: "Failed to delete MCP endpoint",- type: "error"- });- } finally {- setIsDeleteModalOpen(false);- setSelectedEndpoint(null);- }- };-- return (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex items-center justify-between">- <div>- <h2 className="text-xl font-semibold text-mineshaft-100">MCP Endpoints</h2>- <p className="text-sm text-bunker-300">- Create connection URLs that AI clients like Claude can use to access your MCP servers- </p>- </div>-- <ProjectPermissionCan- I={ProjectPermissionMcpEndpointActions.Create}- a={ProjectPermissionSub.McpEndpoints}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="button"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={handleCreateEndpoint}- isDisabled={!isAllowed}- >- Create Endpoint- </Button>- )}- </ProjectPermissionCan>- </div>-- <MCPEndpointList- onEditEndpoint={handleEditEndpoint}- onDeleteEndpoint={handleDeleteEndpoint}- />-- <AddMCPEndpointModal isOpen={isCreateModalOpen} onOpenChange={setIsCreateModalOpen} />-- <EditMCPEndpointModal- isOpen={isEditModalOpen}- onOpenChange={(isOpen) => {- setIsEditModalOpen(isOpen);- if (!isOpen) {- setSelectedEndpoint(null);- }- }}- endpoint={selectedEndpoint}- />-- {selectedEndpoint && (- <DeleteActionModal- isOpen={isDeleteModalOpen}- title={`Delete MCP Endpoint ${selectedEndpoint.name}?`}- onChange={(isOpen) => {- setIsDeleteModalOpen(isOpen);- if (!isOpen) {- setSelectedEndpoint(null);- }- }}- deleteKey={selectedEndpoint.name}- onDeleteApproved={handleDeleteConfirm}- />- )}- </div>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/index.ts b/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/index.tsdeleted file mode 100644index 745608c87a..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPEndpointsTab/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./MCPEndpointsTab";diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AddMCPServerForm.schema.ts b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AddMCPServerForm.schema.tsdeleted file mode 100644index 178fc1f5f4..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AddMCPServerForm.schema.ts+++ /dev/null@@ -1,58 +0,0 @@-import { z } from "zod";--export enum MCPServerCredentialMode {- SHARED = "shared",- PERSONAL = "personal"-}--export enum MCPServerAuthMethod {- BASIC = "basic",- BEARER = "bearer",- OAUTH = "oauth"-}--const BasicAuthCredentialsSchema = z.object({- authMethod: z.literal(MCPServerAuthMethod.BASIC),- credentials: z.object({- username: z.string().min(1, "Username is required"),- password: z.string().min(1, "Password is required")- })-});--const BearerAuthCredentialsSchema = z.object({- authMethod: z.literal(MCPServerAuthMethod.BEARER),- credentials: z.object({- token: z.string().min(1, "Bearer token is required")- })-});--// OAuth credentials obtained after completing OAuth flow (DCR)-const OAuthCredentialsSchema = z.object({- authMethod: z.literal(MCPServerAuthMethod.OAUTH),- credentials: z.object({- accessToken: z.string().min(1, "Access token is required"),- refreshToken: z.string().optional(),- expiresAt: z.number().optional(),- tokenType: z.string().optional()- })-});--const MCPServerCredentialsSchema = z.discriminatedUnion("authMethod", [- BasicAuthCredentialsSchema,- BearerAuthCredentialsSchema,- OAuthCredentialsSchema-]);--export const AddMCPServerFormSchema = z- .object({- name: z.string().trim().min(1, "Name is required").max(64, "Name cannot exceed 64 characters"),- description: z.string().trim().max(256, "Description cannot exceed 256 characters").optional(),- url: z.string().trim().min(1, "Endpoint URL is required").url("Must be a valid URL"),- credentialMode: z.nativeEnum(MCPServerCredentialMode),- oauthClientId: z.string().trim().optional(),- oauthClientSecret: z.string().trim().optional(),- gatewayId: z.string().uuid().optional().nullable()- })- .and(MCPServerCredentialsSchema);--export type TAddMCPServerForm = z.infer<typeof AddMCPServerFormSchema>;diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AddMCPServerModal.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AddMCPServerModal.tsxdeleted file mode 100644index 0924907b12..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AddMCPServerModal.tsx+++ /dev/null@@ -1,234 +0,0 @@-import { useState } from "react";-import { FormProvider, useForm } from "react-hook-form";-import { Tab } from "@headlessui/react";-import { zodResolver } from "@hookform/resolvers/zod";-import { useNavigate, useParams } from "@tanstack/react-router";--import { createNotification } from "@app/components/notifications";-import { Button, Modal, ModalContent } from "@app/components/v2";-import { useProject } from "@app/context";-import {- AiMcpServerAuthMethod,- AiMcpServerCredentialMode,- TCreateAiMcpServerDTO,- useCreateAiMcpServer-} from "@app/hooks/api";--import {- AddMCPServerFormSchema,- MCPServerAuthMethod,- MCPServerCredentialMode,- TAddMCPServerForm-} from "./AddMCPServerForm.schema";-import { AuthenticationStep } from "./AuthenticationStep";-import { BasicInfoStep } from "./BasicInfoStep";--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;-};--const FORM_TABS = [- { name: "Basic Info", key: "basic-info", fields: ["name", "url", "credentialMode"] as const },- {- name: "Authentication",- key: "authentication",- fields: ["authMethod", "credentials"] as const- }-];--export const AddMCPServerModal = ({ isOpen, onOpenChange }: Props) => {- const navigate = useNavigate();- const { orgId } = useParams({ strict: false }) as { orgId?: string };- const { currentProject } = useProject();- const [selectedTabIndex, setSelectedTabIndex] = useState(0);-- const createMcpServer = useCreateAiMcpServer();-- const formMethods = useForm<TAddMCPServerForm>({- resolver: zodResolver(AddMCPServerFormSchema),- defaultValues: {- name: "",- description: "",- url: "",- credentialMode: MCPServerCredentialMode.SHARED,- authMethod: MCPServerAuthMethod.OAUTH,- credentials: {- accessToken: "",- refreshToken: "",- tokenType: "Bearer"- },- oauthClientId: "",- oauthClientSecret: ""- } as TAddMCPServerForm- });-- const { handleSubmit, trigger, reset, watch } = formMethods;-- const isFinalStep = selectedTabIndex === FORM_TABS.length - 1;-- // Check if authentication is complete based on method- const authMethod = watch("authMethod");- const credentials = watch("credentials");-- const isOAuthCompleted =- authMethod === MCPServerAuthMethod.OAUTH &&- "accessToken" in credentials &&- Boolean(credentials.accessToken);-- const isBearerCompleted =- authMethod === MCPServerAuthMethod.BEARER &&- "token" in credentials &&- Boolean(credentials.token);-- const isAuthCompleted = isOAuthCompleted || isBearerCompleted;-- const isStepValid = async (index: number) => {- const { fields } = FORM_TABS[index];- return trigger(fields as unknown as (keyof TAddMCPServerForm)[]);- };-- const handleClose = () => {- reset();- setSelectedTabIndex(0);- onOpenChange(false);- };-- const onSubmit = async (data: TAddMCPServerForm) => {- if (!currentProject?.id) {- createNotification({- text: "No project selected",- type: "error"- });- return;- }-- try {- const server = await createMcpServer.mutateAsync({- projectId: currentProject.id,- name: data.name,- url: data.url,- description: data.description || undefined,- credentialMode: data.credentialMode as unknown as AiMcpServerCredentialMode,- authMethod: data.authMethod as unknown as AiMcpServerAuthMethod,- credentials: data.credentials,- oauthClientId: data.oauthClientId || undefined,- oauthClientSecret: data.oauthClientSecret || undefined,- gatewayId: data.gatewayId || undefined- } as TCreateAiMcpServerDTO);-- createNotification({- text: `Successfully added MCP server "${data.name}"`,- type: "success"- });-- reset();- setSelectedTabIndex(0);- onOpenChange(false);-- if (orgId) {- navigate({- to: "/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId",- params: { orgId, projectId: currentProject.id, serverId: server.id }- });- }- } catch (error) {- console.error("Failed to create MCP server:", error);- createNotification({- text: "Failed to create MCP server",- type: "error"- });- }- };-- const handleNext = async () => {- const isValid = await isStepValid(selectedTabIndex);- if (!isValid) return;-- if (isFinalStep) {- handleSubmit(onSubmit)();- return;- }-- setSelectedTabIndex((prev) => prev + 1);- };-- const handleBack = () => {- setSelectedTabIndex((prev) => prev - 1);- };-- const isTabEnabled = async (index: number) => {- let isEnabled = true;- for (let i = index - 1; i >= 0; i -= 1) {- // eslint-disable-next-line no-await-in-loop- isEnabled = isEnabled && (await isStepValid(i));- }- return isEnabled;- };-- return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- title="Add MCP Server"- subTitle="Configure connection details and authentication for a new MCP server"- className="max-w-2xl"- bodyClassName="overflow-visible"- onClose={handleClose}- >- <FormProvider {...formMethods}>- <form>- <Tab.Group selectedIndex={selectedTabIndex} onChange={setSelectedTabIndex}>- <Tab.List className="-pb-1 mb-6 w-full border-b-2 border-mineshaft-600">- {FORM_TABS.map((tab, index) => (- <Tab- key={tab.key}- onClick={async (e) => {- e.preventDefault();- const isEnabled = await isTabEnabled(index);- setSelectedTabIndex((prev) => (isEnabled ? index : prev));- }}- className={({ selected }) =>- `-mb-[0.14rem] whitespace-nowrap ${index > selectedTabIndex ? "opacity-30" : ""} px-4 py-2 text-sm font-medium outline-hidden disabled:opacity-60 ${- selected- ? "border-b-2 border-mineshaft-300 text-mineshaft-200"- : "text-bunker-300"- }`- }- >- {index + 1}. {tab.name}- </Tab>- ))}- </Tab.List>- <Tab.Panels>- <Tab.Panel>- <BasicInfoStep />- </Tab.Panel>- <Tab.Panel>- <AuthenticationStep onOAuthSuccess={() => handleSubmit(onSubmit)()} />- </Tab.Panel>- </Tab.Panels>- </Tab.Group>-- <div className="mt-6 flex w-full justify-between gap-4">- {selectedTabIndex > 0 ? (- <Button onClick={handleBack} colorSchema="secondary">- Back- </Button>- ) : (- <div />- )}- <Button- onClick={handleNext}- colorSchema="primary"- isLoading={createMcpServer.isPending}- isDisabled={createMcpServer.isPending || (isFinalStep && !isAuthCompleted)}- >- {isFinalStep ? "Add MCP Server" : "Next"}- </Button>- </div>- </form>- </FormProvider>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsxdeleted file mode 100644index 14a3b3eebc..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsx+++ /dev/null@@ -1,439 +0,0 @@-import { useCallback, useEffect, useRef, useState } from "react";-import { Controller, useFormContext } from "react-hook-form";-import { faCheck, faSpinner } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input, Select, SelectItem } from "@app/components/v2";-import { useProject } from "@app/context";-import { useGetOAuthStatus, useInitiateOAuth } from "@app/hooks/api";--import {- MCPServerAuthMethod,- MCPServerCredentialMode,- TAddMCPServerForm-} from "./AddMCPServerForm.schema";--const AUTH_METHOD_OPTIONS = [- { value: MCPServerAuthMethod.OAUTH, label: "OAuth" },- { value: MCPServerAuthMethod.BEARER, label: "Bearer Token" }-];--const OAUTH_POPUP_WIDTH = 600;-const OAUTH_POPUP_HEIGHT = 700;-const OAUTH_POLL_INTERVAL = 2000; // Poll every 2 seconds-const OAUTH_MAX_TIMEOUT = 5 * 60 * 1000; // 5 minutes--type Props = {- onOAuthSuccess?: () => void;-};--export const AuthenticationStep = ({ onOAuthSuccess }: Props) => {- const { currentProject } = useProject();- const { control, watch, setValue, getValues } = useFormContext<TAddMCPServerForm>();- const authMethod = watch("authMethod");- const credentialMode = watch("credentialMode");- const gatewayId = watch("gatewayId");- const isPersonalMode = credentialMode === MCPServerCredentialMode.PERSONAL;-- // Filter out OAuth when gateway is selected (OAuth requires browser access to auth page)- const availableAuthMethods = gatewayId- ? AUTH_METHOD_OPTIONS.filter((opt) => opt.value !== MCPServerAuthMethod.OAUTH)- : AUTH_METHOD_OPTIONS;-- // OAuth state- const [oauthSessionId, setOauthSessionId] = useState<string | null>(null);- const [isOAuthPending, setIsOAuthPending] = useState(false);- const popupRef = useRef<Window | null>(null);-- // Check if OAuth is already authorized (has access token)- const oauthCredentials = authMethod === MCPServerAuthMethod.OAUTH ? watch("credentials") : null;- const isOAuthAuthorized =- oauthCredentials && "accessToken" in oauthCredentials && Boolean(oauthCredentials.accessToken);-- // Hooks- const initiateOAuth = useInitiateOAuth();- const { data: oauthStatus } = useGetOAuthStatus(- { sessionId: oauthSessionId || "" },- {- enabled: Boolean(oauthSessionId) && isOAuthPending,- refetchInterval: isOAuthPending ? OAUTH_POLL_INTERVAL : false- }- );-- // Handle OAuth status updates- useEffect(() => {- if (oauthStatus?.authorized && oauthStatus.accessToken) {- // OAuth completed successfully - use shouldDirty and shouldTouch to trigger re-renders- setValue(- "credentials",- {- accessToken: oauthStatus.accessToken,- refreshToken: oauthStatus.refreshToken,- expiresAt: oauthStatus.expiresAt,- tokenType: oauthStatus.tokenType || "Bearer"- },- { shouldDirty: true, shouldTouch: true, shouldValidate: true }- );-- setValue("oauthClientId", oauthStatus.clientId || "");- setValue("oauthClientSecret", oauthStatus.clientSecret || "");-- setIsOAuthPending(false);- setOauthSessionId(null);-- createNotification({- text: "OAuth authorization successful",- type: "success"- });-- // Auto-submit the form after OAuth succeeds- if (onOAuthSuccess) {- // Small delay to ensure form state is updated- setTimeout(() => {- onOAuthSuccess();- }, 100);- }- }- }, [oauthStatus, setValue, onOAuthSuccess]);-- // Cleanup on unmount- useEffect(() => {- return () => {- if (popupRef.current && !popupRef.current.closed) {- popupRef.current.close();- }- };- }, []);-- // Timeout-based cancellation (popup.closed is unreliable with COOP headers)- useEffect(() => {- if (!isOAuthPending) return () => {};-- const startTime = Date.now();- const checkTimeout = setInterval(() => {- if (Date.now() - startTime > OAUTH_MAX_TIMEOUT) {- clearInterval(checkTimeout);- setIsOAuthPending(false);- setOauthSessionId(null);- createNotification({- text: "OAuth authorization timed out. Please try again.",- type: "error"- });- }- }, 5000);-- return () => clearInterval(checkTimeout);- }, [isOAuthPending]);-- const handleAuthMethodChange = useCallback(- (value: MCPServerAuthMethod) => {- setValue("authMethod", value);- // Reset credentials when auth method changes- if (value === MCPServerAuthMethod.BASIC) {- setValue("credentials", { username: "", password: "" });- } else if (value === MCPServerAuthMethod.BEARER) {- setValue("credentials", { token: "" });- } else if (value === MCPServerAuthMethod.OAUTH) {- setValue("credentials", { accessToken: "", refreshToken: "", tokenType: "Bearer" });- }-- // Reset OAuth state- setOauthSessionId(null);- setIsOAuthPending(false);- },- [setValue]- );-- // Auto-switch from OAuth to Bearer when gateway is selected- useEffect(() => {- if (gatewayId && authMethod === MCPServerAuthMethod.OAUTH) {- handleAuthMethodChange(MCPServerAuthMethod.BEARER);- }- }, [gatewayId, authMethod, handleAuthMethodChange]);-- const handleOAuthAuthorize = async () => {- const serverUrl = getValues("url");- if (!serverUrl) {- createNotification({- text: "Please enter the server URL first",- type: "error"- });- return;- }-- if (!currentProject?.id) {- createNotification({- text: "No project selected",- type: "error"- });- return;- }-- try {- setIsOAuthPending(true);-- // Get optional client credentials and gateway- const clientId = getValues("oauthClientId");- const clientSecret = getValues("oauthClientSecret");- const selectedGatewayId = getValues("gatewayId");-- // 1. Call backend to initiate OAuth and get auth URL- const { authUrl, sessionId } = await initiateOAuth.mutateAsync({- url: serverUrl,- projectId: currentProject.id,- clientId: clientId || undefined,- clientSecret: clientSecret || undefined,- gatewayId: selectedGatewayId || undefined- });-- setOauthSessionId(sessionId);-- // 2. Calculate popup position (centered)- const left = window.screenX + (window.outerWidth - OAUTH_POPUP_WIDTH) / 2;- const top = window.screenY + (window.outerHeight - OAUTH_POPUP_HEIGHT) / 2;-- // 3. Open popup for OAuth- popupRef.current = window.open(- authUrl,- "MCP OAuth Authorization",- `width=${OAUTH_POPUP_WIDTH},height=${OAUTH_POPUP_HEIGHT},left=${left},top=${top},scrollbars=yes,resizable=yes`- );-- if (!popupRef.current) {- createNotification({- text: "Failed to open OAuth popup. Please allow popups for this site.",- type: "error"- });- setIsOAuthPending(false);- setOauthSessionId(null);- }- } catch (error) {- console.error("Failed to initiate OAuth:", error);- createNotification({- text: "Failed to initiate OAuth authorization",- type: "error"- });- setIsOAuthPending(false);- setOauthSessionId(null);- }- };-- const handleCancelOAuth = () => {- setIsOAuthPending(false);- setOauthSessionId(null);-- if (popupRef.current && !popupRef.current.closed) {- popupRef.current.close();- }- };-- return (- <>- {isPersonalMode ? (- <div className="mb-4 space-y-2">- <p className="text-sm text-bunker-300">- Authorize once to discover available tools from the MCP server.- </p>- <div className="rounded-md border border-primary-500/30 bg-primary-500/10 p-3">- <p className="text-xs text-mineshaft-200">- <span className="font-medium text-primary-400">Note:</span> Since you selected- Personal Credentials, each user will authenticate with their own credentials when- accessing this server. This authorization is only used to fetch the list of available- tools.- </p>- </div>- </div>- ) : (- <p className="mb-4 text-sm text-bunker-300">- Configure shared authentication credentials for the MCP server.- </p>- )}-- {gatewayId && (- <div className="mb-4 rounded-md border border-primary-500/30 bg-primary-500/10 p-3">- <p className="text-xs text-mineshaft-200">- <span className="font-medium text-primary-400">Note:</span> OAuth is not available when- using a gateway.- </p>- </div>- )}-- <Controller- control={control}- name="authMethod"- render={({ field: { value }, fieldState: { error } }) => (- <FormControl- label="Authentication Type"- isRequired- isError={Boolean(error)}- errorText={error?.message}- >- <Select- value={value}- onValueChange={(val) => handleAuthMethodChange(val as MCPServerAuthMethod)}- className="w-full"- placeholder="Select authentication type..."- isDisabled={isOAuthPending}- position="popper"- dropdownContainerClassName="max-w-none"- >- {availableAuthMethods.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />-- {authMethod === MCPServerAuthMethod.BEARER && (- <Controller- control={control}- name="credentials.token"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Bearer Token"- isRequired- isError={Boolean(error)}- errorText={error?.message}- helperText="This credential will be securely stored in Infisical"- >- <Input {...field} type="password" placeholder="Enter bearer token" />- </FormControl>- )}- />- )}-- {authMethod === MCPServerAuthMethod.BASIC && (- <>- <Controller- control={control}- name="credentials.username"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Username"- isRequired- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="Enter username" />- </FormControl>- )}- />- <Controller- control={control}- name="credentials.password"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Password"- isRequired- isError={Boolean(error)}- errorText={error?.message}- helperText="This credential will be securely stored in Infisical"- >- <Input {...field} type="password" placeholder="Enter password" />- </FormControl>- )}- />- </>- )}-- {authMethod === MCPServerAuthMethod.OAUTH && (- <div className="mt-2 space-y-4">- {/* Optional client credentials for servers without DCR support (like GitHub) */}- <div className="space-y-4 rounded-md border border-mineshaft-600 bg-mineshaft-700/50 p-4">- <p className="text-xs text-bunker-300">- Optional: For MCP servers that don't support Dynamic Client Registration, enter- your OAuth app credentials below.- {isPersonalMode &&- " These will be saved so users don't need to provide them when authenticating."}- </p>- <Controller- control={control}- name="oauthClientId"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Client ID"- isError={Boolean(error)}- errorText={error?.message}- className="mb-2"- >- <Input- {...field}- value={field.value || ""}- placeholder="Optional client ID"- isDisabled={isOAuthPending || !!isOAuthAuthorized}- autoComplete="one-time-code"- />- </FormControl>- )}- />- <Controller- control={control}- name="oauthClientSecret"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Client Secret"- isError={Boolean(error)}- errorText={error?.message}- className="mb-0"- >- <Input- {...field}- value={field.value || ""}- type="password"- placeholder="Optional client secret"- isDisabled={isOAuthPending || !!isOAuthAuthorized}- autoComplete="new-password"- />- </FormControl>- )}- />- </div>-- {isOAuthAuthorized && (- <div className="flex items-center gap-2 rounded-md border border-green/30 bg-green/10 p-3">- <FontAwesomeIcon icon={faCheck} className="text-green" />- <span className="text-sm text-green">- {isPersonalMode- ? "Authorization successful — tools can now be discovered"- : "OAuth authorization successful"}- </span>- </div>- )}- {!isOAuthAuthorized && isOAuthPending && (- <div className="space-y-3">- <div className="flex items-center gap-2 rounded-md border border-primary-500/30 bg-primary-500/10 p-3">- <FontAwesomeIcon icon={faSpinner} className="animate-spin text-primary-400" />- <span className="text-sm text-mineshaft-200">- Waiting for OAuth authorization...- </span>- </div>- <Button- onClick={handleCancelOAuth}- colorSchema="secondary"- variant="outline"- className="w-full"- >- Cancel- </Button>- </div>- )}- {!isOAuthAuthorized && !isOAuthPending && (- <Button- onClick={handleOAuthAuthorize}- colorSchema="secondary"- className="w-full"- isLoading={initiateOAuth.isPending}- isDisabled={initiateOAuth.isPending}- >- {isPersonalMode ? "Authorize to Discover Tools" : "Authorize with OAuth"}- </Button>- )}- </div>- )}- </>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsxdeleted file mode 100644index a4f9429fca..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsx+++ /dev/null@@ -1,162 +0,0 @@-import { Controller, useFormContext } from "react-hook-form";-import { useQuery } from "@tanstack/react-query";--import { OrgPermissionCan } from "@app/components/permissions";-import { FormControl, Input, Select, SelectItem, TextArea, Tooltip } from "@app/components/v2";-import { OrgPermissionSubjects } from "@app/context/OrgPermissionContext";-import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";-import { gatewaysQueryKeys } from "@app/hooks/api";--import { MCPServerCredentialMode, TAddMCPServerForm } from "./AddMCPServerForm.schema";--const CREDENTIAL_MODE_OPTIONS = [- {- value: MCPServerCredentialMode.SHARED,- label: "Shared Credentials",- description:- "Your credentials will be used by all connecting users - everyone will authenticate as you"- },- {- value: MCPServerCredentialMode.PERSONAL,- label: "Personal Credentials",- description:- "Each connecting user must provide and authenticate with their own individual credentials"- }-];--export const BasicInfoStep = () => {- const { control, watch } = useFormContext<TAddMCPServerForm>();- const credentialMode = watch("credentialMode");-- const selectedModeOption = CREDENTIAL_MODE_OPTIONS.find(- (option) => option.value === credentialMode- );-- const { data: gateways, isPending: isGatewaysLoading } = useQuery(gatewaysQueryKeys.list());-- return (- <>- <p className="mb-4 text-sm text-bunker-300">- Configure the basic information and credential mode for the MCP server.- </p>-- <Controller- control={control}- name="name"- render={({ field, fieldState: { error } }) => (- <FormControl label="Name" isRequired isError={Boolean(error)} errorText={error?.message}>- <Input {...field} placeholder="my-mcp-server" />- </FormControl>- )}- />-- <Controller- control={control}- name="description"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Description"- isOptional- isError={Boolean(error)}- errorText={error?.message}- >- <TextArea- {...field}- placeholder="Enter server description"- className="resize-none!"- rows={3}- />- </FormControl>- )}- />-- <Controller- control={control}- name="url"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Endpoint URL"- isRequired- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="https://mcp-server.example.com" />- </FormControl>- )}- />-- <OrgPermissionCan- I={OrgGatewayPermissionActions.AttachGateways}- a={OrgPermissionSubjects.Gateway}- >- {(isAllowed) => (- <Controller- control={control}- name="gatewayId"- render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- isError={Boolean(error?.message)}- errorText={error?.message}- label="Gateway"- helperText="Select a gateway to route connections through a private network"- >- <Tooltip- isDisabled={isAllowed}- content="Restricted access. You don't have permission to attach gateways to resources."- >- <div>- <Select- isDisabled={!isAllowed}- value={value ?? "__none__"}- onValueChange={(val) => onChange(val === "__none__" ? null : val)}- className="w-full border border-mineshaft-500"- dropdownContainerClassName="max-w-none"- isLoading={isGatewaysLoading}- placeholder="Default: Internet Gateway"- position="popper"- >- <SelectItem value="__none__">Internet Gateway</SelectItem>- {gateways?.map((el) => (- <SelectItem value={el.id} key={el.id}>- {el.name}- </SelectItem>- ))}- </Select>- </div>- </Tooltip>- </FormControl>- )}- />- )}- </OrgPermissionCan>-- <Controller- control={control}- name="credentialMode"- render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- label="Credential Mode"- isRequired- isError={Boolean(error)}- errorText={error?.message}- helperText={selectedModeOption?.description}- >- <Select- value={value}- onValueChange={onChange}- className="w-full"- position="popper"- dropdownContainerClassName="max-w-none"- >- {CREDENTIAL_MODE_OPTIONS.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- </>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/index.ts b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/index.tsdeleted file mode 100644index a9535c8276..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/index.ts+++ /dev/null@@ -1 +0,0 @@-export { AddMCPServerModal } from "./AddMCPServerModal";diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/EditMCPServerModal.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/EditMCPServerModal.tsxdeleted file mode 100644index 70cde3aa9d..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/EditMCPServerModal.tsx+++ /dev/null@@ -1,197 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import { useQuery } from "@tanstack/react-query";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import { OrgPermissionCan } from "@app/components/permissions";-import {- Button,- FormControl,- Input,- Modal,- ModalContent,- Select,- SelectItem,- TextArea,- Tooltip-} from "@app/components/v2";-import { OrgPermissionSubjects } from "@app/context/OrgPermissionContext";-import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";-import { gatewaysQueryKeys, TAiMcpServer, useUpdateAiMcpServer } from "@app/hooks/api";--const EditMCPServerFormSchema = z.object({- name: z.string().trim().min(1, "Name is required").max(64, "Name must be 64 characters or less"),- description: z.string().trim().max(256, "Description must be 256 characters or less").optional(),- gatewayId: z.string().uuid().nullable().optional()-});--type TEditMCPServerForm = z.infer<typeof EditMCPServerFormSchema>;--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- server: TAiMcpServer | null;-};--export const EditMCPServerModal = ({ isOpen, onOpenChange, server }: Props) => {- const updateMcpServer = useUpdateAiMcpServer();- const { data: gateways, isPending: isGatewaysLoading } = useQuery(gatewaysQueryKeys.list());-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting }- } = useForm<TEditMCPServerForm>({- resolver: zodResolver(EditMCPServerFormSchema),- defaultValues: {- name: "",- description: "",- gatewayId: null- }- });-- // Reset form when server changes- useEffect(() => {- if (server) {- reset({- name: server.name,- description: server.description || "",- gatewayId: server.gatewayId || null- });- }- }, [server, reset]);-- const handleClose = () => {- reset();- onOpenChange(false);- };-- const onSubmit = async (data: TEditMCPServerForm) => {- if (!server) return;-- try {- await updateMcpServer.mutateAsync({- serverId: server.id,- name: data.name,- description: data.description || undefined,- gatewayId: data.gatewayId- });-- createNotification({- text: `Successfully updated MCP server "${data.name}"`,- type: "success"- });-- handleClose();- } catch (error) {- console.error("Failed to update MCP server:", error);- createNotification({- text: "Failed to update MCP server",- type: "error"- });- }- };-- return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- title="Edit MCP Server"- subTitle="Update the server details"- onClose={handleClose}- >- <form onSubmit={handleSubmit(onSubmit)}>- <Controller- control={control}- name="name"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Server Name"- isRequired- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="My MCP Server" />- </FormControl>- )}- />-- <Controller- control={control}- name="description"- render={({ field, fieldState: { error } }) => (- <FormControl label="Description" isError={Boolean(error)} errorText={error?.message}>- <TextArea- {...field}- placeholder="Optional description for this MCP server"- rows={3}- />- </FormControl>- )}- />-- <OrgPermissionCan- I={OrgGatewayPermissionActions.AttachGateways}- a={OrgPermissionSubjects.Gateway}- >- {(isAllowed) => (- <Controller- control={control}- name="gatewayId"- render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- isError={Boolean(error?.message)}- errorText={error?.message}- label="Gateway"- helperText="Select a gateway to route connections through a private network"- >- <Tooltip- isDisabled={isAllowed}- content="Restricted access. You don't have permission to attach gateways to resources."- >- <div>- <Select- isDisabled={!isAllowed}- value={value ?? "__none__"}- onValueChange={(val) => onChange(val === "__none__" ? null : val)}- className="w-full border border-mineshaft-500"- dropdownContainerClassName="max-w-none"- isLoading={isGatewaysLoading}- placeholder="Default: Internet Gateway"- position="popper"- >- <SelectItem value="__none__">Internet Gateway</SelectItem>- {gateways?.map((el) => (- <SelectItem value={el.id} key={el.id}>- {el.name}- </SelectItem>- ))}- </Select>- </div>- </Tooltip>- </FormControl>- )}- />- )}- </OrgPermissionCan>-- <div className="mt-6 flex justify-end gap-4">- <Button onClick={handleClose} colorSchema="secondary" type="button">- Cancel- </Button>- <Button- type="submit"- colorSchema="primary"- isLoading={isSubmitting || updateMcpServer.isPending}- isDisabled={isSubmitting || updateMcpServer.isPending}- >- Save Changes- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServerList.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServerList.tsxdeleted file mode 100644index ca7dd0e20a..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServerList.tsx+++ /dev/null@@ -1,65 +0,0 @@-import {- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";-import { useProject } from "@app/context";-import { TAiMcpServer, useListAiMcpServers } from "@app/hooks/api";--import { MCPServerRow } from "./MCPServerRow";--interface Props {- onEditServer: (server: TAiMcpServer) => void;- onDeleteServer: (server: TAiMcpServer) => void;-}--export const MCPServerList = ({ onEditServer, onDeleteServer }: Props) => {- const { currentProject } = useProject();-- const { data, isLoading } = useListAiMcpServers({- projectId: currentProject?.id || ""- });-- const servers = data?.servers;-- return (- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Status</Th>- <Th className="w-16" />- </Tr>- </THead>- <TBody>- {isLoading && <TableSkeleton columns={3} innerKey="mcp-servers" />}- {!isLoading && (!servers || servers.length === 0) && (- <Tr>- <Td colSpan={3}>- <EmptyState title="No MCP Servers" />- </Td>- </Tr>- )}- {!isLoading &&- servers &&- servers.length > 0 &&- servers.map((server) => (- <MCPServerRow- key={server.id}- server={server}- onEditServer={onEditServer}- onDeleteServer={onDeleteServer}- />- ))}- </TBody>- </Table>- </TableContainer>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServerRow.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServerRow.tsxdeleted file mode 100644index 69152853fb..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServerRow.tsx+++ /dev/null@@ -1,142 +0,0 @@-import { useCallback } from "react";-import { faCheck, faCopy, faEdit, faEllipsisV, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { useNavigate, useParams } from "@tanstack/react-router";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- Td,- Tooltip,- Tr-} from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useToggle } from "@app/hooks";-import { AiMcpServerStatus, TAiMcpServer } from "@app/hooks/api";--interface Props {- server: TAiMcpServer;- onEditServer: (server: TAiMcpServer) => void;- onDeleteServer: (server: TAiMcpServer) => void;-}--export const MCPServerRow = ({ server, onEditServer, onDeleteServer }: Props) => {- const navigate = useNavigate();- const { orgId, projectId } = useParams({ strict: false });- const [isIdCopied, setIsIdCopied] = useToggle(false);-- const handleCopyId = useCallback(() => {- setIsIdCopied.on();- navigator.clipboard.writeText(server.id);-- createNotification({- text: "Server ID copied to clipboard",- type: "info"- });-- setTimeout(() => setIsIdCopied.off(), 2000);- }, [setIsIdCopied, server.id]);-- const handleRowClick = () => {- navigate({- to: "/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId",- params: { orgId: orgId!, projectId: projectId!, serverId: server.id }- });- };-- const getStatusBadge = (status: AiMcpServerStatus) => {- const statusConfig = {- [AiMcpServerStatus.ACTIVE]: {- color: "bg-emerald-500",- label: "Active"- },- [AiMcpServerStatus.INACTIVE]: {- color: "bg-red-500",- label: "Inactive"- },- [AiMcpServerStatus.UNINITIALIZED]: {- color: "bg-yellow-500",- label: "Uninitialized"- }- };-- const config = statusConfig[status] || statusConfig[AiMcpServerStatus.UNINITIALIZED];-- return (- <div className="flex items-center gap-2">- <div className={`h-2 w-2 rounded-full ${config.color}`} />- <span className="text-sm text-mineshaft-300">{config.label}</span>- </div>- );- };-- return (- <Tr- className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"- onClick={handleRowClick}- >- <Td>- <span className="text-mineshaft-300">{server.name}</span>- </Td>- <Td>{getStatusBadge(server.status)}</Td>- <Td className="text-right">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="flex cursor-pointer justify-end hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsisV} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="p-1">- <DropdownMenuItem- icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} className="w-3" />}- onClick={() => handleCopyId()}- >- Copy Server ID- </DropdownMenuItem>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.McpServers}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- onEditServer(server);- }}- icon={<FontAwesomeIcon icon={faEdit} className="w-3" />}- isDisabled={!isAllowed}- >- Edit Server- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.McpServers}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={(e) => {- e.stopPropagation();- onDeleteServer(server);- }}- icon={<FontAwesomeIcon icon={faTrash} className="w-3" />}- className="text-red-500 hover:text-red-400"- isDisabled={!isAllowed}- >- Delete Server- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsxdeleted file mode 100644index 3692b17a61..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/MCPServersTab.tsx+++ /dev/null@@ -1,117 +0,0 @@-import { useState } from "react";-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { TAiMcpServer, useDeleteAiMcpServer } from "@app/hooks/api";--import { AddMCPServerModal } from "./AddMCPServerModal";-import { EditMCPServerModal } from "./EditMCPServerModal";-import { MCPServerList } from "./MCPServerList";--export const MCPServersTab = () => {- const [isAddModalOpen, setIsAddModalOpen] = useState(false);- const [isEditModalOpen, setIsEditModalOpen] = useState(false);- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);- const [selectedServer, setSelectedServer] = useState<TAiMcpServer | null>(null);-- const deleteServer = useDeleteAiMcpServer();-- const handleAddServer = () => {- setIsAddModalOpen(true);- };-- const handleEditServer = (server: TAiMcpServer) => {- setSelectedServer(server);- setIsEditModalOpen(true);- };-- const handleDeleteServer = (server: TAiMcpServer) => {- setSelectedServer(server);- setIsDeleteModalOpen(true);- };-- const handleDeleteConfirm = async () => {- if (!selectedServer) return;-- try {- await deleteServer.mutateAsync({ serverId: selectedServer.id });- createNotification({- text: `MCP server "${selectedServer.name}" deleted successfully`,- type: "success"- });- } catch (error) {- console.error("Failed to delete MCP server:", error);- createNotification({- text: "Failed to delete MCP server",- type: "error"- });- } finally {- setIsDeleteModalOpen(false);- setSelectedServer(null);- }- };-- return (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex items-center justify-between">- <div>- <h2 className="text-xl font-semibold text-mineshaft-100">MCP Servers</h2>- <p className="text-sm text-bunker-300">- Connect to remote MCP servers like Notion, GitHub, and Slack to enable AI tool access- </p>- </div>-- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.McpServers}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="button"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={handleAddServer}- isDisabled={!isAllowed}- >- Add MCP Server- </Button>- )}- </ProjectPermissionCan>- </div>-- <MCPServerList onEditServer={handleEditServer} onDeleteServer={handleDeleteServer} />-- <AddMCPServerModal isOpen={isAddModalOpen} onOpenChange={setIsAddModalOpen} />-- <EditMCPServerModal- isOpen={isEditModalOpen}- onOpenChange={(isOpen) => {- setIsEditModalOpen(isOpen);- if (!isOpen) {- setSelectedServer(null);- }- }}- server={selectedServer}- />-- {selectedServer && (- <DeleteActionModal- isOpen={isDeleteModalOpen}- title={`Delete MCP Server ${selectedServer.name}?`}- onChange={(isOpen) => {- setIsDeleteModalOpen(isOpen);- if (!isOpen) {- setSelectedServer(null);- }- }}- deleteKey={selectedServer.name}- onDeleteApproved={handleDeleteConfirm}- />- )}- </div>- );-};diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/index.ts b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/index.tsdeleted file mode 100644index 1c7fdb8aab..0000000000--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/index.ts+++ /dev/null@@ -1 +0,0 @@-export { MCPServersTab } from "./MCPServersTab";diff --git a/frontend/src/pages/ai/MCPPage/index.ts b/frontend/src/pages/ai/MCPPage/index.tsdeleted file mode 100644index 6cf4ba33f5..0000000000--- a/frontend/src/pages/ai/MCPPage/index.ts+++ /dev/null@@ -1 +0,0 @@-export { MCPPage } from "./MCPPage";diff --git a/frontend/src/pages/ai/MCPPage/route.tsx b/frontend/src/pages/ai/MCPPage/route.tsxdeleted file mode 100644index 3039a11779..0000000000--- a/frontend/src/pages/ai/MCPPage/route.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";-import { zodValidator } from "@tanstack/zod-adapter";-import { z } from "zod";--import { MCPPage } from "./MCPPage";--const mcpPageSearchSchema = z.object({- selectedTab: z.string().optional().default("mcp-endpoints")-});--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview"-)({- component: MCPPage,- validateSearch: zodValidator(mcpPageSearchSchema),- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "MCP"- }- ]- };- }-});diff --git a/frontend/src/pages/ai/MCPServerDetailPage/MCPServerDetailPage.tsx b/frontend/src/pages/ai/MCPServerDetailPage/MCPServerDetailPage.tsxdeleted file mode 100644index fb5f6fefd5..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/MCPServerDetailPage.tsx+++ /dev/null@@ -1,196 +0,0 @@-import { useState } from "react";-import { Helmet } from "react-helmet";-import { faBan, faChevronLeft, faEllipsisV, faServer } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { useNavigate, useParams } from "@tanstack/react-router";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button,- ContentLoader,- DeleteActionModal,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState-} from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useDeleteAiMcpServer, useGetAiMcpServerById } from "@app/hooks/api";--import { EditMCPServerModal } from "../MCPPage/components/MCPServersTab/EditMCPServerModal";-import {- MCPServerAvailableToolsSection,- MCPServerConnectionSection,- MCPServerCredentialsSection,- MCPServerDetailsSection-} from "./components";--const PageContent = () => {- const navigate = useNavigate();- const params = useParams({- strict: false- }) as { serverId?: string; projectId?: string; orgId?: string };-- const { serverId, projectId, orgId } = params;-- const [isEditModalOpen, setIsEditModalOpen] = useState(false);- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);-- const { data: mcpServer, isPending } = useGetAiMcpServerById(serverId!, {- refetchInterval: 30000,- enabled: Boolean(serverId)- });-- const deleteServer = useDeleteAiMcpServer();-- if (isPending) {- return (- <div className="flex h-full w-full items-center justify-center">- <ContentLoader />- </div>- );- }-- if (!mcpServer) {- return (- <div className="flex h-full w-full items-center justify-center px-20">- <EmptyState- className="max-w-2xl rounded-md text-center"- icon={faBan}- title={`Could not find MCP Server with ID ${serverId}`}- />- </div>- );- }-- const handleBack = () => {- navigate({- to: "/organizations/$orgId/projects/ai/$projectId/overview",- params: { orgId: orgId!, projectId: projectId! }- });- };-- const handleDeleteConfirm = async () => {- if (!mcpServer) return;-- try {- await deleteServer.mutateAsync({ serverId: mcpServer.id });- createNotification({- text: `MCP server "${mcpServer.name}" deleted successfully`,- type: "success"- });- handleBack();- } catch (error) {- console.error("Failed to delete MCP server:", error);- createNotification({- text: "Failed to delete MCP server",- type: "error"- });- }- };-- return (- <div className="container mx-auto flex max-w-7xl flex-col px-6 py-6 text-mineshaft-50">- <button- type="button"- onClick={handleBack}- className="mb-4 flex items-center gap-1 text-sm text-bunker-300 hover:text-primary-400"- >- <FontAwesomeIcon icon={faChevronLeft} className="text-xs" />- MCP Servers- </button>-- <div className="mb-6 flex items-center justify-between">- <div className="flex items-center gap-4">- <div className="flex h-12 w-12 items-center justify-center rounded-lg bg-mineshaft-700">- <FontAwesomeIcon icon={faServer} className="text-xl text-primary" />- </div>- <div>- <h1 className="text-2xl font-semibold text-mineshaft-100">{mcpServer.name}</h1>- <p className="text-sm text-bunker-300">MCP Server</p>- </div>- </div>- <div className="flex items-center gap-3">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="outline" size="sm" colorSchema="secondary">- <FontAwesomeIcon icon={faEllipsisV} />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.McpServers}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={() => setIsEditModalOpen(true)}- isDisabled={!isAllowed}- >- Edit Server- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.McpServers}- >- {(isAllowed) => (- <DropdownMenuItem- onClick={() => setIsDeleteModalOpen(true)}- className="text-red-500"- isDisabled={!isAllowed}- >- Delete Server- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </div>- </div>-- <div className="flex gap-6">- {/* Left Column - Details, Connection, Credentials */}- <div className="flex w-80 flex-col gap-4">- <MCPServerDetailsSection server={mcpServer} onEdit={() => setIsEditModalOpen(true)} />- <MCPServerConnectionSection server={mcpServer} />- <MCPServerCredentialsSection server={mcpServer} />- </div>-- {/* Right Column - Available Tools */}- <div className="flex flex-1 flex-col gap-4">- <MCPServerAvailableToolsSection serverId={mcpServer.id} />- </div>- </div>-- <EditMCPServerModal- isOpen={isEditModalOpen}- onOpenChange={setIsEditModalOpen}- server={mcpServer}- />-- <DeleteActionModal- isOpen={isDeleteModalOpen}- title={`Delete MCP Server ${mcpServer.name}?`}- onChange={(isOpen) => setIsDeleteModalOpen(isOpen)}- deleteKey={mcpServer.name}- onDeleteApproved={handleDeleteConfirm}- />- </div>- );-};--export const MCPServerDetailPage = () => {- return (- <>- <Helmet>- <title>MCP Server | Infisical</title>- <link rel="icon" href="/infisical.ico" />- </Helmet>- <PageContent />- </>- );-};diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsx b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsxdeleted file mode 100644index 850b1b3630..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsx+++ /dev/null@@ -1,98 +0,0 @@-import {- EmptyState,- Table,- TableContainer,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import { useListAiMcpServerTools } from "@app/hooks/api";--type Props = {- serverId: string;-};--export const MCPServerAvailableToolsSection = ({ serverId }: Props) => {- const { data: toolsData, isPending } = useListAiMcpServerTools({ serverId });- // const syncTools = useSyncAiMcpServerTools();-- const tools = toolsData?.tools || [];-- // const handleSyncTools = async () => {- // await syncTools.mutateAsync({ serverId });- // };-- return (- <div className="flex w-full flex-col rounded-lg border border-mineshaft-600 bg-mineshaft-900">- <div className="flex items-center justify-between border-b border-mineshaft-600 px-4 py-3">- <div>- <h3 className="text-lg font-medium text-mineshaft-100">Available Tools</h3>- <p className="text-sm text-bunker-300">- Tools provided by this MCP server that can be enabled in endpoints- </p>- </div>- {/* <Button- variant="outline_bg"- size="sm"- leftIcon={<FontAwesomeIcon icon={faRefresh} />}- onClick={handleSyncTools}- isLoading={syncTools.isPending}- >- Sync Tools- </Button> */}- </div>- <div className="p-4">- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-1/3">Tool Name</Th>- <Th>Description</Th>- </Tr>- </THead>- <TBody>- {isPending && (- <Tr>- <Td colSpan={2} className="text-center text-mineshaft-400">- Loading tools...- </Td>- </Tr>- )}- {!isPending && tools.length === 0 && (- <Tr>- <Td colSpan={2}>- <EmptyState title="No tools available" className="py-8" />- </Td>- </Tr>- )}- {tools.map((tool) => (- <Tr key={tool.id} className="hover:bg-mineshaft-700">- <Td>- <code className="rounded bg-mineshaft-700 px-2 py-1 font-mono text-sm text-mineshaft-200">- {tool.name}- </code>- </Td>- <Td className="max-w-md text-mineshaft-300">- {tool.description ? (- <Tooltip- content={tool.description}- className="max-h-96 max-w-lg overflow-y-auto"- >- <span className="line-clamp-2 cursor-help">{tool.description}</span>- </Tooltip>- ) : (- "-"- )}- </Td>- </Tr>- ))}- </TBody>- </Table>- </TableContainer>- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerConnectionSection.tsx b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerConnectionSection.tsxdeleted file mode 100644index d41b2bfd42..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerConnectionSection.tsx+++ /dev/null@@ -1,33 +0,0 @@-import { GenericFieldLabel } from "@app/components/v2";-import { AiMcpServerAuthMethod, TAiMcpServer } from "@app/hooks/api";--type Props = {- server: TAiMcpServer;-};--const getAuthMethodLabel = (method: AiMcpServerAuthMethod) => {- const labels: Record<AiMcpServerAuthMethod, string> = {- [AiMcpServerAuthMethod.BASIC]: "Basic Auth",- [AiMcpServerAuthMethod.BEARER]: "API Token",- [AiMcpServerAuthMethod.OAUTH]: "OAuth"- };- return labels[method] || "Unknown";-};--export const MCPServerConnectionSection = ({ server }: Props) => {- return (- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Connection</h3>- </div>- <div className="space-y-3">- <GenericFieldLabel label="Endpoint" truncate>- {server.url}- </GenericFieldLabel>- <GenericFieldLabel label="Authentication">- {getAuthMethodLabel(server.authMethod)}- </GenericFieldLabel>- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsx b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsxdeleted file mode 100644index 3a0cc93c03..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsx+++ /dev/null@@ -1,32 +0,0 @@-import { GenericFieldLabel } from "@app/components/v2";-import { AiMcpServerCredentialMode, TAiMcpServer } from "@app/hooks/api";--type Props = {- server: TAiMcpServer;-};--const getCredentialModeLabel = (mode: AiMcpServerCredentialMode) => {- const labels: Record<AiMcpServerCredentialMode, string> = {- [AiMcpServerCredentialMode.SHARED]: "Shared Credentials",- [AiMcpServerCredentialMode.PERSONAL]: "Personal Credentials"- };- return labels[mode] || "Unknown";-};--export const MCPServerCredentialsSection = ({ server }: Props) => {- return (- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Credentials</h3>- {/* <Button variant="outline_bg" size="xs" onClick={handleManageCredentials}>- Manage- </Button> */}- </div>- <div className="space-y-3">- <GenericFieldLabel label="Credential Mode">- {getCredentialModeLabel(server.credentialMode)}- </GenericFieldLabel>- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerDetailsSection.tsx b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerDetailsSection.tsxdeleted file mode 100644index 89c588713a..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerDetailsSection.tsx+++ /dev/null@@ -1,67 +0,0 @@-import { faEdit } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { format } from "date-fns";--import { ProjectPermissionCan } from "@app/components/permissions";-import { GenericFieldLabel, IconButton } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { AiMcpServerStatus, TAiMcpServer } from "@app/hooks/api";--type Props = {- server: TAiMcpServer;- onEdit: VoidFunction;-};--const getStatusLabel = (status: AiMcpServerStatus) => {- const labels: Record<AiMcpServerStatus, string> = {- [AiMcpServerStatus.ACTIVE]: "Active",- [AiMcpServerStatus.INACTIVE]: "Inactive",- [AiMcpServerStatus.UNINITIALIZED]: "Uninitialized"- };- return labels[status] || "Unknown";-};--const getStatusColor = (status: AiMcpServerStatus) => {- const colors: Record<AiMcpServerStatus, string> = {- [AiMcpServerStatus.ACTIVE]: "bg-emerald-500",- [AiMcpServerStatus.INACTIVE]: "bg-red-500",- [AiMcpServerStatus.UNINITIALIZED]: "bg-yellow-500"- };- return colors[status] || "bg-yellow-500";-};--export const MCPServerDetailsSection = ({ server, onEdit }: Props) => {- return (- <div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">- <h3 className="text-lg font-medium text-mineshaft-100">Details</h3>- <ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.McpServers}>- {(isAllowed) => (- <IconButton- variant="plain"- colorSchema="secondary"- ariaLabel="Edit server details"- onClick={onEdit}- isDisabled={!isAllowed}- >- <FontAwesomeIcon icon={faEdit} />- </IconButton>- )}- </ProjectPermissionCan>- </div>- <div className="space-y-3">- <GenericFieldLabel label="Name">{server.name}</GenericFieldLabel>- <GenericFieldLabel label="Description">{server.description}</GenericFieldLabel>- <GenericFieldLabel label="Status">- <div className="flex items-center gap-2">- <div className={`h-2 w-2 rounded-full ${getStatusColor(server.status)}`} />- {getStatusLabel(server.status)}- </div>- </GenericFieldLabel>- <GenericFieldLabel label="Created">- {format(new Date(server.createdAt), "yyyy-MM-dd, hh:mm aaa")}- </GenericFieldLabel>- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/index.ts b/frontend/src/pages/ai/MCPServerDetailPage/components/index.tsdeleted file mode 100644index afe2a8f9a6..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/components/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export { MCPServerAvailableToolsSection } from "./MCPServerAvailableToolsSection";-export { MCPServerConnectionSection } from "./MCPServerConnectionSection";-export { MCPServerCredentialsSection } from "./MCPServerCredentialsSection";-export { MCPServerDetailsSection } from "./MCPServerDetailsSection";diff --git a/frontend/src/pages/ai/MCPServerDetailPage/index.ts b/frontend/src/pages/ai/MCPServerDetailPage/index.tsdeleted file mode 100644index 7eb071aa2d..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/index.ts+++ /dev/null@@ -1 +0,0 @@-export { MCPServerDetailPage } from "./MCPServerDetailPage";diff --git a/frontend/src/pages/ai/MCPServerDetailPage/route.tsx b/frontend/src/pages/ai/MCPServerDetailPage/route.tsxdeleted file mode 100644index aa42eee6be..0000000000--- a/frontend/src/pages/ai/MCPServerDetailPage/route.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { MCPServerDetailPage } from "./MCPServerDetailPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId"-)({- component: MCPServerDetailPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "MCP Servers",- link: linkOptions({- to: "/organizations/$orgId/projects/ai/$projectId/overview",- params: { orgId: params.orgId, projectId: params.projectId }- })- },- {- label: "Server Details"- }- ]- };- }-});diff --git a/frontend/src/pages/ai/SettingsPage/SettingsPage.tsx b/frontend/src/pages/ai/SettingsPage/SettingsPage.tsxdeleted file mode 100644index d320047093..0000000000--- a/frontend/src/pages/ai/SettingsPage/SettingsPage.tsx+++ /dev/null@@ -1,50 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";-import { Link } from "@tanstack/react-router";-import { InfoIcon } from "lucide-react";--import { PageHeader, TabPanel, Tabs } from "@app/components/v2";-import { useOrganization } from "@app/context";-import { ProjectType } from "@app/hooks/api/projects/types";-import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";--const tabs = [- {- name: "General",- key: "tab-project-general",- Component: ProjectGeneralTab- }-];--export const SettingsPage = () => {- const { t } = useTranslation();- const { currentOrg } = useOrganization();-- return (- <div className="flex h-full w-full justify-center bg-bunker-800 text-white">- <Helmet>- <title>{t("common.head-title", { title: t("settings.project.title") })}</title>- </Helmet>- <div className="w-full max-w-8xl">- <PageHeader scope={ProjectType.AI} title={t("settings.project.title")}>- <Link- to="/organizations/$orgId/settings"- params={{- orgId: currentOrg.id- }}- className="flex items-center gap-x-1.5 text-xs whitespace-nowrap text-neutral hover:underline"- >- <InfoIcon size={12} /> Looking for organization settings?- </Link>- </PageHeader>- <Tabs orientation="vertical" defaultValue={tabs[0].key}>- {tabs.map(({ key, Component }) => (- <TabPanel value={key} key={key}>- <Component />- </TabPanel>- ))}- </Tabs>- </div>- </div>- );-};diff --git a/frontend/src/pages/ai/SettingsPage/route.tsx b/frontend/src/pages/ai/SettingsPage/route.tsxdeleted file mode 100644index e2d8f8c9f4..0000000000--- a/frontend/src/pages/ai/SettingsPage/route.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { SettingsPage } from "./SettingsPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings"-)({- component: SettingsPage,- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Settings"- }- ]- };- }-});diff --git a/frontend/src/pages/ai/layout.tsx b/frontend/src/pages/ai/layout.tsxdeleted file mode 100644index ed09ea701b..0000000000--- a/frontend/src/pages/ai/layout.tsx+++ /dev/null@@ -1,37 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { BreadcrumbTypes } from "@app/components/v2";-import { projectKeys } from "@app/hooks/api";-import { fetchProjectById } from "@app/hooks/api/projects/queries";-import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";-import { AILayout } from "@app/layouts/AILayout";-import { ProjectSelect } from "@app/layouts/ProjectLayout/components/ProjectSelect";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"-)({- component: AILayout,- beforeLoad: async ({ params, context }) => {- const project = await context.queryClient.ensureQueryData({- queryKey: projectKeys.getProjectById(params.projectId),- queryFn: () => fetchProjectById(params.projectId)- });-- await context.queryClient.ensureQueryData({- queryKey: roleQueryKeys.getUserProjectPermissions({- projectId: params.projectId- }),- queryFn: () => fetchUserProjectPermissions({ projectId: params.projectId })- });-- return {- project,- breadcrumbs: [- {- type: BreadcrumbTypes.Component,- component: ProjectSelect- }- ]- };- }-});diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsxindex 45ca209caf..d9d2fdc44a 100644--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx@@ -98,7 +98,6 @@ const PRODUCT_DEFINITIONS: ProductDefinition[] = [roles: CERT_MANAGER_ROLES},{ type: ProjectType.KMS, name: getProjectTitle(ProjectType.KMS), isSingleton: false },- { type: ProjectType.SSH, name: getProjectTitle(ProjectType.SSH), isSingleton: false },{type: ProjectType.SecretScanning,name: getProjectTitle(ProjectType.SecretScanning),diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddSubOrgMemberModal.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddSubOrgMemberModal.tsxindex 162d17e777..2b2c5272a6 100644--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddSubOrgMemberModal.tsx+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddSubOrgMemberModal.tsx@@ -136,8 +136,6 @@ export const AddSubOrgMemberModal = ({ onClose }: Props) => {return "Certificate Manager";case ProjectType.KMS:return "KMS";- case ProjectType.SSH:- return "SSH";default:return "Other";}diff --git a/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsx b/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsxdeleted file mode 100644index 57a600c0f5..0000000000--- a/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsx+++ /dev/null@@ -1,531 +0,0 @@-import { useCallback, useEffect, useState } from "react";-import { Helmet } from "react-helmet";-import { Controller, useForm } from "react-hook-form";-import { faCheckCircle, faExternalLink, faSpinner } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import { Link, useSearch } from "@tanstack/react-router";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input } from "@app/components/v2";-import {- useFinalizeMcpEndpointOAuth,- useGetAiMcpEndpointById,- useGetServersRequiringAuth,- useInitiateServerOAuth,- useSaveUserServerCredential,- useVerifyServerBearerToken-} from "@app/hooks/api";-import { TServerAuthStatus } from "@app/hooks/api/aiMcpEndpoints/types";-import { useGetOAuthStatus } from "@app/hooks/api/aiMcpServers/queries";-import { AiMcpServerAuthMethod } from "@app/hooks/api/aiMcpServers/types";--import { BearerTokenModal } from "./components/BearerTokenModal";--const OAUTH_POPUP_WIDTH = 600;-const OAUTH_POPUP_HEIGHT = 700;-const OAUTH_POLL_INTERVAL = 2000;--const FinalizeFormSchema = z.object({- expireIn: z.string().min(1, "Expiration is required")-});--type FormData = z.infer<typeof FinalizeFormSchema>;--type ServerOAuthState = {- sessionId: string | null;- isPending: boolean;- isAuthorized: boolean;-};--export const McpEndpointFinalizePage = () => {- const [isRedirecting, setIsRedirecting] = useState(false);- const [serverStates, setServerStates] = useState<Map<string, ServerOAuthState>>(new Map());- const [activeServerId, setActiveServerId] = useState<string | null>(null);- const [bearerModalServer, setBearerModalServer] = useState<{ id: string; name: string } | null>(- null- );- const [bearerTokenError, setBearerTokenError] = useState<string | undefined>(undefined);-- const search = useSearch({- from: "/_authenticate/organization/mcp-endpoint-finalize"- });-- const { data: endpoint, isLoading: isEndpointLoading } = useGetAiMcpEndpointById({- endpointId: search.endpointId- });-- const { data: serversRequiringAuth, isLoading: isServersLoading } = useGetServersRequiringAuth({- endpointId: search.endpointId- });-- const { mutateAsync: finalizeOAuth, isPending } = useFinalizeMcpEndpointOAuth();- const initiateServerOAuth = useInitiateServerOAuth();- const saveUserCredential = useSaveUserServerCredential();- const verifyBearerToken = useVerifyServerBearerToken();-- // Get active server's state for polling- const activeState = activeServerId ? serverStates.get(activeServerId) : null;- const activeSessionId = activeState?.sessionId ?? null;- const shouldPoll = Boolean(activeSessionId) && activeState?.isPending === true;-- // Poll OAuth status - continues until authorized: true- const { data: oauthStatus } = useGetOAuthStatus(- { sessionId: activeSessionId || "" },- {- enabled: shouldPoll,- refetchInterval: OAUTH_POLL_INTERVAL- }- );-- const {- handleSubmit,- control,- formState: { isSubmitting }- } = useForm<FormData>({- resolver: zodResolver(FinalizeFormSchema),- defaultValues: {- expireIn: "30d"- }- });-- // Initialize server states when data loads- useEffect(() => {- if (serversRequiringAuth && serversRequiringAuth.length > 0) {- setServerStates((prev) => {- const newStates = new Map<string, ServerOAuthState>();- serversRequiringAuth.forEach((server) => {- // Preserve existing state if available, otherwise initialize- const existing = prev.get(server.id);- newStates.set(server.id, {- sessionId: existing?.sessionId ?? null,- isPending: existing?.isPending ?? false,- isAuthorized: existing?.isAuthorized ?? server.hasCredentials- });- });- return newStates;- });- }- }, [serversRequiringAuth]);-- // Handle OAuth success - save credentials when authorized- useEffect(() => {- if (- !oauthStatus?.authorized ||- !oauthStatus.accessToken ||- !activeServerId ||- !activeSessionId- ) {- return;- }-- // Prevent duplicate saves- const state = serverStates.get(activeServerId);- if (!state?.isPending) {- return;- }-- // Save credentials- saveUserCredential.mutate(- {- endpointId: search.endpointId,- serverId: activeServerId,- accessToken: oauthStatus.accessToken,- refreshToken: oauthStatus.refreshToken,- expiresAt: oauthStatus.expiresAt,- tokenType: oauthStatus.tokenType- },- {- onSuccess: () => {- setServerStates((prev) => {- const newMap = new Map(prev);- newMap.set(activeServerId, {- sessionId: null,- isPending: false,- isAuthorized: true- });- return newMap;- });- setActiveServerId(null);- createNotification({- text: "Server authentication successful",- type: "success"- });- },- onError: () => {- createNotification({- text: "Failed to save credentials",- type: "error"- });- }- }- );- }, [oauthStatus?.authorized, oauthStatus?.accessToken, activeServerId, activeSessionId]);-- const handleServerOAuth = useCallback(- async (serverId: string) => {- try {- // Set pending state- setServerStates((prev) => {- const newMap = new Map(prev);- const existing = prev.get(serverId);- newMap.set(serverId, {- sessionId: null,- isPending: true,- isAuthorized: existing?.isAuthorized ?? false- });- return newMap;- });- setActiveServerId(serverId);-- // Get OAuth URL and session- const { authUrl, sessionId } = await initiateServerOAuth.mutateAsync({- endpointId: search.endpointId,- serverId- });-- // Store session ID to start polling- setServerStates((prev) => {- const newMap = new Map(prev);- const existing = prev.get(serverId);- newMap.set(serverId, {- sessionId,- isPending: true,- isAuthorized: existing?.isAuthorized ?? false- });- return newMap;- });-- // Open OAuth popup- const left = window.screenX + (window.outerWidth - OAUTH_POPUP_WIDTH) / 2;- const top = window.screenY + (window.outerHeight - OAUTH_POPUP_HEIGHT) / 2;-- const popup = window.open(- authUrl,- `oauth_${serverId}`,- `width=${OAUTH_POPUP_WIDTH},height=${OAUTH_POPUP_HEIGHT},left=${left},top=${top},scrollbars=yes,resizable=yes`- );-- if (!popup) {- createNotification({- text: "Failed to open OAuth popup. Please allow popups for this site.",- type: "error"- });- setServerStates((prev) => {- const newMap = new Map(prev);- newMap.set(serverId, {- sessionId: null,- isPending: false,- isAuthorized: false- });- return newMap;- });- setActiveServerId(null);- }- } catch (error) {- console.error("Failed to initiate OAuth:", error);- createNotification({- text: "Failed to initiate authentication",- type: "error"- });- setServerStates((prev) => {- const newMap = new Map(prev);- newMap.set(serverId, {- sessionId: null,- isPending: false,- isAuthorized: false- });- return newMap;- });- setActiveServerId(null);- }- },- [search.endpointId, initiateServerOAuth]- );-- const handleServerAuth = useCallback(- (server: TServerAuthStatus) => {- if (server.authMethod === AiMcpServerAuthMethod.BEARER) {- setBearerTokenError(undefined);- setBearerModalServer({ id: server.id, name: server.name });- } else {- // OAuth flow (default for oauth and basic auth types)- handleServerOAuth(server.id);- }- },- [handleServerOAuth]- );-- const handleBearerTokenSubmit = useCallback(- async (token: string) => {- if (!bearerModalServer) return;-- setBearerTokenError(undefined);-- try {- // First verify the token- const { valid, message } = await verifyBearerToken.mutateAsync({- endpointId: search.endpointId,- serverId: bearerModalServer.id,- accessToken: token- });-- if (!valid) {- setBearerTokenError(message || "Invalid token");- return;- }-- // Token is valid, save credentials- await saveUserCredential.mutateAsync({- endpointId: search.endpointId,- serverId: bearerModalServer.id,- accessToken: token,- tokenType: "Bearer"- });-- setServerStates((prev) => {- const newMap = new Map(prev);- newMap.set(bearerModalServer.id, {- sessionId: null,- isPending: false,- isAuthorized: true- });- return newMap;- });-- createNotification({- text: "Server authentication successful",- type: "success"- });-- setBearerModalServer(null);- } catch (error) {- console.error("Failed to verify/save bearer token:", error);- // Extract error message from axios error if available- const axiosError = error as { response?: { data?: { message?: string } } };- const errorMessage =- axiosError?.response?.data?.message ||- "Failed to verify token. Please check your token and try again.";- setBearerTokenError(errorMessage);- }- },- [bearerModalServer, search.endpointId, verifyBearerToken, saveUserCredential]- );-- const allServersAuthenticated =- !serversRequiringAuth ||- serversRequiringAuth.length === 0 ||- serversRequiringAuth.every((server) => {- const state = serverStates.get(server.id);- return state?.isAuthorized || server.hasCredentials;- });-- const onSubmit = async ({ expireIn }: FormData) => {- try {- const { callbackUrl } = await finalizeOAuth({- endpointId: search.endpointId,- response_type: search.response_type,- client_id: search.client_id,- code_challenge: search.code_challenge,- code_challenge_method: search.code_challenge_method,- redirect_uri: search.redirect_uri,- resource: search.resource,- expireIn- });-- setIsRedirecting(true);- window.location.href = callbackUrl;-- setTimeout(() => {- window.close();- }, 3000);- } catch (error) {- console.error("Failed to authorize:", error);- createNotification({- text: "Failed to authorize MCP endpoint access",- type: "error"- });- }- };-- if (isRedirecting) {- return (- <div className="flex min-h-screen flex-col items-center justify-center bg-bunker-800">- <div className="w-full max-w-md rounded-lg border border-mineshaft-600 bg-mineshaft-800 p-8 text-center shadow-lg">- <div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-green-500/10">- <FontAwesomeIcon icon={faCheckCircle} className="text-3xl text-green-500" />- </div>- <h1 className="text-xl font-semibold text-mineshaft-100">Authorization Successful</h1>- <p className="mt-2 text-sm text-bunker-300">- <FontAwesomeIcon icon={faSpinner} className="mr-2 animate-spin" />- Redirecting back to the application...- </p>- </div>- </div>- );- }-- const hasServersRequiringAuth = serversRequiringAuth && serversRequiringAuth.length > 0;-- return (- <div className="flex min-h-screen flex-col items-center justify-center bg-bunker-800">- <Helmet>- <title>Authorize MCP Endpoint</title>- <link rel="icon" href="/infisical.ico" />- </Helmet>-- <div className="w-full max-w-md rounded-lg border border-mineshaft-600 bg-mineshaft-800 p-8 shadow-lg">- <Link to="/" className="mb-6 block">- <img src="/images/gradientLogo.svg" className="mx-auto h-16" alt="Infisical logo" />- </Link>-- <div className="mb-6 text-center">- <h1 className="text-xl font-semibold text-mineshaft-100">Authorize MCP Access</h1>- <p className="mt-2 text-sm text-bunker-300">- An external application is requesting access to your MCP endpoint- </p>- </div>-- {isEndpointLoading && (- <div className="mb-6 animate-pulse rounded-lg border border-mineshaft-600 bg-mineshaft-700 p-4">- <div className="h-4 w-1/3 rounded bg-mineshaft-600" />- <div className="mt-2 h-3 w-2/3 rounded bg-mineshaft-600" />- </div>- )}- {!isEndpointLoading && endpoint && (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-700 p-4">- <p className="text-xs font-medium tracking-wide text-bunker-400 uppercase">Endpoint</p>- <p className="mt-1 font-medium text-mineshaft-100">{endpoint.name}</p>- {endpoint.description && (- <p className="mt-1 text-sm text-bunker-300">{endpoint.description}</p>- )}- <div className="mt-3 flex items-center gap-4 text-xs text-bunker-400">- <span>{endpoint.connectedServers} server(s)</span>- <span>{endpoint.activeTools} tool(s)</span>- </div>- </div>- )}- {!isEndpointLoading && !endpoint && (- <div className="mb-6 rounded-lg border border-red-500/30 bg-red-500/10 p-4 text-center">- <p className="text-sm text-red-400">Endpoint not found</p>- </div>- )}-- {/* Servers requiring authentication */}- {!isServersLoading && hasServersRequiringAuth && (- <div className="mt-6 mb-6 space-y-2">- <div className="rounded-md border border-primary-500/30 bg-primary-500/10 p-3">- <p className="text-xs text-mineshaft-200">- <span className="font-medium text-primary-400">Note:</span>{" "}- {serversRequiringAuth.length === 1- ? "The following server uses personal credentials. Authenticate with your own account to access its tools."- : "The following servers use personal credentials. Authenticate with your own accounts to access their tools."}- </p>- </div>- {serversRequiringAuth.map((server) => {- const state = serverStates.get(server.id);- const isAuthorized = state?.isAuthorized || server.hasCredentials;- const isServerPending = state?.isPending;-- return (- <div- key={server.id}- className={`flex items-center justify-between rounded-md border px-3 py-2 ${- isAuthorized- ? "border-green-500/30 bg-green-500/5"- : "border-mineshaft-600 bg-mineshaft-700/50"- }`}- >- <div className="min-w-0 flex-1">- <p className="truncate text-sm font-medium text-mineshaft-100">{server.name}</p>- </div>- <div className="ml-3 flex shrink-0 items-center gap-2">- {isAuthorized && (- <>- <FontAwesomeIcon icon={faCheckCircle} className="text-green-500" />- <Button- size="xs"- variant="outline_bg"- onClick={() => handleServerAuth(server)}- >- Re-authenticate- </Button>- </>- )}- {!isAuthorized && isServerPending && (- <FontAwesomeIcon icon={faSpinner} className="animate-spin text-yellow-500" />- )}- {!isAuthorized && !isServerPending && (- <Button- size="xs"- variant="outline_bg"- onClick={() => handleServerAuth(server)}- isLoading={initiateServerOAuth.isPending && activeServerId === server.id}- leftIcon={<FontAwesomeIcon icon={faExternalLink} />}- >- Authenticate- </Button>- )}- </div>- </div>- );- })}- </div>- )}-- {/* Only show authorization form after all servers are authenticated */}- {allServersAuthenticated && (- <>- <form onSubmit={handleSubmit(onSubmit)}>- <Controller- control={control}- name="expireIn"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Access Duration"- isError={Boolean(error)}- errorText={error?.message}- helperText="How long the access token should be valid (e.g., 1h, 7d, 30d)"- >- <Input {...field} placeholder="30d" />- </FormControl>- )}- />-- <div className="mt-6 flex gap-3">- <Button- type="submit"- className="flex-1"- isLoading={isSubmitting || isPending}- isDisabled={isSubmitting || isPending || !endpoint}- >- Authorize- </Button>- <Link to="/">- <Button variant="outline_bg" colorSchema="secondary">- Cancel- </Button>- </Link>- </div>- </form>-- <p className="mt-6 text-center text-xs text-bunker-400">- By authorizing, you grant the external application access to interact with the tools- available through this MCP endpoint.- </p>- </>- )}- </div>-- <BearerTokenModal- isOpen={bearerModalServer !== null}- onOpenChange={(isOpen) => !isOpen && setBearerModalServer(null)}- serverName={bearerModalServer?.name || ""}- isLoading={verifyBearerToken.isPending || saveUserCredential.isPending}- errorMessage={bearerTokenError}- onSubmit={handleBearerTokenSubmit}- />- </div>- );-};diff --git a/frontend/src/pages/organization/McpEndpointFinalizePage/components/BearerTokenModal.tsx b/frontend/src/pages/organization/McpEndpointFinalizePage/components/BearerTokenModal.tsxdeleted file mode 100644index 0ae3a59d0d..0000000000--- a/frontend/src/pages/organization/McpEndpointFinalizePage/components/BearerTokenModal.tsx+++ /dev/null@@ -1,82 +0,0 @@-import { useEffect, useState } from "react";--import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- serverName: string;- isLoading?: boolean;- errorMessage?: string;- onSubmit: (token: string) => void;-};--export const BearerTokenModal = ({- isOpen,- onOpenChange,- serverName,- isLoading,- errorMessage,- onSubmit-}: Props) => {- const [token, setToken] = useState("");-- // Clear token when modal closes- useEffect(() => {- if (!isOpen) {- setToken("");- }- }, [isOpen]);-- const handleSubmit = () => {- if (token) {- onSubmit(token);- }- };-- return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent title="Enter Bearer Token" subTitle={`Authenticate with ${serverName}`}>- <form- onSubmit={(e) => {- e.preventDefault();- handleSubmit();- }}- >- <FormControl- label="Bearer Token"- helperText="This credential will be securely stored in Infisical"- isError={Boolean(errorMessage)}- errorText={errorMessage}- >- <Input- type="password"- value={token}- onChange={(e) => setToken(e.target.value)}- placeholder="ghp_1a2b3c4d5e6f7g8h9i0j"- autoComplete="off"- />- </FormControl>- <div className="flex items-center justify-end">- <Button- colorSchema="secondary"- variant="plain"- className="py-2"- onClick={() => onOpenChange(false)}- >- Cancel- </Button>- <Button- type="submit"- isDisabled={!token || isLoading}- isLoading={isLoading}- className="ml-4"- >- Submit- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/organization/McpEndpointFinalizePage/route.tsx b/frontend/src/pages/organization/McpEndpointFinalizePage/route.tsxdeleted file mode 100644index 0732b58e74..0000000000--- a/frontend/src/pages/organization/McpEndpointFinalizePage/route.tsx+++ /dev/null@@ -1,22 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";-import { zodValidator } from "@tanstack/zod-adapter";-import { z } from "zod";--import { McpEndpointFinalizePage } from "./McpEndpointFinalizePage";--const McpEndpointFinalizePageQuerySchema = z.object({- response_type: z.string(),- client_id: z.string(),- code_challenge: z.string(),- code_challenge_method: z.string(),- redirect_uri: z.string(),- resource: z.string().optional(),- state: z.string().optional(),- scope: z.string().optional(),- endpointId: z.string()-});--export const Route = createFileRoute("/_authenticate/organization/mcp-endpoint-finalize")({- component: McpEndpointFinalizePage,- validateSearch: zodValidator(McpEndpointFinalizePageQuerySchema)-});diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsxindex 88008202df..6fe9f85589 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsx@@ -36,7 +36,6 @@ const totalCountOf = (r: TGatewayConnectedResources | undefined) =>? r.appConnections.length +r.dynamicSecrets.length +r.kubernetesAuths.length +- r.mcpServers.length +r.pkiDiscoveryConfigs.length: 0;@@ -168,28 +167,6 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {</AccordionItem>)}- {(resources?.mcpServers.length ?? 0) > 0 && (- <AccordionItem value="mcp-servers">- <AccordionTrigger>- <span className="flex-1">MCP Servers</span>- <Badge variant="neutral">{resources?.mcpServers.length}</Badge>- </AccordionTrigger>- <AccordionContent className="group-data-[variant=default]/accordion:p-3">- <ItemGroup>- {resources?.mcpServers.map((s) => (- <ResourceRow- key={s.id}- name={s.name}- subtitle={s.projectName}- to="/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId"- params={{ orgId: currentOrg.id, projectId: s.projectId, serverId: s.id }}- />- ))}- </ItemGroup>- </AccordionContent>- </AccordionItem>- )}-{(resources?.pkiDiscoveryConfigs.length ?? 0) > 0 && (<AccordionItem value="pki-discovery"><AccordionTrigger>diff --git a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsxindex eb1b6d4d47..5bae95ad69 100644--- a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx+++ b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx@@ -37,7 +37,7 @@ import { useOrgAdminAccessProject } from "@app/hooks/api/orgAdmin/mutation";import { resolvePamProjectId } from "@app/hooks/api/pam/queries";import { Project, ProjectType } from "@app/hooks/api/projects/types";-type ActiveProducts = Exclude<ProjectType, ProjectType.AI | ProjectType.SSH>;+type ActiveProducts = ProjectType;const PRODUCT_TYPES: ActiveProducts[] = [ProjectType.SecretManager,diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProductSelectSection/OrgProductSelectSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProductSelectSection/OrgProductSelectSection.tsxindex de1d584d1c..54e997aa07 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgProductSelectSection/OrgProductSelectSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProductSelectSection/OrgProductSelectSection.tsx@@ -20,10 +20,6 @@ export const OrgProductSelectSection = () => {name: "KMS",enabled: true},- sshProductEnabled: {- name: "SSH",- enabled: true- },scannerProductEnabled: {name: "Scanner",enabled: truediff --git a/frontend/src/pages/project/AccessControlPage/route-ai.tsx b/frontend/src/pages/project/AccessControlPage/route-ai.tsxdeleted file mode 100644index 5cc4a5d363..0000000000--- a/frontend/src/pages/project/AccessControlPage/route-ai.tsx+++ /dev/null@@ -1,32 +0,0 @@-import { createFileRoute, stripSearchParams } from "@tanstack/react-router";-import { zodValidator } from "@tanstack/zod-adapter";-import { z } from "zod";--import { ProjectAccessControlTabs } from "@app/types/project";--import { AccessControlPage } from "./AccessControlPage";--const AccessControlPageQuerySchema = z.object({- selectedTab: z.nativeEnum(ProjectAccessControlTabs).catch(ProjectAccessControlTabs.Member),- requesterEmail: z.string().catch("")-});--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management"-)({- component: AccessControlPage,- validateSearch: zodValidator(AccessControlPageQuerySchema),- search: {- middlewares: [stripSearchParams({ requesterEmail: "" })]- },- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control"- }- ]- };- }-});diff --git a/frontend/src/pages/project/AccessControlPage/route-ssh.tsx b/frontend/src/pages/project/AccessControlPage/route-ssh.tsxdeleted file mode 100644index fceb9bbf43..0000000000--- a/frontend/src/pages/project/AccessControlPage/route-ssh.tsx+++ /dev/null@@ -1,32 +0,0 @@-import { createFileRoute, stripSearchParams } from "@tanstack/react-router";-import { zodValidator } from "@tanstack/zod-adapter";-import { z } from "zod";--import { ProjectAccessControlTabs } from "@app/types/project";--import { AccessControlPage } from "./AccessControlPage";--const AccessControlPageQuerySchema = z.object({- selectedTab: z.nativeEnum(ProjectAccessControlTabs).catch(ProjectAccessControlTabs.Member),- requesterEmail: z.string().catch("")-});--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management"-)({- component: AccessControlPage,- validateSearch: zodValidator(AccessControlPageQuerySchema),- search: {- middlewares: [stripSearchParams({ requesterEmail: "" })]- },- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control"- }- ]- };- }-});diff --git a/frontend/src/pages/project/AuditLogsPage/route-ai.tsx b/frontend/src/pages/project/AuditLogsPage/route-ai.tsxdeleted file mode 100644index 4ef7102cdf..0000000000--- a/frontend/src/pages/project/AuditLogsPage/route-ai.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { AuditLogsPage } from "./AuditLogsPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs"-)({- component: AuditLogsPage,- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Audit Logs"- }- ]- };- }-});diff --git a/frontend/src/pages/project/AuditLogsPage/route-ssh.tsx b/frontend/src/pages/project/AuditLogsPage/route-ssh.tsxdeleted file mode 100644index ac9483af16..0000000000--- a/frontend/src/pages/project/AuditLogsPage/route-ssh.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { AuditLogsPage } from "./AuditLogsPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs"-)({- component: AuditLogsPage,- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Audit Logs"- }- ]- };- }-});diff --git a/frontend/src/pages/project/GroupDetailsByIDPage/route-ai.tsx b/frontend/src/pages/project/GroupDetailsByIDPage/route-ai.tsxdeleted file mode 100644index 939641094c..0000000000--- a/frontend/src/pages/project/GroupDetailsByIDPage/route-ai.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { GroupDetailsByIDPage } from "./GroupDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId"-)({- component: GroupDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ai/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Groups- }- })- },- {- label: "Group"- }- ]- };- }-});diff --git a/frontend/src/pages/project/GroupDetailsByIDPage/route-ssh.tsx b/frontend/src/pages/project/GroupDetailsByIDPage/route-ssh.tsxdeleted file mode 100644index 6990029a5c..0000000000--- a/frontend/src/pages/project/GroupDetailsByIDPage/route-ssh.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { GroupDetailsByIDPage } from "./GroupDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId"-)({- component: GroupDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Groups- }- })- },- {- label: "Group"- }- ]- };- }-});diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/route-ai.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/route-ai.tsxdeleted file mode 100644index 8d4e1c5c2b..0000000000--- a/frontend/src/pages/project/IdentityDetailsByIDPage/route-ai.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { IdentityDetailsByIDPage } from "./IdentityDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId"-)({- component: IdentityDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ai/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Identities- }- })- },- {- label: "Machine Identity"- }- ]- };- }-});diff --git a/frontend/src/pages/project/IdentityDetailsByIDPage/route-ssh.tsx b/frontend/src/pages/project/IdentityDetailsByIDPage/route-ssh.tsxdeleted file mode 100644index 8a4df2b493..0000000000--- a/frontend/src/pages/project/IdentityDetailsByIDPage/route-ssh.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { IdentityDetailsByIDPage } from "./IdentityDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId"-)({- component: IdentityDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Identities- }- })- },- {- label: "Machine Identity"- }- ]- };- }-});diff --git a/frontend/src/pages/project/MemberDetailsByIDPage/route-ai.tsx b/frontend/src/pages/project/MemberDetailsByIDPage/route-ai.tsxdeleted file mode 100644index c0201ff71e..0000000000--- a/frontend/src/pages/project/MemberDetailsByIDPage/route-ai.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { MemberDetailsByIDPage } from "./MemberDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId"-)({- component: MemberDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ai/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Member- }- })- },- {- label: "User"- }- ]- };- }-});diff --git a/frontend/src/pages/project/MemberDetailsByIDPage/route-ssh.tsx b/frontend/src/pages/project/MemberDetailsByIDPage/route-ssh.tsxdeleted file mode 100644index fc9383b64d..0000000000--- a/frontend/src/pages/project/MemberDetailsByIDPage/route-ssh.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { MemberDetailsByIDPage } from "./MemberDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId"-)({- component: MemberDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Member- }- })- },- {- label: "User"- }- ]- };- }-});diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/McpEndpointPermissionConditions.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/McpEndpointPermissionConditions.tsxdeleted file mode 100644index 11722491a5..0000000000--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/McpEndpointPermissionConditions.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { ProjectPermissionSub } from "@app/context/ProjectPermissionContext/types";--import { ConditionsFields } from "./ConditionsFields";--type Props = {- position?: number;- isDisabled?: boolean;-};--export const McpEndpointPermissionConditions = ({ position = 0, isDisabled }: Props) => {- return (- <ConditionsFields- isDisabled={isDisabled}- subject={ProjectPermissionSub.McpEndpoints}- position={position}- selectOptions={[- {- value: "name",- label: "Endpoint Name",- description: "The name of the MCP endpoint"- }- ]}- />- );-};diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsxindex 4505924951..ae0c636d9c 100644--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx@@ -25,7 +25,6 @@ import {ProjectPermissionIdentityActions,ProjectPermissionInsightsActions,ProjectPermissionKmipActions,- ProjectPermissionMcpEndpointActions,ProjectPermissionMemberActions,ProjectPermissionPkiCertificateInstallationActions,ProjectPermissionPkiDiscoveryActions,@@ -42,7 +41,6 @@ import {ProjectPermissionSecretScanningDataSourceActions,ProjectPermissionSecretScanningFindingActions,ProjectPermissionSecretSyncActions,- ProjectPermissionSshHostActions,TPermissionCondition,TPermissionConditionOperators} from "@app/context/ProjectPermissionContext/types";@@ -223,14 +221,6 @@ const KmipPolicyActionSchema = z.object({[ProjectPermissionKmipActions.GenerateClientCertificates]: z.boolean().optional()});-const SshHostPolicyActionSchema = z.object({- [ProjectPermissionSshHostActions.Read]: z.boolean().optional(),- [ProjectPermissionSshHostActions.Create]: z.boolean().optional(),- [ProjectPermissionSshHostActions.Edit]: z.boolean().optional(),- [ProjectPermissionSshHostActions.Delete]: z.boolean().optional(),- [ProjectPermissionSshHostActions.IssueHostCert]: z.boolean().optional()-});-const PkiSubscriberPolicyActionSchema = z.object({[ProjectPermissionPkiSubscriberActions.Read]: z.boolean().optional(),[ProjectPermissionPkiSubscriberActions.Create]: z.boolean().optional(),@@ -271,25 +261,6 @@ const SecretEventsPolicyActionSchema = z.object({[ProjectPermissionSecretEventActions.SubscribeToImportMutationEvents]: z.boolean().optional()});-const McpEndpointPolicyActionSchema = z.object({- [ProjectPermissionMcpEndpointActions.Read]: z.boolean().optional(),- [ProjectPermissionMcpEndpointActions.Create]: z.boolean().optional(),- [ProjectPermissionMcpEndpointActions.Edit]: z.boolean().optional(),- [ProjectPermissionMcpEndpointActions.Delete]: z.boolean().optional(),- [ProjectPermissionMcpEndpointActions.Connect]: z.boolean().optional()-});--const McpServerPolicyActionSchema = z.object({- [ProjectPermissionActions.Read]: z.boolean().optional(),- [ProjectPermissionActions.Create]: z.boolean().optional(),- [ProjectPermissionActions.Edit]: z.boolean().optional(),- [ProjectPermissionActions.Delete]: z.boolean().optional()-});--const McpActivityLogPolicyActionSchema = z.object({- [ProjectPermissionActions.Read]: z.boolean().optional()-});-const ApprovalRequestPolicyActionSchema = z.object({[ProjectPermissionApprovalRequestActions.Read]: z.boolean().optional(),[ProjectPermissionApprovalRequestActions.Create]: z.boolean().optional()@@ -794,18 +765,6 @@ export const projectRoleFormSchema = z.object({}).array().default([]),- [ProjectPermissionSub.SshCertificateAuthorities]: GeneralPolicyActionSchema.array().default(- []- ),- [ProjectPermissionSub.SshCertificates]: GeneralPolicyActionSchema.array().default([]),- [ProjectPermissionSub.SshCertificateTemplates]: GeneralPolicyActionSchema.array().default([]),- [ProjectPermissionSub.SshHosts]: SshHostPolicyActionSchema.extend({- inverted: z.boolean().optional(),- conditions: ConditionSchema- })- .array()- .default([]),- [ProjectPermissionSub.SshHostGroups]: GeneralPolicyActionSchema.array().default([]),[ProjectPermissionSub.SecretApproval]: ApprovalPolicyActionSchema.array().default([]),[ProjectPermissionSub.SecretRollback]: SecretRollbackPolicyActionSchema.array().default([]),[ProjectPermissionSub.Project]: WorkspacePolicyActionSchema.array().default([]),@@ -830,14 +789,6 @@ export const projectRoleFormSchema = z.object({}).array().default([]),- [ProjectPermissionSub.McpEndpoints]: McpEndpointPolicyActionSchema.extend({- inverted: z.boolean().optional(),- conditions: ConditionSchema- })- .array()- .default([]),- [ProjectPermissionSub.McpServers]: McpServerPolicyActionSchema.array().default([]),- [ProjectPermissionSub.McpActivityLogs]: McpActivityLogPolicyActionSchema.array().default([]),[ProjectPermissionSub.ApprovalRequests]: ApprovalRequestPolicyActionSchema.array().default([]),@@ -891,14 +842,12 @@ type TConditionalFields =| ProjectPermissionSub.Certificates| ProjectPermissionSub.CertificateProfiles| ProjectPermissionSub.CertificatePolicies- | ProjectPermissionSub.SshHosts| ProjectPermissionSub.SecretRotation| ProjectPermissionSub.Identity| ProjectPermissionSub.SecretSyncs| ProjectPermissionSub.PkiSyncs| ProjectPermissionSub.SecretEventSubscriptions| ProjectPermissionSub.AppConnections- | ProjectPermissionSub.McpEndpoints| ProjectPermissionSub.Member| ProjectPermissionSub.Groups| ProjectPermissionSub.Commits@@ -914,7 +863,6 @@ export const isConditionalSubjects = (subject === ProjectPermissionSub.SecretImports ||subject === ProjectPermissionSub.SecretFolders ||subject === ProjectPermissionSub.Identity ||- subject === ProjectPermissionSub.SshHosts ||subject === ProjectPermissionSub.SecretRotation ||subject === ProjectPermissionSub.PkiSubscribers ||subject === ProjectPermissionSub.CertificateTemplates ||@@ -926,7 +874,6 @@ export const isConditionalSubjects = (subject === ProjectPermissionSub.PkiSyncs ||subject === ProjectPermissionSub.SecretEventSubscriptions ||subject === ProjectPermissionSub.AppConnections ||- subject === ProjectPermissionSub.McpEndpoints ||subject === ProjectPermissionSub.Member ||subject === ProjectPermissionSub.Groups ||subject === ProjectPermissionSub.Commits ||@@ -1067,18 +1014,11 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {ProjectPermissionSub.Tags,ProjectPermissionSub.SecretRotation,ProjectPermissionSub.Kms,- ProjectPermissionSub.SshCertificateTemplates,- ProjectPermissionSub.SshCertificateAuthorities,- ProjectPermissionSub.SshCertificates,- ProjectPermissionSub.SshHostGroups,ProjectPermissionSub.SecretSyncs,ProjectPermissionSub.PkiSyncs,ProjectPermissionSub.SecretEventSubscriptions,ProjectPermissionSub.AppConnections,ProjectPermissionSub.HsmConnectors,- ProjectPermissionSub.McpEndpoints,- ProjectPermissionSub.McpServers,- ProjectPermissionSub.McpActivityLogs,ProjectPermissionSub.Insights,ProjectPermissionSub.ProjectFolderGrant].includes(subject)@@ -1763,32 +1703,6 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {return;}- if (subject === ProjectPermissionSub.SshHosts) {- if (!formVal[subject]) formVal[subject] = [];-- formVal[subject]!.push({- [ProjectPermissionSshHostActions.Edit]: action.includes(- ProjectPermissionSshHostActions.Edit- ),- [ProjectPermissionSshHostActions.Delete]: action.includes(- ProjectPermissionSshHostActions.Delete- ),- [ProjectPermissionSshHostActions.Create]: action.includes(- ProjectPermissionSshHostActions.Create- ),- [ProjectPermissionSshHostActions.Read]: action.includes(- ProjectPermissionSshHostActions.Read- ),- [ProjectPermissionSshHostActions.IssueHostCert]: action.includes(- ProjectPermissionSshHostActions.IssueHostCert- ),- conditions: conditions ? convertCaslConditionToFormOperator(conditions) : [],- inverted- });-- return;- }-if (subject === ProjectPermissionSub.Commits) {const canRead = action.includes(ProjectPermissionCommitsActions.Read);const canPerformRollback = action.includes(ProjectPermissionCommitsActions.PerformRollback);@@ -1908,48 +1822,6 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {return;}- if (subject === ProjectPermissionSub.McpEndpoints) {- const canRead = action.includes(ProjectPermissionMcpEndpointActions.Read);- const canCreate = action.includes(ProjectPermissionMcpEndpointActions.Create);- const canEdit = action.includes(ProjectPermissionMcpEndpointActions.Edit);- const canDelete = action.includes(ProjectPermissionMcpEndpointActions.Delete);- const canConnect = action.includes(ProjectPermissionMcpEndpointActions.Connect);-- if (!formVal[subject]) formVal[subject] = [];-- formVal[subject]!.push({- [ProjectPermissionMcpEndpointActions.Read]: canRead,- [ProjectPermissionMcpEndpointActions.Create]: canCreate,- [ProjectPermissionMcpEndpointActions.Edit]: canEdit,- [ProjectPermissionMcpEndpointActions.Delete]: canDelete,- [ProjectPermissionMcpEndpointActions.Connect]: canConnect,- conditions: conditions ? convertCaslConditionToFormOperator(conditions) : [],- inverted- });- }-- if (subject === ProjectPermissionSub.McpServers) {- const canRead = action.includes(ProjectPermissionActions.Read);- const canCreate = action.includes(ProjectPermissionActions.Create);- const canEdit = action.includes(ProjectPermissionActions.Edit);- const canDelete = action.includes(ProjectPermissionActions.Delete);-- if (!formVal[subject]) formVal[subject] = [{}];-- if (canRead) formVal[subject]![0][ProjectPermissionActions.Read] = true;- if (canCreate) formVal[subject]![0][ProjectPermissionActions.Create] = true;- if (canEdit) formVal[subject]![0][ProjectPermissionActions.Edit] = true;- if (canDelete) formVal[subject]![0][ProjectPermissionActions.Delete] = true;- }-- if (subject === ProjectPermissionSub.McpActivityLogs) {- const canRead = action.includes(ProjectPermissionActions.Read);-- if (!formVal[subject]) formVal[subject] = [{}];-- if (canRead) formVal[subject]![0][ProjectPermissionActions.Read] = true;- }-if (subject === ProjectPermissionSub.ApprovalRequests) {const canRead = action.includes(ProjectPermissionApprovalRequestActions.Read);const canCreate = action.includes(ProjectPermissionApprovalRequestActions.Create);@@ -2790,77 +2662,6 @@ export const PROJECT_PERMISSION_OBJECT: TProjectPermissionObject = {}]},- [ProjectPermissionSub.SshCertificateAuthorities]: {- title: "SSH Certificate Authorities",- description: "Manage SSH CA for signing host and user certificates",- actions: [- { label: "Read", value: "read", description: "View SSH certificate authorities" },- { label: "Create", value: "create", description: "Create new SSH certificate authorities" },- { label: "Modify", value: "edit", description: "Update SSH CA configuration" },- { label: "Remove", value: "delete", description: "Delete SSH certificate authorities" }- ]- },- [ProjectPermissionSub.SshCertificates]: {- title: "SSH Certificates",- description: "Issue and manage SSH user certificates",- actions: [- { label: "Read", value: "read", description: "View SSH certificates" },- { label: "Create", value: "create", description: "Issue new SSH certificates" },- { label: "Modify", value: "edit", description: "Update SSH certificate properties" },- { label: "Remove", value: "delete", description: "Revoke SSH certificates" }- ]- },- [ProjectPermissionSub.SshCertificateTemplates]: {- title: "SSH Certificate Templates",- description: "Define templates for SSH certificate issuance",- actions: [- { label: "Read", value: "read", description: "View SSH certificate templates" },- { label: "Create", value: "create", description: "Create new SSH certificate templates" },- { label: "Modify", value: "edit", description: "Update SSH template configuration" },- { label: "Remove", value: "delete", description: "Delete SSH certificate templates" }- ]- },- [ProjectPermissionSub.SshHosts]: {- title: "SSH Hosts",- description: "Manage SSH host certificates and access",- actions: [- {- label: "Read",- value: ProjectPermissionSshHostActions.Read,- description: "View SSH hosts and their configuration"- },- {- label: "Create",- value: ProjectPermissionSshHostActions.Create,- description: "Register new SSH hosts"- },- {- label: "Modify",- value: ProjectPermissionSshHostActions.Edit,- description: "Update SSH host settings"- },- {- label: "Remove",- value: ProjectPermissionSshHostActions.Delete,- description: "Remove SSH hosts"- },- {- label: "Issue Host Certificate",- value: ProjectPermissionSshHostActions.IssueHostCert,- description: "Issue host certificates for SSH hosts"- }- ]- },- [ProjectPermissionSub.SshHostGroups]: {- title: "SSH Host Groups",- description: "Organize SSH hosts into groups",- actions: [- { label: "Read", value: "read", description: "View SSH host groups" },- { label: "Create", value: "create", description: "Create new SSH host groups" },- { label: "Modify", value: "edit", description: "Update SSH host group membership" },- { label: "Remove", value: "delete", description: "Delete SSH host groups" }- ]- },[ProjectPermissionSub.PkiSubscribers]: {title: "PKI Subscribers",description: "Manage entities that receive certificates",@@ -3369,66 +3170,6 @@ export const PROJECT_PERMISSION_OBJECT: TProjectPermissionObject = {}]},- [ProjectPermissionSub.McpEndpoints]: {- title: "MCP Endpoints",- description: "Manage Model Context Protocol endpoints",- actions: [- {- label: "Read",- value: ProjectPermissionMcpEndpointActions.Read,- description: "View MCP endpoints"- },- {- label: "Create",- value: ProjectPermissionMcpEndpointActions.Create,- description: "Create new MCP endpoints"- },- {- label: "Modify",- value: ProjectPermissionMcpEndpointActions.Edit,- description: "Update endpoint configuration"- },- {- label: "Remove",- value: ProjectPermissionMcpEndpointActions.Delete,- description: "Delete MCP endpoints"- },- {- label: "Connect",- value: ProjectPermissionMcpEndpointActions.Connect,- description: "Connect to MCP endpoints"- }- ]- },- [ProjectPermissionSub.McpServers]: {- title: "MCP Servers",- description: "Configure MCP server connections",- actions: [- { label: "Read", value: ProjectPermissionActions.Read, description: "View MCP servers" },- {- label: "Create",- value: ProjectPermissionActions.Create,- description: "Register new MCP servers"- },- {- label: "Modify",- value: ProjectPermissionActions.Edit,- description: "Update server configuration"- },- { label: "Remove", value: ProjectPermissionActions.Delete, description: "Remove MCP servers" }- ]- },- [ProjectPermissionSub.McpActivityLogs]: {- title: "MCP Activity Logs",- description: "View MCP endpoint activity and usage",- actions: [- {- label: "Read",- value: ProjectPermissionActions.Read,- description: "View MCP activity and access logs"- }- ]- },[ProjectPermissionSub.SecretApprovalRequest]: {title: "Secret Approval Requests",description: "View secret change requests pending approval",@@ -3501,26 +3242,12 @@ const CertificateManagerPermissionSubjects = (enabled = false) => ({[ProjectPermissionSub.HsmConnectors]: enabled});-const SshPermissionSubjects = (enabled = false) => ({- [ProjectPermissionSub.SshCertificateAuthorities]: enabled,- [ProjectPermissionSub.SshCertificates]: enabled,- [ProjectPermissionSub.SshCertificateTemplates]: enabled,- [ProjectPermissionSub.SshHosts]: enabled,- [ProjectPermissionSub.SshHostGroups]: enabled-});-const SecretScanningSubject = (enabled = false) => ({[ProjectPermissionSub.SecretScanningDataSources]: enabled,[ProjectPermissionSub.SecretScanningFindings]: enabled,[ProjectPermissionSub.SecretScanningConfigs]: enabled});-const AiPermissionSubjects = (enabled = false) => ({- [ProjectPermissionSub.McpEndpoints]: enabled,- [ProjectPermissionSub.McpServers]: enabled,- [ProjectPermissionSub.McpActivityLogs]: enabled-});-// scott: this structure ensures we don't forget to add project permissions to their relevant project typeexport const ProjectTypePermissionSubjects: Record<ProjectType,@@ -3531,9 +3258,7 @@ export const ProjectTypePermissionSubjects: Record<...SecretsManagerPermissionSubjects(true),...KmsPermissionSubjects(),...CertificateManagerPermissionSubjects(),- ...SshPermissionSubjects(),...SecretScanningSubject(),- ...AiPermissionSubjects(),[ProjectPermissionSub.AppConnections]: true,// Approval Requests / Grants are not used in Secret Manager (secret approvals use SecretApproval policy)[ProjectPermissionSub.ApprovalRequests]: false,@@ -3544,9 +3269,7 @@ export const ProjectTypePermissionSubjects: Record<...KmsPermissionSubjects(true),...SecretsManagerPermissionSubjects(),...CertificateManagerPermissionSubjects(),- ...SshPermissionSubjects(),...SecretScanningSubject(),- ...AiPermissionSubjects(),[ProjectPermissionSub.AppConnections]: false},[ProjectType.CertificateManager]: {@@ -3554,49 +3277,23 @@ export const ProjectTypePermissionSubjects: Record<...CertificateManagerPermissionSubjects(true),...KmsPermissionSubjects(),...SecretsManagerPermissionSubjects(),- ...SshPermissionSubjects(),...SecretScanningSubject(),- ...AiPermissionSubjects(),[ProjectPermissionSub.AppConnections]: true},- [ProjectType.SSH]: {- ...SharedPermissionSubjects,- ...SshPermissionSubjects(true),- ...CertificateManagerPermissionSubjects(),- ...KmsPermissionSubjects(),- ...SecretsManagerPermissionSubjects(),- ...SecretScanningSubject(),- ...AiPermissionSubjects(),- [ProjectPermissionSub.AppConnections]: false- },[ProjectType.SecretScanning]: {...SharedPermissionSubjects,...SecretScanningSubject(true),- ...SshPermissionSubjects(),...CertificateManagerPermissionSubjects(),...KmsPermissionSubjects(),...SecretsManagerPermissionSubjects(),- ...AiPermissionSubjects(),[ProjectPermissionSub.AppConnections]: true},[ProjectType.PAM]: {...SharedPermissionSubjects,...SecretScanningSubject(),- ...SshPermissionSubjects(),...CertificateManagerPermissionSubjects(),...KmsPermissionSubjects(),...SecretsManagerPermissionSubjects(),- ...AiPermissionSubjects(),- [ProjectPermissionSub.AppConnections]: false- },- [ProjectType.AI]: {- ...SharedPermissionSubjects,- ...SecretsManagerPermissionSubjects(),- ...KmsPermissionSubjects(),- ...CertificateManagerPermissionSubjects(),- ...SshPermissionSubjects(),- ...SecretScanningSubject(),- ...AiPermissionSubjects(true),[ProjectPermissionSub.AppConnections]: false}};@@ -3651,70 +3348,6 @@ const projectManagerTemplate = (});export const RoleTemplates: Record<ProjectType, RoleTemplate[]> = {- [ProjectType.SSH]: [- {- id: "ssh-viewer",- name: "SSH Viewing Policies",- description: "Grants read access to SSH certificates and hosts",- permissions: [- {- subject: ProjectPermissionSub.SshCertificateAuthorities,- actions: [ProjectPermissionActions.Read]- },- {- subject: ProjectPermissionSub.SshCertificates,- actions: [ProjectPermissionActions.Read]- },- {- subject: ProjectPermissionSub.SshCertificateTemplates,- actions: [ProjectPermissionActions.Read]- },- {- subject: ProjectPermissionSub.SshHosts,- actions: [ProjectPermissionSshHostActions.Read]- },- {- subject: ProjectPermissionSub.SshHostGroups,- actions: [ProjectPermissionActions.Read]- }- ]- },- {- id: "ssh-cert-editor",- name: "SSH Certificate Editing Policies",- description: "Grants read and edit access to SSH certificates",- permissions: [- {- subject: ProjectPermissionSub.SshCertificateAuthorities,- actions: Object.values(ProjectPermissionActions)- },- {- subject: ProjectPermissionSub.SshCertificates,- actions: Object.values(ProjectPermissionActions)- },- {- subject: ProjectPermissionSub.SshCertificateTemplates,- actions: Object.values(ProjectPermissionActions)- }- ]- },- {- id: "ssh-host-editor",- name: "SSH Host Editing Policies",- description: "Grants read and edit access to SSH hosts",- permissions: [- {- subject: ProjectPermissionSub.SshHosts,- actions: Object.values(ProjectPermissionSshHostActions)- },- {- subject: ProjectPermissionSub.SshHostGroups,- actions: Object.values(ProjectPermissionActions)- }- ]- },- projectManagerTemplate()- ],[ProjectType.KMS]: [{id: "kms-viewer",@@ -4081,6 +3714,5 @@ export const RoleTemplates: Record<ProjectType, RoleTemplate[]> = {]}],- [ProjectType.PAM]: [projectManagerTemplate()],- [ProjectType.AI]: [projectManagerTemplate()]+ [ProjectType.PAM]: [projectManagerTemplate()]};diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsxindex 874e2b1d05..f432b037b8 100644--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsx+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/RolePermissionsSection.tsx@@ -30,7 +30,6 @@ import {} from "./GeneralPermissionPolicies";import { GroupPermissionConditions } from "./GroupPermissionConditions";import { IdentityManagementPermissionConditions } from "./IdentityManagementPermissionConditions";-import { McpEndpointPermissionConditions } from "./McpEndpointPermissionConditions";import { MemberPermissionConditions } from "./MemberPermissionConditions";import { PermissionEmptyState } from "./PermissionEmptyState";import { PkiSubscriberPermissionConditions } from "./PkiSubscriberPermissionConditions";@@ -50,7 +49,6 @@ import { SecretEventPermissionConditions } from "./SecretEventPermissionConditioimport { SecretPermissionConditions } from "./SecretPermissionConditions";import { SecretRotationPermissionConditions } from "./SecretRotationPermissionConditions";import { SecretSyncPermissionConditions } from "./SecretSyncPermissionConditions";-import { SshHostPermissionConditions } from "./SshHostPermissionConditions";type Props = {roleSlug: string;@@ -72,10 +70,6 @@ export const renderConditionalComponents = (return <IdentityManagementPermissionConditions isDisabled={isDisabled} />;}- if (subject === ProjectPermissionSub.SshHosts) {- return <SshHostPermissionConditions isDisabled={isDisabled} />;- }-if (subject === ProjectPermissionSub.PkiSubscribers) {return <PkiSubscriberPermissionConditions isDisabled={isDisabled} />;}@@ -116,10 +110,6 @@ export const renderConditionalComponents = (return <CertificatePolicyPermissionConditions isDisabled={isDisabled} />;}- if (subject === ProjectPermissionSub.McpEndpoints) {- return <McpEndpointPermissionConditions isDisabled={isDisabled} />;- }-if (subject === ProjectPermissionSub.HoneyTokens) {return <GeneralPermissionConditions isDisabled={isDisabled} type={subject} />;}diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/SshHostPermissionConditions.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/SshHostPermissionConditions.tsxdeleted file mode 100644index 061460c8e1..0000000000--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/SshHostPermissionConditions.tsx+++ /dev/null@@ -1,25 +0,0 @@-import { ProjectPermissionSub } from "@app/context/ProjectPermissionContext/types";--import { ConditionsFields } from "./ConditionsFields";--type Props = {- position?: number;- isDisabled?: boolean;-};--export const SshHostPermissionConditions = ({ position = 0, isDisabled }: Props) => {- return (- <ConditionsFields- isDisabled={isDisabled}- subject={ProjectPermissionSub.SshHosts}- position={position}- selectOptions={[- {- value: "hostname",- label: "Hostname",- description: "The hostname of the SSH host"- }- ]}- />- );-};diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/route-ai.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/route-ai.tsxdeleted file mode 100644index c30ee6914c..0000000000--- a/frontend/src/pages/project/RoleDetailsBySlugPage/route-ai.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { RoleDetailsBySlugPage } from "./RoleDetailsBySlugPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug"-)({- component: RoleDetailsBySlugPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ai/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Roles- }- })- },- {- label: "Roles"- }- ]- };- }-});diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/route-ssh.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/route-ssh.tsxdeleted file mode 100644index 6861dd03d5..0000000000--- a/frontend/src/pages/project/RoleDetailsBySlugPage/route-ssh.tsx+++ /dev/null@@ -1,34 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { ProjectAccessControlTabs } from "@app/types/project";--import { RoleDetailsBySlugPage } from "./RoleDetailsBySlugPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug"-)({- component: RoleDetailsBySlugPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Access Control",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/access-management",- params: {- orgId: params.orgId,- projectId: params.projectId- },- search: {- selectedTab: ProjectAccessControlTabs.Roles- }- })- },- {- label: "Roles"- }- ]- };- }-});diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/SshInputForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/SshInputForm.tsxindex 437838e827..3be4878c46 100644--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/SshInputForm.tsx+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/SshInputForm.tsx@@ -22,9 +22,9 @@ import {Tag} from "@app/components/v2";import { useCreateDynamicSecret, useGetSshCaPublicKey } from "@app/hooks/api";+import { SshCertKeyAlgorithm, sshCertKeyAlgorithms } from "@app/hooks/api/dynamicSecret/constants";import { DynamicSecretProviders } from "@app/hooks/api/dynamicSecret/types";import { getAuthToken } from "@app/hooks/api/reactQuery";-import { SshCertKeyAlgorithm, sshCertKeyAlgorithms } from "@app/hooks/api/sshCa/constants";import { ProjectEnv } from "@app/hooks/api/types";import { slugSchema } from "@app/lib/schemas";diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSshForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSshForm.tsxindex d3bbf000d4..9c90ad162e 100644--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSshForm.tsx+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretSshForm.tsx@@ -20,9 +20,9 @@ import {Tag} from "@app/components/v2";import { useGetSshCaPublicKey, useUpdateDynamicSecret } from "@app/hooks/api";+import { SshCertKeyAlgorithm, sshCertKeyAlgorithms } from "@app/hooks/api/dynamicSecret/constants";import { TDynamicSecret } from "@app/hooks/api/dynamicSecret/types";import { getAuthToken } from "@app/hooks/api/reactQuery";-import { SshCertKeyAlgorithm, sshCertKeyAlgorithms } from "@app/hooks/api/sshCa/constants";import { slugSchema } from "@app/lib/schemas";const sshCertKeyAlgorithmsArray = sshCertKeyAlgorithms.map((a) => a.value);diff --git a/frontend/src/pages/ssh/SettingsPage/SettingsPage.tsx b/frontend/src/pages/ssh/SettingsPage/SettingsPage.tsxdeleted file mode 100644index 05d9c7c944..0000000000--- a/frontend/src/pages/ssh/SettingsPage/SettingsPage.tsx+++ /dev/null@@ -1,66 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";-import { Link } from "@tanstack/react-router";-import { InfoIcon } from "lucide-react";--import { ProjectPermissionCan } from "@app/components/permissions";-import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub, useOrganization } from "@app/context";-import { ProjectType } from "@app/hooks/api/projects/types";-import { ProjectGeneralTab } from "@app/pages/project/SettingsPage/components/ProjectGeneralTab";--import { ProjectSshTab } from "./components/ProjectSshTab";--export const SettingsPage = () => {- const { t } = useTranslation();-- const { currentOrg, isSubOrganization } = useOrganization();-- return (- <div className="flex h-full w-full justify-center bg-bunker-800 text-white">- <Helmet>- <title>{t("common.head-title", { title: t("settings.project.title") })}</title>- </Helmet>- <div className="w-full max-w-8xl">- <PageHeader- scope={ProjectType.SSH}- title="Project Settings"- description="Configure your SSH product's configurations."- >- <Link- to="/organizations/$orgId/settings"- params={{- orgId: currentOrg.id- }}- className="flex items-center gap-x-1.5 text-xs whitespace-nowrap text-neutral hover:underline"- >- <InfoIcon size={12} /> Looking for {isSubOrganization ? "sub-" : ""}organization- settings?- </Link>- </PageHeader>- <Tabs orientation="vertical" defaultValue="tab-project-general">- <TabList>- <Tab variant="project" value="tab-project-general">- General- </Tab>- <Tab variant="project" value="tab-ssh-settings">- SSH Settings- </Tab>- </TabList>- <TabPanel value="tab-project-general">- <ProjectGeneralTab />- </TabPanel>- <TabPanel value="tab-ssh-settings">- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.Project}- renderGuardBanner- >- <ProjectSshTab />- </ProjectPermissionCan>- </TabPanel>- </Tabs>- </div>- </div>- );-};diff --git a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/ProjectSshTab.tsx b/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/ProjectSshTab.tsxdeleted file mode 100644index 8a79591bc1..0000000000--- a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/ProjectSshTab.tsx+++ /dev/null@@ -1,9 +0,0 @@-import { ProjectSshConfigCasSection } from "./components";--export const ProjectSshTab = () => {- return (- <div>- <ProjectSshConfigCasSection />- </div>- );-};diff --git a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/components/ProjectSshConfigCasSection.tsx b/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/components/ProjectSshConfigCasSection.tsxdeleted file mode 100644index aed25d46fd..0000000000--- a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/components/ProjectSshConfigCasSection.tsx+++ /dev/null@@ -1,131 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, FormControl, Select, SelectItem } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";-import {- useGetProjectSshConfig,- useListWorkspaceSshCas,- useUpdateProjectSshConfig-} from "@app/hooks/api";--const schema = z- .object({- defaultUserSshCaId: z.string(),- defaultHostSshCaId: z.string()- })- .required();--export type FormData = z.infer<typeof schema>;--export const ProjectSshConfigCasSection = () => {- const { currentProject } = useProject();- const { data: sshConfig } = useGetProjectSshConfig(currentProject.id);- const { data: sshCas } = useListWorkspaceSshCas(currentProject.id);- const { mutate: updateProjectSshConfig } = useUpdateProjectSshConfig();-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting }- } = useForm<FormData>({- resolver: zodResolver(schema)- });-- useEffect(() => {- if (sshConfig) {- reset({- defaultUserSshCaId: sshConfig.defaultUserSshCaId || "",- defaultHostSshCaId: sshConfig.defaultHostSshCaId || ""- });- }- }, [sshConfig]);-- const onFormSubmit = async ({ defaultUserSshCaId, defaultHostSshCaId }: FormData) => {- await updateProjectSshConfig({- projectId: currentProject.id,- defaultUserSshCaId: defaultUserSshCaId || undefined,- defaultHostSshCaId: defaultHostSshCaId || undefined- });-- createNotification({- text: "Successfully updated SSH project settings",- type: "success"- });- };-- return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <p className="mb-8 text-xl font-medium">Certificate Authorities</p>- <form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="defaultUserSshCaId"- defaultValue=""- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Default User CA"- isError={Boolean(error)}- errorText={error?.message}- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="min-w-[20rem]"- >- {sshCas?.map(({ id, friendlyName }) => (- <SelectItem value={String(id || "")} key={friendlyName}>- {friendlyName}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <Controller- control={control}- name="defaultHostSshCaId"- defaultValue=""- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Default Host CA"- isError={Boolean(error)}- errorText={error?.message}- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="min-w-[20rem]"- >- {sshCas?.map(({ id, friendlyName }) => (- <SelectItem value={String(id || "")} key={friendlyName}>- {friendlyName}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <ProjectPermissionCan I={ProjectPermissionActions.Edit} a={ProjectPermissionSub.Project}>- {(isAllowed) => (- <Button- colorSchema="secondary"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting || !isAllowed}- >- Save- </Button>- )}- </ProjectPermissionCan>- </form>- </div>- );-};diff --git a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/components/index.tsx b/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/components/index.tsxdeleted file mode 100644index 79010edb99..0000000000--- a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/components/index.tsx+++ /dev/null@@ -1 +0,0 @@-export { ProjectSshConfigCasSection } from "./ProjectSshConfigCasSection";diff --git a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/index.tsx b/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/index.tsxdeleted file mode 100644index 2fff359fe6..0000000000--- a/frontend/src/pages/ssh/SettingsPage/components/ProjectSshTab/index.tsx+++ /dev/null@@ -1 +0,0 @@-export { ProjectSshTab } from "./ProjectSshTab";diff --git a/frontend/src/pages/ssh/SettingsPage/route.tsx b/frontend/src/pages/ssh/SettingsPage/route.tsxdeleted file mode 100644index b5331c20aa..0000000000--- a/frontend/src/pages/ssh/SettingsPage/route.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { SettingsPage } from "./SettingsPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings"-)({- component: SettingsPage,- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Settings"- }- ]- };- }-});diff --git a/frontend/src/pages/ssh/SshCaByIDPage/SshCaByIDPage.tsx b/frontend/src/pages/ssh/SshCaByIDPage/SshCaByIDPage.tsxdeleted file mode 100644index 6bd7f7e831..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/SshCaByIDPage.tsx+++ /dev/null@@ -1,166 +0,0 @@-import { Helmet } from "react-helmet";-import { faChevronLeft } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { Link, useNavigate, useParams } from "@tanstack/react-router";-import { twMerge } from "tailwind-merge";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button,- DeleteActionModal,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- PageHeader,- Tooltip-} from "@app/components/v2";-import { ROUTE_PATHS } from "@app/const/routes";-import {- ProjectPermissionActions,- ProjectPermissionSub,- useOrganization,- useProject-} from "@app/context";-import { useDeleteSshCa, useGetSshCaById } from "@app/hooks/api";-import { ProjectType } from "@app/hooks/api/projects/types";-import { usePopUp } from "@app/hooks/usePopUp";--import { SshCaModal } from "../SshCasPage/components/SshCaModal";-import { SshCaDetailsSection, SshCertificateTemplatesSection } from "./components";--const Page = () => {- const { currentOrg } = useOrganization();- const { currentProject } = useProject();-- const navigate = useNavigate();- const projectId = currentProject?.id || "";- const caId = useParams({- from: ROUTE_PATHS.Ssh.SshCaByIDPage.id,- select: (el) => el.caId- });- const { data } = useGetSshCaById(caId);-- const { mutateAsync: deleteSshCa } = useDeleteSshCa();-- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "sshCa",- "deleteSshCa"- ] as const);-- const onRemoveCaSubmit = async (caIdToDelete: string) => {- if (!projectId) return;-- await deleteSshCa({ caId: caIdToDelete });-- createNotification({- text: "Successfully deleted SSH CA",- type: "success"- });-- handlePopUpClose("deleteSshCa");- navigate({- to: "/organizations/$orgId/projects/ssh/$projectId/overview",- params: {- orgId: currentOrg.id,- projectId- }- });- };-- return (- <div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">- {data && (- <div className="mx-auto mb-6 w-full max-w-8xl">- <Link- to="/organizations/$orgId/projects/ssh/$projectId/cas"- params={{- orgId: currentOrg.id,- projectId- }}- className="mb-4 flex items-center gap-x-2 text-sm text-mineshaft-400"- >- <FontAwesomeIcon icon={faChevronLeft} />- Certificate Authorities- </Link>- <PageHeader- scope={ProjectType.SSH}- description="Configure Certificate Authority"- title={data.friendlyName}- >- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <Button variant="outline_bg">More</Button>- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="p-1">- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.SshCertificateAuthorities}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- isAllowed- ? "hover:bg-red-500! hover:text-white!"- : "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={() =>- handlePopUpOpen("deleteSshCa", {- caId: data.id- })- }- disabled={!isAllowed}- >- Delete SSH CA- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </PageHeader>- <div className="flex">- <div className="mr-4 w-96">- <SshCaDetailsSection caId={caId} handlePopUpOpen={handlePopUpOpen} />- </div>- <div className="w-full">- <SshCertificateTemplatesSection caId={caId} />- </div>- </div>- </div>- )}- <SshCaModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <DeleteActionModal- isOpen={popUp.deleteSshCa.isOpen}- title="Are you sure you want to remove the SSH CA from the project?"- onChange={(isOpen) => handlePopUpToggle("deleteSshCa", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveCaSubmit((popUp?.deleteSshCa?.data as { caId: string })?.caId)- }- />- </div>- );-};--export const SshCaByIDPage = () => {- return (- <>- <Helmet>- <title>SSH Certificate Authority</title>- </Helmet>- <ProjectPermissionCan- I={ProjectPermissionActions.Read}- a={ProjectPermissionSub.SshCertificateAuthorities}- passThrough={false}- renderGuardBanner- >- <Page />- </ProjectPermissionCan>- </>- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsxdeleted file mode 100644index 96ba2c493c..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCaDetailsSection.tsx+++ /dev/null@@ -1,126 +0,0 @@-import { faCheck, faCopy, faDownload, faPencil } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import FileSaver from "file-saver";--import { ProjectPermissionCan } from "@app/components/permissions";-import { IconButton, Tooltip } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useTimedReset } from "@app/hooks";-import { useGetSshCaById } from "@app/hooks/api";-import { caStatusToNameMap } from "@app/hooks/api/ca/constants";-import { sshCertKeyAlgorithmToNameMap } from "@app/hooks/api/sshCa/constants";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- caId: string;- handlePopUpOpen: (popUpName: keyof UsePopUpState<["sshCa"]>, data?: object) => void;-};--export const SshCaDetailsSection = ({ caId, handlePopUpOpen }: Props) => {- const [copyTextId, isCopyingId, setCopyTextId] = useTimedReset<string>({- initialState: "Copy ID to clipboard"- });- const [downloadText, isDownloading, setDownloadText] = useTimedReset<string>({- initialState: "Save public key"- });-- const { data: ca } = useGetSshCaById(caId);-- const downloadTxtFile = (filename: string, content: string) => {- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });- FileSaver.saveAs(blob, filename);- };-- return ca ? (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">- <h3 className="text-lg font-medium text-mineshaft-100">SSH CA Details</h3>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshCertificateAuthorities}- >- {(isAllowed) => {- return (- <Tooltip content="Edit SSH CA">- <IconButton- isDisabled={!isAllowed}- ariaLabel="copy icon"- variant="plain"- className="group relative"- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("sshCa", {- caId: ca.id- });- }}- >- <FontAwesomeIcon icon={faPencil} />- </IconButton>- </Tooltip>- );- }}- </ProjectPermissionCan>- </div>- <div className="pt-4">- <div className="mb-4">- <p className="text-sm font-medium text-mineshaft-300">SSH CA ID</p>- <div className="group flex align-top">- <p className="text-sm text-mineshaft-300">{ca.id}</p>- <div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100">- <Tooltip content={copyTextId}>- <IconButton- ariaLabel="copy icon"- variant="plain"- className="group relative ml-2"- onClick={() => {- navigator.clipboard.writeText(ca.id);- setCopyTextId("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingId ? faCheck : faCopy} />- </IconButton>- </Tooltip>- </div>- </div>- </div>- <div className="mb-4">- <p className="text-sm font-medium text-mineshaft-300">Friendly Name</p>- <p className="text-sm text-mineshaft-300">{ca.friendlyName}</p>- </div>- <div className="mb-4">- <p className="text-sm font-medium text-mineshaft-300">Status</p>- <p className="text-sm text-mineshaft-300">{caStatusToNameMap[ca.status]}</p>- </div>- <div className="mb-4">- <p className="text-sm font-medium text-mineshaft-300">Key Algorithm</p>- <p className="text-sm text-mineshaft-300">- {sshCertKeyAlgorithmToNameMap[ca.keyAlgorithm]}- </p>- </div>- <div>- <p className="text-sm font-medium text-mineshaft-300">Public Key</p>- <div className="group flex align-top">- <p className="flex-1 text-sm text-mineshaft-300">{ca.publicKey.substring(0, 20)}...</p>- <div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100">- <Tooltip content={downloadText}>- <IconButton- ariaLabel="copy icon"- variant="plain"- className="group relative ml-2"- onClick={() => {- setDownloadText("Saved");- downloadTxtFile("ssh_ca.pub", ca.publicKey);- }}- >- <FontAwesomeIcon icon={isDownloading ? faCheck : faDownload} />- </IconButton>- </Tooltip>- </div>- </div>- </div>- </div>- </div>- ) : (- <div />- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateContent.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateContent.tsxdeleted file mode 100644index 9a7eaa58ee..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateContent.tsx+++ /dev/null@@ -1,174 +0,0 @@-import { faCheck, faCopy, faDownload } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import FileSaver from "file-saver";--import { IconButton, Tooltip } from "@app/components/v2";-import { useTimedReset } from "@app/hooks";--type Props = {- serialNumber: string;- signedKey: string;- privateKey?: string;- publicKey?: string;-};--export const SshCertificateContent = ({- serialNumber,- signedKey,- privateKey,- publicKey-}: Props) => {- const [copyTextSerialNumber, isCopyingSerialNumber, setCopyTextSerialNumber] =- useTimedReset<string>({- initialState: "Copy to clipboard"- });- const [copyTextCertificate, isCopyingCertificate, setCopyTextCertificate] = useTimedReset<string>(- {- initialState: "Copy to clipboard"- }- );-- const [copyTextCertificateSk, isCopyingCertificateSk, setCopyTextCertificateSk] =- useTimedReset<string>({- initialState: "Copy to clipboard"- });-- const [copyTextCertificatePk, isCopyingCertificatePk, setCopyTextCertificatePk] =- useTimedReset<string>({- initialState: "Copy to clipboard"- });-- const downloadTxtFile = (filename: string, content: string) => {- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });- FileSaver.saveAs(blob, filename);- };-- return (- <div>- <h2 className="mb-4">Serial Number</h2>- <div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">- <p className="mr-4 break-all">{serialNumber}</p>- <Tooltip content={copyTextSerialNumber}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative"- onClick={() => {- navigator.clipboard.writeText(serialNumber);- setCopyTextSerialNumber("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingSerialNumber ? faCheck : faCopy} />- </IconButton>- </Tooltip>- </div>- <div className="mb-4 flex items-center justify-between">- <h2>SSH Certificate / Signed Key</h2>- <div className="flex">- <Tooltip content={copyTextCertificate}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative"- onClick={() => {- navigator.clipboard.writeText(signedKey);- setCopyTextCertificate("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingCertificate ? faCheck : faCopy} />- </IconButton>- </Tooltip>- <Tooltip content="Download">- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative ml-2"- onClick={() => {- downloadTxtFile("user_key-cert.pub", signedKey);- }}- >- <FontAwesomeIcon icon={faDownload} />- </IconButton>- </Tooltip>- </div>- </div>- <div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">- <p className="mr-4 break-all whitespace-pre-wrap">{signedKey}</p>- </div>- {privateKey && (- <>- <div className="mb-4 flex items-center justify-between">- <h2>Private Key</h2>- <div className="flex">- <Tooltip content={copyTextCertificateSk}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative"- onClick={() => {- navigator.clipboard.writeText(privateKey);- setCopyTextCertificateSk("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingCertificateSk ? faCheck : faCopy} />- </IconButton>- </Tooltip>- <Tooltip content={copyTextCertificateSk}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative ml-2"- onClick={() => {- downloadTxtFile("user_key.pem", privateKey);- }}- >- <FontAwesomeIcon icon={faDownload} />- </IconButton>- </Tooltip>- </div>- </div>- <div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">- <p className="mr-4 break-all whitespace-pre-wrap">{privateKey}</p>- </div>- </>- )}- {publicKey && (- <>- <div className="mb-4 flex items-center justify-between">- <h2>Public Key</h2>- <div className="flex">- <Tooltip content={copyTextCertificatePk}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative"- onClick={() => {- navigator.clipboard.writeText(publicKey);- setCopyTextCertificatePk("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingCertificatePk ? faCheck : faCopy} />- </IconButton>- </Tooltip>- <Tooltip content={copyTextCertificatePk}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative ml-2"- onClick={() => {- downloadTxtFile("user_key.pub", publicKey);- }}- >- <FontAwesomeIcon icon={faDownload} />- </IconButton>- </Tooltip>- </div>- </div>- <div className="flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">- <p className="mr-4 break-all whitespace-pre-wrap">{publicKey}</p>- </div>- </>- )}- </div>- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsxdeleted file mode 100644index 32470308a2..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateModal.tsx+++ /dev/null@@ -1,368 +0,0 @@-import { useEffect, useState } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import ms from "ms";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- Input,- Modal,- ModalContent,- Select,- SelectItem-} from "@app/components/v2";-import { useProject } from "@app/context";-import {- SshCertTemplateStatus,- useGetSshCertTemplate,- useIssueSshCreds,- useListWorkspaceSshCertificateTemplates,- useSignSshKey-} from "@app/hooks/api";-import {- SshCertKeyAlgorithm,- sshCertKeyAlgorithms,- SshCertType-} from "@app/hooks/api/sshCa/constants";-import { UsePopUpState } from "@app/hooks/usePopUp";--import { SshCertificateContent } from "./SshCertificateContent";--const schema = z.object({- templateId: z.string(),- publicKey: z.string().optional(),- keyAlgorithm: z.enum([- SshCertKeyAlgorithm.RSA_2048,- SshCertKeyAlgorithm.RSA_4096,- SshCertKeyAlgorithm.ECDSA_P256,- SshCertKeyAlgorithm.ECDSA_P384,- SshCertKeyAlgorithm.ED25519- ]),- certType: z.nativeEnum(SshCertType),- principals: z.string(),- ttl: z- .string()- .trim()- .refine((val) => ms(val) > 0, "TTL must be a valid time string such as 2 days, 1d, 2h 1y, ...")- .optional(),- keyId: z.string().optional()-});--export type FormData = z.infer<typeof schema>;--type Props = {- popUp: UsePopUpState<["sshCertificate"]>;- handlePopUpToggle: (popUpName: keyof UsePopUpState<["sshCertificate"]>, state?: boolean) => void;-};--type TSshCertificateDetails = {- serialNumber: string;- signedKey: string;- privateKey?: string;- publicKey?: string;-};--enum SshCertificateOperation {- SIGN_SSH_KEY = "sign-ssh-key",- ISSUE_SSH_CREDS = "issue-ssh-creds"-}--export const SshCertificateModal = ({ popUp, handlePopUpToggle }: Props) => {- const { currentProject } = useProject();- const projectId = currentProject?.id || "";- const [operation, setOperation] = useState<SshCertificateOperation>(- SshCertificateOperation.SIGN_SSH_KEY- );- const [certificateDetails, setCertificateDetails] = useState<TSshCertificateDetails | null>(null);-- const { mutateAsync: signSshKey } = useSignSshKey();- const { mutateAsync: issueSshCreds } = useIssueSshCreds();-- const popUpData = popUp?.sshCertificate?.data as {- sshCaId: string;- templateId: string;- };-- const { data: templatesData } = useListWorkspaceSshCertificateTemplates(projectId);-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting },- setValue,- watch- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {- keyAlgorithm: SshCertKeyAlgorithm.ED25519,- certType: SshCertType.USER- }- });-- const templateId = watch("templateId");- const { data: templateData } = useGetSshCertTemplate(templateId);-- useEffect(() => {- if (popUpData) {- setValue("templateId", popUpData.templateId);- } else if (templatesData && templatesData.certificateTemplates.length > 0) {- setValue("templateId", templatesData.certificateTemplates[0].id);- }- }, [popUpData]);-- const onFormSubmit = async ({- keyAlgorithm,- certType,- publicKey: existingPublicKey,- principals,- ttl,- keyId- }: FormData) => {- if (!templateData) return;- if (!projectId) return;-- switch (operation) {- case SshCertificateOperation.SIGN_SSH_KEY: {- const { serialNumber, signedKey } = await signSshKey({- projectId,- certificateTemplateId: templateData.id,- publicKey: existingPublicKey,- certType,- principals: principals.split(",").map((user) => user.trim()),- ttl,- keyId- });-- setCertificateDetails({- serialNumber,- signedKey- });- break;- }- case SshCertificateOperation.ISSUE_SSH_CREDS: {- const { serialNumber, publicKey, privateKey, signedKey } = await issueSshCreds({- projectId,- certificateTemplateId: templateData.id,- keyAlgorithm,- certType,- principals: principals.split(",").map((user) => user.trim()),- ttl,- keyId- });-- setCertificateDetails({- serialNumber,- privateKey,- publicKey,- signedKey- });- break;- }- default: {- break;- }- }-- reset();-- createNotification({- text: "Successfully created SSH certificate",- type: "success"- });- };-- return (- <Modal- isOpen={popUp?.sshCertificate?.isOpen}- onOpenChange={(isOpen) => {- handlePopUpToggle("sshCertificate", isOpen);- reset();- setCertificateDetails(null);- }}- >- <ModalContent title="Issue SSH Certificate">- {!certificateDetails ? (- <form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="templateId"- defaultValue=""- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Certificate Template"- errorText={error?.message}- isError={Boolean(error)}- isRequired- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- isDisabled={Boolean(popUpData?.sshCaId)}- >- {(templatesData?.certificateTemplates || [])- .filter((template) => template.status === SshCertTemplateStatus.ACTIVE)- .map(({ id, name }) => (- <SelectItem value={id} key={`ssh-cert-template-${id}`}>- {name}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <FormControl label="Operation">- <Select- defaultValue="issue-ssh-creds"- value={operation}- onValueChange={(e) => setOperation(e as SshCertificateOperation)}- className="w-full"- >- <SelectItem value="sign-ssh-key" key="sign-ssh-key">- Sign SSH Key- </SelectItem>- <SelectItem value="issue-ssh-creds" key="issue-ssh-creds">- Issue SSH Credentials- </SelectItem>- </Select>- </FormControl>- <Controller- control={control}- name="certType"- defaultValue={SshCertType.USER}- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Certificate Type"- errorText={error?.message}- isError={Boolean(error)}- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- >- {templateData && templateData.allowUserCertificates && (- <SelectItem value={SshCertType.USER}>User</SelectItem>- )}- {templateData && templateData.allowHostCertificates && (- <SelectItem value={SshCertType.HOST}>Host</SelectItem>- )}- </Select>- </FormControl>- )}- />- {operation === SshCertificateOperation.SIGN_SSH_KEY && (- <Controller- control={control}- name="publicKey"- render={({ field, fieldState: { error } }) => (- <FormControl- label="SSH Public Key"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="ssh-rsa AAA ..." />- </FormControl>- )}- />- )}- {operation === SshCertificateOperation.ISSUE_SSH_CREDS && (- <Controller- control={control}- name="keyAlgorithm"- defaultValue={SshCertKeyAlgorithm.ED25519}- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Key Algorithm"- errorText={error?.message}- isError={Boolean(error)}- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- >- {sshCertKeyAlgorithms.map(({ label, value }) => (- <SelectItem value={String(value || "")} key={label}>- {label}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- )}- <Controller- control={control}- name="principals"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Principal(s)"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="ec2-user" />- </FormControl>- )}- />-- <Controller- control={control}- name="ttl"- render={({ field, fieldState: { error } }) => (- <FormControl label="TTL" isError={Boolean(error)} errorText={error?.message}>- <Input {...field} placeholder="2 days, 1d, 2h, 1y, ..." />- </FormControl>- )}- />- {templateData && templateData.allowCustomKeyIds && (- <Controller- control={control}- name="keyId"- render={({ field, fieldState: { error } }) => (- <FormControl label="Key ID" isError={Boolean(error)} errorText={error?.message}>- <Input {...field} placeholder="12345678" />- </FormControl>- )}- />- )}- <div className="mt-4 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >- Create- </Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("sshCertificate", false)}- >- Cancel- </Button>- </div>- </form>- ) : (- <SshCertificateContent- serialNumber={certificateDetails.serialNumber}- signedKey={certificateDetails.signedKey}- publicKey={certificateDetails.publicKey}- privateKey={certificateDetails.privateKey}- />- )}- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplateModal.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplateModal.tsxdeleted file mode 100644index 926a1d0220..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplateModal.tsx+++ /dev/null@@ -1,368 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import slugify from "@sindresorhus/slugify";-import ms from "ms";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- Input,- Modal,- ModalContent,- Select,- SelectItem,- Switch-} from "@app/components/v2";-import { useProject } from "@app/context";-import {- useCreateSshCertTemplate,- useGetSshCaById,- useGetSshCertTemplate,- useListWorkspaceSshCas,- useUpdateSshCertTemplate-} from "@app/hooks/api";-import { UsePopUpState } from "@app/hooks/usePopUp";--const schema = z- .object({- sshCaId: z.string(),- name: z- .string()- .trim()- .toLowerCase()- .min(1)- .max(36)- .refine((v) => slugify(v) === v, {- message: "Invalid name. Name can only contain alphanumeric characters and hyphens."- }),- ttl: z- .string()- .trim()- .refine(- (val) => ms(val) > 0,- "TTL must be a valid time string such as 2 days, 1d, 2h 1y, ..."- )- .default("1h"),- maxTTL: z- .string()- .trim()- .refine(- (val) => ms(val) > 0,- "Max TTL must be a valid time string such as 2 days, 1d, 2h 1y, ..."- )- .default("30d"),- allowedUsers: z.string(),- allowedHosts: z.string(),- allowUserCertificates: z.boolean().optional().default(false),- allowHostCertificates: z.boolean().optional().default(false),- allowCustomKeyIds: z.boolean().optional().default(false)- })- .refine((data) => ms(data.maxTTL) >= ms(data.ttl), {- message: "Max TTL must be greater than or equal to TTL",- path: ["maxTTL"]- });--export type FormData = z.infer<typeof schema>;--type Props = {- sshCaId: string;- popUp: UsePopUpState<["sshCertificateTemplate"]>;- handlePopUpToggle: (- popUpName: keyof UsePopUpState<["sshCertificateTemplate"]>,- state?: boolean- ) => void;-};--export const SshCertificateTemplateModal = ({ popUp, handlePopUpToggle, sshCaId }: Props) => {- const { currentProject } = useProject();-- const { data: ca } = useGetSshCaById(sshCaId);-- const { data: certTemplate } = useGetSshCertTemplate(- (popUp?.sshCertificateTemplate?.data as { id: string })?.id || ""- );-- const { data: cas } = useListWorkspaceSshCas(currentProject?.id || "");-- const { mutateAsync: createSshCertTemplate } = useCreateSshCertTemplate();- const { mutateAsync: updateSshCertTemplate } = useUpdateSshCertTemplate();-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting }- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {}- });-- useEffect(() => {- if (certTemplate) {- reset({- sshCaId: certTemplate.sshCaId,- name: certTemplate.name,- ttl: certTemplate.ttl,- maxTTL: certTemplate.maxTTL,- allowedUsers: certTemplate.allowedUsers.join(", "),- allowedHosts: certTemplate.allowedHosts.join(", "),- allowUserCertificates: certTemplate.allowUserCertificates,- allowHostCertificates: certTemplate.allowHostCertificates,- allowCustomKeyIds: certTemplate.allowCustomKeyIds- });- } else {- reset({- sshCaId,- name: "",- ttl: "1h",- maxTTL: "30d",- allowedUsers: "",- allowedHosts: "",- allowUserCertificates: false,- allowHostCertificates: false,- allowCustomKeyIds: false- });- }- }, [certTemplate, ca]);-- const onFormSubmit = async ({- name,- ttl,- maxTTL,- allowUserCertificates,- allowHostCertificates,- allowedUsers,- allowedHosts,- allowCustomKeyIds- }: FormData) => {- if (certTemplate) {- await updateSshCertTemplate({- id: certTemplate.id,- name,- ttl,- maxTTL,- allowedUsers: allowedUsers ? allowedUsers.split(",").map((user) => user.trim()) : [],- allowedHosts: allowedHosts ? allowedHosts.split(",").map((host) => host.trim()) : [],- allowUserCertificates,- allowHostCertificates,- allowCustomKeyIds- });-- createNotification({- text: "Successfully updated SSH certificate template",- type: "success"- });- } else {- await createSshCertTemplate({- sshCaId,- name,- ttl,- maxTTL,- allowedUsers: allowedUsers ? allowedUsers.split(",").map((user) => user.trim()) : [],- allowedHosts: allowedHosts ? allowedHosts.split(",").map((host) => host.trim()) : [],- allowUserCertificates,- allowHostCertificates,- allowCustomKeyIds- });-- createNotification({- text: "Successfully created SSH certificate template",- type: "success"- });- }-- reset();- handlePopUpToggle("sshCertificateTemplate", false);- };-- return (- <Modal- isOpen={popUp?.sshCertificateTemplate?.isOpen}- onOpenChange={(isOpen) => {- handlePopUpToggle("sshCertificateTemplate", isOpen);- reset();- }}- >- <ModalContent- title={certTemplate ? "SSH Certificate Template" : "Create SSH Certificate Template"}- >- <form onSubmit={handleSubmit(onFormSubmit)}>- {certTemplate && (- <FormControl label="SSH Certificate Template ID">- <Input value={certTemplate.id} isDisabled className="bg-white/[0.07]" />- </FormControl>- )}- <Controller- control={control}- defaultValue=""- name="name"- render={({ field, fieldState: { error } }) => (- <FormControl- label="SSH Template Name"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="administrator" />- </FormControl>- )}- />- <Controller- control={control}- name="sshCaId"- defaultValue={sshCaId}- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Issuing SSH CA"- errorText={error?.message}- isError={Boolean(error)}- className="mt-4"- isRequired- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- isDisabled- >- {(cas || []).map(({ id, friendlyName }) => (- <SelectItem value={id} key={`ssh-ca-${id}`}>- {friendlyName}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <Controller- control={control}- name="allowedUsers"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Allowed Users"- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="ec2-user, developer, ..." />- </FormControl>- )}- />- <Controller- control={control}- name="allowedHosts"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Allowed Hosts"- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="*.compute.amazonaws.com, api.example.com, ..." />- </FormControl>- )}- />- <Controller- control={control}- name="ttl"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Default TTL"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="2 days, 1d, 2h, 1y, ..." />- </FormControl>- )}- />- <Controller- control={control}- name="maxTTL"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Max TTL"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="2 days, 1d, 2h, 1y, ..." />- </FormControl>- )}- />- <Controller- control={control}- name="allowUserCertificates"- render={({ field, fieldState: { error } }) => {- return (- <FormControl isError={Boolean(error)} errorText={error?.message}>- <Switch- id="allow-user-certificates"- onCheckedChange={(value) => field.onChange(value)}- isChecked={field.value}- >- <p className="ml-1 w-full">Allow User Certificates</p>- </Switch>- </FormControl>- );- }}- />- <Controller- control={control}- name="allowHostCertificates"- render={({ field, fieldState: { error } }) => {- return (- <FormControl isError={Boolean(error)} errorText={error?.message}>- <Switch- id="allow-host-certificates"- onCheckedChange={(value) => field.onChange(value)}- isChecked={field.value}- >- <p className="ml-1 w-full">Allow Host Certificates</p>- </Switch>- </FormControl>- );- }}- />- <Controller- control={control}- name="allowCustomKeyIds"- render={({ field, fieldState: { error } }) => {- return (- <FormControl isError={Boolean(error)} errorText={error?.message}>- <Switch- id="allow-custom-key-ids"- onCheckedChange={(value) => field.onChange(value)}- isChecked={field.value}- >- <p className="ml-1 w-full">Allow Custom Key IDs</p>- </Switch>- </FormControl>- );- }}- />- <div className="mt-4 flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >- Save- </Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("sshCertificateTemplate", false)}- >- Cancel- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplatesSection.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplatesSection.tsxdeleted file mode 100644index 5b021715f6..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplatesSection.tsx+++ /dev/null@@ -1,143 +0,0 @@-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { DeleteActionModal, IconButton } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { usePopUp } from "@app/hooks";-import {- SshCertTemplateStatus,- useDeleteSshCertTemplate,- useUpdateSshCertTemplate-} from "@app/hooks/api";--import { SshCertificateModal } from "./SshCertificateModal";-import { SshCertificateTemplateModal } from "./SshCertificateTemplateModal";-import { SshCertificateTemplatesTable } from "./SshCertificateTemplatesTable";--type Props = {- caId: string;-};--export const SshCertificateTemplatesSection = ({ caId }: Props) => {- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "sshCertificateTemplate",- "sshCertificateTemplateStatus",- "sshCertificate",- "deleteSshCertificateTemplate",- "upgradePlan"- ] as const);-- const { mutateAsync: deleteSshCertTemplate } = useDeleteSshCertTemplate();- const { mutateAsync: updateSshCertTemplate } = useUpdateSshCertTemplate();-- const onRemoveSshCertificateTemplateSubmit = async (id: string) => {- await deleteSshCertTemplate({- id- });-- createNotification({- text: "Successfully deleted SSH certificate template",- type: "success"- });-- handlePopUpClose("deleteSshCertificateTemplate");- };-- const onUpdateSshCaStatus = async ({- templateId,- status- }: {- templateId: string;- status: SshCertTemplateStatus;- }) => {- await updateSshCertTemplate({ id: templateId, status });-- createNotification({- text: `Successfully ${- status === SshCertTemplateStatus.ACTIVE ? "enabled" : "disabled"- } SSH certificate template`,- type: "success"- });-- handlePopUpClose("sshCertificateTemplateStatus");- };-- return (- <div className="h-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">- <h3 className="text-lg font-medium text-mineshaft-100">Certificate Templates</h3>- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.SshCertificateTemplates}- >- {(isAllowed) => (- <IconButton- ariaLabel="copy icon"- variant="plain"- className="group relative"- onClick={() => handlePopUpOpen("sshCertificateTemplate")}- isDisabled={!isAllowed}- >- <FontAwesomeIcon icon={faPlus} />- </IconButton>- )}- </ProjectPermissionCan>- </div>- <div className="py-4">- <SshCertificateTemplatesTable handlePopUpOpen={handlePopUpOpen} sshCaId={caId} />- </div>- <SshCertificateModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <SshCertificateTemplateModal- popUp={popUp}- handlePopUpToggle={handlePopUpToggle}- sshCaId={caId}- />- <DeleteActionModal- isOpen={popUp.deleteSshCertificateTemplate.isOpen}- title={`Are you sure you want to delete the SSH certificate template ${- (popUp?.deleteSshCertificateTemplate?.data as { name: string })?.name || ""- }?`}- onChange={(isOpen) => handlePopUpToggle("deleteSshCertificateTemplate", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveSshCertificateTemplateSubmit(- (popUp?.deleteSshCertificateTemplate?.data as { id: string })?.id- )- }- />- <DeleteActionModal- isOpen={popUp.sshCertificateTemplateStatus.isOpen}- title={`Are you sure you want to ${- (popUp?.sshCertificateTemplateStatus?.data as { status: string })?.status ===- SshCertTemplateStatus.ACTIVE- ? "enable"- : "disable"- } this certificate template?`}- subTitle={- (popUp?.sshCertificateTemplateStatus?.data as { status: string })?.status ===- SshCertTemplateStatus.ACTIVE- ? "This action will allow certificate issuance under this template again."- : "This action will prevent certificate issuance under this template."- }- onChange={(isOpen) => handlePopUpToggle("sshCertificateTemplateStatus", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onUpdateSshCaStatus(- popUp?.sshCertificateTemplateStatus?.data as {- templateId: string;- status: SshCertTemplateStatus;- }- )- }- buttonText={- (popUp?.sshCertificateTemplateStatus?.data as { status: string })?.status ===- SshCertTemplateStatus.ACTIVE- ? "Enable"- : "Disable"- }- />- </div>- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplatesTable.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplatesTable.tsxdeleted file mode 100644index 8f2b71b030..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/SshCertificateTemplatesTable.tsx+++ /dev/null@@ -1,193 +0,0 @@-import {- faBan,- faCertificate,- faEllipsis,- faFileAlt,- faTrash-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { twMerge } from "tailwind-merge";--import { ProjectPermissionCan } from "@app/components/permissions";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import { Badge } from "@app/components/v3";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { SshCertTemplateStatus, useGetSshCaCertTemplates } from "@app/hooks/api";-import { caStatusToNameMap, getCaStatusBadgeVariant } from "@app/hooks/api/ca/constants";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- sshCaId: string;- handlePopUpOpen: (- popUpName: keyof UsePopUpState<- [- "sshCertificateTemplate",- "sshCertificateTemplateStatus",- "sshCertificate",- "deleteSshCertificateTemplate",- "upgradePlan"- ]- >,- data?: {- id?: string;- name?: string;- sshCaId?: string;- status?: SshCertTemplateStatus;- templateId?: string;- }- ) => void;-};--export const SshCertificateTemplatesTable = ({ handlePopUpOpen, sshCaId }: Props) => {- const { data, isPending } = useGetSshCaCertTemplates(sshCaId);- return (- <div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Name</Th>- <Th>Status</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={2} innerKey="project-cas" />}- {!isPending &&- data?.certificateTemplates.map((certificateTemplate) => {- return (- <Tr className="h-10" key={`certificate-${certificateTemplate.id}`}>- <Td>{certificateTemplate.name}</Td>- <Td>- <Badge variant={getCaStatusBadgeVariant(certificateTemplate.status)}>- {caStatusToNameMap[certificateTemplate.status]}- </Badge>- </Td>- <Td className="flex justify-end">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="sm" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshCertificateTemplates}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("sshCertificateTemplateStatus", {- templateId: certificateTemplate.id,- status:- certificateTemplate.status === SshCertTemplateStatus.ACTIVE- ? SshCertTemplateStatus.DISABLED- : SshCertTemplateStatus.ACTIVE- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faBan} />}- >- {`${- certificateTemplate.status === SshCertTemplateStatus.ACTIVE- ? "Disable"- : "Enable"- } Template`}- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshCertificateTemplates}- >- <DropdownMenuItem- onClick={() => {- handlePopUpOpen("sshCertificate", {- sshCaId,- templateId: certificateTemplate.id- });- }}- icon={- <FontAwesomeIcon icon={faCertificate} size="sm" className="mr-1" />- }- >- Issue Certificate- </DropdownMenuItem>- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshCertificateTemplates}- >- <DropdownMenuItem- onClick={() =>- handlePopUpOpen("sshCertificateTemplate", {- id: certificateTemplate.id- })- }- icon={<FontAwesomeIcon icon={faFileAlt} size="sm" className="mr-1" />}- >- Edit Template- </DropdownMenuItem>- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.SshCertificateTemplates}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} size="sm" className="mr-1" />}- onClick={() =>- handlePopUpOpen("deleteSshCertificateTemplate", {- id: certificateTemplate.id,- name: certificateTemplate.name- })- }- >- Delete Template- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && !data?.certificateTemplates?.length && (- <EmptyState- title="No certificate templates have been created for this SSH CA"- icon={faFileAlt}- />- )}- </TableContainer>- </div>- );-};diff --git a/frontend/src/pages/ssh/SshCaByIDPage/components/index.tsx b/frontend/src/pages/ssh/SshCaByIDPage/components/index.tsxdeleted file mode 100644index 9466ecc8f6..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/components/index.tsx+++ /dev/null@@ -1,3 +0,0 @@-export { SshCaDetailsSection } from "./SshCaDetailsSection";-export { SshCertificateModal } from "./SshCertificateModal";-export { SshCertificateTemplatesSection } from "./SshCertificateTemplatesSection";diff --git a/frontend/src/pages/ssh/SshCaByIDPage/route.tsx b/frontend/src/pages/ssh/SshCaByIDPage/route.tsxdeleted file mode 100644index d32cf5b6b4..0000000000--- a/frontend/src/pages/ssh/SshCaByIDPage/route.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { SshCaByIDPage } from "./SshCaByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId"-)({- component: SshCaByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Certificate Authorities",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/cas",- params- })- },- {- label: "Details"- }- ]- };- }-});diff --git a/frontend/src/pages/ssh/SshCasPage/SshCasPage.tsx b/frontend/src/pages/ssh/SshCasPage/SshCasPage.tsxdeleted file mode 100644index dbc4668a40..0000000000--- a/frontend/src/pages/ssh/SshCasPage/SshCasPage.tsx+++ /dev/null@@ -1,30 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";--import { PageHeader } from "@app/components/v2";-import { ProjectType } from "@app/hooks/api/projects/types";--import { SshCaSection } from "./components";--export const SshCasPage = () => {- const { t } = useTranslation();- return (- <>- <Helmet>- <title>{t("common.head-title", { title: "SSH" })}</title>- </Helmet>- <div className="h-full bg-bunker-800">- <div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">- <div className="mx-auto mb-6 w-full max-w-8xl">- <PageHeader- scope={ProjectType.SSH}- title="SSH Certificate Authorities"- description="Manage the SSH certificate authorities used to sign user and host certificates, including custom and default CAs."- />- <SshCaSection />- </div>- </div>- </div>- </>- );-};diff --git a/frontend/src/pages/ssh/SshCasPage/components/SshCaModal.tsx b/frontend/src/pages/ssh/SshCasPage/components/SshCaModal.tsxdeleted file mode 100644index da5d24a64e..0000000000--- a/frontend/src/pages/ssh/SshCasPage/components/SshCaModal.tsx+++ /dev/null@@ -1,290 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import { useNavigate } from "@tanstack/react-router";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- Input,- Modal,- ModalContent,- Select,- SelectItem,- TextArea-} from "@app/components/v2";-import { useOrganization, useProject } from "@app/context";-import { useCreateSshCa, useGetSshCaById, useUpdateSshCa } from "@app/hooks/api";-import {- SshCaKeySource,- SshCertKeyAlgorithm,- sshCertKeyAlgorithms-} from "@app/hooks/api/sshCa/constants";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- popUp: UsePopUpState<["sshCa"]>;- handlePopUpToggle: (popUpName: keyof UsePopUpState<["sshCa"]>, state?: boolean) => void;-};--const sshCaKeySources = [- { label: "Internal", value: SshCaKeySource.INTERNAL },- { label: "External", value: SshCaKeySource.EXTERNAL }-];--const schema = z- .object({- friendlyName: z.string(),- keySource: z.nativeEnum(SshCaKeySource),- publicKey: z.string().optional(),- privateKey: z.string().optional(),- keyAlgorithm: z.enum([- SshCertKeyAlgorithm.RSA_2048,- SshCertKeyAlgorithm.RSA_4096,- SshCertKeyAlgorithm.ECDSA_P256,- SshCertKeyAlgorithm.ECDSA_P384,- SshCertKeyAlgorithm.ED25519- ])- })- .required();--export type FormData = z.infer<typeof schema>;--export const SshCaModal = ({ popUp, handlePopUpToggle }: Props) => {- const navigate = useNavigate();- const { currentProject } = useProject();- const { currentOrg } = useOrganization();- const projectId = currentProject?.id || "";- const { data: ca } = useGetSshCaById((popUp?.sshCa?.data as { caId: string })?.caId || "");-- const { mutateAsync: createMutateAsync } = useCreateSshCa();- const { mutateAsync: updateMutateAsync } = useUpdateSshCa();-- const {- control,- handleSubmit,- reset,- formState: { isSubmitting },- watch- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {- friendlyName: "",- keyAlgorithm: SshCertKeyAlgorithm.ED25519,- keySource: SshCaKeySource.INTERNAL,- publicKey: "",- privateKey: ""- }- });-- const caKeySource = watch("keySource");-- useEffect(() => {- if (ca) {- reset({- friendlyName: ca.friendlyName,- keyAlgorithm: ca.keyAlgorithm,- keySource: ca.keySource,- publicKey: ca.publicKey- });- } else {- reset({- friendlyName: "",- keyAlgorithm: SshCertKeyAlgorithm.ED25519,- keySource: SshCaKeySource.INTERNAL,- publicKey: "",- privateKey: ""- });- }- }, [ca]);-- const onFormSubmit = async ({- friendlyName,- keySource,- keyAlgorithm,- publicKey,- privateKey- }: FormData) => {- if (!projectId) return;-- if (ca) {- await updateMutateAsync({- caId: ca.id,- friendlyName- });- } else {- const { id: newCaId } = await createMutateAsync({- projectId,- friendlyName,- keySource,- keyAlgorithm,- publicKey,- privateKey- });-- navigate({- to: "/organizations/$orgId/projects/ssh/$projectId/ca/$caId",- params: {- orgId: currentOrg.id,- projectId,- caId: newCaId- }- });- }-- reset();- handlePopUpToggle("sshCa", false);-- createNotification({- text: `Successfully ${ca ? "updated" : "created"} SSH CA`,- type: "success"- });- };-- return (- <Modal- isOpen={popUp?.sshCa?.isOpen}- onOpenChange={(isOpen) => {- reset();- handlePopUpToggle("sshCa", isOpen);- }}- >- <ModalContent title={`${ca ? "View" : "Create"} SSH CA`}>- <form onSubmit={handleSubmit(onFormSubmit)}>- {ca && (- <FormControl label="CA ID">- <Input value={ca.id} isDisabled className="bg-white/[0.07]" />- </FormControl>- )}- <Controller- control={control}- defaultValue=""- name="friendlyName"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Friendly Name"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="My SSH CA" />- </FormControl>- )}- />- {caKeySource && (- <Controller- control={control}- name="keySource"- defaultValue={SshCaKeySource.INTERNAL}- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Key Source"- errorText={error?.message}- isError={Boolean(error)}- isRequired- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- isDisabled={Boolean(ca)}- >- {sshCaKeySources.map(({ label, value }) => (- <SelectItem value={String(value || "")} key={label}>- {label}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- )}- {caKeySource === SshCaKeySource.INTERNAL && (- <Controller- control={control}- name="keyAlgorithm"- defaultValue={SshCertKeyAlgorithm.ED25519}- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Key Algorithm"- errorText={error?.message}- isError={Boolean(error)}- isRequired={caKeySource === SshCaKeySource.INTERNAL}- >- <Select- defaultValue={field.value}- {...field}- onValueChange={(e) => onChange(e)}- className="w-full"- isDisabled={Boolean(ca)}- >- {sshCertKeyAlgorithms.map(({ label, value }) => (- <SelectItem value={String(value || "")} key={label}>- {label}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- )}- {caKeySource === SshCaKeySource.EXTERNAL && !ca && (- <>- <Controller- control={control}- defaultValue=""- name="publicKey"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Public Key"- isError={Boolean(error)}- errorText={error?.message}- isRequired={caKeySource === SshCaKeySource.EXTERNAL}- >- <Input {...field} placeholder="ssh-rsa AAA..." />- </FormControl>- )}- />- <Controller- control={control}- defaultValue=""- name="privateKey"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Private Key"- errorText={error?.message}- isError={Boolean(error)}- isRequired={caKeySource === SshCaKeySource.EXTERNAL}- >- <TextArea {...field} placeholder="-----BEGIN OPENSSH PRIVATE KEY----- ..." />- </FormControl>- )}- />- </>- )}- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >- {popUp?.sshCa?.data ? "Update" : "Create"}- </Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("sshCa", false)}- >- Cancel- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ssh/SshCasPage/components/SshCaSection.tsx b/frontend/src/pages/ssh/SshCasPage/components/SshCaSection.tsxdeleted file mode 100644index 11942795cb..0000000000--- a/frontend/src/pages/ssh/SshCasPage/components/SshCaSection.tsx+++ /dev/null@@ -1,98 +0,0 @@-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { SshCaStatus, useDeleteSshCa, useUpdateSshCa } from "@app/hooks/api";-import { usePopUp } from "@app/hooks/usePopUp";--import { SshCaModal } from "./SshCaModal";-import { SshCaTable } from "./SshCaTable";--export const SshCaSection = () => {- const { mutateAsync: deleteSshCa } = useDeleteSshCa();- const { mutateAsync: updateSshCa } = useUpdateSshCa();-- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "sshCa",- "deleteSshCa",- "sshCaStatus" // enable / disable- ] as const);-- const onRemoveSshCaSubmit = async (caId: string) => {- await deleteSshCa({ caId });-- createNotification({- text: "Successfully deleted SSH CA",- type: "success"- });-- handlePopUpClose("deleteSshCa");- };-- const onUpdateSshCaStatus = async ({ caId, status }: { caId: string; status: SshCaStatus }) => {- await updateSshCa({ caId, status });-- createNotification({- text: `Successfully ${status === SshCaStatus.ACTIVE ? "enabled" : "disabled"} SSH CA`,- type: "success"- });-- handlePopUpClose("sshCaStatus");- };-- return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex justify-between">- <p className="text-xl font-medium text-mineshaft-100">Certificate Authorities</p>- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.SshCertificateAuthorities}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="submit"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handlePopUpOpen("sshCa")}- isDisabled={!isAllowed}- >- Create SSH CA- </Button>- )}- </ProjectPermissionCan>- </div>- <SshCaTable handlePopUpOpen={handlePopUpOpen} />- <SshCaModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <DeleteActionModal- isOpen={popUp.deleteSshCa.isOpen}- title="Are you sure you want to remove the SSH CA?"- onChange={(isOpen) => handlePopUpToggle("deleteSshCa", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveSshCaSubmit((popUp?.deleteSshCa?.data as { caId: string })?.caId)- }- />- <DeleteActionModal- isOpen={popUp.sshCaStatus.isOpen}- title={`Are you sure you want to ${- (popUp?.sshCaStatus?.data as { status: string })?.status === SshCaStatus.ACTIVE- ? "enable"- : "disable"- } the CA?`}- subTitle={- (popUp?.sshCaStatus?.data as { status: string })?.status === SshCaStatus.ACTIVE- ? "This action will allow the SSH CA to start issuing certificates again."- : "This action will prevent the SSH CA from issuing new certificates."- }- onChange={(isOpen) => handlePopUpToggle("sshCaStatus", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onUpdateSshCaStatus(popUp?.sshCaStatus?.data as { caId: string; status: SshCaStatus })- }- />- </div>- );-};diff --git a/frontend/src/pages/ssh/SshCasPage/components/SshCaTable.tsx b/frontend/src/pages/ssh/SshCasPage/components/SshCaTable.tsxdeleted file mode 100644index 626098dbbf..0000000000--- a/frontend/src/pages/ssh/SshCasPage/components/SshCaTable.tsx+++ /dev/null@@ -1,166 +0,0 @@-import { faBan, faCertificate, faEllipsis, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { useNavigate } from "@tanstack/react-router";-import { twMerge } from "tailwind-merge";--import { ProjectPermissionCan } from "@app/components/permissions";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import { Badge } from "@app/components/v3";-import {- ProjectPermissionActions,- ProjectPermissionSub,- useOrganization,- useProject-} from "@app/context";-import { SshCaStatus, useListWorkspaceSshCas } from "@app/hooks/api";-import { caStatusToNameMap, getCaStatusBadgeVariant } from "@app/hooks/api/ca/constants";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- handlePopUpOpen: (- popUpName: keyof UsePopUpState<["deleteSshCa", "sshCaStatus"]>,- data?: object- ) => void;-};--export const SshCaTable = ({ handlePopUpOpen }: Props) => {- const navigate = useNavigate();- const { currentOrg } = useOrganization();- const { currentProject } = useProject();- const { data, isPending } = useListWorkspaceSshCas(currentProject?.id || "");-- return (- <div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Friendly Name</Th>- <Th>Status</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={3} innerKey="org-ssh-cas" />}- {!isPending &&- data &&- data.length > 0 &&- data.map((ca) => {- return (- <Tr- className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"- key={`ca-${ca.id}`}- onClick={() =>- navigate({- to: "/organizations/$orgId/projects/ssh/$projectId/ca/$caId",- params: {- orgId: currentOrg.id,- projectId: currentProject.id,- caId: ca.id- }- })- }- >- <Td>{ca.friendlyName}</Td>- <Td>- <Badge variant={getCaStatusBadgeVariant(ca.status)}>- {caStatusToNameMap[ca.status]}- </Badge>- </Td>- <Td className="flex justify-end">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- {(ca.status === SshCaStatus.ACTIVE ||- ca.status === SshCaStatus.DISABLED) && (- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshCertificateAuthorities}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed &&- "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("sshCaStatus", {- caId: ca.id,- status:- ca.status === SshCaStatus.ACTIVE- ? SshCaStatus.DISABLED- : SshCaStatus.ACTIVE- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faBan} />}- >- {`${- ca.status === SshCaStatus.ACTIVE ? "Disable" : "Enable"- } SSH CA`}- </DropdownMenuItem>- )}- </ProjectPermissionCan>- )}- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.SshCertificateAuthorities}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("deleteSshCa", {- caId: ca.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- >- Delete SSH CA- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && data?.length === 0 && (- <EmptyState- title="No SSH certificate authorities have been created"- icon={faCertificate}- />- )}- </TableContainer>- </div>- );-};diff --git a/frontend/src/pages/ssh/SshCasPage/components/index.tsx b/frontend/src/pages/ssh/SshCasPage/components/index.tsxdeleted file mode 100644index 0ba2a04c7f..0000000000--- a/frontend/src/pages/ssh/SshCasPage/components/index.tsx+++ /dev/null@@ -1 +0,0 @@-export { SshCaSection } from "./SshCaSection";diff --git a/frontend/src/pages/ssh/SshCasPage/route.tsx b/frontend/src/pages/ssh/SshCasPage/route.tsxdeleted file mode 100644index d39a19cb8a..0000000000--- a/frontend/src/pages/ssh/SshCasPage/route.tsx+++ /dev/null@@ -1,23 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { SshCasPage } from "./SshCasPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas"-)({- component: SshCasPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Certificate Authorities",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/cas",- params- })- }- ]- };- }-});diff --git a/frontend/src/pages/ssh/SshCertsPage/SshCertsPage.tsx b/frontend/src/pages/ssh/SshCertsPage/SshCertsPage.tsxdeleted file mode 100644index ea53c04cde..0000000000--- a/frontend/src/pages/ssh/SshCertsPage/SshCertsPage.tsx+++ /dev/null@@ -1,30 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";--import { PageHeader } from "@app/components/v2";-import { ProjectType } from "@app/hooks/api/projects/types";--import { SshCertificatesSection } from "./components";--export const SshCertsPage = () => {- const { t } = useTranslation();- return (- <>- <Helmet>- <title>{t("common.head-title", { title: "Certificates" })}</title>- </Helmet>- <div className="h-full bg-bunker-800">- <div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">- <div className="mx-auto mb-6 w-full max-w-8xl">- <PageHeader- scope={ProjectType.SSH}- title="SSH Certificates"- description="View and audit all issued SSH certificates, including validity and associated access metadata."- />- <SshCertificatesSection />- </div>- </div>- </div>- </>- );-};diff --git a/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesSection.tsx b/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesSection.tsxdeleted file mode 100644index a9bf71a848..0000000000--- a/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesSection.tsx+++ /dev/null@@ -1,39 +0,0 @@-import { faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { ProjectPermissionCan } from "@app/components/permissions";-import { Button } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { usePopUp } from "@app/hooks/usePopUp";--import { SshCertificateModal } from "../../SshCaByIDPage/components/SshCertificateModal";-import { SshCertificatesTable } from "./SshCertificatesTable";--export const SshCertificatesSection = () => {- const { popUp, handlePopUpToggle, handlePopUpOpen } = usePopUp(["sshCertificate"] as const);- return (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex justify-between">- <p className="text-xl font-medium text-mineshaft-100">Certificates</p>- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.SshCertificates}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="submit"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handlePopUpOpen("sshCertificate")}- isDisabled={!isAllowed}- >- Request- </Button>- )}- </ProjectPermissionCan>- </div>- <SshCertificatesTable />- <SshCertificateModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- </div>- );-};diff --git a/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesTable.tsx b/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesTable.tsxdeleted file mode 100644index 19aefb92ab..0000000000--- a/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesTable.tsx+++ /dev/null@@ -1,87 +0,0 @@-import { useState } from "react";-import { faCertificate } from "@fortawesome/free-solid-svg-icons";-import { format } from "date-fns";--import {- EmptyState,- Pagination,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";-import { Badge } from "@app/components/v3";-import { useProject } from "@app/context";-import { useListWorkspaceSshCertificates } from "@app/hooks/api";--import { getSshCertStatusBadgeDetails } from "./SshCertificatesTable.utils";--const PER_PAGE_INIT = 25;--export const SshCertificatesTable = () => {- const { currentProject } = useProject();- const [page, setPage] = useState(1);- const [perPage, setPerPage] = useState(PER_PAGE_INIT);-- const { data, isPending } = useListWorkspaceSshCertificates({- projectId: currentProject?.id || "",- offset: (page - 1) * perPage,- limit: perPage- });-- return (- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Principals</Th>- <Th>Status</Th>- <Th>Not Before</Th>- <Th>Not After</Th>- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={4} innerKey="org-ssh-certificates" />}- {!isPending &&- data?.certificates?.map((certificate) => {- const { variant, label } = getSshCertStatusBadgeDetails(certificate.notAfter);- return (- <Tr className="h-10" key={`certificate-${certificate.id}`}>- <Td>{certificate.principals.join(", ")}</Td>- <Td>- <Badge variant={variant}>{label}</Badge>- </Td>- <Td>- {certificate.notBefore- ? format(new Date(certificate.notBefore), "yyyy-MM-dd | HH:mm:ss")- : "-"}- </Td>- <Td>- {certificate.notAfter- ? format(new Date(certificate.notAfter), "yyyy-MM-dd | HH:mm:ss")- : "-"}- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && data?.totalCount !== undefined && data.totalCount >= PER_PAGE_INIT && (- <Pagination- count={data.totalCount}- page={page}- perPage={perPage}- onChangePage={(newPage) => setPage(newPage)}- onChangePerPage={(newPerPage) => setPerPage(newPerPage)}- />- )}- {!isPending && !data?.certificates?.length && (- <EmptyState title="No SSH certificates have been issued" icon={faCertificate} />- )}- </TableContainer>- );-};diff --git a/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesTable.utils.ts b/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesTable.utils.tsdeleted file mode 100644index 12b75aa08a..0000000000--- a/frontend/src/pages/ssh/SshCertsPage/components/SshCertificatesTable.utils.ts+++ /dev/null@@ -1,17 +0,0 @@-export const getSshCertStatusBadgeDetails = (notAfter: string) => {- const currentDate = new Date().getTime();- const notAfterDate = new Date(notAfter).getTime();-- let variant: "success" | "primary" | "danger" = "success";- let label = "Active";-- if (notAfterDate > currentDate) {- variant = "success";- label = "Active";- } else {- variant = "danger";- label = "Expired";- }-- return { variant, label };-};diff --git a/frontend/src/pages/ssh/SshCertsPage/components/index.tsx b/frontend/src/pages/ssh/SshCertsPage/components/index.tsxdeleted file mode 100644index 34c1b3c8be..0000000000--- a/frontend/src/pages/ssh/SshCertsPage/components/index.tsx+++ /dev/null@@ -1 +0,0 @@-export { SshCertificatesSection } from "./SshCertificatesSection";diff --git a/frontend/src/pages/ssh/SshCertsPage/route.tsx b/frontend/src/pages/ssh/SshCertsPage/route.tsxdeleted file mode 100644index a26f316c28..0000000000--- a/frontend/src/pages/ssh/SshCertsPage/route.tsx+++ /dev/null@@ -1,9 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { SshCertsPage } from "./SshCertsPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates"-)({- component: SshCertsPage-});diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/SshHostGroupDetailsByIDPage.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/SshHostGroupDetailsByIDPage.tsxdeleted file mode 100644index 7ce4d96f18..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/SshHostGroupDetailsByIDPage.tsx+++ /dev/null@@ -1,169 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";-import { faChevronLeft } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { Link, useNavigate, useParams } from "@tanstack/react-router";-import { twMerge } from "tailwind-merge";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button,- DeleteActionModal,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- PageHeader,- Tooltip-} from "@app/components/v2";-import { ROUTE_PATHS } from "@app/const/routes";-import {- ProjectPermissionActions,- ProjectPermissionSub,- useOrganization,- useProject-} from "@app/context";-import { useDeleteSshHostGroup, useGetSshHostGroupById } from "@app/hooks/api";-import { ProjectType } from "@app/hooks/api/projects/types";-import { usePopUp } from "@app/hooks/usePopUp";--import { SshHostGroupModal } from "../SshHostsPage/components/SshHostGroupModal";-import { SshHostGroupDetailsSection, SshHostGroupHostsSection } from "./components";--const Page = () => {- const { currentOrg } = useOrganization();- const { currentProject } = useProject();- const navigate = useNavigate();- const projectId = currentProject?.id || "";- const sshHostGroupId = useParams({- from: ROUTE_PATHS.Ssh.SshHostGroupDetailsByIDPage.id,- select: (el) => el.sshHostGroupId- });- const { data } = useGetSshHostGroupById(sshHostGroupId);-- const { mutateAsync: deleteSshHostGroup } = useDeleteSshHostGroup();-- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "sshHostGroup",- "deleteSshHostGroup"- ] as const);-- const onRemoveSshGroupSubmit = async (groupIdToDelete: string) => {- if (!projectId) return;-- await deleteSshHostGroup({ sshHostGroupId: groupIdToDelete });-- createNotification({- text: "Successfully deleted SSH group",- type: "success"- });-- handlePopUpClose("deleteSshHostGroup");- navigate({- to: "/organizations/$orgId/projects/ssh/$projectId/overview",- params: {- orgId: currentOrg.id,- projectId- }- });- };-- return (- <div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">- {data && (- <div className="mx-auto mb-6 w-full max-w-8xl">- <Link- to="/organizations/$orgId/projects/ssh/$projectId/overview"- params={{- orgId: currentOrg.id,- projectId- }}- className="mb-4 flex items-center gap-x-2 text-sm text-mineshaft-400"- >- <FontAwesomeIcon icon={faChevronLeft} />- Hosts- </Link>- <PageHeader scope={ProjectType.SSH} title={data.name} description="Configure SSH Group">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <Button variant="outline_bg">More</Button>- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="p-1">- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- isAllowed- ? "hover:bg-red-500! hover:text-white!"- : "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={() =>- handlePopUpOpen("deleteSshHostGroup", {- groupId: data.id,- name: data.name- })- }- disabled={!isAllowed}- >- Delete SSH Group- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </PageHeader>- <div className="flex">- <div className="mr-4 w-96">- <SshHostGroupDetailsSection- sshHostGroupId={sshHostGroupId}- handlePopUpOpen={handlePopUpOpen}- />- </div>- <div className="w-full">- <SshHostGroupHostsSection sshHostGroupId={sshHostGroupId} />- </div>- </div>- </div>- )}- <SshHostGroupModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <DeleteActionModal- isOpen={popUp.deleteSshHostGroup.isOpen}- title={`Are you sure you want to remove the SSH group: ${- (popUp?.deleteSshHostGroup?.data as { name: string })?.name || ""- }?`}- onChange={(isOpen) => handlePopUpToggle("deleteSshHostGroup", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveSshGroupSubmit((popUp?.deleteSshHostGroup?.data as { groupId: string })?.groupId)- }- />- </div>- );-};--export const SshHostGroupDetailsByIDPage = () => {- const { t } = useTranslation();- return (- <>- <Helmet>- <title>{t("common.head-title", { title: "SSH Group" })}</title>- </Helmet>- <ProjectPermissionCan- I={ProjectPermissionActions.Read}- a={ProjectPermissionSub.SshHostGroups}- passThrough={false}- renderGuardBanner- >- <Page />- </ProjectPermissionCan>- </>- );-};diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/AddHostGroupMemberModal.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/AddHostGroupMemberModal.tsxdeleted file mode 100644index e45266fa00..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/AddHostGroupMemberModal.tsx+++ /dev/null@@ -1,120 +0,0 @@-import { faServer } from "@fortawesome/free-solid-svg-icons";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- Button,- EmptyState,- Modal,- ModalContent,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useAddHostToSshHostGroup, useListSshHostGroupHosts } from "@app/hooks/api";-import { EHostGroupMembershipFilter } from "@app/hooks/api/sshHostGroup/types";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- popUp: UsePopUpState<["addHostGroupMembers"]>;- handlePopUpToggle: (- popUpName: keyof UsePopUpState<["addHostGroupMembers"]>,- state?: boolean- ) => void;-};--export const AddHostGroupMemberModal = ({ popUp, handlePopUpToggle }: Props) => {- const popUpData = popUp?.addHostGroupMembers?.data as {- sshHostGroupId: string;- };-- const { data, isPending } = useListSshHostGroupHosts({- sshHostGroupId: popUpData?.sshHostGroupId,- filter: EHostGroupMembershipFilter.NON_GROUP_MEMBERS- });- const { mutateAsync: addHostToSshHostGroup, isPending: isAddingHostToSshHostGroup } =- useAddHostToSshHostGroup();-- const handleAddHost = async (sshHostId: string) => {- if (!popUpData?.sshHostGroupId) {- createNotification({- text: "Some data is missing, please refresh the page and try again",- type: "error"- });- return;- }-- await addHostToSshHostGroup({- sshHostGroupId: popUpData.sshHostGroupId,- sshHostId- });-- createNotification({- text: "Successfully added host to the group",- type: "success"- });- };-- return (- <Modal- isOpen={popUp?.addHostGroupMembers?.isOpen}- onOpenChange={(isOpen) => {- handlePopUpToggle("addHostGroupMembers", isOpen);- }}- >- <ModalContent title="Add Hosts to Group">- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Alias</Th>- <Th>Hostname</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={3} innerKey="ssh-hosts" />}- {!isPending &&- data?.hosts?.map((host) => {- return (- <Tr className="items-center" key={`host-${host.id}`}>- <Td>{host.alias ?? "-"}</Td>- <Td>{host.hostname}</Td>- <Td className="flex justify-end">- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <Button- isLoading={isAddingHostToSshHostGroup}- isDisabled={!isAllowed}- colorSchema="primary"- variant="outline_bg"- type="button"- onClick={() => handleAddHost(host.id)}- >- Add- </Button>- )}- </ProjectPermissionCan>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && !data?.hosts?.length && (- <EmptyState title="No hosts available to add to the SSH host group" icon={faServer} />- )}- </TableContainer>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupDetailsSection.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupDetailsSection.tsxdeleted file mode 100644index a2d9c32c00..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupDetailsSection.tsx+++ /dev/null@@ -1,84 +0,0 @@-import { faCheck, faCopy, faPencil } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { ProjectPermissionCan } from "@app/components/permissions";-import { IconButton, Tooltip } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useTimedReset } from "@app/hooks";-import { useGetSshHostGroupById } from "@app/hooks/api";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- sshHostGroupId: string;- handlePopUpOpen: (popUpName: keyof UsePopUpState<["sshHostGroup"]>, data?: object) => void;-};--export const SshHostGroupDetailsSection = ({ sshHostGroupId, handlePopUpOpen }: Props) => {- const [copyTextId, isCopyingId, setCopyTextId] = useTimedReset<string>({- initialState: "Copy ID to clipboard"- });-- const { data: sshHostGroup } = useGetSshHostGroupById(sshHostGroupId);-- return sshHostGroup ? (- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">- <h3 className="text-lg font-medium text-mineshaft-100">SSH Host Group Details</h3>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => {- return (- <Tooltip content="Edit SSH Host Group">- <IconButton- isDisabled={!isAllowed}- ariaLabel="edit icon"- variant="plain"- className="group relative"- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("sshHostGroup", {- sshHostGroupId: sshHostGroup.id- });- }}- >- <FontAwesomeIcon icon={faPencil} />- </IconButton>- </Tooltip>- );- }}- </ProjectPermissionCan>- </div>- <div className="pt-4">- <div className="mb-4">- <p className="text-sm font-medium text-mineshaft-300">SSH Host Group ID</p>- <div className="group flex align-top">- <p className="text-sm text-mineshaft-300">{sshHostGroup.id}</p>- <div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100">- <Tooltip content={copyTextId}>- <IconButton- ariaLabel="copy icon"- variant="plain"- className="group relative ml-2"- onClick={() => {- navigator.clipboard.writeText(sshHostGroup.id);- setCopyTextId("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingId ? faCheck : faCopy} />- </IconButton>- </Tooltip>- </div>- </div>- </div>- <div>- <p className="text-sm font-medium text-mineshaft-300">Name</p>- <p className="text-sm text-mineshaft-300">{sshHostGroup.name}</p>- </div>- </div>- </div>- ) : (- <div />- );-};diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupHostsSection.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupHostsSection.tsxdeleted file mode 100644index 189ec6e567..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupHostsSection.tsx+++ /dev/null@@ -1,106 +0,0 @@-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 { DeleteActionModal, IconButton } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub, useSubscription } from "@app/context";-import { usePopUp } from "@app/hooks";-import { useRemoveHostFromSshHostGroup } from "@app/hooks/api";--import { AddHostGroupMemberModal } from "./AddHostGroupMemberModal";-import { SshHostGroupHostsTable } from "./SshHostGroupHostsTable";--type Props = {- sshHostGroupId: string;-};--export const SshHostGroupHostsSection = ({ sshHostGroupId }: Props) => {- const { subscription } = useSubscription();- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "removeHostFromSshHostGroup",- "addHostGroupMembers",- "upgradePlan"- ] as const);-- const { mutateAsync: removeHostFromGroup } = useRemoveHostFromSshHostGroup();-- const handleAddSshHostModal = () => {- if (!subscription?.sshHostGroups) {- handlePopUpOpen("upgradePlan", {- text: "Managing SSH host groups can be unlocked if you upgrade to Infisical Enterprise plan.",- isEnterpriseFeature: true- });- } else {- handlePopUpOpen("addHostGroupMembers", {- sshHostGroupId- });- }- };-- const onRemoveSshHostSubmit = async (sshHostId: string) => {- await removeHostFromGroup({- sshHostId,- sshHostGroupId- });-- createNotification({- text: "Successfully removed host from SSH group",- type: "success"- });-- handlePopUpClose("removeHostFromSshHostGroup");- };-- return (- <div className="h-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="flex items-center justify-between border-b border-mineshaft-400 pb-4">- <h3 className="text-lg font-medium text-mineshaft-100">SSH Hosts</h3>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <IconButton- ariaLabel="add host"- variant="plain"- className="group relative"- onClick={() => handleAddSshHostModal()}- isDisabled={!isAllowed}- >- <FontAwesomeIcon icon={faPlus} />- </IconButton>- )}- </ProjectPermissionCan>- </div>- <div className="py-4">- <SshHostGroupHostsTable sshHostGroupId={sshHostGroupId} handlePopUpOpen={handlePopUpOpen} />- </div>- <AddHostGroupMemberModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <DeleteActionModal- isOpen={popUp.removeHostFromSshHostGroup.isOpen}- title={`Are you sure you want to remove ${- (popUp?.removeHostFromSshHostGroup?.data as { hostname: string; alias?: string })- ?.alias ||- (popUp?.removeHostFromSshHostGroup?.data as { hostname: string; alias?: string })- ?.hostname ||- ""- } from this host group?`}- onChange={(isOpen) => handlePopUpToggle("removeHostFromSshHostGroup", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveSshHostSubmit(- (popUp?.removeHostFromSshHostGroup?.data as { sshHostId: string })?.sshHostId- )- }- />- <UpgradePlanModal- isOpen={popUp.upgradePlan.isOpen}- onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}- text={popUp.upgradePlan?.data?.text}- isEnterpriseFeature={popUp.upgradePlan?.data?.isEnterpriseFeature}- />- </div>- );-};diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupHostsTable.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupHostsTable.tsxdeleted file mode 100644index 7866d2125b..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/SshHostGroupHostsTable.tsx+++ /dev/null@@ -1,97 +0,0 @@-import { faServer, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { ProjectPermissionCan } from "@app/components/permissions";-import {- EmptyState,- IconButton,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useListSshHostGroupHosts } from "@app/hooks/api";-import { EHostGroupMembershipFilter } from "@app/hooks/api/sshHostGroup/types";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- sshHostGroupId: string;- handlePopUpOpen: (- popUpName: keyof UsePopUpState<["removeHostFromSshHostGroup"]>,- data?: object- ) => void;-};--export const SshHostGroupHostsTable = ({ sshHostGroupId, handlePopUpOpen }: Props) => {- const { data, isPending } = useListSshHostGroupHosts({- sshHostGroupId,- filter: EHostGroupMembershipFilter.GROUP_MEMBERS- });-- return (- <div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th>Alias</Th>- <Th>Hostname</Th>- <Th>Added On</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={4} innerKey="ssh-host-group-hosts" />}- {!isPending &&- data?.hosts.map((host) => {- return (- <Tr className="h-10" key={`host-${host.id}`}>- <Td>{host.alias ?? "-"}</Td>- <Td>{host.hostname}</Td>- <Td>{new Date(host.joinedGroupAt).toLocaleDateString()}</Td>- <Td className="flex justify-end">- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <Tooltip content="Remove host from group">- <IconButton- isDisabled={!isAllowed}- ariaLabel="Remove host from group"- onClick={() =>- handlePopUpOpen("removeHostFromSshHostGroup", {- sshHostId: host.id,- alias: host.alias,- hostname: host.hostname- })- }- variant="plain"- colorSchema="danger"- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>- </Tooltip>- )}- </ProjectPermissionCan>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && !data?.hosts?.length && (- <EmptyState title="No hosts have been added to this SSH host group" icon={faServer} />- )}- </TableContainer>- </div>- );-};--export default SshHostGroupHostsTable;diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/index.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/index.tsxdeleted file mode 100644index ff25edf77f..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/components/index.tsx+++ /dev/null@@ -1,3 +0,0 @@-export { SshHostGroupDetailsSection } from "./SshHostGroupDetailsSection";-export { SshHostGroupHostsSection } from "./SshHostGroupHostsSection";-export { SshHostGroupHostsTable } from "./SshHostGroupHostsTable";diff --git a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/route.tsx b/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/route.tsxdeleted file mode 100644index c155649c03..0000000000--- a/frontend/src/pages/ssh/SshHostGroupDetailsByIDPage/route.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { createFileRoute, linkOptions } from "@tanstack/react-router";--import { SshHostGroupDetailsByIDPage } from "./SshHostGroupDetailsByIDPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId"-)({- component: SshHostGroupDetailsByIDPage,- beforeLoad: ({ context, params }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Hosts",- link: linkOptions({- to: "/organizations/$orgId/projects/ssh/$projectId/overview",- params- })- },- {- label: "Host Group"- }- ]- };- }-});diff --git a/frontend/src/pages/ssh/SshHostsPage/SshHostsPage.tsx b/frontend/src/pages/ssh/SshHostsPage/SshHostsPage.tsxdeleted file mode 100644index 4ca3aad1e0..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/SshHostsPage.tsx+++ /dev/null@@ -1,31 +0,0 @@-import { Helmet } from "react-helmet";-import { useTranslation } from "react-i18next";--import { PageHeader } from "@app/components/v2";-import { ProjectType } from "@app/hooks/api/projects/types";--import { SshHostGroupsSection, SshHostsSection } from "./components";--export const SshHostsPage = () => {- const { t } = useTranslation();- return (- <>- <Helmet>- <title>{t("common.head-title", { title: "SSH" })}</title>- </Helmet>- <div className="h-full bg-bunker-800">- <div className="mx-auto flex flex-col justify-between bg-bunker-800 text-white">- <div className="mx-auto mb-6 w-full max-w-8xl">- <PageHeader- scope={ProjectType.SSH}- title="Hosts"- description="Manage your SSH hosts, configure access policies, and define login behavior for secure connections."- />- <SshHostGroupsSection />- <SshHostsSection />- </div>- </div>- </div>- </>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupModal.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupModal.tsxdeleted file mode 100644index d7411f8891..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupModal.tsx+++ /dev/null@@ -1,458 +0,0 @@-import { useEffect, useState } from "react";-import { Controller, useFieldArray, useForm } from "react-hook-form";-import { faChevronDown, faChevronRight, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- FormLabel,- IconButton,- Input,- Modal,- ModalContent,- Select,- SelectItem-} from "@app/components/v2";-import { useProject } from "@app/context";-import {- useCreateSshHostGroup,- useGetSshHostGroupById,- useGetWorkspaceUsers,- useListWorkspaceGroups,- useListWorkspaceSshHostGroups,- useUpdateSshHostGroup-} from "@app/hooks/api";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- popUp: UsePopUpState<["sshHostGroup"]>;- handlePopUpToggle: (popUpName: keyof UsePopUpState<["sshHostGroup"]>, state?: boolean) => void;-};--const schema = z- .object({- name: z.string().trim().min(1).max(64),- loginMappings: z- .object({- loginUser: z.string().trim().min(1),- allowedPrincipals: z- .array(- z.object({- type: z.enum(["user", "group"]),- value: z.string().trim().min(1)- })- )- .default([])- })- .array()- .default([])- })- .required();--export type FormData = z.infer<typeof schema>;--export const SshHostGroupModal = ({ popUp, handlePopUpToggle }: Props) => {- const { currentProject } = useProject();- const projectId = currentProject.id;- const { data: sshHostGroups } = useListWorkspaceSshHostGroups(projectId);- const { data: members = [] } = useGetWorkspaceUsers(projectId);- const { data: groups = [] } = useListWorkspaceGroups(projectId);- const [expandedMappings, setExpandedMappings] = useState<Record<number, boolean>>({});-- const { data: sshHostGroup } = useGetSshHostGroupById(- (popUp?.sshHostGroup?.data as { sshHostGroupId: string })?.sshHostGroupId || ""- );-- const { mutateAsync: createMutateAsync } = useCreateSshHostGroup();- const { mutateAsync: updateMutateAsync } = useUpdateSshHostGroup();-- const {- control,- handleSubmit,- reset,- getValues,- setValue,- formState: { isSubmitting }- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {- name: "",- loginMappings: []- }- });-- const loginMappingsFormFields = useFieldArray({- control,- name: "loginMappings"- });-- useEffect(() => {- if (sshHostGroup) {- reset({- name: sshHostGroup.name,- loginMappings: sshHostGroup.loginMappings.map(({ loginUser, allowedPrincipals }) => ({- loginUser,- allowedPrincipals: [- ...(allowedPrincipals.usernames || []).map((username) => ({- type: "user" as const,- value: username- })),- ...(allowedPrincipals.groups || []).map((group) => ({- type: "group" as const,- value: group- }))- ]- }))- });-- setExpandedMappings(- Object.fromEntries(sshHostGroup.loginMappings.map((_, index) => [index, false]))- );- } else {- reset({- name: "",- loginMappings: []- });- }- }, [sshHostGroup]);-- const onFormSubmit = async ({ name, loginMappings }: FormData) => {- if (!projectId) return;-- // check if there is already a different host group with the same name- const existingNames =- sshHostGroups?.filter((h) => h.id !== sshHostGroup?.id).map((h) => h.name) || [];-- if (existingNames.includes(name.trim())) {- createNotification({- text: "A host group with this name already exists.",- type: "error"- });- return;- }-- const transformedLoginMappings = loginMappings.map(({ loginUser, allowedPrincipals }) => {- const usernames = allowedPrincipals- .filter((p) => p.type === "user" && p.value)- .map((p) => p.value);-- const groupNames = allowedPrincipals- .filter((p) => p.type === "group" && p.value)- .map((p) => p.value);-- return {- loginUser,- allowedPrincipals: {- usernames,- groups: groupNames- }- };- });-- if (sshHostGroup) {- await updateMutateAsync({- sshHostGroupId: sshHostGroup.id,- name,- loginMappings: transformedLoginMappings- });- } else {- await createMutateAsync({- projectId,- name,- loginMappings: transformedLoginMappings- });- }-- reset();- handlePopUpToggle("sshHostGroup", false);-- createNotification({- text: `Successfully ${sshHostGroup ? "updated" : "created"} SSH host group`,- type: "success"- });- };-- const toggleMapping = (index: number) => {- setExpandedMappings((prev) => ({- ...prev,- [index]: !prev[index]- }));- };-- const isPrincipalDuplicate = (- mappingIndex: number,- principalType: string,- principalValue: string- ) => {- const principals = getValues(`loginMappings.${mappingIndex}.allowedPrincipals`) || [];- return principals.some((p) => p.type === principalType && p.value === principalValue);- };-- return (- <Modal- isOpen={popUp?.sshHostGroup?.isOpen}- onOpenChange={(isOpen) => {- reset();- handlePopUpToggle("sshHostGroup", isOpen);- }}- >- <ModalContent title={`${sshHostGroup ? "View" : "Add"} SSH host group`}>- <form onSubmit={handleSubmit(onFormSubmit)}>- {sshHostGroup && (- <FormControl label="SSH Host Group ID">- <Input value={sshHostGroup.id} isDisabled className="bg-white/[0.07]" />- </FormControl>- )}- <Controller- control={control}- defaultValue=""- name="name"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Name"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="production" />- </FormControl>- )}- />- <div className="mb-4 flex items-center justify-between">- <FormLabel label="Login Mappings" />- <Button- leftIcon={<FontAwesomeIcon icon={faPlus} />}- size="xs"- variant="outline_bg"- onClick={() => {- const newIndex = loginMappingsFormFields.fields.length;- loginMappingsFormFields.append({- loginUser: "",- allowedPrincipals: [{ type: "user", value: "" }]- });- setExpandedMappings((prev) => ({- ...prev,- [newIndex]: true- }));- }}- >- Add Login Mapping- </Button>- </div>- <div className="mb-4 flex flex-col space-y-4">- {loginMappingsFormFields.fields.map(({ id: metadataFieldId }, i) => (- <div- key={metadataFieldId}- className="flex flex-col space-y-2 rounded-md border border-mineshaft-600 p-4"- >- <div className="mb-2 flex items-center justify-between">- <button- type="button"- className="flex cursor-pointer items-center py-1 text-sm text-mineshaft-200"- onClick={() => toggleMapping(i)}- >- <FontAwesomeIcon- icon={expandedMappings[i] ? faChevronDown : faChevronRight}- className="mr-4"- size="sm"- />- <Controller- control={control}- name={`loginMappings.${i}.loginUser`}- render={({ field }) => (- <span className="text-sm leading-tight font-medium">- {field.value || "New Login Mapping"}- </span>- )}- />- </button>- <IconButton- ariaLabel="delete login mapping"- variant="plain"- onClick={() => loginMappingsFormFields.remove(i)}- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>- </div>-- {expandedMappings[i] && (- <>- <div>- <span className="text-xs text-mineshaft-400">Login User</span>- <Controller- control={control}- name={`loginMappings.${i}.loginUser`}- render={({ field, fieldState: { error } }) => (- <FormControl- isError={Boolean(error?.message)}- errorText={error?.message}- className="mb-0"- >- <Input- {...field}- placeholder="ec2-user"- onChange={(e) => {- const newValue = e.target.value;- const loginMappings = getValues("loginMappings");- const isDuplicate = loginMappings.some(- (mapping, index) => index !== i && mapping.loginUser === newValue- );-- if (isDuplicate) {- createNotification({- text: "This login user already exists",- type: "error"- });- return;- }-- field.onChange(e);- }}- />- </FormControl>- )}- />- </div>- <div className="flex flex-col space-y-2">- <div className="mt-4 mb-2 flex items-center justify-between">- <FormLabel- label="Allowed Principals"- className="text-xs text-mineshaft-400"- />- <Button- leftIcon={<FontAwesomeIcon icon={faPlus} />}- size="xs"- variant="outline_bg"- onClick={() => {- const current = getValues(`loginMappings.${i}.allowedPrincipals`) ?? [];- setValue(`loginMappings.${i}.allowedPrincipals`, [- ...current,- { type: "user", value: "" }- ]);- }}- >- Add Principal- </Button>- </div>- <Controller- control={control}- name={`loginMappings.${i}.allowedPrincipals`}- render={({ field: { value = [], onChange }, fieldState: { error } }) => (- <div className="flex flex-col space-y-2">- {value.map((principal, principalIndex) => (- <div- key={`principal-${i + 1}-${principalIndex + 1}-${principal.type}`}- className="flex items-center space-x-2"- >- <div className="mr-2">- <Select- className="w-24"- value={principal.type}- onValueChange={(newType) => {- const newPrincipals = [...value];- newPrincipals[principalIndex] = {- type: newType as "user" | "group",- value: ""- };- onChange(newPrincipals);- }}- >- <SelectItem value="user">User</SelectItem>- <SelectItem value="group">Group</SelectItem>- </Select>- </div>- <div className="flex-1">- <Select- value={principal.value}- onValueChange={(newValue) => {- if (isPrincipalDuplicate(i, principal.type, newValue)) {- createNotification({- text: `This ${principal.type} is already added`,- type: "error"- });- return;- }- const newPrincipals = [...value];- newPrincipals[principalIndex] = {- type: principal.type as "user" | "group",- value: newValue- };- onChange(newPrincipals);- }}- placeholder={`Select a ${principal.type}`}- className="w-full"- >- {principal.type === "user"- ? members.map((member) => (- <SelectItem- key={member.user.id}- value={member.user.username}- >- {member.user.username}- </SelectItem>- ))- : groups.map((group) => (- <SelectItem- key={group.group.slug}- value={group.group.slug}- >- {group.group.slug}- </SelectItem>- ))}- </Select>- </div>- <div className="flex w-10 justify-center">- <IconButton- size="sm"- ariaLabel="delete principal"- variant="plain"- className="h-9"- onClick={() => {- const newPrincipals = value.filter(- (_, idx) => idx !== principalIndex- );- onChange(newPrincipals.length ? newPrincipals : []);- }}- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>- </div>- </div>- ))}- {error && <span className="text-sm text-red-500">{error.message}</span>}- </div>- )}- />- </div>- </>- )}- </div>- ))}- </div>- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >- {popUp?.sshHostGroup?.data ? "Update" : "Add"}- </Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("sshHostGroup", false)}- >- Cancel- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupsSection.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupsSection.tsxdeleted file mode 100644index 5febe22b7c..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupsSection.tsx+++ /dev/null@@ -1,105 +0,0 @@-import { faArrowUpRightFromSquare, 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 { useDeleteSshHostGroup } from "@app/hooks/api";-import { usePopUp } from "@app/hooks/usePopUp";--import { SshHostGroupModal } from "./SshHostGroupModal";-import { SshHostGroupsTable } from "./SshHostGroupsTable";--export const SshHostGroupsSection = () => {- const { subscription } = useSubscription();- const { mutateAsync: deleteSshHostGroup } = useDeleteSshHostGroup();-- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "sshHostGroup",- "deleteSshHostGroup",- "upgradePlan"- ] as const);-- const handleAddSshHostGroupModal = () => {- if (!subscription?.sshHostGroups) {- handlePopUpOpen("upgradePlan", {- text: "Managing SSH host groups can be unlocked if you upgrade to Infisical Enterprise plan.",- isEnterpriseFeature: true- });- } else {- handlePopUpOpen("sshHostGroup");- }- };-- const onRemoveSshHostGroupSubmit = async (sshHostGroupId: string) => {- const hostGroup = await deleteSshHostGroup({ sshHostGroupId });-- createNotification({- text: `Successfully deleted SSH host group: ${hostGroup.name}`,- type: "success"- });-- handlePopUpClose("deleteSshHostGroup");- };-- return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex justify-between">- <p className="text-xl font-medium text-mineshaft-100">Host Groups</p>- <div className="flex justify-end">- <a- target="_blank"- rel="noopener noreferrer"- href="https://infisical.com/docs/documentation/platform/ssh/host-groups"- >- <span className="flex w-max cursor-pointer items-center rounded-md border border-mineshaft-500 bg-mineshaft-600 px-4 py-2 text-mineshaft-200 duration-200 hover:border-primary/40 hover:bg-primary/10 hover:text-white">- Documentation{" "}- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="mb-[0.06rem] ml-1 text-xs"- />- </span>- </a>- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="button"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handleAddSshHostGroupModal()}- isDisabled={!isAllowed}- className="ml-4"- >- Add Group- </Button>- )}- </ProjectPermissionCan>- </div>- </div>- <SshHostGroupsTable handlePopUpOpen={handlePopUpOpen} />- <SshHostGroupModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <DeleteActionModal- isOpen={popUp.deleteSshHostGroup.isOpen}- title={`Are you sure you want to remove the SSH host group: ${popUp?.deleteSshHostGroup?.data?.name}?`}- onChange={(isOpen) => handlePopUpToggle("deleteSshHostGroup", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveSshHostGroupSubmit(- (popUp?.deleteSshHostGroup?.data as { sshHostGroupId: string })?.sshHostGroupId- )- }- />- <UpgradePlanModal- isOpen={popUp.upgradePlan.isOpen}- onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}- text={popUp.upgradePlan?.data?.text}- isEnterpriseFeature={popUp.upgradePlan?.data?.isEnterpriseFeature}- />- </div>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupsTable.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupsTable.tsxdeleted file mode 100644index c80ab47a44..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostGroupsTable.tsx+++ /dev/null@@ -1,230 +0,0 @@-import {- faEllipsis,- faPencil,- faServer,- faTrash,- faUser,- faUsers-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { useNavigate } from "@tanstack/react-router";-import { twMerge } from "tailwind-merge";--import { ProjectPermissionCan } from "@app/components/permissions";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import { Badge } from "@app/components/v3";-import {- ProjectPermissionActions,- ProjectPermissionSub,- useOrganization,- useProject-} from "@app/context";-import { useListWorkspaceSshHostGroups } from "@app/hooks/api";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- handlePopUpOpen: (- popUpName: keyof UsePopUpState<["deleteSshHostGroup", "sshHostGroup"]>,- data?: object- ) => void;-};--export const SshHostGroupsTable = ({ handlePopUpOpen }: Props) => {- const navigate = useNavigate();- const { currentOrg } = useOrganization();- const { currentProject } = useProject();- const { data, isPending } = useListWorkspaceSshHostGroups(currentProject?.id || "");- return (- <div>- <TableContainer>- <Table className="w-full table-fixed">- <THead>- <Tr>- <Th>Name</Th>- <Th># Hosts in Group</Th>- <Th>Login User - Authorized Principals Mapping</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={3} innerKey="org-ssh-cas" />}- {!isPending &&- data &&- data.length > 0 &&- data.map((group) => {- return (- <Tr- className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"- key={`ssh-host-group-${group.id}`}- onClick={() =>- navigate({- to: "/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId",- params: {- orgId: currentOrg.id,- projectId: currentProject.id,- sshHostGroupId: group.id- }- })- }- >- <Td>{group.name}</Td>- <Td>{group.hostCount}</Td>- <Td>- {group.loginMappings.length === 0 ? (- <span className="text-mineshaft-400 italic">None</span>- ) : (- group.loginMappings.map(({ loginUser, allowedPrincipals }) => (- <div key={`${group.id}-${loginUser}`} className="mb-2">- <div className="text-mineshaft-200">{loginUser}</div>- {allowedPrincipals.usernames?.map((username) => (- <div- key={`${loginUser}-${username}`}- className="flex items-center gap-2"- >- <div className="flex items-center">- <span className="text-gray-400">└─</span>- </div>- <div className="flex items-center gap-1.5">- <FontAwesomeIcon- icon={faUser}- className="text-xs text-yellow/80"- />- <span>{username}</span>- <Badge variant="warning">user</Badge>- </div>- </div>- ))}- {allowedPrincipals.groups?.map((allowedGroup) => (- <div- key={`${loginUser}-${allowedGroup}`}- className="flex items-center gap-2"- >- <div className="flex items-center">- <span className="text-gray-400">└─</span>- </div>- <div className="flex items-center gap-1.5">- <FontAwesomeIcon- icon={faUsers}- className="text-xs text-green/80"- />- <span>{allowedGroup}</span>- <Badge variant="success">group</Badge>- </div>- </div>- ))}- </div>- ))- )}- </Td>- <Td className="text-right align-middle">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("sshHostGroup", {- sshHostGroupId: group.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faPencil} />}- >- Edit Host Group- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Edit}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- navigate({- to: "/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId",- params: {- orgId: currentOrg.id,- projectId: currentProject.id,- sshHostGroupId: group.id- }- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faServer} />}- >- Manage Hosts- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionActions.Delete}- a={ProjectPermissionSub.SshHostGroups}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("deleteSshHostGroup", {- sshHostGroupId: group.id,- name: group.name- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- >- Delete Host Group- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && data?.length === 0 && (- <EmptyState title="No SSH host groups have been created" icon={faServer} />- )}- </TableContainer>- </div>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostModal.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostModal.tsxdeleted file mode 100644index afcde908ff..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostModal.tsx+++ /dev/null@@ -1,576 +0,0 @@-import { useEffect, useState } from "react";-import { Controller, useFieldArray, useForm } from "react-hook-form";-import { faChevronDown, faChevronRight, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { zodResolver } from "@hookform/resolvers/zod";-import ms from "ms";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- FormControl,- FormLabel,- IconButton,- Input,- Modal,- ModalContent,- Select,- SelectItem-} from "@app/components/v2";-import { useProject } from "@app/context";-import {- useCreateSshHost,- useGetSshHostById,- useGetWorkspaceUsers,- useListWorkspaceGroups,- useListWorkspaceSshHosts,- useUpdateSshHost-} from "@app/hooks/api";-import { LoginMappingSource } from "@app/hooks/api/sshHost/types";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- popUp: UsePopUpState<["sshHost"]>;- handlePopUpToggle: (popUpName: keyof UsePopUpState<["sshHost"]>, state?: boolean) => void;-};--const schema = z- .object({- hostname: z.string().trim(),- alias: z.string().trim(),- userCertTtl: z- .string()- .trim()- .refine(- (val) => ms(val) > 0,- "TTL must be a valid time string such as 2 days, 1d, 2h 1y, ..."- )- .default("8h"),- loginMappings: z- .object({- loginUser: z.string().trim().min(1),- allowedPrincipals: z- .array(- z.object({- type: z.enum(["user", "group"]),- value: z.string().trim().min(1)- })- )- .default([]),- source: z.nativeEnum(LoginMappingSource)- })- .array()- .default([])- })- .required();--export type FormData = z.infer<typeof schema>;--export const SshHostModal = ({ popUp, handlePopUpToggle }: Props) => {- const { currentProject } = useProject();- const projectId = currentProject?.id || "";- const { data: sshHosts } = useListWorkspaceSshHosts(currentProject.id);- const { data: members = [] } = useGetWorkspaceUsers(projectId);- const { data: groups = [] } = useListWorkspaceGroups(projectId);- const [expandedMappings, setExpandedMappings] = useState<Record<number, boolean>>({});-- const { data: sshHost } = useGetSshHostById(- (popUp?.sshHost?.data as { sshHostId: string })?.sshHostId || ""- );-- const { mutateAsync: createMutateAsync } = useCreateSshHost();- const { mutateAsync: updateMutateAsync } = useUpdateSshHost();-- const {- control,- handleSubmit,- reset,- getValues,- setValue,- formState: { isSubmitting }- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {- hostname: "",- alias: "",- userCertTtl: "8h",- loginMappings: []- }- });-- const loginMappingsFormFields = useFieldArray({- control,- name: "loginMappings"- });-- useEffect(() => {- if (sshHost) {- reset({- hostname: sshHost.hostname,- alias: sshHost.alias ?? "",- userCertTtl: sshHost.userCertTtl,- loginMappings: sshHost.loginMappings.map(({ loginUser, allowedPrincipals, source }) => ({- loginUser,- allowedPrincipals: [- ...(allowedPrincipals.usernames || []).map((username) => ({- type: "user" as const,- value: username- })),- ...(allowedPrincipals.groups || []).map((group) => ({- type: "group" as const,- value: group- }))- ],- source- }))- });-- setExpandedMappings(- Object.fromEntries(sshHost.loginMappings.map((_, index) => [index, false]))- );- } else {- reset({- hostname: "",- alias: "",- userCertTtl: "8h",- loginMappings: []- });- }- }, [sshHost]);-- const onFormSubmit = async ({ hostname, alias, userCertTtl, loginMappings }: FormData) => {- if (!projectId) return;-- // Filter out login mappings that are from host groups- const hostLoginMappings = loginMappings.filter(- (mapping) => mapping.source === LoginMappingSource.HOST- );-- // check if there is already a different host with the same hostname- const existingHostnames =- sshHosts?.filter((h) => h.id !== sshHost?.id).map((h) => h.hostname) || [];-- if (existingHostnames.includes(hostname.trim())) {- createNotification({- text: "A host with this hostname already exists.",- type: "error"- });- return;- }-- const trimmedAlias = alias.trim();-- // check if there is already a different host with the same non-null alias- if (trimmedAlias) {- const existingAliases =- sshHosts?.filter((h) => h.id !== sshHost?.id && h.alias !== null).map((h) => h.alias) || [];-- if (existingAliases.includes(trimmedAlias)) {- createNotification({- text: "A host with this alias already exists.",- type: "error"- });- return;- }- }-- const transformedLoginMappings = hostLoginMappings.map(({ loginUser, allowedPrincipals }) => {- const usernames = allowedPrincipals- .filter((p) => p.type === "user" && p.value)- .map((p) => p.value);-- const groupNames = allowedPrincipals- .filter((p) => p.type === "group" && p.value)- .map((p) => p.value);-- return {- loginUser,- allowedPrincipals: {- usernames,- groups: groupNames- }- };- });-- if (sshHost) {- await updateMutateAsync({- sshHostId: sshHost.id,- hostname,- alias: trimmedAlias,- userCertTtl,- loginMappings: transformedLoginMappings- });- } else {- await createMutateAsync({- projectId,- hostname,- alias: trimmedAlias,- userCertTtl,- loginMappings: transformedLoginMappings- });- }-- reset();- handlePopUpToggle("sshHost", false);-- createNotification({- text: `Successfully ${sshHost ? "updated" : "added"} SSH host`,- type: "success"- });- };-- const toggleMapping = (index: number) => {- setExpandedMappings((prev) => ({- ...prev,- [index]: !prev[index]- }));- };-- const isPrincipalDuplicate = (- mappingIndex: number,- principalType: string,- principalValue: string- ) => {- const principals = getValues(`loginMappings.${mappingIndex}.allowedPrincipals`) || [];- return principals.some((p) => p.type === principalType && p.value === principalValue);- };-- return (- <Modal- isOpen={popUp?.sshHost?.isOpen}- onOpenChange={(isOpen) => {- reset();- handlePopUpToggle("sshHost", isOpen);- }}- >- <ModalContent title={`${sshHost ? "View" : "Add"} SSH host`}>- <form onSubmit={handleSubmit(onFormSubmit)}>- {sshHost && (- <FormControl label="SSH Host ID">- <Input value={sshHost.id} isDisabled className="bg-white/[0.07]" />- </FormControl>- )}- <Controller- control={control}- defaultValue=""- name="hostname"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Hostname"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="host.example.com" />- </FormControl>- )}- />- <Controller- control={control}- defaultValue=""- name="alias"- render={({ field, fieldState: { error } }) => (- <FormControl label="Alias" isError={Boolean(error)} errorText={error?.message}>- <Input {...field} placeholder="host" />- </FormControl>- )}- />- <Controller- control={control}- defaultValue=""- name="userCertTtl"- render={({ field, fieldState: { error } }) => (- <FormControl- label="User Certificate TTL"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="8h, 1d, 30m" />- </FormControl>- )}- />- <div className="mb-4 flex items-center justify-between">- <FormLabel label="Login Mappings" />- <Button- leftIcon={<FontAwesomeIcon icon={faPlus} />}- size="xs"- variant="outline_bg"- onClick={() => {- const newIndex = loginMappingsFormFields.fields.length;- loginMappingsFormFields.append({- loginUser: "",- allowedPrincipals: [],- source: LoginMappingSource.HOST- });- setExpandedMappings((prev) => ({- ...prev,- [newIndex]: true- }));- }}- >- Add Login Mapping- </Button>- </div>- <div className="mb-4 flex flex-col space-y-4">- {loginMappingsFormFields.fields.map(({ id: metadataFieldId }, i) => (- <div- key={metadataFieldId}- className="flex flex-col space-y-2 rounded-md border border-mineshaft-600 p-4"- >- <div className="mb-2 flex items-center justify-between">- <button- type="button"- className="flex cursor-pointer items-center py-1 text-sm text-mineshaft-200"- onClick={() => toggleMapping(i)}- >- <FontAwesomeIcon- icon={expandedMappings[i] ? faChevronDown : faChevronRight}- className="mr-4"- size="sm"- />- <Controller- control={control}- name={`loginMappings.${i}.loginUser`}- render={({ field }) => (- <span className="text-sm leading-tight font-medium">- {field.value || "New Login Mapping"}- {loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP && (- <span className="ml-2 text-xs text-mineshaft-400">- (inherited from host group)- </span>- )}- </span>- )}- />- </button>- <IconButton- ariaLabel="delete login mapping"- variant="plain"- onClick={() => loginMappingsFormFields.remove(i)}- isDisabled={- loginMappingsFormFields.fields[i].source === LoginMappingSource.HOST_GROUP- }- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>- </div>-- {expandedMappings[i] && (- <>- <div>- <span className="text-xs text-mineshaft-400">Login User</span>- <Controller- control={control}- name={`loginMappings.${i}.loginUser`}- render={({ field, fieldState: { error } }) => (- <FormControl- isError={Boolean(error?.message)}- errorText={error?.message}- className="mb-0"- >- <Input- {...field}- placeholder="ec2-user"- isDisabled={- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- }- onChange={(e) => {- if (- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- )- return;-- const newValue = e.target.value;- const loginMappings = getValues("loginMappings");- const isDuplicate = loginMappings.some(- (mapping, index) =>- index !== i &&- mapping.loginUser === newValue &&- mapping.source === LoginMappingSource.HOST- );-- if (isDuplicate) {- createNotification({- text: "This login user already exists",- type: "error"- });- return;- }-- field.onChange(e);- }}- />- </FormControl>- )}- />- </div>- <div className="flex flex-col space-y-2">- <div className="mt-4 mb-2 flex items-center justify-between">- <FormLabel- label="Allowed Principals"- className="text-xs text-mineshaft-400"- />- {loginMappingsFormFields.fields[i].source === LoginMappingSource.HOST && (- <Button- leftIcon={<FontAwesomeIcon icon={faPlus} />}- size="xs"- variant="outline_bg"- onClick={() => {- const current =- getValues(`loginMappings.${i}.allowedPrincipals`) ?? [];- setValue(`loginMappings.${i}.allowedPrincipals`, [- ...current,- { type: "user", value: "" }- ]);- }}- >- Add Principal- </Button>- )}- </div>- <Controller- control={control}- name={`loginMappings.${i}.allowedPrincipals`}- render={({ field: { value = [], onChange }, fieldState: { error } }) => (- <div className="flex flex-col space-y-2">- {value.map((principal, principalIndex) => (- <div- key={`principal-${i + 1}-${principalIndex + 1}-${principal.type}`}- className="flex items-center space-x-2"- >- <div className="mr-2">- <Select- className="w-24"- value={principal.type}- onValueChange={(newType) => {- const newPrincipals = [...value];- newPrincipals[principalIndex] = {- type: newType as "user" | "group",- value: ""- };- onChange(newPrincipals);- }}- isDisabled={- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- }- >- <SelectItem value="user">User</SelectItem>- <SelectItem value="group">Group</SelectItem>- </Select>- </div>- <div className="flex-1">- <Select- value={principal.value}- onValueChange={(newValue) => {- if (- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- )- return;- if (isPrincipalDuplicate(i, principal.type, newValue)) {- createNotification({- text: `This ${principal.type} is already added`,- type: "error"- });- return;- }- const newPrincipals = [...value];- newPrincipals[principalIndex] = {- type: principal.type,- value: newValue- };- onChange(newPrincipals);- }}- placeholder={`Select a ${principal.type}`}- className="w-full"- isDisabled={- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- }- >- {principal.type === "user"- ? members.map((member) => (- <SelectItem- key={member.user.id}- value={member.user.username}- >- {member.user.username}- </SelectItem>- ))- : groups.map((group) => (- <SelectItem- key={group.group.slug}- value={group.group.slug}- >- {group.group.slug}- </SelectItem>- ))}- </Select>- </div>- <div className="flex w-10 justify-center">- <IconButton- size="sm"- ariaLabel="delete principal"- variant="plain"- className="h-9"- onClick={() => {- if (- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- )- return;-- const newPrincipals = value.filter(- (_, idx) => idx !== principalIndex- );- onChange([...newPrincipals]);- }}- isDisabled={- loginMappingsFormFields.fields[i].source ===- LoginMappingSource.HOST_GROUP- }- >- <FontAwesomeIcon icon={faTrash} />- </IconButton>- </div>- </div>- ))}- {error && <span className="text-sm text-red-500">{error.message}</span>}- </div>- )}- />- </div>- </>- )}- </div>- ))}- </div>- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >- {popUp?.sshHost?.data ? "Update" : "Add"}- </Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("sshHost", false)}- >- Cancel- </Button>- </div>- </form>- </ModalContent>- </Modal>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostsSection.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostsSection.tsxdeleted file mode 100644index 53e8062ab1..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostsSection.tsx+++ /dev/null@@ -1,83 +0,0 @@-import { faArrowUpRightFromSquare, faPlus } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal } from "@app/components/v2";-import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";-import { useDeleteSshHost } from "@app/hooks/api";-import { usePopUp } from "@app/hooks/usePopUp";--import { SshHostModal } from "./SshHostModal";-import { SshHostsTable } from "./SshHostsTable";--export const SshHostsSection = () => {- const { mutateAsync: deleteSshHost } = useDeleteSshHost();-- const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([- "sshHost",- "deleteSshHost"- ] as const);-- const onRemoveSshHostSubmit = async (sshHostId: string) => {- const host = await deleteSshHost({ sshHostId });-- createNotification({- text: `Successfully deleted SSH host: ${host.hostname}`,- type: "success"- });-- handlePopUpClose("deleteSshHost");- };-- return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="mb-4 flex justify-between">- <p className="text-xl font-medium text-mineshaft-100">Hosts</p>- <div className="flex justify-end">- <a- target="_blank"- rel="noopener noreferrer"- href="https://infisical.com/docs/documentation/platform/ssh"- >- <span className="flex w-max cursor-pointer items-center rounded-md border border-mineshaft-500 bg-mineshaft-600 px-4 py-2 text-mineshaft-200 duration-200 hover:border-primary/40 hover:bg-primary/10 hover:text-white">- Documentation{" "}- <FontAwesomeIcon- icon={faArrowUpRightFromSquare}- className="mb-[0.06rem] ml-1 text-xs"- />- </span>- </a>- <ProjectPermissionCan- I={ProjectPermissionActions.Create}- a={ProjectPermissionSub.SshHosts}- >- {(isAllowed) => (- <Button- colorSchema="primary"- type="submit"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- onClick={() => handlePopUpOpen("sshHost")}- isDisabled={!isAllowed}- className="ml-4"- >- Add Host- </Button>- )}- </ProjectPermissionCan>- </div>- </div>- <SshHostsTable handlePopUpOpen={handlePopUpOpen} />- <SshHostModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />- <DeleteActionModal- isOpen={popUp.deleteSshHost.isOpen}- title="Are you sure you want to remove the SSH host?"- onChange={(isOpen) => handlePopUpToggle("deleteSshHost", isOpen)}- deleteKey="confirm"- onDeleteApproved={() =>- onRemoveSshHostSubmit((popUp?.deleteSshHost?.data as { sshHostId: string })?.sshHostId)- }- />- </div>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsx b/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsxdeleted file mode 100644index 448e62300b..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/SshHostsTable.tsx+++ /dev/null@@ -1,278 +0,0 @@-import {- faDownload,- faEllipsis,- faPencil,- faServer,- faTrash-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import FileSaver from "file-saver";-import { UserIcon, UsersIcon } from "lucide-react";-import { twMerge } from "tailwind-merge";--import { createNotification } from "@app/components/notifications";-import { ProjectPermissionCan } from "@app/components/permissions";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import { Badge } from "@app/components/v3";-import { ProjectPermissionSshHostActions, ProjectPermissionSub, useProject } from "@app/context";-import { fetchSshHostUserCaPublicKey, useListWorkspaceSshHosts } from "@app/hooks/api";-import { LoginMappingSource } from "@app/hooks/api/sshHost/types";-import { UsePopUpState } from "@app/hooks/usePopUp";--type Props = {- handlePopUpOpen: (- popUpName: keyof UsePopUpState<["deleteSshHost", "sshHost"]>,- data?: object- ) => void;-};--export const SshHostsTable = ({ handlePopUpOpen }: Props) => {- const { currentProject } = useProject();- const { data, isPending } = useListWorkspaceSshHosts(currentProject?.id || "");-- const downloadTxtFile = (filename: string, content: string) => {- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });- FileSaver.saveAs(blob, filename);- };-- const handleDownloadUserCaKey = async (sshHostId: string) => {- try {- const publicKey = await fetchSshHostUserCaPublicKey(sshHostId);- downloadTxtFile("infisical_user_ca.pub", publicKey);- } catch (err) {- console.error("Failed to download User CA public key", err);- createNotification({- type: "error",- text: "Failed to download User CA public key"- });- }- };-- return (- <div>- <TableContainer>- <Table className="w-full table-fixed">- <THead>- <Tr>- <Th>Alias</Th>- <Th>Hostname</Th>- <Th>Login User - Authorized Principals Mapping</Th>- <Th />- </Tr>- </THead>- <TBody>- {isPending && <TableSkeleton columns={3} innerKey="org-ssh-cas" />}- {!isPending &&- data &&- data.length > 0 &&- data.map((host) => {- return (- <Tr- // className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"- className="h-10"- key={`ssh-host-${host.id}`}- >- <Td>{host.alias ?? "-"}</Td>- <Td>{host.hostname}</Td>- <Td>- {host.loginMappings.length === 0 ? (- <span className="text-mineshaft-400 italic">None</span>- ) : (- (() => {- const hostMappings = host.loginMappings.filter(- (m) => m.source !== LoginMappingSource.HOST_GROUP- );- const groupMappings = host.loginMappings.filter(- (m) => m.source === LoginMappingSource.HOST_GROUP- );-- const hostLoginUserToPrincipals = hostMappings.reduce(- (acc, { loginUser, allowedPrincipals }) => {- acc[loginUser] = {- users: new Set(allowedPrincipals.usernames),- groups: new Set(allowedPrincipals.groups)- };- return acc;- },- {} as Record<string, { users: Set<string>; groups: Set<string> }>- );-- const entriesFromHost = hostMappings.map(- ({ loginUser, allowedPrincipals }) => ({- loginUser,- source: LoginMappingSource.HOST,- users: allowedPrincipals.usernames,- groups: allowedPrincipals.groups- })- );-- const entriesFromGroup = groupMappings- .map(({ loginUser, allowedPrincipals }) => {- const existing = hostLoginUserToPrincipals[loginUser] || {};- const filteredUsernames = allowedPrincipals.usernames?.filter(- (u) => !existing.users?.has(u)- );- const filteredGroups = allowedPrincipals.groups?.filter(- (g) => !existing.groups?.has(g)- );- return ((filteredGroups?.length || filteredUsernames?.length) ?? 0) >- 0- ? {- loginUser,- source: LoginMappingSource.HOST_GROUP,- users: filteredUsernames,- groups: filteredGroups- }- : null;- })- .filter(Boolean) as {- loginUser: string;- source: LoginMappingSource;- users: string[];- groups: string[];- }[];-- return [...entriesFromHost, ...entriesFromGroup]- .sort((a, b) => a.loginUser.localeCompare(b.loginUser))- .map(({ loginUser, users, groups, source }) => (- <div key={`${host.id}-${loginUser}-${source}`} className="mb-2">- <div className="text-mineshaft-200">- {loginUser}- {source === LoginMappingSource.HOST_GROUP && (- <span className="ml-2 text-xs text-mineshaft-400">- (inherited from host group)- </span>- )}- </div>- {users?.map((username) => (- <div- key={`${host.id}-${loginUser}-${source}-${username}`}- className="flex items-center gap-2"- >- <div className="flex items-center">- <span className="text-gray-400">└</span>- </div>- <div className="flex items-center gap-1.5">- <span>{username}</span>- <Badge variant="neutral">- <UserIcon />- User- </Badge>- </div>- </div>- ))}- {groups?.map((group) => (- <div- key={`${host.id}-${loginUser}-${source}-${group}`}- className="flex items-center gap-2"- >- <div className="flex items-center">- <span className="text-gray-400">└</span>- </div>- <div className="flex items-center gap-1.5">- <span>{group}</span>- <Badge variant="neutral">- <UsersIcon />- Group- </Badge>- </div>- </div>- ))}- </div>- ));- })()- )}- </Td>- <Td className="text-right align-middle">- <DropdownMenu>- <DropdownMenuTrigger asChild className="rounded-lg">- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">- <Tooltip content="More options">- <FontAwesomeIcon size="lg" icon={faEllipsis} />- </Tooltip>- </div>- </DropdownMenuTrigger>- <DropdownMenuContent align="start" className="p-1">- <DropdownMenuItem- onClick={async (e) => {- e.stopPropagation();- handleDownloadUserCaKey(host.id);- }}- icon={<FontAwesomeIcon icon={faDownload} />}- >- Download User CA Public Key- </DropdownMenuItem>- <ProjectPermissionCan- I={ProjectPermissionSshHostActions.Edit}- a={ProjectPermissionSub.SshHosts}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("sshHost", {- sshHostId: host.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faPencil} />}- >- Edit Host- </DropdownMenuItem>- )}- </ProjectPermissionCan>- <ProjectPermissionCan- I={ProjectPermissionSshHostActions.Delete}- a={ProjectPermissionSub.SshHosts}- >- {(isAllowed) => (- <DropdownMenuItem- className={twMerge(- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"- )}- onClick={(e) => {- e.stopPropagation();- handlePopUpOpen("deleteSshHost", {- sshHostId: host.id- });- }}- disabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- >- Delete Host- </DropdownMenuItem>- )}- </ProjectPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Td>- </Tr>- );- })}- </TBody>- </Table>- {!isPending && data?.length === 0 && (- <EmptyState title="No SSH hosts have been added" icon={faServer} />- )}- </TableContainer>- </div>- );-};diff --git a/frontend/src/pages/ssh/SshHostsPage/components/index.tsx b/frontend/src/pages/ssh/SshHostsPage/components/index.tsxdeleted file mode 100644index 96fb67e09b..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/components/index.tsx+++ /dev/null@@ -1,2 +0,0 @@-export { SshHostGroupsSection } from "./SshHostGroupsSection";-export { SshHostsSection } from "./SshHostsSection";diff --git a/frontend/src/pages/ssh/SshHostsPage/route.tsx b/frontend/src/pages/ssh/SshHostsPage/route.tsxdeleted file mode 100644index 54b60b8415..0000000000--- a/frontend/src/pages/ssh/SshHostsPage/route.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { SshHostsPage } from "./SshHostsPage";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview"-)({- component: SshHostsPage,- beforeLoad: ({ context }) => {- return {- breadcrumbs: [- ...context.breadcrumbs,- {- label: "Hosts"- }- ]- };- }-});diff --git a/frontend/src/pages/ssh/layout.tsx b/frontend/src/pages/ssh/layout.tsxdeleted file mode 100644index 9cf47cfe40..0000000000--- a/frontend/src/pages/ssh/layout.tsx+++ /dev/null@@ -1,37 +0,0 @@-import { createFileRoute } from "@tanstack/react-router";--import { BreadcrumbTypes } from "@app/components/v2";-import { projectKeys } from "@app/hooks/api";-import { fetchProjectById } from "@app/hooks/api/projects/queries";-import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";-import { ProjectSelect } from "@app/layouts/ProjectLayout/components/ProjectSelect";-import { SshLayout } from "@app/layouts/SshLayout";--export const Route = createFileRoute(- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"-)({- component: SshLayout,- beforeLoad: async ({ params, context }) => {- const project = await context.queryClient.ensureQueryData({- queryKey: projectKeys.getProjectById(params.projectId),- queryFn: () => fetchProjectById(params.projectId)- });-- await context.queryClient.ensureQueryData({- queryKey: roleQueryKeys.getUserProjectPermissions({- projectId: params.projectId- }),- queryFn: () => fetchUserProjectPermissions({ projectId: params.projectId })- });-- return {- project,- breadcrumbs: [- {- type: BreadcrumbTypes.Component,- component: ProjectSelect- }- ]- };- }-});diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.tsindex 3c068b66b2..5025aba0ad 100644--- a/frontend/src/routeTree.gen.ts+++ b/frontend/src/routeTree.gen.ts@@ -39,7 +39,6 @@ import { Route as adminSignUpPageRouteImport } from './pages/admin/SignUpPage/roimport { Route as organizationSignupOnboardingPageRouteImport } from './pages/organization/SignupOnboardingPage/route'import { Route as organizationNoOrgPageRouteImport } from './pages/organization/NoOrgPage/route'import { Route as organizationOauthConsentPageRouteImport } from './pages/organization/OauthConsentPage/route'-import { Route as organizationMcpEndpointFinalizePageRouteImport } from './pages/organization/McpEndpointFinalizePage/route'import { Route as MfaSessionPageRouteImport } from './pages/MfaSessionPage/route'import { Route as authSignUpPageRouteImport } from './pages/auth/SignUpPage/route'import { Route as authLoginPageRouteImport } from './pages/auth/LoginPage/route'@@ -95,12 +94,10 @@ import { Route as pamPamApprovalRequestsPageRouteImport } from './pages/pam/PamAimport { Route as pamPamAccountsPageRouteImport } from './pages/pam/PamAccountsPage/route'import { Route as organizationNetworkingPageRelayDetailsByIDPageRouteImport } from './pages/organization/NetworkingPage/RelayDetailsByIDPage/route'import { Route as organizationNetworkingPageGatewayDetailsByIDPageRouteImport } from './pages/organization/NetworkingPage/GatewayDetailsByIDPage/route'-import { Route as sshLayoutImport } from './pages/ssh/layout'import { Route as secretScanningLayoutImport } from './pages/secret-scanning/layout'import { Route as secretManagerLayoutImport } from './pages/secret-manager/layout'import { Route as kmsLayoutImport } from './pages/kms/layout'import { Route as certManagerLayoutImport } from './pages/cert-manager/layout'-import { Route as aiLayoutImport } from './pages/ai/layout'import { Route as projectRoleDetailsBySlugPageRoutePamImport } from './pages/project/RoleDetailsBySlugPage/route-pam'import { Route as projectMemberDetailsByIDPageRoutePamImport } from './pages/project/MemberDetailsByIDPage/route-pam'import { Route as projectIdentityDetailsByIDPageRoutePamImport } from './pages/project/IdentityDetailsByIDPage/route-pam'@@ -113,8 +110,6 @@ import { Route as organizationAppConnectionsOauthCallbackPageRouteImport } fromimport { Route as organizationSecretSharingPageRouteImport } from './pages/organization/SecretSharingPage/route'import { Route as organizationProductSettingsPageSecretsManagementRouteImport } from './pages/organization/ProductSettingsPage/SecretsManagement/route'import { Route as organizationKmipServersPageRouteImport } from './pages/organization/KmipServersPage/route'-import { Route as projectAuditLogsPageRouteSshImport } from './pages/project/AuditLogsPage/route-ssh'-import { Route as projectAccessControlPageRouteSshImport } from './pages/project/AccessControlPage/route-ssh'import { Route as projectAuditLogsPageRouteSecretScanningImport } from './pages/project/AuditLogsPage/route-secret-scanning'import { Route as projectAppConnectionsPageRouteSecretScanningImport } from './pages/project/AppConnectionsPage/route-secret-scanning'import { Route as projectAccessControlPageRouteSecretScanningImport } from './pages/project/AccessControlPage/route-secret-scanning'@@ -126,13 +121,7 @@ import { Route as projectAccessControlPageRouteKmsImport } from './pages/projectimport { Route as projectAuditLogsPageRouteCertManagerImport } from './pages/project/AuditLogsPage/route-cert-manager'import { Route as projectAppConnectionsPageRouteCertManagerImport } from './pages/project/AppConnectionsPage/route-cert-manager'import { Route as projectAccessControlPageRouteCertManagerImport } from './pages/project/AccessControlPage/route-cert-manager'-import { Route as projectAuditLogsPageRouteAiImport } from './pages/project/AuditLogsPage/route-ai'-import { Route as projectAccessControlPageRouteAiImport } from './pages/project/AccessControlPage/route-ai'import { Route as certManagerDashboardPageRouteIndexImport } from './pages/cert-manager/DashboardPage/route-index'-import { Route as sshSettingsPageRouteImport } from './pages/ssh/SettingsPage/route'-import { Route as sshSshHostsPageRouteImport } from './pages/ssh/SshHostsPage/route'-import { Route as sshSshCertsPageRouteImport } from './pages/ssh/SshCertsPage/route'-import { Route as sshSshCasPageRouteImport } from './pages/ssh/SshCasPage/route'import { Route as secretScanningSettingsPageRouteImport } from './pages/secret-scanning/SettingsPage/route'import { Route as secretScanningSecretScanningFindingsPageRouteImport } from './pages/secret-scanning/SecretScanningFindingsPage/route'import { Route as organizationProductSettingsPageSecretsManagementProjectTemplatesRouteImport } from './pages/organization/ProductSettingsPage/SecretsManagement/project-templates/route'@@ -151,12 +140,6 @@ import { Route as certManagerDashboardPageRouteImport } from './pages/cert-managimport { Route as certManagerInventoryPageRouteImport } from './pages/cert-manager/InventoryPage/route'import { Route as certManagerCertificateAuthoritiesPageRouteImport } from './pages/cert-manager/CertificateAuthoritiesPage/route'import { Route as certManagerAlertingPageRouteImport } from './pages/cert-manager/AlertingPage/route'-import { Route as aiSettingsPageRouteImport } from './pages/ai/SettingsPage/route'-import { Route as aiMCPPageRouteImport } from './pages/ai/MCPPage/route'-import { Route as projectRoleDetailsBySlugPageRouteSshImport } from './pages/project/RoleDetailsBySlugPage/route-ssh'-import { Route as projectMemberDetailsByIDPageRouteSshImport } from './pages/project/MemberDetailsByIDPage/route-ssh'-import { Route as projectIdentityDetailsByIDPageRouteSshImport } from './pages/project/IdentityDetailsByIDPage/route-ssh'-import { Route as projectGroupDetailsByIDPageRouteSshImport } from './pages/project/GroupDetailsByIDPage/route-ssh'import { Route as projectRoleDetailsBySlugPageRouteSecretScanningImport } from './pages/project/RoleDetailsBySlugPage/route-secret-scanning'import { Route as projectMemberDetailsByIDPageRouteSecretScanningImport } from './pages/project/MemberDetailsByIDPage/route-secret-scanning'import { Route as projectIdentityDetailsByIDPageRouteSecretScanningImport } from './pages/project/IdentityDetailsByIDPage/route-secret-scanning'@@ -174,12 +157,6 @@ import { Route as certManagerPkiCollectionDetailsByIDPageRoutesImport } from './import { Route as projectMemberDetailsByIDPageRouteCertManagerImport } from './pages/project/MemberDetailsByIDPage/route-cert-manager'import { Route as projectIdentityDetailsByIDPageRouteCertManagerImport } from './pages/project/IdentityDetailsByIDPage/route-cert-manager'import { Route as projectGroupDetailsByIDPageRouteCertManagerImport } from './pages/project/GroupDetailsByIDPage/route-cert-manager'-import { Route as projectRoleDetailsBySlugPageRouteAiImport } from './pages/project/RoleDetailsBySlugPage/route-ai'-import { Route as projectMemberDetailsByIDPageRouteAiImport } from './pages/project/MemberDetailsByIDPage/route-ai'-import { Route as projectIdentityDetailsByIDPageRouteAiImport } from './pages/project/IdentityDetailsByIDPage/route-ai'-import { Route as projectGroupDetailsByIDPageRouteAiImport } from './pages/project/GroupDetailsByIDPage/route-ai'-import { Route as sshSshHostGroupDetailsByIDPageRouteImport } from './pages/ssh/SshHostGroupDetailsByIDPage/route'-import { Route as sshSshCaByIDPageRouteImport } from './pages/ssh/SshCaByIDPage/route'import { Route as secretManagerSecretDashboardPageRouteImport } from './pages/secret-manager/SecretDashboardPage/route'import { Route as secretManagerIntegrationsSelectIntegrationAuthPageRouteImport } from './pages/secret-manager/integrations/SelectIntegrationAuthPage/route'import { Route as secretManagerIntegrationsDetailsByIDPageRouteImport } from './pages/secret-manager/IntegrationsDetailsByIDPage/route'@@ -194,8 +171,6 @@ import { Route as certManagerCertificatePolicyDetailsByIDPageRouteImport } fromimport { Route as certManagerCertAuthDetailsByIDPageRouteImport } from './pages/cert-manager/CertAuthDetailsByIDPage/route'import { Route as certManagerApprovalRequestDetailPageRouteImport } from './pages/cert-manager/ApprovalRequestDetailPage/route'import { Route as certManagerApplicationDetailsByIDPageRouteImport } from './pages/cert-manager/ApplicationDetailsByIDPage/route'-import { Route as aiMCPServerDetailPageRouteImport } from './pages/ai/MCPServerDetailPage/route'-import { Route as aiMCPEndpointDetailPageRouteImport } from './pages/ai/MCPEndpointDetailPage/route'import { Route as secretScanningSecretScanningDataSourcesPageRouteImport } from './pages/secret-scanning/SecretScanningDataSourcesPage/route'import { Route as secretManagerIntegrationsListPageRouteImport } from './pages/secret-manager/IntegrationsListPage/route'import { Route as certManagerPkiSubscribersPageRouteImport } from './pages/cert-manager/PkiSubscribersPage/route'@@ -329,10 +304,6 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSecretManagerProjeccreateFileRoute('/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId',)()-const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdImport =- createFileRoute(- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId',- )()const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdImport =createFileRoute('/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId',@@ -361,10 +332,6 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagercreateFileRoute('/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId',)()-const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdImport =- createFileRoute(- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId',- )()const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdPamPamLayoutAccessImport =createFileRoute('/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/access',@@ -617,13 +584,6 @@ const organizationOauthConsentPageRouteRoute =getParentRoute: () => middlewaresAuthenticateRoute,} as any)-const organizationMcpEndpointFinalizePageRouteRoute =- organizationMcpEndpointFinalizePageRouteImport.update({- id: '/organization/mcp-endpoint-finalize',- path: '/organization/mcp-endpoint-finalize',- getParentRoute: () => middlewaresAuthenticateRoute,- } as any)-const MfaSessionPageRouteRoute = MfaSessionPageRouteImport.update({id: '/mfa-session/$mfaSessionId',path: '/mfa-session/$mfaSessionId',@@ -1018,15 +978,6 @@ const secretManagerRedirectsRedirectApprovalPageRoute =AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSecretManagerProjectIdRoute,} as any)-const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRoute =- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdImport.update(- {- id: '/ssh/$projectId',- path: '/ssh/$projectId',- getParentRoute: () => organizationProjectsPageRouteRoute,- } as any,- )-const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRoute =AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdImport.update({@@ -1090,15 +1041,6 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManager} as any,)-const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRoute =- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdImport.update(- {- id: '/ai/$projectId',- path: '/ai/$projectId',- getParentRoute: () => organizationProjectsPageRouteRoute,- } as any,- )-const projectAuditLogsPageRoutePamRoute =projectAuditLogsPageRoutePamImport.update({id: '/audit-logs',@@ -1177,12 +1119,6 @@ const organizationNetworkingPageGatewayDetailsByIDPageRouteRoute =AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdNetworkingRoute,} as any)-const sshLayoutRoute = sshLayoutImport.update({- id: '/_ssh-layout',- getParentRoute: () =>- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRoute,-} as any)-const secretScanningLayoutRoute = secretScanningLayoutImport.update({id: '/_secret-scanning-layout',getParentRoute: () =>@@ -1207,12 +1143,6 @@ const certManagerLayoutRoute = certManagerLayoutImport.update({AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdRoute,} as any)-const aiLayoutRoute = aiLayoutImport.update({- id: '/_ai-layout',- getParentRoute: () =>- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRoute,-} as any)-const projectRoleDetailsBySlugPageRoutePamRoute =projectRoleDetailsBySlugPageRoutePamImport.update({id: '/roles/$roleSlug',@@ -1304,20 +1234,6 @@ const organizationKmipServersPageRouteRoute =AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsKmipServersRoute,} as any)-const projectAuditLogsPageRouteSshRoute =- projectAuditLogsPageRouteSshImport.update({- id: '/audit-logs',- path: '/audit-logs',- getParentRoute: () => sshLayoutRoute,- } as any)--const projectAccessControlPageRouteSshRoute =- projectAccessControlPageRouteSshImport.update({- id: '/access-management',- path: '/access-management',- getParentRoute: () => sshLayoutRoute,- } as any)-const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdSecretScanningLayoutDataSourcesRoute =AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdSecretScanningLayoutDataSourcesImport.update({@@ -1494,20 +1410,6 @@ const projectAccessControlPageRouteCertManagerRoute =getParentRoute: () => certManagerLayoutRoute,} as any)-const projectAuditLogsPageRouteAiRoute =- projectAuditLogsPageRouteAiImport.update({- id: '/audit-logs',- path: '/audit-logs',- getParentRoute: () => aiLayoutRoute,- } as any)--const projectAccessControlPageRouteAiRoute =- projectAccessControlPageRouteAiImport.update({- id: '/access-management',- path: '/access-management',- getParentRoute: () => aiLayoutRoute,- } as any)-const certManagerDashboardPageRouteIndexRoute =certManagerDashboardPageRouteIndexImport.update({id: '/',@@ -1515,30 +1417,6 @@ const certManagerDashboardPageRouteIndexRoute =getParentRoute: () => certManagerLayoutRoute,} as any)-const sshSettingsPageRouteRoute = sshSettingsPageRouteImport.update({- id: '/settings',- path: '/settings',- getParentRoute: () => sshLayoutRoute,-} as any)--const sshSshHostsPageRouteRoute = sshSshHostsPageRouteImport.update({- id: '/overview',- path: '/overview',- getParentRoute: () => sshLayoutRoute,-} as any)--const sshSshCertsPageRouteRoute = sshSshCertsPageRouteImport.update({- id: '/certificates',- path: '/certificates',- getParentRoute: () => sshLayoutRoute,-} as any)--const sshSshCasPageRouteRoute = sshSshCasPageRouteImport.update({- id: '/cas',- path: '/cas',- getParentRoute: () => sshLayoutRoute,-} as any)-const secretScanningSettingsPageRouteRoute =secretScanningSettingsPageRouteImport.update({id: '/settings',@@ -1665,46 +1543,6 @@ const certManagerAlertingPageRouteRoute =getParentRoute: () => certManagerLayoutRoute,} as any)-const aiSettingsPageRouteRoute = aiSettingsPageRouteImport.update({- id: '/settings',- path: '/settings',- getParentRoute: () => aiLayoutRoute,-} as any)--const aiMCPPageRouteRoute = aiMCPPageRouteImport.update({- id: '/overview',- path: '/overview',- getParentRoute: () => aiLayoutRoute,-} as any)--const projectRoleDetailsBySlugPageRouteSshRoute =- projectRoleDetailsBySlugPageRouteSshImport.update({- id: '/roles/$roleSlug',- path: '/roles/$roleSlug',- getParentRoute: () => sshLayoutRoute,- } as any)--const projectMemberDetailsByIDPageRouteSshRoute =- projectMemberDetailsByIDPageRouteSshImport.update({- id: '/members/$membershipId',- path: '/members/$membershipId',- getParentRoute: () => sshLayoutRoute,- } as any)--const projectIdentityDetailsByIDPageRouteSshRoute =- projectIdentityDetailsByIDPageRouteSshImport.update({- id: '/identities/$identityId',- path: '/identities/$identityId',- getParentRoute: () => sshLayoutRoute,- } as any)--const projectGroupDetailsByIDPageRouteSshRoute =- projectGroupDetailsByIDPageRouteSshImport.update({- id: '/groups/$groupId',- path: '/groups/$groupId',- getParentRoute: () => sshLayoutRoute,- } as any)-const projectRoleDetailsBySlugPageRouteSecretScanningRoute =projectRoleDetailsBySlugPageRouteSecretScanningImport.update({id: '/roles/$roleSlug',@@ -1824,47 +1662,6 @@ const projectGroupDetailsByIDPageRouteCertManagerRoute =getParentRoute: () => certManagerLayoutRoute,} as any)-const projectRoleDetailsBySlugPageRouteAiRoute =- projectRoleDetailsBySlugPageRouteAiImport.update({- id: '/roles/$roleSlug',- path: '/roles/$roleSlug',- getParentRoute: () => aiLayoutRoute,- } as any)--const projectMemberDetailsByIDPageRouteAiRoute =- projectMemberDetailsByIDPageRouteAiImport.update({- id: '/members/$membershipId',- path: '/members/$membershipId',- getParentRoute: () => aiLayoutRoute,- } as any)--const projectIdentityDetailsByIDPageRouteAiRoute =- projectIdentityDetailsByIDPageRouteAiImport.update({- id: '/identities/$identityId',- path: '/identities/$identityId',- getParentRoute: () => aiLayoutRoute,- } as any)--const projectGroupDetailsByIDPageRouteAiRoute =- projectGroupDetailsByIDPageRouteAiImport.update({- id: '/groups/$groupId',- path: '/groups/$groupId',- getParentRoute: () => aiLayoutRoute,- } as any)--const sshSshHostGroupDetailsByIDPageRouteRoute =- sshSshHostGroupDetailsByIDPageRouteImport.update({- id: '/ssh-host-groups/$sshHostGroupId',- path: '/ssh-host-groups/$sshHostGroupId',- getParentRoute: () => sshLayoutRoute,- } as any)--const sshSshCaByIDPageRouteRoute = sshSshCaByIDPageRouteImport.update({- id: '/ca/$caId',- path: '/ca/$caId',- getParentRoute: () => sshLayoutRoute,-} as any)-const secretManagerSecretDashboardPageRouteRoute =secretManagerSecretDashboardPageRouteImport.update({id: '/secrets/$envSlug',@@ -1973,21 +1770,6 @@ const certManagerApplicationDetailsByIDPageRouteRoute =AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutApplicationsRoute,} as any)-const aiMCPServerDetailPageRouteRoute = aiMCPServerDetailPageRouteImport.update(- {- id: '/mcp-servers/$serverId',- path: '/mcp-servers/$serverId',- getParentRoute: () => aiLayoutRoute,- } as any,-)--const aiMCPEndpointDetailPageRouteRoute =- aiMCPEndpointDetailPageRouteImport.update({- id: '/mcp-endpoints/$endpointId',- path: '/mcp-endpoints/$endpointId',- getParentRoute: () => aiLayoutRoute,- } as any)-const secretScanningSecretScanningDataSourcesPageRouteRoute =secretScanningSecretScanningDataSourcesPageRouteImport.update({id: '/',@@ -2873,13 +2655,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof MfaSessionPageRouteImportparentRoute: typeof middlewaresAuthenticateImport}- '/_authenticate/organization/mcp-endpoint-finalize': {- id: '/_authenticate/organization/mcp-endpoint-finalize'- path: '/organization/mcp-endpoint-finalize'- fullPath: '/organization/mcp-endpoint-finalize'- preLoaderRoute: typeof organizationMcpEndpointFinalizePageRouteImport- parentRoute: typeof middlewaresAuthenticateImport- }'/_authenticate/organization/oauth-consent': {id: '/_authenticate/organization/oauth-consent'path: '/organization/oauth-consent'@@ -3398,13 +3173,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof projectAuditLogsPageRoutePamImportparentRoute: typeof pamLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId'- path: '/ai/$projectId'- fullPath: '/organizations/$orgId/projects/ai/$projectId'- preLoaderRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdImport- parentRoute: typeof organizationProjectsPageRouteImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId'path: '/cert-manager/$projectId'@@ -3454,13 +3222,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdImportparentRoute: typeof organizationProjectsPageRouteImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId'- path: '/ssh/$projectId'- fullPath: '/organizations/$orgId/projects/ssh/$projectId'- preLoaderRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdImport- parentRoute: typeof organizationProjectsPageRouteImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId/approval': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId/approval'path: '/approval'@@ -3552,13 +3313,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof projectRoleDetailsBySlugPageRoutePamImportparentRoute: typeof pamLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout'- path: ''- fullPath: '/organizations/$orgId/projects/ai/$projectId'- preLoaderRoute: typeof aiLayoutImport- parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout'path: ''@@ -3587,27 +3341,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof secretScanningLayoutImportparentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout'- path: ''- fullPath: '/organizations/$orgId/projects/ssh/$projectId'- preLoaderRoute: typeof sshLayoutImport- parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview'- path: '/overview'- fullPath: '/organizations/$orgId/projects/ai/$projectId/overview'- preLoaderRoute: typeof aiMCPPageRouteImport- parentRoute: typeof aiLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings'- path: '/settings'- fullPath: '/organizations/$orgId/projects/ai/$projectId/settings'- preLoaderRoute: typeof aiSettingsPageRouteImport- parentRoute: typeof aiLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/alerting': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/alerting'path: '/alerting'@@ -3734,34 +3467,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof secretScanningSettingsPageRouteImportparentRoute: typeof secretScanningLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas'- path: '/cas'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/cas'- preLoaderRoute: typeof sshSshCasPageRouteImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates'- path: '/certificates'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/certificates'- preLoaderRoute: typeof sshSshCertsPageRouteImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview'- path: '/overview'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/overview'- preLoaderRoute: typeof sshSshHostsPageRouteImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings'- path: '/settings'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/settings'- preLoaderRoute: typeof sshSettingsPageRouteImport- parentRoute: typeof sshLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/'path: '/'@@ -3769,20 +3474,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof certManagerDashboardPageRouteIndexImportparentRoute: typeof certManagerLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management'- path: '/access-management'- fullPath: '/organizations/$orgId/projects/ai/$projectId/access-management'- preLoaderRoute: typeof projectAccessControlPageRouteAiImport- parentRoute: typeof aiLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs'- path: '/audit-logs'- fullPath: '/organizations/$orgId/projects/ai/$projectId/audit-logs'- preLoaderRoute: typeof projectAuditLogsPageRouteAiImport- parentRoute: typeof aiLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/access-management': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/access-management'path: '/access-management'@@ -3937,20 +3628,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdSecretScanningLayoutDataSourcesImportparentRoute: typeof secretScanningLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management'- path: '/access-management'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/access-management'- preLoaderRoute: typeof projectAccessControlPageRouteSshImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs'- path: '/audit-logs'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/audit-logs'- preLoaderRoute: typeof projectAuditLogsPageRouteSshImport- parentRoute: typeof sshLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/'path: '/'@@ -4028,20 +3705,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof secretScanningSecretScanningDataSourcesPageRouteImportparentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdSecretScanningLayoutDataSourcesImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId'- path: '/mcp-endpoints/$endpointId'- fullPath: '/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId'- preLoaderRoute: typeof aiMCPEndpointDetailPageRouteImport- parentRoute: typeof aiLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId'- path: '/mcp-servers/$serverId'- fullPath: '/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId'- preLoaderRoute: typeof aiMCPServerDetailPageRouteImport- parentRoute: typeof aiLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/$applicationName': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/$applicationName'path: '/$applicationName'@@ -4140,48 +3803,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof secretManagerSecretDashboardPageRouteImportparentRoute: typeof secretManagerLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId'- path: '/ca/$caId'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/ca/$caId'- preLoaderRoute: typeof sshSshCaByIDPageRouteImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId'- path: '/ssh-host-groups/$sshHostGroupId'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId'- preLoaderRoute: typeof sshSshHostGroupDetailsByIDPageRouteImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId'- path: '/groups/$groupId'- fullPath: '/organizations/$orgId/projects/ai/$projectId/groups/$groupId'- preLoaderRoute: typeof projectGroupDetailsByIDPageRouteAiImport- parentRoute: typeof aiLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId'- path: '/identities/$identityId'- fullPath: '/organizations/$orgId/projects/ai/$projectId/identities/$identityId'- preLoaderRoute: typeof projectIdentityDetailsByIDPageRouteAiImport- parentRoute: typeof aiLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId'- path: '/members/$membershipId'- fullPath: '/organizations/$orgId/projects/ai/$projectId/members/$membershipId'- preLoaderRoute: typeof projectMemberDetailsByIDPageRouteAiImport- parentRoute: typeof aiLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug'- path: '/roles/$roleSlug'- fullPath: '/organizations/$orgId/projects/ai/$projectId/roles/$roleSlug'- preLoaderRoute: typeof projectRoleDetailsBySlugPageRouteAiImport- parentRoute: typeof aiLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId'path: '/groups/$groupId'@@ -4301,34 +3922,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof projectRoleDetailsBySlugPageRouteSecretScanningImportparentRoute: typeof secretScanningLayoutImport}- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId'- path: '/groups/$groupId'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/groups/$groupId'- preLoaderRoute: typeof projectGroupDetailsByIDPageRouteSshImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId'- path: '/identities/$identityId'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/identities/$identityId'- preLoaderRoute: typeof projectIdentityDetailsByIDPageRouteSshImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId'- path: '/members/$membershipId'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/members/$membershipId'- preLoaderRoute: typeof projectMemberDetailsByIDPageRouteSshImport- parentRoute: typeof sshLayoutImport- }- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug': {- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug'- path: '/roles/$roleSlug'- fullPath: '/organizations/$orgId/projects/ssh/$projectId/roles/$roleSlug'- preLoaderRoute: typeof projectRoleDetailsBySlugPageRouteSshImport- parentRoute: typeof sshLayoutImport- }'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId': {id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId'path: '/installations/$installationId'@@ -4947,54 +4540,6 @@ const AuthenticateInjectOrgDetailsOrgLayoutIntegrationsRouteWithChildren =AuthenticateInjectOrgDetailsOrgLayoutIntegrationsRouteChildren,)-interface aiLayoutRouteChildren {- aiMCPPageRouteRoute: typeof aiMCPPageRouteRoute- aiSettingsPageRouteRoute: typeof aiSettingsPageRouteRoute- projectAccessControlPageRouteAiRoute: typeof projectAccessControlPageRouteAiRoute- projectAuditLogsPageRouteAiRoute: typeof projectAuditLogsPageRouteAiRoute- aiMCPEndpointDetailPageRouteRoute: typeof aiMCPEndpointDetailPageRouteRoute- aiMCPServerDetailPageRouteRoute: typeof aiMCPServerDetailPageRouteRoute- projectGroupDetailsByIDPageRouteAiRoute: typeof projectGroupDetailsByIDPageRouteAiRoute- projectIdentityDetailsByIDPageRouteAiRoute: typeof projectIdentityDetailsByIDPageRouteAiRoute- projectMemberDetailsByIDPageRouteAiRoute: typeof projectMemberDetailsByIDPageRouteAiRoute- projectRoleDetailsBySlugPageRouteAiRoute: typeof projectRoleDetailsBySlugPageRouteAiRoute-}--const aiLayoutRouteChildren: aiLayoutRouteChildren = {- aiMCPPageRouteRoute: aiMCPPageRouteRoute,- aiSettingsPageRouteRoute: aiSettingsPageRouteRoute,- projectAccessControlPageRouteAiRoute: projectAccessControlPageRouteAiRoute,- projectAuditLogsPageRouteAiRoute: projectAuditLogsPageRouteAiRoute,- aiMCPEndpointDetailPageRouteRoute: aiMCPEndpointDetailPageRouteRoute,- aiMCPServerDetailPageRouteRoute: aiMCPServerDetailPageRouteRoute,- projectGroupDetailsByIDPageRouteAiRoute:- projectGroupDetailsByIDPageRouteAiRoute,- projectIdentityDetailsByIDPageRouteAiRoute:- projectIdentityDetailsByIDPageRouteAiRoute,- projectMemberDetailsByIDPageRouteAiRoute:- projectMemberDetailsByIDPageRouteAiRoute,- projectRoleDetailsBySlugPageRouteAiRoute:- projectRoleDetailsBySlugPageRouteAiRoute,-}--const aiLayoutRouteWithChildren = aiLayoutRoute._addFileChildren(- aiLayoutRouteChildren,-)--interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteChildren {- aiLayoutRoute: typeof aiLayoutRouteWithChildren-}--const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteChildren: AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteChildren =- {- aiLayoutRoute: aiLayoutRouteWithChildren,- }--const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteWithChildren =- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRoute._addFileChildren(- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteChildren,- )-interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutApplicationsRouteChildren {certManagerApplicationsPageRouteRoute: typeof certManagerApplicationsPageRouteRoutecertManagerApplicationDetailsByIDPageRouteRoute: typeof certManagerApplicationDetailsByIDPageRouteRoute@@ -5768,62 +5313,8 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScannAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRouteChildren,)-interface sshLayoutRouteChildren {- sshSshCasPageRouteRoute: typeof sshSshCasPageRouteRoute- sshSshCertsPageRouteRoute: typeof sshSshCertsPageRouteRoute- sshSshHostsPageRouteRoute: typeof sshSshHostsPageRouteRoute- sshSettingsPageRouteRoute: typeof sshSettingsPageRouteRoute- projectAccessControlPageRouteSshRoute: typeof projectAccessControlPageRouteSshRoute- projectAuditLogsPageRouteSshRoute: typeof projectAuditLogsPageRouteSshRoute- sshSshCaByIDPageRouteRoute: typeof sshSshCaByIDPageRouteRoute- sshSshHostGroupDetailsByIDPageRouteRoute: typeof sshSshHostGroupDetailsByIDPageRouteRoute- projectGroupDetailsByIDPageRouteSshRoute: typeof projectGroupDetailsByIDPageRouteSshRoute- projectIdentityDetailsByIDPageRouteSshRoute: typeof projectIdentityDetailsByIDPageRouteSshRoute- projectMemberDetailsByIDPageRouteSshRoute: typeof projectMemberDetailsByIDPageRouteSshRoute- projectRoleDetailsBySlugPageRouteSshRoute: typeof projectRoleDetailsBySlugPageRouteSshRoute-}--const sshLayoutRouteChildren: sshLayoutRouteChildren = {- sshSshCasPageRouteRoute: sshSshCasPageRouteRoute,- sshSshCertsPageRouteRoute: sshSshCertsPageRouteRoute,- sshSshHostsPageRouteRoute: sshSshHostsPageRouteRoute,- sshSettingsPageRouteRoute: sshSettingsPageRouteRoute,- projectAccessControlPageRouteSshRoute: projectAccessControlPageRouteSshRoute,- projectAuditLogsPageRouteSshRoute: projectAuditLogsPageRouteSshRoute,- sshSshCaByIDPageRouteRoute: sshSshCaByIDPageRouteRoute,- sshSshHostGroupDetailsByIDPageRouteRoute:- sshSshHostGroupDetailsByIDPageRouteRoute,- projectGroupDetailsByIDPageRouteSshRoute:- projectGroupDetailsByIDPageRouteSshRoute,- projectIdentityDetailsByIDPageRouteSshRoute:- projectIdentityDetailsByIDPageRouteSshRoute,- projectMemberDetailsByIDPageRouteSshRoute:- projectMemberDetailsByIDPageRouteSshRoute,- projectRoleDetailsBySlugPageRouteSshRoute:- projectRoleDetailsBySlugPageRouteSshRoute,-}--const sshLayoutRouteWithChildren = sshLayoutRoute._addFileChildren(- sshLayoutRouteChildren,-)--interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteChildren {- sshLayoutRoute: typeof sshLayoutRouteWithChildren-}--const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteChildren: AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteChildren =- {- sshLayoutRoute: sshLayoutRouteWithChildren,- }--const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteWithChildren =- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRoute._addFileChildren(- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteChildren,- )-interface organizationProjectsPageRouteRouteChildren {organizationProjectsPageProjectTypePageRouteRoute: typeof organizationProjectsPageProjectTypePageRouteRoute- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteWithChildrenAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdRouteWithChildrenAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsProjectIdRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsProjectIdRouteWithChildrenAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsKmipServersRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsKmipServersRouteWithChildren@@ -5831,15 +5322,12 @@ interface organizationProjectsPageRouteRouteChildren {AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProductSettingsRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProductSettingsRouteWithChildrenAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementSecretSharingRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementSecretSharingRouteWithChildrenAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRouteWithChildren- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteWithChildren}const organizationProjectsPageRouteRouteChildren: organizationProjectsPageRouteRouteChildren ={organizationProjectsPageProjectTypePageRouteRoute:organizationProjectsPageProjectTypePageRouteRoute,- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRoute:- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteWithChildren,AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdRoute:AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdRouteWithChildren,AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsProjectIdRoute:@@ -5854,8 +5342,6 @@ const organizationProjectsPageRouteRouteChildren: organizationProjectsPageRouteRAuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementSecretSharingRouteWithChildren,AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRoute:AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRouteWithChildren,- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRoute:- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteWithChildren,}const organizationProjectsPageRouteRouteWithChildren =@@ -6177,7 +5663,6 @@ interface middlewaresAuthenticateRouteChildren {middlewaresInjectOrgDetailsRoute: typeof middlewaresInjectOrgDetailsRouteWithChildrenAuthenticatePersonalSettingsRoute: typeof AuthenticatePersonalSettingsRouteWithChildrenMfaSessionPageRouteRoute: typeof MfaSessionPageRouteRoute- organizationMcpEndpointFinalizePageRouteRoute: typeof organizationMcpEndpointFinalizePageRouteRouteorganizationOauthConsentPageRouteRoute: typeof organizationOauthConsentPageRouteRouteorganizationNoOrgPageRouteRoute: typeof organizationNoOrgPageRouteRouteorganizationSignupOnboardingPageRouteRoute: typeof organizationSignupOnboardingPageRouteRoute@@ -6191,8 +5676,6 @@ const middlewaresAuthenticateRouteChildren: middlewaresAuthenticateRouteChildrenAuthenticatePersonalSettingsRoute:AuthenticatePersonalSettingsRouteWithChildren,MfaSessionPageRouteRoute: MfaSessionPageRouteRoute,- organizationMcpEndpointFinalizePageRouteRoute:- organizationMcpEndpointFinalizePageRouteRoute,organizationOauthConsentPageRouteRoute:organizationOauthConsentPageRouteRoute,organizationNoOrgPageRouteRoute: organizationNoOrgPageRouteRoute,@@ -6294,7 +5777,6 @@ export interface FileRoutesByFullPath {'/login/': typeof authLoginPageRouteRoute'/signup/': typeof authSignUpPageRouteRoute'/mfa-session/$mfaSessionId': typeof MfaSessionPageRouteRoute- '/organization/mcp-endpoint-finalize': typeof organizationMcpEndpointFinalizePageRouteRoute'/organization/oauth-consent': typeof organizationOauthConsentPageRouteRoute'/organizations/none': typeof organizationNoOrgPageRouteRoute'/organizations/onboarding': typeof organizationSignupOnboardingPageRouteRoute@@ -6365,7 +5847,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/pam/access': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdPamPamLayoutAccessRouteWithChildren'/organizations/$orgId/pam/access-management': typeof projectAccessControlPageRoutePamRoute'/organizations/$orgId/pam/audit-logs': typeof projectAuditLogsPageRoutePamRoute- '/organizations/$orgId/projects/ai/$projectId': typeof aiLayoutRouteWithChildren'/organizations/$orgId/projects/cert-manager/$projectId': typeof certManagerLayoutRouteWithChildren'/organizations/$orgId/projects/kms/$projectId': typeof kmsLayoutRouteWithChildren'/organizations/$orgId/projects/kms/kmip-servers': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsKmipServersRouteWithChildren@@ -6373,7 +5854,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/projects/secret-management/product-settings': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProductSettingsRouteWithChildren'/organizations/$orgId/projects/secret-management/secret-sharing': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementSecretSharingRouteWithChildren'/organizations/$orgId/projects/secret-scanning/$projectId': typeof secretScanningLayoutRouteWithChildren- '/organizations/$orgId/projects/ssh/$projectId': typeof sshLayoutRouteWithChildren'/organizations/$orgId/secret-manager/$projectId/approval': typeof secretManagerRedirectsRedirectApprovalPageRoute'/organizations/$orgId/projects/kms/kmip-servers/': typeof organizationKmipServersPageRouteRoute'/organizations/$orgId/projects/secret-management/product-settings/': typeof organizationProductSettingsPageSecretsManagementRouteRoute@@ -6387,8 +5867,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/pam/identities/$identityId': typeof projectIdentityDetailsByIDPageRoutePamRoute'/organizations/$orgId/pam/members/$membershipId': typeof projectMemberDetailsByIDPageRoutePamRoute'/organizations/$orgId/pam/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRoutePamRoute- '/organizations/$orgId/projects/ai/$projectId/overview': typeof aiMCPPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/settings': typeof aiSettingsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/alerting': typeof certManagerAlertingPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities': typeof certManagerCertificateAuthoritiesPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/inventory': typeof certManagerInventoryPageRouteRoute@@ -6407,13 +5885,7 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/projects/secret-management/product-settings/project-templates/$templateId': typeof organizationProductSettingsPageSecretsManagementProjectTemplatesRouteRoute'/organizations/$orgId/projects/secret-scanning/$projectId/findings': typeof secretScanningSecretScanningFindingsPageRouteRoute'/organizations/$orgId/projects/secret-scanning/$projectId/settings': typeof secretScanningSettingsPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/cas': typeof sshSshCasPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/certificates': typeof sshSshCertsPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/overview': typeof sshSshHostsPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/settings': typeof sshSettingsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/': typeof certManagerDashboardPageRouteIndexRoute- '/organizations/$orgId/projects/ai/$projectId/access-management': typeof projectAccessControlPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/audit-logs': typeof projectAuditLogsPageRouteAiRoute'/organizations/$orgId/projects/cert-manager/$projectId/access-management': typeof projectAccessControlPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/app-connections': typeof projectAppConnectionsPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/applications': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutApplicationsRouteWithChildren@@ -6436,8 +5908,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/projects/secret-scanning/$projectId/app-connections': typeof projectAppConnectionsPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/audit-logs': typeof projectAuditLogsPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/data-sources': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdSecretScanningLayoutDataSourcesRouteWithChildren- '/organizations/$orgId/projects/ssh/$projectId/access-management': typeof projectAccessControlPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/audit-logs': typeof projectAuditLogsPageRouteSshRoute'/organizations/$orgId/projects/cert-manager/$projectId/applications/': typeof certManagerApplicationsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/approvals/': typeof certManagerApprovalsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/': typeof certManagerCertificatePoliciesPageRouteRoute@@ -6449,8 +5919,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/projects/cert-manager/$projectId/subscribers/': typeof certManagerPkiSubscribersPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/': typeof secretManagerIntegrationsListPageRouteRoute'/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/': typeof secretScanningSecretScanningDataSourcesPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId': typeof aiMCPEndpointDetailPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId': typeof aiMCPServerDetailPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/applications/$applicationName': typeof certManagerApplicationDetailsByIDPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId': typeof certManagerApprovalRequestDetailPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId': typeof certManagerCertAuthDetailsByIDPageRouteRoute@@ -6465,12 +5933,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth': typeof secretManagerIntegrationsSelectIntegrationAuthPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug': typeof secretManagerSecretDashboardPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/ca/$caId': typeof sshSshCaByIDPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId': typeof sshSshHostGroupDetailsByIDPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteAiRoute'/organizations/$orgId/projects/cert-manager/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteCertManagerRoute@@ -6488,10 +5950,6 @@ export interface FileRoutesByFullPath {'/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSecretScanningRoute- '/organizations/$orgId/projects/ssh/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSshRoute'/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId': typeof certManagerInstallationDetailsByIDPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize': typeof secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create': typeof secretManagerIntegrationsAwsParameterStoreConfigurePageRouteRoute@@ -6591,7 +6049,6 @@ export interface FileRoutesByTo {'/login': typeof authLoginPageRouteRoute'/signup': typeof authSignUpPageRouteRoute'/mfa-session/$mfaSessionId': typeof MfaSessionPageRouteRoute- '/organization/mcp-endpoint-finalize': typeof organizationMcpEndpointFinalizePageRouteRoute'/organization/oauth-consent': typeof organizationOauthConsentPageRouteRoute'/organizations/none': typeof organizationNoOrgPageRouteRoute'/organizations/onboarding': typeof organizationSignupOnboardingPageRouteRoute@@ -6656,12 +6113,10 @@ export interface FileRoutesByTo {'/organizations/$orgId/settings/oauth/callback': typeof organizationSettingsPageOauthCallbackPageRouteRoute'/organizations/$orgId/pam/access-management': typeof projectAccessControlPageRoutePamRoute'/organizations/$orgId/pam/audit-logs': typeof projectAuditLogsPageRoutePamRoute- '/organizations/$orgId/projects/ai/$projectId': typeof aiLayoutRouteWithChildren'/organizations/$orgId/projects/cert-manager/$projectId': typeof certManagerDashboardPageRouteIndexRoute'/organizations/$orgId/projects/kms/$projectId': typeof kmsLayoutRouteWithChildren'/organizations/$orgId/projects/secret-management/$projectId': typeof secretManagerLayoutRouteWithChildren'/organizations/$orgId/projects/secret-scanning/$projectId': typeof secretScanningLayoutRouteWithChildren- '/organizations/$orgId/projects/ssh/$projectId': typeof sshLayoutRouteWithChildren'/organizations/$orgId/secret-manager/$projectId/approval': typeof secretManagerRedirectsRedirectApprovalPageRoute'/organizations/$orgId/projects/kms/kmip-servers': typeof organizationKmipServersPageRouteRoute'/organizations/$orgId/projects/secret-management/product-settings': typeof organizationProductSettingsPageSecretsManagementRouteRoute@@ -6675,8 +6130,6 @@ export interface FileRoutesByTo {'/organizations/$orgId/pam/identities/$identityId': typeof projectIdentityDetailsByIDPageRoutePamRoute'/organizations/$orgId/pam/members/$membershipId': typeof projectMemberDetailsByIDPageRoutePamRoute'/organizations/$orgId/pam/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRoutePamRoute- '/organizations/$orgId/projects/ai/$projectId/overview': typeof aiMCPPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/settings': typeof aiSettingsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/alerting': typeof certManagerAlertingPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities': typeof certManagerCertificateAuthoritiesPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/inventory': typeof certManagerInventoryPageRouteRoute@@ -6695,12 +6148,6 @@ export interface FileRoutesByTo {'/organizations/$orgId/projects/secret-management/product-settings/project-templates/$templateId': typeof organizationProductSettingsPageSecretsManagementProjectTemplatesRouteRoute'/organizations/$orgId/projects/secret-scanning/$projectId/findings': typeof secretScanningSecretScanningFindingsPageRouteRoute'/organizations/$orgId/projects/secret-scanning/$projectId/settings': typeof secretScanningSettingsPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/cas': typeof sshSshCasPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/certificates': typeof sshSshCertsPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/overview': typeof sshSshHostsPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/settings': typeof sshSettingsPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/access-management': typeof projectAccessControlPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/audit-logs': typeof projectAuditLogsPageRouteAiRoute'/organizations/$orgId/projects/cert-manager/$projectId/access-management': typeof projectAccessControlPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/app-connections': typeof projectAppConnectionsPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/audit-logs': typeof projectAuditLogsPageRouteCertManagerRoute@@ -6712,8 +6159,6 @@ export interface FileRoutesByTo {'/organizations/$orgId/projects/secret-scanning/$projectId/access-management': typeof projectAccessControlPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/app-connections': typeof projectAppConnectionsPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/audit-logs': typeof projectAuditLogsPageRouteSecretScanningRoute- '/organizations/$orgId/projects/ssh/$projectId/access-management': typeof projectAccessControlPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/audit-logs': typeof projectAuditLogsPageRouteSshRoute'/organizations/$orgId/projects/cert-manager/$projectId/applications': typeof certManagerApplicationsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/approvals': typeof certManagerApprovalsPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies': typeof certManagerCertificatePoliciesPageRouteRoute@@ -6725,8 +6170,6 @@ export interface FileRoutesByTo {'/organizations/$orgId/projects/cert-manager/$projectId/subscribers': typeof certManagerPkiSubscribersPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations': typeof secretManagerIntegrationsListPageRouteRoute'/organizations/$orgId/projects/secret-scanning/$projectId/data-sources': typeof secretScanningSecretScanningDataSourcesPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId': typeof aiMCPEndpointDetailPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId': typeof aiMCPServerDetailPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/applications/$applicationName': typeof certManagerApplicationDetailsByIDPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId': typeof certManagerApprovalRequestDetailPageRouteRoute'/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId': typeof certManagerCertAuthDetailsByIDPageRouteRoute@@ -6741,12 +6184,6 @@ export interface FileRoutesByTo {'/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth': typeof secretManagerIntegrationsSelectIntegrationAuthPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug': typeof secretManagerSecretDashboardPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/ca/$caId': typeof sshSshCaByIDPageRouteRoute- '/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId': typeof sshSshHostGroupDetailsByIDPageRouteRoute- '/organizations/$orgId/projects/ai/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteAiRoute- '/organizations/$orgId/projects/ai/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteAiRoute'/organizations/$orgId/projects/cert-manager/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteCertManagerRoute'/organizations/$orgId/projects/cert-manager/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteCertManagerRoute@@ -6764,10 +6201,6 @@ export interface FileRoutesByTo {'/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSecretScanningRoute'/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSecretScanningRoute- '/organizations/$orgId/projects/ssh/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSshRoute- '/organizations/$orgId/projects/ssh/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSshRoute'/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId': typeof certManagerInstallationDetailsByIDPageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize': typeof secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteRoute'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create': typeof secretManagerIntegrationsAwsParameterStoreConfigurePageRouteRoute@@ -6870,7 +6303,6 @@ export interface FileRoutesById {'/_restrict-login-signup/login/': typeof authLoginPageRouteRoute'/_restrict-login-signup/signup/': typeof authSignUpPageRouteRoute'/_authenticate/mfa-session/$mfaSessionId': typeof MfaSessionPageRouteRoute- '/_authenticate/organization/mcp-endpoint-finalize': typeof organizationMcpEndpointFinalizePageRouteRoute'/_authenticate/organization/oauth-consent': typeof organizationOauthConsentPageRouteRoute'/_authenticate/organizations/none': typeof organizationNoOrgPageRouteRoute'/_authenticate/organizations/onboarding': typeof organizationSignupOnboardingPageRouteRoute@@ -6945,7 +6377,6 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/access': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdPamPamLayoutAccessRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/access-management': typeof projectAccessControlPageRoutePamRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/audit-logs': typeof projectAuditLogsPageRoutePamRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsProjectIdRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/kmip-servers': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsKmsKmipServersRouteWithChildren@@ -6953,7 +6384,6 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProductSettingsRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/secret-sharing': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementSecretSharingRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdRouteWithChildren- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSshProjectIdRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId/approval': typeof secretManagerRedirectsRedirectApprovalPageRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/kmip-servers/': typeof organizationKmipServersPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings/': typeof organizationProductSettingsPageSecretsManagementRouteRoute@@ -6967,14 +6397,10 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRoutePamRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRoutePamRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRoutePamRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout': typeof aiLayoutRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout': typeof certManagerLayoutRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/$projectId/_kms-layout': typeof kmsLayoutRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout': typeof secretManagerLayoutRouteWithChildren'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout': typeof secretScanningLayoutRouteWithChildren- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout': typeof sshLayoutRouteWithChildren- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview': typeof aiMCPPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings': typeof aiSettingsPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/alerting': typeof certManagerAlertingPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-authorities': typeof certManagerCertificateAuthoritiesPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/inventory': typeof certManagerInventoryPageRouteRoute@@ -6993,13 +6419,7 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings/project-templates/$templateId': typeof organizationProductSettingsPageSecretsManagementProjectTemplatesRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/findings': typeof secretScanningSecretScanningFindingsPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/settings': typeof secretScanningSettingsPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas': typeof sshSshCasPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates': typeof sshSshCertsPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview': typeof sshSshHostsPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings': typeof sshSettingsPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/': typeof certManagerDashboardPageRouteIndexRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management': typeof projectAccessControlPageRouteAiRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs': typeof projectAuditLogsPageRouteAiRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/access-management': typeof projectAccessControlPageRouteCertManagerRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/app-connections': typeof projectAppConnectionsPageRouteCertManagerRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutApplicationsRouteWithChildren@@ -7022,8 +6442,6 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/app-connections': typeof projectAppConnectionsPageRouteSecretScanningRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/audit-logs': typeof projectAuditLogsPageRouteSecretScanningRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretScanningProjectIdSecretScanningLayoutDataSourcesRouteWithChildren- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management': typeof projectAccessControlPageRouteSshRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs': typeof projectAuditLogsPageRouteSshRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/': typeof certManagerApplicationsPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approvals/': typeof certManagerApprovalsPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-policies/': typeof certManagerCertificatePoliciesPageRouteRoute@@ -7035,8 +6453,6 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/subscribers/': typeof certManagerPkiSubscribersPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/': typeof secretManagerIntegrationsListPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources/': typeof secretScanningSecretScanningDataSourcesPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId': typeof aiMCPEndpointDetailPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId': typeof aiMCPServerDetailPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/$applicationName': typeof certManagerApplicationDetailsByIDPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approvals/$approvalRequestId': typeof certManagerApprovalRequestDetailPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/ca/$caId': typeof certManagerCertAuthDetailsByIDPageRouteRoute@@ -7051,12 +6467,6 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/select-integration-auth': typeof secretManagerIntegrationsSelectIntegrationAuthPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/secrets/$envSlug': typeof secretManagerSecretDashboardPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId': typeof sshSshCaByIDPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId': typeof sshSshHostGroupDetailsByIDPageRouteRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId': typeof projectGroupDetailsByIDPageRouteAiRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteAiRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRouteAiRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteAiRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId': typeof projectGroupDetailsByIDPageRouteCertManagerRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteCertManagerRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRouteCertManagerRoute@@ -7074,10 +6484,6 @@ export interface FileRoutesById {'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSecretScanningRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSecretScanningRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSecretScanningRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId': typeof projectGroupDetailsByIDPageRouteSshRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSshRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSshRoute- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSshRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId': typeof certManagerInstallationDetailsByIDPageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/authorize': typeof secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteRoute'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/create': typeof secretManagerIntegrationsAwsParameterStoreConfigurePageRouteRoute@@ -7181,7 +6587,6 @@ export interface FileRouteTypes {| '/login/'| '/signup/'| '/mfa-session/$mfaSessionId'- | '/organization/mcp-endpoint-finalize'| '/organization/oauth-consent'| '/organizations/none'| '/organizations/onboarding'@@ -7252,7 +6657,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/pam/access'| '/organizations/$orgId/pam/access-management'| '/organizations/$orgId/pam/audit-logs'- | '/organizations/$orgId/projects/ai/$projectId'| '/organizations/$orgId/projects/cert-manager/$projectId'| '/organizations/$orgId/projects/kms/$projectId'| '/organizations/$orgId/projects/kms/kmip-servers'@@ -7260,7 +6664,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-management/product-settings'| '/organizations/$orgId/projects/secret-management/secret-sharing'| '/organizations/$orgId/projects/secret-scanning/$projectId'- | '/organizations/$orgId/projects/ssh/$projectId'| '/organizations/$orgId/secret-manager/$projectId/approval'| '/organizations/$orgId/projects/kms/kmip-servers/'| '/organizations/$orgId/projects/secret-management/product-settings/'@@ -7274,8 +6677,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/pam/identities/$identityId'| '/organizations/$orgId/pam/members/$membershipId'| '/organizations/$orgId/pam/roles/$roleSlug'- | '/organizations/$orgId/projects/ai/$projectId/overview'- | '/organizations/$orgId/projects/ai/$projectId/settings'| '/organizations/$orgId/projects/cert-manager/$projectId/alerting'| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities'| '/organizations/$orgId/projects/cert-manager/$projectId/inventory'@@ -7294,13 +6695,7 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-management/product-settings/project-templates/$templateId'| '/organizations/$orgId/projects/secret-scanning/$projectId/findings'| '/organizations/$orgId/projects/secret-scanning/$projectId/settings'- | '/organizations/$orgId/projects/ssh/$projectId/cas'- | '/organizations/$orgId/projects/ssh/$projectId/certificates'- | '/organizations/$orgId/projects/ssh/$projectId/overview'- | '/organizations/$orgId/projects/ssh/$projectId/settings'| '/organizations/$orgId/projects/cert-manager/$projectId/'- | '/organizations/$orgId/projects/ai/$projectId/access-management'- | '/organizations/$orgId/projects/ai/$projectId/audit-logs'| '/organizations/$orgId/projects/cert-manager/$projectId/access-management'| '/organizations/$orgId/projects/cert-manager/$projectId/app-connections'| '/organizations/$orgId/projects/cert-manager/$projectId/applications'@@ -7323,8 +6718,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-scanning/$projectId/app-connections'| '/organizations/$orgId/projects/secret-scanning/$projectId/audit-logs'| '/organizations/$orgId/projects/secret-scanning/$projectId/data-sources'- | '/organizations/$orgId/projects/ssh/$projectId/access-management'- | '/organizations/$orgId/projects/ssh/$projectId/audit-logs'| '/organizations/$orgId/projects/cert-manager/$projectId/applications/'| '/organizations/$orgId/projects/cert-manager/$projectId/approvals/'| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/'@@ -7336,8 +6729,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/cert-manager/$projectId/subscribers/'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/'| '/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/'- | '/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId'- | '/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId'| '/organizations/$orgId/projects/cert-manager/$projectId/applications/$applicationName'| '/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId'| '/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId'@@ -7352,12 +6743,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth'| '/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug'- | '/organizations/$orgId/projects/ssh/$projectId/ca/$caId'- | '/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId'- | '/organizations/$orgId/projects/ai/$projectId/groups/$groupId'- | '/organizations/$orgId/projects/ai/$projectId/identities/$identityId'- | '/organizations/$orgId/projects/ai/$projectId/members/$membershipId'- | '/organizations/$orgId/projects/ai/$projectId/roles/$roleSlug'| '/organizations/$orgId/projects/cert-manager/$projectId/groups/$groupId'| '/organizations/$orgId/projects/cert-manager/$projectId/identities/$identityId'| '/organizations/$orgId/projects/cert-manager/$projectId/members/$membershipId'@@ -7375,10 +6760,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId'| '/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId'| '/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug'- | '/organizations/$orgId/projects/ssh/$projectId/groups/$groupId'- | '/organizations/$orgId/projects/ssh/$projectId/identities/$identityId'- | '/organizations/$orgId/projects/ssh/$projectId/members/$membershipId'- | '/organizations/$orgId/projects/ssh/$projectId/roles/$roleSlug'| '/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create'@@ -7477,7 +6858,6 @@ export interface FileRouteTypes {| '/login'| '/signup'| '/mfa-session/$mfaSessionId'- | '/organization/mcp-endpoint-finalize'| '/organization/oauth-consent'| '/organizations/none'| '/organizations/onboarding'@@ -7542,12 +6922,10 @@ export interface FileRouteTypes {| '/organizations/$orgId/settings/oauth/callback'| '/organizations/$orgId/pam/access-management'| '/organizations/$orgId/pam/audit-logs'- | '/organizations/$orgId/projects/ai/$projectId'| '/organizations/$orgId/projects/cert-manager/$projectId'| '/organizations/$orgId/projects/kms/$projectId'| '/organizations/$orgId/projects/secret-management/$projectId'| '/organizations/$orgId/projects/secret-scanning/$projectId'- | '/organizations/$orgId/projects/ssh/$projectId'| '/organizations/$orgId/secret-manager/$projectId/approval'| '/organizations/$orgId/projects/kms/kmip-servers'| '/organizations/$orgId/projects/secret-management/product-settings'@@ -7561,8 +6939,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/pam/identities/$identityId'| '/organizations/$orgId/pam/members/$membershipId'| '/organizations/$orgId/pam/roles/$roleSlug'- | '/organizations/$orgId/projects/ai/$projectId/overview'- | '/organizations/$orgId/projects/ai/$projectId/settings'| '/organizations/$orgId/projects/cert-manager/$projectId/alerting'| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-authorities'| '/organizations/$orgId/projects/cert-manager/$projectId/inventory'@@ -7581,12 +6957,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-management/product-settings/project-templates/$templateId'| '/organizations/$orgId/projects/secret-scanning/$projectId/findings'| '/organizations/$orgId/projects/secret-scanning/$projectId/settings'- | '/organizations/$orgId/projects/ssh/$projectId/cas'- | '/organizations/$orgId/projects/ssh/$projectId/certificates'- | '/organizations/$orgId/projects/ssh/$projectId/overview'- | '/organizations/$orgId/projects/ssh/$projectId/settings'- | '/organizations/$orgId/projects/ai/$projectId/access-management'- | '/organizations/$orgId/projects/ai/$projectId/audit-logs'| '/organizations/$orgId/projects/cert-manager/$projectId/access-management'| '/organizations/$orgId/projects/cert-manager/$projectId/app-connections'| '/organizations/$orgId/projects/cert-manager/$projectId/audit-logs'@@ -7598,8 +6968,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-scanning/$projectId/access-management'| '/organizations/$orgId/projects/secret-scanning/$projectId/app-connections'| '/organizations/$orgId/projects/secret-scanning/$projectId/audit-logs'- | '/organizations/$orgId/projects/ssh/$projectId/access-management'- | '/organizations/$orgId/projects/ssh/$projectId/audit-logs'| '/organizations/$orgId/projects/cert-manager/$projectId/applications'| '/organizations/$orgId/projects/cert-manager/$projectId/approvals'| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies'@@ -7611,8 +6979,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/cert-manager/$projectId/subscribers'| '/organizations/$orgId/projects/secret-management/$projectId/integrations'| '/organizations/$orgId/projects/secret-scanning/$projectId/data-sources'- | '/organizations/$orgId/projects/ai/$projectId/mcp-endpoints/$endpointId'- | '/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId'| '/organizations/$orgId/projects/cert-manager/$projectId/applications/$applicationName'| '/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId'| '/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId'@@ -7627,12 +6993,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth'| '/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug'- | '/organizations/$orgId/projects/ssh/$projectId/ca/$caId'- | '/organizations/$orgId/projects/ssh/$projectId/ssh-host-groups/$sshHostGroupId'- | '/organizations/$orgId/projects/ai/$projectId/groups/$groupId'- | '/organizations/$orgId/projects/ai/$projectId/identities/$identityId'- | '/organizations/$orgId/projects/ai/$projectId/members/$membershipId'- | '/organizations/$orgId/projects/ai/$projectId/roles/$roleSlug'| '/organizations/$orgId/projects/cert-manager/$projectId/groups/$groupId'| '/organizations/$orgId/projects/cert-manager/$projectId/identities/$identityId'| '/organizations/$orgId/projects/cert-manager/$projectId/members/$membershipId'@@ -7650,10 +7010,6 @@ export interface FileRouteTypes {| '/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId'| '/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId'| '/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug'- | '/organizations/$orgId/projects/ssh/$projectId/groups/$groupId'- | '/organizations/$orgId/projects/ssh/$projectId/identities/$identityId'- | '/organizations/$orgId/projects/ssh/$projectId/members/$membershipId'- | '/organizations/$orgId/projects/ssh/$projectId/roles/$roleSlug'| '/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize'| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create'@@ -7754,7 +7110,6 @@ export interface FileRouteTypes {| '/_restrict-login-signup/login/'| '/_restrict-login-signup/signup/'| '/_authenticate/mfa-session/$mfaSessionId'- | '/_authenticate/organization/mcp-endpoint-finalize'| '/_authenticate/organization/oauth-consent'| '/_authenticate/organizations/none'| '/_authenticate/organizations/onboarding'@@ -7829,7 +7184,6 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/access'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/access-management'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/audit-logs'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/$projectId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/kmip-servers'@@ -7837,7 +7191,6 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/secret-sharing'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId/approval'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/kmip-servers/'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings/'@@ -7851,14 +7204,10 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/identities/$identityId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/members/$membershipId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout/roles/$roleSlug'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/$projectId/_kms-layout'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/alerting'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-authorities'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/inventory'@@ -7877,13 +7226,7 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings/project-templates/$templateId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/findings'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/settings'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/access-management'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/app-connections'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications'@@ -7906,8 +7249,6 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/app-connections'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/audit-logs'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approvals/'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-policies/'@@ -7919,8 +7260,6 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/subscribers/'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources/'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/$applicationName'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approvals/$approvalRequestId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/ca/$caId'@@ -7935,12 +7274,6 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/$integrationId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/select-integration-auth'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/secrets/$envSlug'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/identities/$identityId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/members/$membershipId'@@ -7958,10 +7291,6 @@ export interface FileRouteTypes {| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/identities/$identityId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/members/$membershipId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/roles/$roleSlug'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId'- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/authorize'| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/create'@@ -8105,7 +7434,6 @@ export const routeTree = rootRoute"/_authenticate/_inject-org-details","/_authenticate/personal-settings","/_authenticate/mfa-session/$mfaSessionId",- "/_authenticate/organization/mcp-endpoint-finalize","/_authenticate/organization/oauth-consent","/_authenticate/organizations/none","/_authenticate/organizations/onboarding"@@ -8201,10 +7529,6 @@ export const routeTree = rootRoute"filePath": "MfaSessionPage/route.tsx","parent": "/_authenticate"},- "/_authenticate/organization/mcp-endpoint-finalize": {- "filePath": "organization/McpEndpointFinalizePage/route.tsx",- "parent": "/_authenticate"- },"/_authenticate/organization/oauth-consent": {"filePath": "organization/OauthConsentPage/route.tsx","parent": "/_authenticate"@@ -8390,15 +7714,13 @@ export const routeTree = rootRoute"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId","children": ["/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/$type",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/$projectId","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/kms/kmip-servers","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/product-settings","/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/secret-sharing",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId"+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId"]},"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/sso": {@@ -8598,13 +7920,6 @@ export const routeTree = rootRoute"filePath": "project/AuditLogsPage/route-pam.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId": {- "filePath": "",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects",- "children": [- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- ]- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId": {"filePath": "","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects",@@ -8656,13 +7971,6 @@ export const routeTree = rootRoute"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout"]},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId": {- "filePath": "",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects",- "children": [- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- ]- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId/approval": {"filePath": "secret-manager/redirects/redirect-approval-page.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId"@@ -8715,22 +8023,6 @@ export const routeTree = rootRoute"filePath": "project/RoleDetailsBySlugPage/route-pam.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/pam/_pam-layout"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout": {- "filePath": "ai/layout.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId",- "children": [- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug"- ]- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout": {"filePath": "cert-manager/layout.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId",@@ -8817,32 +8109,6 @@ export const routeTree = rootRoute"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/roles/$roleSlug"]},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout": {- "filePath": "ssh/layout.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId",- "children": [- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId",- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug"- ]- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/overview": {- "filePath": "ai/MCPPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/settings": {- "filePath": "ai/SettingsPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/alerting": {"filePath": "cert-manager/AlertingPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout"@@ -8915,34 +8181,10 @@ export const routeTree = rootRoute"filePath": "secret-scanning/SettingsPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/cas": {- "filePath": "ssh/SshCasPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/certificates": {- "filePath": "ssh/SshCertsPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/overview": {- "filePath": "ssh/SshHostsPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/settings": {- "filePath": "ssh/SettingsPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/": {"filePath": "cert-manager/DashboardPage/route-index.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/access-management": {- "filePath": "project/AccessControlPage/route-ai.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/audit-logs": {- "filePath": "project/AuditLogsPage/route-ai.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/access-management": {"filePath": "project/AccessControlPage/route-cert-manager.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout"@@ -9151,14 +8393,6 @@ export const routeTree = rootRoute"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources/$type/$dataSourceId"]},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/access-management": {- "filePath": "project/AccessControlPage/route-ssh.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/audit-logs": {- "filePath": "project/AuditLogsPage/route-ssh.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/": {"filePath": "cert-manager/ApplicationsPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications"@@ -9203,14 +8437,6 @@ export const routeTree = rootRoute"filePath": "secret-scanning/SecretScanningDataSourcesPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-endpoints/$endpointId": {- "filePath": "ai/MCPEndpointDetailPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/mcp-servers/$serverId": {- "filePath": "ai/MCPServerDetailPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications/$applicationName": {"filePath": "cert-manager/ApplicationDetailsByIDPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications"@@ -9267,30 +8493,6 @@ export const routeTree = rootRoute"filePath": "secret-manager/SecretDashboardPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ca/$caId": {- "filePath": "ssh/SshCaByIDPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/ssh-host-groups/$sshHostGroupId": {- "filePath": "ssh/SshHostGroupDetailsByIDPage/route.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/groups/$groupId": {- "filePath": "project/GroupDetailsByIDPage/route-ai.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/identities/$identityId": {- "filePath": "project/IdentityDetailsByIDPage/route-ai.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/members/$membershipId": {- "filePath": "project/MemberDetailsByIDPage/route-ai.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout/roles/$roleSlug": {- "filePath": "project/RoleDetailsBySlugPage/route-ai.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ai/$projectId/_ai-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId": {"filePath": "project/GroupDetailsByIDPage/route-cert-manager.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout"@@ -9359,22 +8561,6 @@ export const routeTree = rootRoute"filePath": "project/RoleDetailsBySlugPage/route-secret-scanning.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout"},- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/groups/$groupId": {- "filePath": "project/GroupDetailsByIDPage/route-ssh.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/identities/$identityId": {- "filePath": "project/IdentityDetailsByIDPage/route-ssh.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/members/$membershipId": {- "filePath": "project/MemberDetailsByIDPage/route-ssh.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout/roles/$roleSlug": {- "filePath": "project/RoleDetailsBySlugPage/route-ssh.tsx",- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/ssh/$projectId/_ssh-layout"- },"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId": {"filePath": "cert-manager/InstallationDetailsByIDPage/route.tsx","parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery"diff --git a/frontend/src/routes.ts b/frontend/src/routes.tsindex 26f588a8ca..0a378cc5fa 100644--- a/frontend/src/routes.ts+++ b/frontend/src/routes.ts@@ -330,21 +330,6 @@ const certManagerRoutes = route("/organizations/$orgId/projects/cert-manager/$pr])]);-const aiRoutes = route("/organizations/$orgId/projects/ai/$projectId", [- layout("ai-layout", "ai/layout.tsx", [- route("/mcp-servers/$serverId", "ai/MCPServerDetailPage/route.tsx"),- route("/mcp-endpoints/$endpointId", "ai/MCPEndpointDetailPage/route.tsx"),- route("/overview", "ai/MCPPage/route.tsx"),- route("/settings", "ai/SettingsPage/route.tsx"),- route("/audit-logs", "project/AuditLogsPage/route-ai.tsx"),- route("/access-management", "project/AccessControlPage/route-ai.tsx"),- route("/roles/$roleSlug", "project/RoleDetailsBySlugPage/route-ai.tsx"),- route("/identities/$identityId", "project/IdentityDetailsByIDPage/route-ai.tsx"),- route("/members/$membershipId", "project/MemberDetailsByIDPage/route-ai.tsx"),- route("/groups/$groupId", "project/GroupDetailsByIDPage/route-ai.tsx")- ])-]);-const kmsRoutes = route("/organizations/$orgId/projects/kms/$projectId", [layout("kms-layout", "kms/layout.tsx", [route("/overview", "kms/OverviewPage/route.tsx"),@@ -359,23 +344,6 @@ const kmsRoutes = route("/organizations/$orgId/projects/kms/$projectId", [])]);-const sshRoutes = route("/organizations/$orgId/projects/ssh/$projectId", [- layout("ssh-layout", "ssh/layout.tsx", [- route("/overview", "ssh/SshHostsPage/route.tsx"),- route("/certificates", "ssh/SshCertsPage/route.tsx"),- route("/cas", "ssh/SshCasPage/route.tsx"),- route("/ca/$caId", "ssh/SshCaByIDPage/route.tsx"),- route("/ssh-host-groups/$sshHostGroupId", "ssh/SshHostGroupDetailsByIDPage/route.tsx"),- route("/settings", "ssh/SettingsPage/route.tsx"),- route("/audit-logs", "project/AuditLogsPage/route-ssh.tsx"),- route("/access-management", "project/AccessControlPage/route-ssh.tsx"),- route("/roles/$roleSlug", "project/RoleDetailsBySlugPage/route-ssh.tsx"),- route("/identities/$identityId", "project/IdentityDetailsByIDPage/route-ssh.tsx"),- route("/members/$membershipId", "project/MemberDetailsByIDPage/route-ssh.tsx"),- route("/groups/$groupId", "project/GroupDetailsByIDPage/route-ssh.tsx")- ])-]);-const secretScanningRoutes = route("/organizations/$orgId/projects/secret-scanning/$projectId", [layout("secret-scanning-layout", "secret-scanning/layout.tsx", [route("/data-sources", [@@ -503,7 +471,6 @@ export const routes = rootRoute("root.tsx", []),route("/organizations/none", "organization/NoOrgPage/route.tsx"),route("/organizations/onboarding", "organization/SignupOnboardingPage/route.tsx"),- route("/organization/mcp-endpoint-finalize", "organization/McpEndpointFinalizePage/route.tsx"),route("/organization/oauth-consent", "organization/OauthConsentPage/route.tsx"),middleware("inject-org-details.tsx", [adminRoute,@@ -530,10 +497,8 @@ export const routes = rootRoute("root.tsx", [secretManagerIntegrationsRedirect,certManagerRoutes,kmsRoutes,- sshRoutes,secretScanningRoutes,- pamRoutes,- aiRoutes+ pamRoutes])])])