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
fix: allow suborgs to create gh app connection
Matheus Nogueira3d3f48ced0f3
diff --git a/backend/src/services/github-app/github-app-service.ts b/backend/src/services/github-app/github-app-service.tsindex 053c318133..3b13526b2a 100644--- a/backend/src/services/github-app/github-app-service.ts+++ b/backend/src/services/github-app/github-app-service.ts@@ -317,7 +317,7 @@ export const gitHubAppServiceFactory = ({projectId: app.projectId,orgAction: OrgPermissionAppConnectionActions.Delete,projectAction: ProjectPermissionAppConnectionActions.Delete,- orgScope: OrganizationActionScope.ParentOrganization+ orgScope: OrganizationActionScope.Any});// Resolve credentials up front — once the row is deleted the private key is gone and we can no@@ -410,7 +410,7 @@ export const gitHubAppServiceFactory = ({projectId,orgAction: OrgPermissionAppConnectionActions.Create,projectAction: ProjectPermissionAppConnectionActions.Create,- orgScope: OrganizationActionScope.ParentOrganization+ orgScope: OrganizationActionScope.Any});assertPlatformGitHubHostAllowed(githubHost);@@ -541,7 +541,7 @@ export const gitHubAppServiceFactory = ({projectId,orgAction: OrgPermissionAppConnectionActions.Create,projectAction: ProjectPermissionAppConnectionActions.Create,- orgScope: OrganizationActionScope.ParentOrganization+ orgScope: OrganizationActionScope.Any});const existingByName = await gitHubAppDAL.findOne({ orgId, projectId, name });diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsxindex fc5ff1d9f1..e1500ef080 100644--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx@@ -221,15 +221,12 @@ export const Navbar = () => {}SecurityClient.setToken(token);- queryClient.removeQueries({ queryKey: adminQueryKeys.serverConfig() });- queryClient.removeQueries({ queryKey: authKeys.getAuthToken });- queryClient.removeQueries({ queryKey: subOrgQuery.queryKey });+ queryClient.clear();await queryClient.refetchQueries({ queryKey: authKeys.getAuthToken });await queryClient.refetchQueries({ queryKey: adminQueryKeys.serverConfig() });await navigateUserToOrg({ navigate, organizationId, navigateTo });- queryClient.removeQueries({ queryKey: projectKeys.allProjectQueries() });if (onSuccess) {await onSuccess();diff --git a/frontend/src/pages/middlewares/inject-org-details.tsx b/frontend/src/pages/middlewares/inject-org-details.tsxindex 6139149ba8..210cb138b8 100644--- a/frontend/src/pages/middlewares/inject-org-details.tsx+++ b/frontend/src/pages/middlewares/inject-org-details.tsx@@ -3,12 +3,8 @@ import { createFileRoute, isRedirect, redirect } from "@tanstack/react-router";import SecurityClient from "@app/components/utilities/SecurityClient";import { SessionStorageKeys } from "@app/const";import { authKeys, fetchAuthToken, selectOrganization } from "@app/hooks/api/auth/queries";-import { certManagerInstanceKeys } from "@app/hooks/api/certManagerInstance";-import { identitiesKeys } from "@app/hooks/api/identities/queries";import { fetchOrganizationById, organizationKeys } from "@app/hooks/api/organization/queries";-import { projectKeys } from "@app/hooks/api/projects";import { fetchUserOrgPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";-import { subOrganizationsQuery } from "@app/hooks/api/subOrganizations";import { fetchOrgSubscription, subscriptionQueryKeys } from "@app/hooks/api/subscriptions/queries";// Route context to fill in organization's data like details, subscription etc@@ -42,13 +38,7 @@ export const Route = createFileRoute("/_authenticate/_inject-org-details")({if (!isMfaEnabled && token) {SecurityClient.setToken(token);-- context.queryClient.removeQueries({ queryKey: authKeys.getAuthToken });- context.queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });- context.queryClient.removeQueries({ queryKey: subOrganizationsQuery.allKey() });- context.queryClient.removeQueries({ queryKey: certManagerInstanceKeys.all });- context.queryClient.removeQueries({ queryKey: identitiesKeys.searchIdentitiesRoot });- context.queryClient.removeQueries({ queryKey: identitiesKeys.countIdentitiesRoot });+ context.queryClient.clear();await context.queryClient.fetchQuery({queryKey: authKeys.getAuthToken,