Skip to content

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

manage gh app directly with connection

Thiago Araujo da Silva064b445dc7c9
diff --git a/backend/src/server/routes/v1/github-app-router.ts b/backend/src/server/routes/v1/github-app-router.ts
index 324d88a28b..9cfb4c915b 100644
--- a/backend/src/server/routes/v1/github-app-router.ts
+++ b/backend/src/server/routes/v1/github-app-router.ts
@@ -5,13 +5,13 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type";
const SanitizedGitHubAppSchema = z.object({
- id: z.string().uuid(),
+ id: z.string().uuid().nullable(),
orgId: z.string().uuid(),
name: z.string(),
appId: z.string(),
slug: z.string(),
- createdAt: z.date(),
- updatedAt: z.date()
+ createdAt: z.date().nullable(),
+ updatedAt: z.date().nullable()
});
export const registerGitHubAppRouter = async (server: FastifyZodProvider) => {
diff --git a/backend/src/services/app-connection/app-connection-service.ts b/backend/src/services/app-connection/app-connection-service.ts
index ebc73a5557..006d0ce152 100644
--- a/backend/src/services/app-connection/app-connection-service.ts
+++ b/backend/src/services/app-connection/app-connection-service.ts
@@ -26,6 +26,7 @@ import {
import { crypto } from "@app/lib/crypto/cryptography";
import { DatabaseErrorCode } from "@app/lib/error-codes";
import { BadRequestError, DatabaseError, NotFoundError } from "@app/lib/errors";
+import { logger } from "@app/lib/logger";
import { DiscriminativePick, OrgServiceActor } from "@app/lib/types";
import {
decryptAppConnection,
@@ -107,7 +108,11 @@ import { ValidateFlyioConnectionCredentialsSchema } from "./flyio";
import { flyioConnectionService } from "./flyio/flyio-connection-service";
import { ValidateGcpConnectionCredentialsSchema } from "./gcp";
import { gcpConnectionService } from "./gcp/gcp-connection-service";
-import { ValidateGitHubConnectionCredentialsSchema } from "./github";
+import {
+ GitHubConnectionMethod,
+ uninstallGitHubAppInstallation,
+ ValidateGitHubConnectionCredentialsSchema
+} from "./github";
import { githubConnectionService } from "./github/github-connection-service";
import { ValidateGitHubRadarConnectionCredentialsSchema } from "./github-radar";
import { githubRadarConnectionService } from "./github-radar/github-radar-connection-service";
@@ -185,7 +190,7 @@ export type TAppConnectionServiceFactoryDep = {
projectDAL: Pick<TProjectDALFactory, "findProjectById">;
appConnectionCredentialRotationService: TAppConnectionCredentialRotationServiceFactory;
identityUaDAL: Pick<TIdentityUaDALFactory, "findOne">;
- gitHubAppDAL: Pick<TGitHubAppDALFactory, "findOne">;
+ gitHubAppDAL: Pick<TGitHubAppDALFactory, "findOne" | "deleteById">;
};
export type TAppConnectionServiceFactory = ReturnType<typeof appConnectionServiceFactory>;
@@ -961,9 +966,44 @@ export const appConnectionServiceFactory = ({
// TODO (scott): add option to delete all dependencies
+ let dedicatedGitHubAppId: string | null = null;
+
+ if (app === AppConnection.GitHub) {
+ const decrypted = await decryptAppConnection(appConnection, kmsService);
+ if (decrypted.method === GitHubConnectionMethod.App) {
+ // Best-effort uninstall on GitHub. Failures don't block local deletion — the user can
+ // always remove the installation manually if our cleanup couldn't reach GitHub.
+ try {
+ await uninstallGitHubAppInstallation(decrypted, gatewayService, gatewayV2Service, gatewayPoolService, {
+ gitHubAppDAL,
+ kmsService
+ });
+ } catch (err) {
+ logger.warn(
+ { err, connectionId },
+ `Failed to uninstall GitHub App for connection [connectionId=${connectionId}]`
+ );
+ }
+ dedicatedGitHubAppId = decrypted.credentials.gitHubAppId ?? null;
+ }
+ }
+
try {
const deletedAppConnection = await appConnectionDAL.deleteById(connectionId);
+ // For dedicated GitHub Apps, drop the encrypted app record now that no connection refers
+ // to it. Best-effort: the connection is already deleted, and an orphaned row is recoverable.
+ if (dedicatedGitHubAppId) {
+ try {
+ await gitHubAppDAL.deleteById(dedicatedGitHubAppId);
+ } catch (err) {
+ logger.warn(
+ { err, gitHubAppId: dedicatedGitHubAppId, connectionId },
+ `Failed to delete dedicated GitHub App row [gitHubAppId=${dedicatedGitHubAppId}]`
+ );
+ }
+ }
+
return await decryptAppConnection(deletedAppConnection, kmsService);
} catch (err) {
if (
diff --git a/backend/src/services/app-connection/github/github-connection-fns.ts b/backend/src/services/app-connection/github/github-connection-fns.ts
index eee8636a8d..60c0c07c59 100644
--- a/backend/src/services/app-connection/github/github-connection-fns.ts
+++ b/backend/src/services/app-connection/github/github-connection-fns.ts
@@ -265,6 +265,74 @@ export const requestWithGitHubGateway = async <T>(
);
};
+export const uninstallGitHubAppInstallation = async (
+ appConnection: TGitHubConnection,
+ gatewayService: Pick<TGatewayServiceFactory, "fnGetGatewayClientTlsByGatewayId">,
+ gatewayV2Service: Pick<TGatewayV2ServiceFactory, "getPlatformConnectionDetailsByGatewayId">,
+ gatewayPoolService: Pick<TGatewayPoolServiceFactory, "resolveEffectiveGatewayId">,
+ deps: TGitHubAppCredentialResolverDeps
+) => {
+ if (appConnection.method !== GitHubConnectionMethod.App) {
+ throw new InternalServerError({ message: "Cannot uninstall a non-app GitHub connection" });
+ }
+
+ const { appId, privateKey } = await resolveGitHubAppCredentials(
+ { gitHubAppId: appConnection.credentials.gitHubAppId, orgId: appConnection.orgId },
+ deps
+ );
+
+ const appPrivateKey = privateKey
+ .split("\n")
+ .map((line) => line.trim())
+ .join("\n");
+
+ const now = Math.floor(Date.now() / 1000);
+ const appJwt = crypto.jwt().sign({ iat: now, exp: now + 5 * 60, iss: appId }, appPrivateKey, {
+ algorithm: "RS256"
+ });
+
+ const apiBaseUrl = await getGitHubInstanceApiUrl(appConnection);
+ const { installationId } = appConnection.credentials;
+
+ const effectiveGatewayId = await gatewayPoolService.resolveEffectiveGatewayId({
+ gatewayId: appConnection.gatewayId,
+ gatewayPoolId: appConnection.gatewayPoolId
+ });
+
+ const gatewayConnectionDetails = effectiveGatewayId
+ ? await getGitHubGatewayConnectionDetails(effectiveGatewayId, apiBaseUrl, gatewayV2Service)
+ : undefined;
+
+ try {
+ await requestWithGitHubGateway(
+ { gatewayId: effectiveGatewayId },
+ gatewayService,
+ gatewayV2Service,
+ {
+ url: `https://${apiBaseUrl}/app/installations/${installationId}`,
+ method: "DELETE",
+ headers: {
+ Accept: "application/vnd.github+json",
+ Authorization: `Bearer ${appJwt}`,
+ "X-GitHub-Api-Version": "2022-11-28"
+ }
+ },
+ gatewayConnectionDetails
+ );
+ } catch (err) {
+ // 404 means the installation is already gone (e.g. the user removed it on GitHub before
+ // deleting the connection in Infisical). That's a no-op success — anything else is logged
+ // but doesn't block local cleanup.
+ const status = (err as AxiosError)?.response?.status;
+ if (status !== 404) {
+ logger.warn(
+ { err, installationId, gitHubAppId: appConnection.credentials.gitHubAppId },
+ `Failed to uninstall GitHub App installation [installationId=${installationId}]`
+ );
+ }
+ }
+};
+
export const getGitHubAppAuthToken = async (
appConnection: TGitHubConnection,
gatewayService: Pick<TGatewayServiceFactory, "fnGetGatewayClientTlsByGatewayId">,
diff --git a/backend/src/services/app-connection/github/github-connection-schemas.ts b/backend/src/services/app-connection/github/github-connection-schemas.ts
index eb6c770a48..de1150a72b 100644
--- a/backend/src/services/app-connection/github/github-connection-schemas.ts
+++ b/backend/src/services/app-connection/github/github-connection-schemas.ts
@@ -164,7 +164,8 @@ export const SanitizedGitHubConnectionSchema = z.discriminatedUnion("method", [
method: z.literal(GitHubConnectionMethod.App),
credentials: z.object({
instanceType: z.union([z.literal("server"), z.literal("cloud")]).optional(),
- host: z.string().optional()
+ host: z.string().optional(),
+ gitHubAppId: z.string().uuid().nullish()
})
}).describe(JSON.stringify({ title: `${APP_CONNECTION_NAME_MAP[AppConnection.GitHub]} (GitHub App)` })),
BaseGitHubConnectionSchema.extend({
diff --git a/backend/src/services/github-app/github-app-service.ts b/backend/src/services/github-app/github-app-service.ts
index 59f5b8ac50..72b361233a 100644
--- a/backend/src/services/github-app/github-app-service.ts
+++ b/backend/src/services/github-app/github-app-service.ts
@@ -3,6 +3,7 @@ import { ForbiddenError } from "@casl/ability";
import { OrganizationActionScope } from "@app/db/schemas";
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/ee/services/permission/org-permission";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
+import { getConfig } from "@app/lib/config/env";
import { request } from "@app/lib/config/request";
import { BadRequestError, NotFoundError } from "@app/lib/errors";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
@@ -119,7 +120,7 @@ export const gitHubAppServiceFactory = ({
orgId: orgPermission.orgId
});
- return apps.map((app) => ({
+ const dbApps: TSanitizedGitHubApp[] = apps.map((app) => ({
id: app.id,
orgId: app.orgId,
name: app.name,
@@ -128,6 +129,23 @@ export const gitHubAppServiceFactory = ({
createdAt: app.createdAt,
updatedAt: app.updatedAt
}));
+
+ const { INF_APP_CONNECTION_GITHUB_APP_ID, INF_APP_CONNECTION_GITHUB_APP_SLUG } = getConfig();
+
+ const sharedApp: TSanitizedGitHubApp | null =
+ INF_APP_CONNECTION_GITHUB_APP_ID && INF_APP_CONNECTION_GITHUB_APP_SLUG
+ ? {
+ id: null,
+ orgId: orgPermission.orgId,
+ name: INF_APP_CONNECTION_GITHUB_APP_SLUG,
+ appId: INF_APP_CONNECTION_GITHUB_APP_ID,
+ slug: INF_APP_CONNECTION_GITHUB_APP_SLUG,
+ createdAt: null,
+ updatedAt: null
+ }
+ : null;
+
+ return sharedApp ? [sharedApp, ...dbApps] : dbApps;
};
const deleteGitHubApp = async ({ id, orgPermission }: TDeleteGitHubAppDTO): Promise<TSanitizedGitHubApp> => {
diff --git a/backend/src/services/github-app/github-app-types.ts b/backend/src/services/github-app/github-app-types.ts
index d3e574f927..3d13e10fdd 100644
--- a/backend/src/services/github-app/github-app-types.ts
+++ b/backend/src/services/github-app/github-app-types.ts
@@ -35,11 +35,11 @@ export type TGitHubAppManifestResponse = {
};
export type TSanitizedGitHubApp = {
- id: string;
+ id: string | null;
orgId: string;
name: string;
appId: string;
slug: string;
- createdAt: Date;
- updatedAt: Date;
+ createdAt: Date | null;
+ updatedAt: Date | null;
};
diff --git a/frontend/src/const/routes.ts b/frontend/src/const/routes.ts
index a465e7cd5a..4742d99683 100644
--- a/frontend/src/const/routes.ts
+++ b/frontend/src/const/routes.ts
@@ -43,10 +43,6 @@ export const ROUTE_PATHS = Object.freeze({
"/organizations/$orgId/settings",
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/"
),
- GitHubAppCallbackPage: setRoute(
- "/organizations/$orgId/settings/github-app/callback",
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/github-app/callback"
- ),
GroupDetailsByIDPage: setRoute(
"/organizations/$orgId/groups/$groupId",
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/groups/$groupId"
@@ -71,6 +67,10 @@ export const ROUTE_PATHS = Object.freeze({
OauthCallbackPage: setRoute(
"/organizations/$orgId/app-connections/$appConnection/oauth/callback",
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/$appConnection/oauth/callback"
+ ),
+ GitHubManifestCallbackPage: setRoute(
+ "/organizations/$orgId/app-connections/github/manifest/callback",
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback"
)
},
NetworkingPage: setRoute(
diff --git a/frontend/src/hooks/api/gitHubApps/index.ts b/frontend/src/hooks/api/gitHubApps/index.ts
index 906dc28da4..1a8b13edff 100644
--- a/frontend/src/hooks/api/gitHubApps/index.ts
+++ b/frontend/src/hooks/api/gitHubApps/index.ts
@@ -1,8 +1,2 @@
-export * from "./mutations";
-export * from "./queries";
-export type {
- TDeleteGitHubAppDTO,
- TExchangeGitHubManifestCodeDTO,
- TGitHubApp,
- TRegisterGitHubAppDTO
-} from "./types";
+export { gitHubAppKeys, useListGitHubApps } from "./queries";
+export type { TGitHubApp } from "./types";
diff --git a/frontend/src/hooks/api/gitHubApps/mutations.tsx b/frontend/src/hooks/api/gitHubApps/mutations.tsx
deleted file mode 100644
index e80f4ecc98..0000000000
--- a/frontend/src/hooks/api/gitHubApps/mutations.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import { useMutation, useQueryClient } from "@tanstack/react-query";
-
-import { apiRequest } from "@app/config/request";
-
-import {
- TDeleteGitHubAppDTO,
- TExchangeGitHubManifestCodeDTO,
- TGitHubApp,
- TRegisterGitHubAppDTO
-} from "./types";
-
-export const useExchangeGitHubManifestCode = () => {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: async (dto: TExchangeGitHubManifestCodeDTO) => {
- const { data } = await apiRequest.post<{ gitHubApp: TGitHubApp }>(
- "/api/v1/github-apps/manifest/exchange",
- dto
- );
-
- return data.gitHubApp;
- },
- onSuccess: () => {
- queryClient.invalidateQueries({
- predicate: (query) => query.queryKey.includes("github-apps")
- });
- }
- });
-};
-
-export const useRegisterGitHubApp = () => {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: async (dto: TRegisterGitHubAppDTO) => {
- const { data } = await apiRequest.post<{ gitHubApp: TGitHubApp }>(
- "/api/v1/github-apps/register",
- dto
- );
-
- return data.gitHubApp;
- },
- onSuccess: () => {
- queryClient.invalidateQueries({
- predicate: (query) => query.queryKey.includes("github-apps")
- });
- }
- });
-};
-
-export const useDeleteGitHubApp = () => {
- const queryClient = useQueryClient();
-
- return useMutation({
- mutationFn: async ({ id }: TDeleteGitHubAppDTO) => {
- const { data } = await apiRequest.delete<{ gitHubApp: TGitHubApp }>(
- `/api/v1/github-apps/${id}`
- );
-
- return data.gitHubApp;
- },
- onSuccess: () => {
- queryClient.invalidateQueries({
- predicate: (query) => query.queryKey.includes("github-apps")
- });
- }
- });
-};
diff --git a/frontend/src/hooks/api/gitHubApps/queries.tsx b/frontend/src/hooks/api/gitHubApps/queries.tsx
index 8362e08d62..3caf84e3a7 100644
--- a/frontend/src/hooks/api/gitHubApps/queries.tsx
+++ b/frontend/src/hooks/api/gitHubApps/queries.tsx
@@ -5,12 +5,12 @@ import { apiRequest } from "@app/config/request";
import { TGitHubApp } from "./types";
export const gitHubAppKeys = {
- list: (orgId?: string) => [{ orgId }, "github-apps"] as const
+ all: ["github-apps"] as const,
+ list: (orgId?: string) => [...gitHubAppKeys.all, "list", orgId] as const
};
-export const fetchGitHubApps = async () => {
+const fetchGitHubApps = async () => {
const { data } = await apiRequest.get<{ gitHubApps: TGitHubApp[] }>("/api/v1/github-apps");
-
return data.gitHubApps;
};
@@ -18,5 +18,6 @@ export const useListGitHubApps = (orgId?: string) =>
useQuery({
queryKey: gitHubAppKeys.list(orgId),
queryFn: fetchGitHubApps,
- enabled: Boolean(orgId)
+ enabled: Boolean(orgId),
+ retry: false
});
diff --git a/frontend/src/hooks/api/gitHubApps/types.ts b/frontend/src/hooks/api/gitHubApps/types.ts
index 97fb7197d9..90dc280c29 100644
--- a/frontend/src/hooks/api/gitHubApps/types.ts
+++ b/frontend/src/hooks/api/gitHubApps/types.ts
@@ -1,27 +1,9 @@
export type TGitHubApp = {
- id: string;
+ id: string | null;
orgId: string;
name: string;
appId: string;
slug: string;
- createdAt: string;
- updatedAt: string;
-};
-
-export type TExchangeGitHubManifestCodeDTO = {
- name: string;
- code: string;
-};
-
-export type TDeleteGitHubAppDTO = {
- id: string;
-};
-
-export type TRegisterGitHubAppDTO = {
- name: string;
- appId: string;
- slug: string;
- clientId: string;
- clientSecret: string;
- privateKey: string;
+ createdAt: string | null;
+ updatedAt: string | null;
};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
index 00aa4f55f1..48ab071b70 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/submenus.ts
@@ -150,7 +150,7 @@ export const getOrgSettingsSubmenu = ({
]
: []),
{ label: "Encryption", icon: Lock, tab: "tab-org-encryption" },
- { label: "Integrations", icon: Plug, tab: "integrations" },
+ { label: "Workflow Integrations", icon: Plug, tab: "workflow-integrations" },
{ label: "Audit Log Streams", icon: FileText, tab: "tag-audit-log-streams" },
{ label: "External Migrations", icon: Database, tab: "tab-external-migrations" },
{ label: "Project Templates", icon: FolderCog, tab: "project-templates" },
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx
index 2640ec8850..486c5a358f 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx
@@ -1,7 +1,10 @@
import crypto from "crypto";
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { Controller, FormProvider, useForm } from "react-hook-form";
+import { faGithub } from "@fortawesome/free-brands-svg-icons";
+import { faCheck, faPlus } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
@@ -20,8 +23,9 @@ import {
SelectItem,
Tooltip
} from "@app/components/v2";
+import { Badge } from "@app/components/v3/generic/Badge";
import { GatewayPicker } from "@app/components/v3/platform/GatewayPicker";
-import { useOrganization, useSubscription } from "@app/context";
+import { useSubscription } from "@app/context";
import {
OrgGatewayPermissionActions,
OrgPermissionSubjects
@@ -38,7 +42,6 @@ import {
useGetAppConnectionOption
} from "@app/hooks/api/appConnections";
import { AppConnection } from "@app/hooks/api/appConnections/enums";
-import { useListGitHubApps } from "@app/hooks/api/gitHubApps";
import { GitHubFormData } from "../../../OauthCallbackPage/OauthCallbackPage.types";
import {
@@ -52,6 +55,8 @@ type Props = {
onSubmit: (formData: PatSchemaForm) => Promise<void>;
};
+type GitHubAppSource = "shared" | "dedicated";
+
const rootSchema = genericAppConnectionFieldsSchema.extend({
app: z.literal(AppConnection.GitHub),
method: z.nativeEnum(GitHubConnectionMethod)
@@ -68,22 +73,9 @@ const baseCredentialsSchema = z.union([
})
]);
-const appCredentialsSchema = z.union([
- z.object({
- instanceType: z.literal("server"),
- host: z.string().min(1, "Host is required for server instance type"),
- gitHubAppId: z.string().nullish()
- }),
- z.object({
- instanceType: z.literal("cloud").optional(),
- host: z.string().optional(),
- gitHubAppId: z.string().nullish()
- })
-]);
-
const appSchema = rootSchema.extend({
method: z.literal(GitHubConnectionMethod.App),
- credentials: appCredentialsSchema
+ credentials: baseCredentialsSchema
});
const oauthSchema = rootSchema.extend({
@@ -113,6 +105,81 @@ const formSchema = z.discriminatedUnion("method", [appSchema, oauthSchema, patSc
type FormData = z.infer<typeof formSchema>;
+const slugifyConnectionName = (name: string) =>
+ name
+ .trim()
+ .toLowerCase()
+ .replace(/\s+/g, "-")
+ .replace(/[^a-z0-9-]/g, "")
+ .replace(/-+/g, "-")
+ .replace(/^-|-$/g, "");
+
+const buildDedicatedAppSlug = (connectionName: string) => {
+ const slug = slugifyConnectionName(connectionName || "");
+ return `infisical-${slug}`;
+};
+
+const buildGitHubManifest = ({
+ appName,
+ redirectUrl,
+ oauthCallbackUrl
+}: {
+ appName: string;
+ redirectUrl: string;
+ oauthCallbackUrl: string;
+}) => ({
+ name: appName,
+ url: window.location.origin,
+ redirect_url: redirectUrl,
+ callback_urls: [oauthCallbackUrl],
+ description: "Infisical GitHub App Connection",
+ public: false,
+ request_oauth_on_install: true,
+ default_permissions: {
+ metadata: "read",
+ secrets: "write",
+ environments: "write",
+ actions: "read",
+ organization_secrets: "write"
+ },
+ default_events: [] as string[]
+});
+
+type AppSourceCardProps = {
+ title: string;
+ description: string;
+ icon: React.ReactNode;
+ selected: boolean;
+ onClick: () => void;
+};
+
+const AppSourceCard = ({ title, description, icon, selected, onClick }: AppSourceCardProps) => (
+ <button
+ type="button"
+ onClick={onClick}
+ className={`relative flex h-full flex-col items-start gap-2 rounded-md border p-3 text-left transition-all ${
+ selected
+ ? "border-primary/60 bg-primary/10"
+ : "border-mineshaft-500 bg-mineshaft-700/30 hover:border-mineshaft-400 hover:bg-mineshaft-700/60"
+ }`}
+ >
+ {selected && (
+ <div className="absolute top-2 right-2 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-mineshaft-900">
+ <FontAwesomeIcon icon={faCheck} className="text-[8px]" />
+ </div>
+ )}
+ <div className="flex items-center gap-2">
+ <div className="flex h-7 w-7 items-center justify-center rounded-sm bg-mineshaft-600 text-mineshaft-100">
+ {icon}
+ </div>
+ <div className="flex flex-wrap items-center gap-1.5">
+ <span className="text-sm font-medium text-mineshaft-100">{title}</span>
+ </div>
+ </div>
+ <p className="text-xs leading-relaxed text-mineshaft-300">{description}</p>
+ </button>
+);
+
export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Props) => {
const isUpdate = Boolean(appConnection);
const [isRedirecting, setIsRedirecting] = useState(false);
@@ -130,8 +197,7 @@ export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Pro
gatewayId: null,
gatewayPoolId: null,
credentials: {
- instanceType: "cloud",
- gitHubAppId: null
+ instanceType: "cloud"
}
}
});
@@ -145,16 +211,26 @@ export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Pro
} = form;
const { subscription } = useSubscription();
- const { currentOrg } = useOrganization();
- const { data: gitHubApps } = useListGitHubApps(currentOrg?.id);
const selectedMethod = watch("method");
const instanceType = watch("credentials.instanceType");
const gatewayId = watch("gatewayId");
const gatewayPoolId = watch("gatewayPoolId");
+ const connectionName = watch("name") ?? "";
+
+ // Dedicated is the recommended default for new connections; update flow is reconnect-only
+ // and uses the instance-default app since the dedicated app slug lives in the DB.
+ const [appSource, setAppSource] = useState<GitHubAppSource>(isUpdate ? "shared" : "dedicated");
+ const [dedicatedAppOrg, setDedicatedAppOrg] = useState("");
+
+ useEffect(() => {
+ if (isUpdate) setAppSource("shared");
+ }, [isUpdate]);
const returnUrl = useGetAppConnectionOauthReturnUrl();
+ const dedicatedAppSlug = buildDedicatedAppSlug(connectionName);
+
const submitHandler = async (formData: FormData) => {
if (formData.method === GitHubConnectionMethod.Pat) {
await onSubmit(formData);
@@ -180,17 +256,55 @@ export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Pro
? `https://${formData.credentials.host}`
: "https://github.com";
- const selectedAppSlug =
- formData.method === GitHubConnectionMethod.App && formData.credentials.gitHubAppId
- ? gitHubApps?.find((app) => app.id === formData.credentials.gitHubAppId)?.slug
- : appClientSlug;
-
switch (formData.method) {
- case GitHubConnectionMethod.App:
+ case GitHubConnectionMethod.App: {
+ if (appSource === "dedicated") {
+ const manifestState = crypto.randomBytes(16).toString("hex");
+ const redirectUrl = `${window.location.origin}/organization/app-connections/github/manifest/callback`;
+ const oauthCallbackUrl = `${window.location.origin}/organization/app-connections/github/oauth/callback`;
+
+ const manifest = buildGitHubManifest({
+ appName: dedicatedAppSlug,
+ redirectUrl,
+ oauthCallbackUrl
+ });
+
+ localStorage.setItem("githubManifestCSRFToken", manifestState);
+ localStorage.setItem(
+ "githubManifestFormData",
+ JSON.stringify({
+ connectionFormDataKey: "githubConnectionFormData",
+ instanceType: formData.credentials?.instanceType ?? "cloud",
+ host: formData.credentials?.host ?? "",
+ name: dedicatedAppSlug
+ })
+ );
+
+ const orgSlug = dedicatedAppOrg.trim();
+ const baseUrl = orgSlug
+ ? `${githubHost}/organizations/${encodeURIComponent(orgSlug)}/settings/apps/new`
+ : `${githubHost}/settings/apps/new`;
+
+ const formEl = document.createElement("form");
+ formEl.method = "post";
+ formEl.action = `${baseUrl}?state=${encodeURIComponent(manifestState)}`;
+
+ const input = document.createElement("input");
+ input.type = "hidden";
+ input.name = "manifest";
+ input.value = JSON.stringify(manifest);
+ formEl.appendChild(input);
+
+ document.body.appendChild(formEl);
+ formEl.submit();
+ return;
+ }
+
window.location.assign(
- `${githubHost}/${formData.credentials?.instanceType === "server" ? "github-apps" : "apps"}/${selectedAppSlug}/installations/new?state=${state}`
+ `${githubHost}/${formData.credentials?.instanceType === "server" ? "github-apps" : "apps"}/${appClientSlug}/installations/new?state=${state}`
);
break;
+ }
case GitHubConnectionMethod.OAuth:
window.location.assign(
`${githubHost}/login/oauth/authorize?client_id=${oauthClientId}&response_type=code&scope=repo,admin:org&redirect_uri=${window.location.origin}/organization/app-connections/github/oauth/callback&state=${state}`
@@ -208,7 +322,7 @@ export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Pro
isMissingConfig = !oauthClientId;
break;
case GitHubConnectionMethod.App:
- isMissingConfig = !appClientSlug && !(gitHubApps && gitHubApps.length > 0);
+ isMissingConfig = (isUpdate || appSource === "shared") && !appClientSlug;
break;
case GitHubConnectionMethod.Pat:
isMissingConfig = false;
@@ -244,6 +358,10 @@ export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Pro
return isUpdate ? "Update Connection" : "Create Connection";
}
+ if (selectedMethod === GitHubConnectionMethod.App && appSource === "dedicated" && !isUpdate) {
+ return "Create app & connect";
+ }
+
return isUpdate ? "Reconnect to GitHub" : "Connect to GitHub";
};
@@ -283,40 +401,77 @@ export const GitHubConnectionForm = ({ appConnection, projectId, onSubmit }: Pro
</FormControl>
)}
/>
- {selectedMethod === GitHubConnectionMethod.App && (
- <Controller
- name={"credentials.gitHubAppId" as never}
- control={control}
- shouldUnregister
- render={({ field: { value, onChange }, fieldState: { error } }) => (
- <FormControl
- tooltipText="Select which GitHub App to install. Registered apps are managed under Organization Settings > Integrations."
- errorText={error?.message}
- isError={Boolean(error?.message)}
- label="GitHub App"
- >
- <Select
- isDisabled={isUpdate}
- value={(value as string | null | undefined) ?? "__instance_default__"}
- onValueChange={(val) => onChange(val === "__instance_default__" ? null : val)}
- className="w-full border border-mineshaft-500"
- position="popper"
- dropdownContainerClassName="max-w-none"
- >
- {appClientSlug && (
- <SelectItem value="__instance_default__" key="__instance_default__">
- Instance default
- </SelectItem>
- )}
- {(gitHubApps ?? []).map((app) => (
- <SelectItem value={app.id} key={app.id}>
- {app.name}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
+ {selectedMethod === GitHubConnectionMethod.App && !isUpdate && (
+ <FormControl
+ label="GitHub App setup"
+ tooltipText="Reuse the shared instance-default GitHub App or create a new private app dedicated to this connection."
+ >
+ <div className="flex flex-col gap-3">
+ {appClientSlug && (
+ <div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
+ <AppSourceCard
+ title="Use shared app"
+ description="Reuse the instance-default GitHub App. Best for teams managing many connections."
+ icon={<FontAwesomeIcon icon={faGithub} className="text-base" />}
+ selected={appSource === "shared"}
+ onClick={() => setAppSource("shared")}
+ />
+ <AppSourceCard
+ title="Create dedicated app"
+ description="One app per connection. Maximum isolation, no admin handoff."
+ icon={<FontAwesomeIcon icon={faPlus} className="text-base" />}
+ selected={appSource === "dedicated"}
+ onClick={() => setAppSource("dedicated")}
+ />
+ </div>
+ )}
+ {appSource === "dedicated" && (
+ <>
+ <div className="flex items-start gap-3 rounded-md border border-mineshaft-500 bg-mineshaft-700/40 px-3 py-2.5">
+ <div className="mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-sm bg-primary/15 text-primary">
+ <FontAwesomeIcon icon={faPlus} className="text-xs" />
+ </div>
+ <div className="text-xs leading-relaxed text-mineshaft-300">
+ Will create and install{" "}
+ <span className="font-mono text-mineshaft-100">{dedicatedAppSlug}</span>{" "}
+ <Badge variant="info" className="ml-1">
+ New
+ </Badge>
+ <div className="mt-0.5 text-mineshaft-400">
+ Private · scoped to this connection
+ </div>
+ </div>
+ </div>
+ <FormControl
+ label="GitHub Organization"
+ isOptional
+ helperText="Leave blank to register under your personal account."
+ className="mb-0"
+ >
+ <Input
+ value={dedicatedAppOrg}
+ onChange={(e) => setDedicatedAppOrg(e.target.value)}
+ placeholder="my-github-org"
+ />
+ </FormControl>
+ </>
+ )}
+ {appSource === "shared" && appClientSlug && (
+ <div className="flex items-start gap-3 rounded-md border border-mineshaft-500 bg-mineshaft-700/40 px-3 py-2.5">
+ <div className="mt-0.5 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-sm bg-mineshaft-600 text-mineshaft-200">
+ <FontAwesomeIcon icon={faGithub} className="text-xs" />
+ </div>
+ <div className="text-xs leading-relaxed text-mineshaft-300">
+ Will install{" "}
+ <span className="font-mono text-mineshaft-100">{appClientSlug}</span>
+ <div className="mt-0.5 text-mineshaft-400">
+ Public · shared across all connections
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ </FormControl>
)}
{selectedMethod === GitHubConnectionMethod.Pat && (
<Controller
diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionRow.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionRow.tsx
index 4833977d98..02da15c966 100644
--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionRow.tsx
+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionRow.tsx
@@ -38,7 +38,9 @@ import { ProjectPermissionAppConnectionActions } from "@app/context/ProjectPermi
import { APP_CONNECTION_MAP, getAppConnectionMethodDetails } from "@app/helpers/appConnections";
import { getProjectBaseURL } from "@app/helpers/project";
import { useToggle } from "@app/hooks";
-import { TAppConnection } from "@app/hooks/api/appConnections";
+import { GitHubConnectionMethod, TAppConnection } from "@app/hooks/api/appConnections";
+import { AppConnection } from "@app/hooks/api/appConnections/enums";
+import { useListGitHubApps } from "@app/hooks/api/gitHubApps";
import { CrededentialRotationStatusBadge } from "./AppConnectionForm/shared/CrededentialRotationBadge";
@@ -94,6 +96,31 @@ export const AppConnectionRow = ({
const connectionDetails = APP_CONNECTION_MAP[app];
+ const isGitHubAppConnection =
+ app === AppConnection.GitHub && method === GitHubConnectionMethod.App;
+
+ const gitHubAppCredentials = isGitHubAppConnection
+ ? (appConnection.credentials as {
+ gitHubAppId?: string | null;
+ host?: string;
+ instanceType?: "cloud" | "server";
+ })
+ : null;
+
+ const { data: gitHubApps } = useListGitHubApps(
+ isGitHubAppConnection ? currentOrg?.id : undefined
+ );
+
+ const linkedGitHubApp = isGitHubAppConnection
+ ? gitHubApps?.find((a) => a.id === (gitHubAppCredentials?.gitHubAppId ?? null))
+ : null;
+
+ const gitHubAppUrl = linkedGitHubApp
+ ? `https://${gitHubAppCredentials?.host?.trim() || "github.com"}/${
+ gitHubAppCredentials?.instanceType === "server" ? "github-apps" : "apps"
+ }/${linkedGitHubApp.slug}`
+ : null;
+
return (
<Tr
className={twMerge("group h-12 transition-colors duration-100 hover:bg-mineshaft-700")}
@@ -129,14 +156,42 @@ export const AppConnectionRow = ({
</div>
</Td>
<Td className="max-w-0 min-w-32!">
- <p className="truncate">
- <FontAwesomeIcon
- size="sm"
- className="mr-1.5 text-mineshaft-300/75"
- icon={methodDetails.icon}
- />
- {methodDetails.name}
- </p>
+ {gitHubAppUrl && linkedGitHubApp ? (
+ <Tooltip
+ content={
+ <div className="flex flex-col gap-0.5">
+ <span className="text-[10px] tracking-wider text-mineshaft-400 uppercase">
+ {methodDetails.name}
+ </span>
+ <span className="font-mono text-sm text-mineshaft-100">{linkedGitHubApp.slug}</span>
+ </div>
+ }
+ >
+ <a
+ href={gitHubAppUrl}
+ target="_blank"
+ rel="noopener noreferrer"
+ onClick={(e) => e.stopPropagation()}
+ className="inline-flex items-center gap-1.5 text-mineshaft-100 underline-offset-2 hover:text-primary hover:underline"
+ >
+ <FontAwesomeIcon
+ size="sm"
+ className="text-mineshaft-300/75"
+ icon={methodDetails.icon}
+ />
+ <span className="truncate underline">{methodDetails.name}</span>
+ </a>
+ </Tooltip>
+ ) : (
+ <p className="truncate">
+ <FontAwesomeIcon
+ size="sm"
+ className="mr-1.5 text-mineshaft-300/75"
+ icon={methodDetails.icon}
+ />
+ {methodDetails.name}
+ </p>
+ )}
</Td>
{!isProjectView && (
<Td className="max-w-0 min-w-32!">
diff --git a/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx b/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx
new file mode 100644
index 0000000000..11a796403e
--- /dev/null
+++ b/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/GitHubManifestCallbackPage.tsx
@@ -0,0 +1,136 @@
+import { useEffect, useRef } from "react";
+import { useNavigate, useSearch } from "@tanstack/react-router";
+
+import { createNotification } from "@app/components/notifications";
+import { ContentLoader } from "@app/components/v2";
+import { apiRequest } from "@app/config/request";
+import { ROUTE_PATHS } from "@app/const/routes";
+import { useOrganization } from "@app/context";
+
+const GITHUB_MANIFEST_CSRF_KEY = "githubManifestCSRFToken";
+const GITHUB_MANIFEST_FORM_KEY = "githubManifestFormData";
+const GITHUB_CONNECTION_FORM_KEY = "githubConnectionFormData";
+
+type ManifestFormStorage = {
+ connectionFormDataKey: string;
+ instanceType: "cloud" | "server";
+ host: string;
+ name: string;
+};
+
+type ExchangeResponse = {
+ gitHubApp: {
+ id: string;
+ orgId: string;
+ name: string;
+ appId: string;
+ slug: string;
+ createdAt: string;
+ updatedAt: string;
+ };
+};
+
+export const GitHubManifestCallbackPage = () => {
+ const navigate = useNavigate();
+ const { currentOrg } = useOrganization();
+ const search = useSearch({
+ from: ROUTE_PATHS.Organization.AppConnections.GitHubManifestCallbackPage.id
+ });
+ const hasRunRef = useRef(false);
+
+ useEffect(() => {
+ if (!currentOrg || hasRunRef.current) return;
+ hasRunRef.current = true;
+
+ const { code, state } = search;
+
+ const fallback = () =>
+ navigate({
+ to: "/organizations/$orgId/app-connections",
+ params: { orgId: currentOrg.id }
+ });
+
+ if (!code || !state) {
+ fallback();
+ return;
+ }
+
+ const storedState = localStorage.getItem(GITHUB_MANIFEST_CSRF_KEY);
+ const storedFormDataRaw = localStorage.getItem(GITHUB_MANIFEST_FORM_KEY);
+
+ localStorage.removeItem(GITHUB_MANIFEST_CSRF_KEY);
+ localStorage.removeItem(GITHUB_MANIFEST_FORM_KEY);
+
+ if (!storedState || storedState !== state || !storedFormDataRaw) {
+ createNotification({ type: "error", text: "Invalid GitHub manifest callback state." });
+ fallback();
+ return;
+ }
+
+ let manifestData: ManifestFormStorage;
+ try {
+ manifestData = JSON.parse(storedFormDataRaw) as ManifestFormStorage;
+ } catch {
+ createNotification({ type: "error", text: "Corrupt GitHub manifest callback state." });
+ fallback();
+ return;
+ }
+
+ const installToken = localStorage.getItem("latestCSRFToken");
+ const connectionFormRaw = localStorage.getItem(
+ manifestData.connectionFormDataKey || GITHUB_CONNECTION_FORM_KEY
+ );
+
+ if (!installToken || !connectionFormRaw) {
+ createNotification({ type: "error", text: "Missing GitHub connection form state." });
+ fallback();
+ return;
+ }
+
+ (async () => {
+ try {
+ const { data } = await apiRequest.post<ExchangeResponse>(
+ "/api/v1/github-apps/manifest/exchange",
+ { name: manifestData.name, code }
+ );
+
+ const connectionForm = JSON.parse(connectionFormRaw) as {
+ credentials?: Record<string, unknown>;
+ };
+ connectionForm.credentials = {
+ ...(connectionForm.credentials ?? {}),
+ gitHubAppId: data.gitHubApp.id
+ };
+ localStorage.setItem(
+ manifestData.connectionFormDataKey || GITHUB_CONNECTION_FORM_KEY,
+ JSON.stringify(connectionForm)
+ );
+
+ const githubHost =
+ manifestData.host && manifestData.host.length > 0
+ ? `https://${manifestData.host}`
+ : "https://github.com";
+
+ const appPathSegment = manifestData.instanceType === "server" ? "github-apps" : "apps";
+
+ window.location.assign(
+ `${githubHost}/${appPathSegment}/${data.gitHubApp.slug}/installations/new?state=${installToken}`
+ );
+ } catch (err) {
+ const message =
+ (err as { response?: { data?: { message?: string } }; message?: string })?.response?.data
+ ?.message ||
+ (err as { message?: string })?.message ||
+ "Failed to register GitHub App. Please try again.";
+ createNotification({ type: "error", text: message });
+ fallback();
+ }
+ })();
+ }, [currentOrg?.id]);
+
+ return (
+ <div className="flex h-full w-full items-center justify-center">
+ <ContentLoader text="Creating your GitHub App, please wait..." />
+ </div>
+ );
+};
diff --git a/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/route.tsx b/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/route.tsx
new file mode 100644
index 0000000000..c0b61d1342
--- /dev/null
+++ b/frontend/src/pages/organization/AppConnections/GitHubManifestCallbackPage/route.tsx
@@ -0,0 +1,20 @@
+import { createFileRoute, stripSearchParams } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
+
+import { GitHubManifestCallbackPage } from "./GitHubManifestCallbackPage";
+
+const GitHubManifestCallbackQueryParamsSchema = z.object({
+ code: z.coerce.string().catch(""),
+ state: z.string().catch("")
+});
+
+export const Route = createFileRoute(
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback"
+)({
+ component: GitHubManifestCallbackPage,
+ validateSearch: zodValidator(GitHubManifestCallbackQueryParamsSchema),
+ search: {
+ middlewares: [stripSearchParams({ state: "" })]
+ }
+});
diff --git a/frontend/src/pages/organization/SettingsPage/GitHubAppCallbackPage/GitHubAppCallbackPage.tsx b/frontend/src/pages/organization/SettingsPage/GitHubAppCallbackPage/GitHubAppCallbackPage.tsx
deleted file mode 100644
index c2cfe00728..0000000000
--- a/frontend/src/pages/organization/SettingsPage/GitHubAppCallbackPage/GitHubAppCallbackPage.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import { useEffect } from "react";
-import { useNavigate, useSearch } from "@tanstack/react-router";
-
-import { createNotification } from "@app/components/notifications";
-import { ContentLoader } from "@app/components/v2";
-import { ROUTE_PATHS } from "@app/const/routes";
-import { useOrganization } from "@app/context";
-import { useExchangeGitHubManifestCode } from "@app/hooks/api/gitHubApps";
-
-const GITHUB_MANIFEST_STATE_KEY = "githubManifestState";
-const GITHUB_MANIFEST_FORM_KEY = "githubManifestFormData";
-
-export const GitHubAppCallbackPage = () => {
- const navigate = useNavigate();
- const { currentOrg } = useOrganization();
- const search = useSearch({ from: ROUTE_PATHS.Organization.GitHubAppCallbackPage.id });
- const { mutateAsync: exchangeManifestCode } = useExchangeGitHubManifestCode();
-
- useEffect(() => {
- if (!currentOrg) return;
-
- const { code, state } = search;
-
- const redirect = () =>
- navigate({
- to: ROUTE_PATHS.Organization.SettingsPage.path,
- params: { orgId: currentOrg.id },
- search: { selectedTab: "integrations" }
- });
-
- if (!code || !state) {
- redirect();
- return;
- }
-
- const storedState = localStorage.getItem(GITHUB_MANIFEST_STATE_KEY);
- const storedFormDataRaw = localStorage.getItem(GITHUB_MANIFEST_FORM_KEY);
-
- localStorage.removeItem(GITHUB_MANIFEST_STATE_KEY);
- localStorage.removeItem(GITHUB_MANIFEST_FORM_KEY);
-
- if (!storedState || storedState !== state || !storedFormDataRaw) {
- redirect();
- return;
- }
-
- let parsedFormData: { name?: string; orgId?: string } = {};
- try {
- parsedFormData = JSON.parse(storedFormDataRaw) as { name?: string; orgId?: string };
- } catch {
- redirect();
- return;
- }
-
- if (!parsedFormData.name || parsedFormData.orgId !== currentOrg.id) {
- redirect();
- return;
- }
-
- exchangeManifestCode({ name: parsedFormData.name, code })
- .then(() => {
- createNotification({
- text: `GitHub App "${parsedFormData.name}" registered successfully.`,
- type: "success"
- });
- })
- .catch((err: { response?: { data?: { message?: string } }; message?: string }) => {
- createNotification({
- text:
- err?.response?.data?.message ||
- err?.message ||
- "Failed to register GitHub App. Please try again.",
- type: "error"
- });
- })
- .finally(() => {
- redirect();
- });
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [currentOrg?.id]);
-
- return (
- <div className="flex h-full w-full items-center justify-center">
- <ContentLoader text="Registering GitHub App, please wait..." />
- </div>
- );
-};
diff --git a/frontend/src/pages/organization/SettingsPage/GitHubAppCallbackPage/route.tsx b/frontend/src/pages/organization/SettingsPage/GitHubAppCallbackPage/route.tsx
deleted file mode 100644
index 5a2c0e35da..0000000000
--- a/frontend/src/pages/organization/SettingsPage/GitHubAppCallbackPage/route.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { createFileRoute } from "@tanstack/react-router";
-import { zodValidator } from "@tanstack/zod-adapter";
-import { z } from "zod";
-
-import { GitHubAppCallbackPage } from "./GitHubAppCallbackPage";
-
-const GitHubAppCallbackPageQueryParams = z.object({
- code: z.string().optional(),
- state: z.string().optional()
-});
-
-export const Route = createFileRoute(
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/github-app/callback"
-)({
- component: GitHubAppCallbackPage,
- validateSearch: zodValidator(GitHubAppCallbackPageQueryParams)
-});
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/AddIntegrationModal.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/AddIntegrationModal.tsx
deleted file mode 100644
index 9d91a408be..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/AddIntegrationModal.tsx
+++ /dev/null
@@ -1,541 +0,0 @@
-import crypto from "crypto";
-
-import { useState } from "react";
-import { Controller, useForm } from "react-hook-form";
-import { BsMicrosoftTeams } from "react-icons/bs";
-import { faGithub, faSlack } from "@fortawesome/free-brands-svg-icons";
-import { faArrowRight, faFileImport, faPlusCircle } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { zodResolver } from "@hookform/resolvers/zod";
-import { AnimatePresence, motion } from "framer-motion";
-import { z } from "zod";
-
-import { createNotification } from "@app/components/notifications";
-import { Button, FormControl, Input, Modal, ModalContent, TextArea } from "@app/components/v2";
-import { useOrganization } from "@app/context";
-import { useRegisterGitHubApp } from "@app/hooks/api/gitHubApps";
-import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";
-
-import { MicrosoftTeamsIntegrationForm } from "./MicrosoftTeamsIntegrationForm";
-import { SlackIntegrationForm } from "./SlackIntegrationForm";
-
-type Props = {
- isOpen?: boolean;
- onToggle: (isOpen: boolean) => void;
-};
-
-enum AppPlatform {
- GitHub = "github"
-}
-
-type SelectedPlatform =
- | WorkflowIntegrationPlatform.SLACK
- | WorkflowIntegrationPlatform.MICROSOFT_TEAMS
- | AppPlatform.GitHub
- | null;
-
-enum WizardSteps {
- SelectPlatform = "select-platform",
- WorkflowInputs = "workflow-inputs",
- GitHubSelectMethod = "github-select-method",
- GitHubManifest = "github-manifest",
- GitHubManual = "github-manual"
-}
-
-type PlatformOption = {
- icon: React.ReactNode;
- platform: SelectedPlatform;
- title: string;
-};
-
-const WORKFLOW_PLATFORMS: PlatformOption[] = [
- {
- icon: <FontAwesomeIcon icon={faSlack} size="lg" />,
- platform: WorkflowIntegrationPlatform.SLACK,
- title: "Slack"
- },
- {
- icon: <BsMicrosoftTeams className="text-lg" />,
- platform: WorkflowIntegrationPlatform.MICROSOFT_TEAMS,
- title: "Microsoft Teams"
- }
-];
-
-const APP_PLATFORMS: PlatformOption[] = [
- {
- icon: <FontAwesomeIcon icon={faGithub} size="lg" />,
- platform: AppPlatform.GitHub,
- title: "GitHub"
- }
-];
-
-const manifestFormSchema = z.object({
- name: z.string().trim().min(1, "Name is required").max(64),
- organization: z.string().trim().optional()
-});
-
-const manualFormSchema = z.object({
- name: z.string().trim().min(1, "Name is required").max(64),
- appId: z.string().trim().min(1, "App ID is required"),
- slug: z.string().trim().min(1, "Slug is required"),
- clientId: z.string().trim().min(1, "Client ID is required"),
- clientSecret: z.string().trim().min(1, "Client secret is required"),
- privateKey: z.string().trim().min(1, "Private key is required")
-});
-
-type TManifestFormData = z.infer<typeof manifestFormSchema>;
-type TManualFormData = z.infer<typeof manualFormSchema>;
-
-const slugifyGitHubAppName = (name: string) =>
- `infisical-${name
- .trim()
- .toLowerCase()
- .replace(/\s+/g, "-")
- .replace(/[^a-z0-9-]/g, "")
- .replace(/-+/g, "-")
- .replace(/^-|-$/g, "")}`;
-
-const buildGitHubManifest = ({ orgId, name }: { orgId: string; name: string }) => {
- const redirectUrl = `${window.location.origin}/organizations/${orgId}/settings/github-app/callback`;
-
- return {
- name: slugifyGitHubAppName(name),
- url: window.location.origin,
- redirect_url: redirectUrl,
- callback_urls: [`${window.location.origin}/organization/app-connections/github/oauth/callback`],
- description: "Infisical GitHub App Integration",
- public: false,
- request_oauth_on_install: true,
- default_permissions: {
- metadata: "read",
- secrets: "write",
- environments: "write",
- actions: "read",
- organization_secrets: "write"
- },
- default_events: [] as string[]
- };
-};
-
-const submitManifestForm = ({
- orgId,
- name,
- organization
-}: {
- orgId: string;
- name: string;
- organization?: string;
-}) => {
- const csrfToken = crypto.randomBytes(32).toString("hex");
- localStorage.setItem("githubManifestState", csrfToken);
- localStorage.setItem("githubManifestFormData", JSON.stringify({ name, orgId }));
-
- const manifest = buildGitHubManifest({ orgId, name });
-
- const form = document.createElement("form");
- form.method = "post";
- const baseUrl = organization
- ? `https://github.com/organizations/${organization}/settings/apps/new`
- : "https://github.com/settings/apps/new";
- form.action = `${baseUrl}?state=${encodeURIComponent(csrfToken)}`;
-
- const input = document.createElement("input");
- input.type = "hidden";
- input.name = "manifest";
- input.value = JSON.stringify(manifest);
- form.appendChild(input);
-
- document.body.appendChild(form);
- form.submit();
-};
-
-export const AddIntegrationModal = ({ isOpen, onToggle }: Props) => {
- const [wizardStep, setWizardStep] = useState(WizardSteps.SelectPlatform);
- const [selectedPlatform, setSelectedPlatform] = useState<SelectedPlatform>(null);
- const { currentOrg } = useOrganization();
-
- const registerGitHubApp = useRegisterGitHubApp();
-
- const manifestForm = useForm<TManifestFormData>({
- resolver: zodResolver(manifestFormSchema)
- });
-
- const manualForm = useForm<TManualFormData>({
- resolver: zodResolver(manualFormSchema)
- });
-
- const handleFormReset = (state: boolean = false) => {
- onToggle(state);
- setWizardStep(WizardSteps.SelectPlatform);
- setSelectedPlatform(null);
- manifestForm.reset();
- manualForm.reset();
- };
-
- const handleSelectPlatform = (platform: SelectedPlatform) => {
- setSelectedPlatform(platform);
- if (platform === AppPlatform.GitHub) {
- setWizardStep(WizardSteps.GitHubSelectMethod);
- } else {
- setWizardStep(WizardSteps.WorkflowInputs);
- }
- };
-
- const handleSubmitManifest = ({ name, organization }: TManifestFormData) => {
- if (!currentOrg) return;
- submitManifestForm({ orgId: currentOrg.id, name, organization });
- };
-
- const handleSubmitManual = async (data: TManualFormData) => {
- if (!currentOrg) return;
-
- await registerGitHubApp.mutateAsync(data, {
- onSuccess: () => {
- createNotification({ type: "success", text: "GitHub App registered successfully." });
- handleFormReset(false);
- },
- onError: (err: unknown) => {
- const message =
- err instanceof Error ? err.message : "Failed to register GitHub App. Please try again.";
- createNotification({ type: "error", text: message });
- }
- });
- };
-
- const getModalTitle = () => {
- if (wizardStep === WizardSteps.GitHubManifest) return "Create a new GitHub App";
- if (wizardStep === WizardSteps.GitHubManual) return "Register an existing GitHub App";
- if (selectedPlatform === WorkflowIntegrationPlatform.SLACK) return "Add a Slack integration";
- if (selectedPlatform === WorkflowIntegrationPlatform.MICROSOFT_TEAMS)
- return "Add a Microsoft Teams integration";
- if (selectedPlatform === AppPlatform.GitHub) return "Add a GitHub App";
- return "Add an integration";
- };
-
- const renderPlatformCard = ({ icon, platform, title }: PlatformOption) => (
- <div
- key={platform ?? title}
- className="flex h-28 w-32 cursor-pointer flex-col items-center space-y-4 rounded-sm border border-mineshaft-500 bg-bunker-600 p-6 transition-all hover:border-primary/70 hover:bg-primary/10 hover:text-white"
- role="button"
- tabIndex={0}
- onClick={() => handleSelectPlatform(platform)}
- onKeyDown={(evt) => {
- if (evt.key === "Enter") handleSelectPlatform(platform);
- }}
- >
- <div>{icon}</div>
- <div className="text-center text-sm whitespace-pre-wrap">{title}</div>
- </div>
- );
-
- return (
- <Modal isOpen={isOpen} onOpenChange={(state) => handleFormReset(state)}>
- <ModalContent title={getModalTitle()} className="my-4">
- <AnimatePresence mode="wait">
- {wizardStep === WizardSteps.SelectPlatform && (
- <motion.div
- key="select-platform"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <div className="mb-2 text-sm font-medium text-mineshaft-200">Workflow</div>
- <div className="mb-6 flex items-center space-x-4">
- {WORKFLOW_PLATFORMS.map(renderPlatformCard)}
- </div>
- <div className="mb-2 text-sm font-medium text-mineshaft-200">Apps</div>
- <div className="flex items-center space-x-4">
- {APP_PLATFORMS.map(renderPlatformCard)}
- </div>
- </motion.div>
- )}
- {wizardStep === WizardSteps.WorkflowInputs &&
- selectedPlatform === WorkflowIntegrationPlatform.SLACK && (
- <motion.div
- key="slack-platform"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <SlackIntegrationForm onClose={() => handleFormReset(false)} />
- </motion.div>
- )}
- {wizardStep === WizardSteps.WorkflowInputs &&
- selectedPlatform === WorkflowIntegrationPlatform.MICROSOFT_TEAMS && (
- <motion.div
- key="microsoft-teams-platform"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <MicrosoftTeamsIntegrationForm onClose={() => handleFormReset(false)} />
- </motion.div>
- )}
- {wizardStep === WizardSteps.GitHubSelectMethod &&
- selectedPlatform === AppPlatform.GitHub && (
- <motion.div
- key="github-select-method"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <div className="mb-4 text-mineshaft-300">
- How would you like to add a GitHub App?
- </div>
- <div className="flex flex-col space-y-3">
- <div
- className="flex cursor-pointer items-start space-x-4 rounded-md border border-mineshaft-500 bg-bunker-600 p-4 transition-all hover:border-primary/70 hover:bg-primary/10"
- role="button"
- tabIndex={0}
- onClick={() => setWizardStep(WizardSteps.GitHubManifest)}
- onKeyDown={(evt) => {
- if (evt.key === "Enter") setWizardStep(WizardSteps.GitHubManifest);
- }}
- >
- <div className="mt-0.5 text-primary">
- <FontAwesomeIcon icon={faPlusCircle} size="lg" />
- </div>
- <div>
- <div className="font-medium text-mineshaft-100">
- Create via GitHub Manifest
- </div>
- <div className="mt-1 text-sm text-mineshaft-400">
- Let Infisical guide you through creating a new GitHub App directly on
- GitHub. Recommended for new setups.
- </div>
- </div>
- <div className="ml-auto self-center text-mineshaft-400">
- <FontAwesomeIcon icon={faArrowRight} />
- </div>
- </div>
- <div
- className="flex cursor-pointer items-start space-x-4 rounded-md border border-mineshaft-500 bg-bunker-600 p-4 transition-all hover:border-primary/70 hover:bg-primary/10"
- role="button"
- tabIndex={0}
- onClick={() => setWizardStep(WizardSteps.GitHubManual)}
- onKeyDown={(evt) => {
- if (evt.key === "Enter") setWizardStep(WizardSteps.GitHubManual);
- }}
- >
- <div className="mt-0.5 text-primary">
- <FontAwesomeIcon icon={faFileImport} size="lg" />
- </div>
- <div>
- <div className="font-medium text-mineshaft-100">Register Existing App</div>
- <div className="mt-1 text-sm text-mineshaft-400">
- Already have a GitHub App? Provide its credentials to register it with
- Infisical.
- </div>
- </div>
- <div className="ml-auto self-center text-mineshaft-400">
- <FontAwesomeIcon icon={faArrowRight} />
- </div>
- </div>
- </div>
- <div className="mt-4">
- <Button
- variant="outline_bg"
- onClick={() => setWizardStep(WizardSteps.SelectPlatform)}
- >
- Back
- </Button>
- </div>
- </motion.div>
- )}
- {wizardStep === WizardSteps.GitHubManifest && selectedPlatform === AppPlatform.GitHub && (
- <motion.div
- key="github-manifest"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <div className="mb-4 text-xs text-mineshaft-200">
- The GitHub App Manifest flow lets you create a new GitHub App without manually
- configuring its settings. Infisical will redirect you to GitHub, where you can
- review and approve the app configuration. Once created, you can install the app on
- any of your GitHub organizations and use it as the basis for GitHub App connections
- in Infisical.
- </div>
- <form onSubmit={manifestForm.handleSubmit(handleSubmitManifest)} autoComplete="off">
- <Controller
- control={manifestForm.control}
- name="name"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="GitHub App name"
- helperText="Used to identify this app in Infisical. Sent to GitHub as a slugified name prefixed with 'infisical-'."
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="My Company GitHub App" {...field} />
- </FormControl>
- )}
- />
- <Controller
- control={manifestForm.control}
- name="organization"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="GitHub Organization"
- helperText="Optional. If set, the app will be registered under this GitHub organization."
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="my-github-org" {...field} />
- </FormControl>
- )}
- />
- <div className="mt-6 flex items-center space-x-4">
- <Button
- type="submit"
- isLoading={manifestForm.formState.isSubmitting}
- isDisabled={manifestForm.formState.isSubmitting}
- >
- Create GitHub App on GitHub →
- </Button>
- <Button
- variant="outline_bg"
- onClick={() => setWizardStep(WizardSteps.GitHubSelectMethod)}
- >
- Back
- </Button>
- </div>
- </form>
- </motion.div>
- )}
- {wizardStep === WizardSteps.GitHubManual && selectedPlatform === AppPlatform.GitHub && (
- <motion.div
- key="github-manual"
- transition={{ duration: 0.1 }}
- initial={{ opacity: 0, translateX: 30 }}
- animate={{ opacity: 1, translateX: 0 }}
- exit={{ opacity: 0, translateX: -30 }}
- >
- <div className="mb-4 text-xs text-mineshaft-200">
- Provide your existing GitHub App credentials. These will be securely encrypted and
- stored in Infisical.
- </div>
- <form onSubmit={manualForm.handleSubmit(handleSubmitManual)} autoComplete="off">
- <Controller
- control={manualForm.control}
- name="name"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Display name"
- helperText="A name to identify this app in Infisical. Must be unique within this organization."
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="My Company GitHub App" {...field} />
- </FormControl>
- )}
- />
- <div className="flex space-x-3">
- <Controller
- control={manualForm.control}
- name="appId"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- className="flex-1"
- label="App ID"
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="123456" {...field} />
- </FormControl>
- )}
- />
- <Controller
- control={manualForm.control}
- name="slug"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- className="flex-1"
- label="App slug"
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="my-company-github-app" {...field} />
- </FormControl>
- )}
- />
- </div>
- <Controller
- control={manualForm.control}
- name="clientId"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Client ID"
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input placeholder="Iv1.a1b2c3d4e5f6g7h8" {...field} />
- </FormControl>
- )}
- />
- <Controller
- control={manualForm.control}
- name="clientSecret"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Client secret"
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <Input type="password" placeholder="••••••••••••••••" {...field} />
- </FormControl>
- )}
- />
- <Controller
- control={manualForm.control}
- name="privateKey"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Private key"
- helperText="The PEM-encoded private key generated for your GitHub App."
- isRequired
- errorText={error?.message}
- isError={Boolean(error)}
- >
- <TextArea
- placeholder="-----BEGIN RSA PRIVATE KEY-----&#10;...&#10;-----END RSA PRIVATE KEY-----"
- className="h-28 font-mono text-xs"
- {...field}
- />
- </FormControl>
- )}
- />
- <div className="mt-6 flex items-center space-x-4">
- <Button
- type="submit"
- isLoading={manualForm.formState.isSubmitting || registerGitHubApp.isPending}
- isDisabled={manualForm.formState.isSubmitting || registerGitHubApp.isPending}
- >
- Register GitHub App
- </Button>
- <Button
- variant="outline_bg"
- onClick={() => setWizardStep(WizardSteps.GitHubSelectMethod)}
- >
- Back
- </Button>
- </div>
- </form>
- </motion.div>
- )}
- </AnimatePresence>
- </ModalContent>
- </Modal>
- );
-};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/GitHubAppsTable.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/GitHubAppsTable.tsx
deleted file mode 100644
index 1dbdd78616..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/GitHubAppsTable.tsx
+++ /dev/null
@@ -1,141 +0,0 @@
-import { faGithub } from "@fortawesome/free-brands-svg-icons";
-import { faEllipsis, faPlug, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { twMerge } from "tailwind-merge";
-
-import { createNotification } from "@app/components/notifications";
-import { OrgPermissionCan } from "@app/components/permissions";
-import {
- DeleteActionModal,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
- EmptyState,
- Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- THead,
- Tr
-} from "@app/components/v2";
-import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
-import { usePopUp } from "@app/hooks";
-import { useDeleteGitHubApp, useListGitHubApps } from "@app/hooks/api/gitHubApps";
-
-export const GitHubAppsTable = () => {
- const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
- "removeAppConnection"
- ] as const);
-
- const { currentOrg } = useOrganization();
-
- const { data: gitHubApps, isPending } = useListGitHubApps(currentOrg?.id);
- const { mutateAsync: deleteGitHubApp } = useDeleteGitHubApp();
-
- const handleRemove = async () => {
- if (!popUp.removeAppConnection?.data?.id) return;
- try {
- await deleteGitHubApp({ id: popUp.removeAppConnection.data.id as string });
- createNotification({ text: "Successfully removed app.", type: "success" });
- } catch (err) {
- createNotification({
- text: (err as Error).message || "Failed to app.",
- type: "error"
- });
- } finally {
- handlePopUpClose("removeAppConnection");
- }
- };
-
- return (
- <>
- <TableContainer>
- <Table>
- <THead>
- <Tr>
- <Td>Platform</Td>
- <Td>Name</Td>
- <Td>App ID</Td>
- <Td>Slug</Td>
- <Td />
- </Tr>
- </THead>
- <TBody>
- {isPending && <TableSkeleton columns={5} innerKey="github-apps-loading" />}
- {!isPending && gitHubApps && gitHubApps.length === 0 && (
- <Tr>
- <Td colSpan={5}>
- <EmptyState title="No app integrations found" icon={faPlug} />
- </Td>
- </Tr>
- )}
- {gitHubApps?.map((app) => (
- <Tr key={app.id}>
- <Td className="flex items-center gap-2">
- <FontAwesomeIcon icon={faGithub} />
- GitHub
- </Td>
- <Td>{app.name}</Td>
- <Td>{app.appId}</Td>
- <Td>
- <a
- href={`https://github.com/apps/${app.slug}`}
- target="_blank"
- rel="noopener noreferrer"
- className="text-primary-400 hover:underline"
- >
- {app.slug}
- </a>
- </Td>
- <Td>
- <DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="flex justify-end hover:text-primary-400 data-[state=open]:text-primary-400">
- <FontAwesomeIcon size="sm" icon={faEllipsis} />
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-1">
- <OrgPermissionCan
- I={OrgPermissionActions.Delete}
- an={OrgPermissionSubjects.Settings}
- >
- {(isAllowed) => (
- <DropdownMenuItem
- isDisabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faTrash} />}
- className={twMerge(
- "text-red",
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
- onClick={(e) => {
- e.stopPropagation();
- handlePopUpOpen("removeAppConnection", {
- id: app.id,
- name: app.name
- });
- }}
- >
- Delete app
- </DropdownMenuItem>
- )}
- </OrgPermissionCan>
- </DropdownMenuContent>
- </DropdownMenu>
- </Td>
- </Tr>
- ))}
- </TBody>
- </Table>
- </TableContainer>
- <DeleteActionModal
- isOpen={popUp.removeAppConnection.isOpen}
- title={`Are you sure you want to remove ${popUp?.removeAppConnection?.data?.name as string}?`}
- onChange={(isOpen) => handlePopUpToggle("removeAppConnection", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={handleRemove}
- />
- </>
- );
-};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/OrgIntegrationTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/OrgIntegrationTab.tsx
deleted file mode 100644
index ec80f4be4b..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/OrgIntegrationTab.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
-import { withPermission } from "@app/hoc";
-
-import { OrgIntegrationsSection } from "./OrgIntegrationsSection";
-
-export const OrgIntegrationTab = withPermission(() => <OrgIntegrationsSection />, {
- action: OrgPermissionActions.Read,
- subject: OrgPermissionSubjects.Settings
-});
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/OrgIntegrationsSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/OrgIntegrationsSection.tsx
deleted file mode 100644
index 634c079ea4..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/OrgIntegrationsSection.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { faPlus } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-
-import { OrgPermissionCan } from "@app/components/permissions";
-import { Button } from "@app/components/v2";
-import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
-import { usePopUp } from "@app/hooks";
-
-import { AddIntegrationModal } from "./AddIntegrationModal";
-import { GitHubAppsTable } from "./GitHubAppsTable";
-import { WorkflowIntegrationsTable } from "./WorkflowIntegrationsTable";
-
-export const OrgIntegrationsSection = () => {
- const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["addIntegration"] as const);
-
- return (
- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
- <div className="flex justify-between">
- <p className="text-xl font-medium text-mineshaft-100">Integrations</p>
- <OrgPermissionCan I={OrgPermissionActions.Create} an={OrgPermissionSubjects.Settings}>
- {(isAllowed) => (
- <Button
- onClick={() => handlePopUpOpen("addIntegration")}
- isDisabled={!isAllowed}
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- >
- Add
- </Button>
- )}
- </OrgPermissionCan>
- </div>
- <p className="mb-4 text-gray-400">
- Connect Infisical to other platforms for workflow notifications and app integrations.
- </p>
-
- <div className="mb-2 text-sm font-medium text-mineshaft-200">Workflow</div>
- <WorkflowIntegrationsTable />
-
- <div className="mt-6 mb-2 text-sm font-medium text-mineshaft-200">Apps</div>
- <GitHubAppsTable />
-
- <AddIntegrationModal
- isOpen={popUp.addIntegration.isOpen}
- onToggle={(state) => handlePopUpToggle("addIntegration", state)}
- />
- </div>
- );
-};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/WorkflowIntegrationsTable.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/WorkflowIntegrationsTable.tsx
deleted file mode 100644
index a790f78396..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/WorkflowIntegrationsTable.tsx
+++ /dev/null
@@ -1,287 +0,0 @@
-import { BsMicrosoftTeams, BsSlack } from "react-icons/bs";
-import { faEllipsis, faGear, faInfoCircle } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import axios from "axios";
-import { twMerge } from "tailwind-merge";
-
-import { createNotification } from "@app/components/notifications";
-import { OrgPermissionCan } from "@app/components/permissions";
-import {
- DeleteActionModal,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
- EmptyState,
- Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- THead,
- Tooltip,
- Tr
-} from "@app/components/v2";
-import { Badge } from "@app/components/v3";
-import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
-import { usePopUp } from "@app/hooks";
-import {
- fetchSlackReinstallUrl,
- useCheckMicrosoftTeamsIntegrationInstallationStatus,
- useDeleteMicrosoftTeamsIntegration,
- useDeleteSlackIntegration,
- useGetWorkflowIntegrations
-} from "@app/hooks/api";
-import {
- WorkflowIntegrationPlatform,
- WorkflowIntegrationStatus
-} from "@app/hooks/api/workflowIntegrations/types";
-
-import { IntegrationFormDetails } from "./IntegrationFormDetails";
-
-const renderStatus = (status: WorkflowIntegrationStatus) => {
- if (status === WorkflowIntegrationStatus.Installed) {
- return <Badge variant="success">Installed</Badge>;
- }
-
- if (status === WorkflowIntegrationStatus.Pending) {
- return <Badge variant="warning">Pending</Badge>;
- }
-
- return <Badge variant="danger">Failed</Badge>;
-};
-
-export const WorkflowIntegrationsTable = () => {
- const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
- "integrationDetails",
- "removeIntegration"
- ] as const);
-
- const { currentOrg } = useOrganization();
- const { data: workflowIntegrations, isPending: isWorkflowIntegrationsLoading } =
- useGetWorkflowIntegrations(currentOrg?.id);
-
- const { mutateAsync: deleteSlackIntegration } = useDeleteSlackIntegration();
- const { mutateAsync: deleteMicrosoftTeamsIntegration } = useDeleteMicrosoftTeamsIntegration();
- const { mutateAsync: checkMicrosoftTeamsInstallationStatus } =
- useCheckMicrosoftTeamsIntegrationInstallationStatus();
-
- const handleRemoveIntegration = async () => {
- if (!currentOrg) {
- return;
- }
-
- const { platform, id } = popUp.removeIntegration.data;
- if (platform === WorkflowIntegrationPlatform.SLACK) {
- await deleteSlackIntegration({
- id,
- orgId: currentOrg?.id
- });
- }
-
- if (platform === WorkflowIntegrationPlatform.MICROSOFT_TEAMS) {
- await deleteMicrosoftTeamsIntegration({
- id,
- orgId: currentOrg?.id
- });
- }
-
- handlePopUpClose("removeIntegration");
- createNotification({
- text: "Successfully deleted integration",
- type: "success"
- });
- };
-
- const triggerSlackReinstall = async (id: string) => {
- try {
- const slackReinstallUrl = await fetchSlackReinstallUrl({
- id
- });
-
- if (slackReinstallUrl) {
- window.location.href = slackReinstallUrl;
- }
- } catch (err) {
- if (axios.isAxiosError(err)) {
- createNotification({
- text: (err.response?.data as { message: string })?.message,
- type: "error"
- });
- }
- }
- };
-
- const triggerMicrosoftTeamsInstallationStatusCheck = async (id: string) => {
- await checkMicrosoftTeamsInstallationStatus({
- workflowIntegrationId: id,
- orgId: currentOrg?.id
- });
-
- createNotification({
- text: "The Microsoft Teams bot is successfully installed in your Microsoft Teams tenant",
- type: "success"
- });
- };
-
- return (
- <>
- <TableContainer>
- <Table>
- <THead>
- <Tr>
- <Td>Provider</Td>
- <Td>Alias</Td>
- <Td>Status</Td>
- </Tr>
- </THead>
- <TBody>
- {isWorkflowIntegrationsLoading && (
- <TableSkeleton columns={2} innerKey="integrations-loading" />
- )}
- {!isWorkflowIntegrationsLoading &&
- workflowIntegrations &&
- workflowIntegrations.length === 0 && (
- <Tr>
- <Td colSpan={5}>
- <EmptyState title="No workflow integrations found" icon={faGear} />
- </Td>
- </Tr>
- )}
- {workflowIntegrations?.map((workflowIntegration) => (
- <Tr key={workflowIntegration.id}>
- <Td className="flex max-w-xs items-center gap-2 overflow-hidden text-ellipsis hover:overflow-auto hover:break-all">
- {workflowIntegration.integration === WorkflowIntegrationPlatform.SLACK ? (
- <BsSlack />
- ) : (
- <BsMicrosoftTeams />
- )}
- <div className="capitalize">
- {workflowIntegration.integration.replaceAll("-", " ")}
- </div>
- {workflowIntegration.description && (
- <Tooltip content={workflowIntegration.description}>
- <FontAwesomeIcon icon={faInfoCircle} className="text-gray-400" size="sm" />
- </Tooltip>
- )}
- </Td>
- <Td>{workflowIntegration.slug}</Td>
- <Td>{renderStatus(workflowIntegration.status)}</Td>
- <Td>
- <DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="flex justify-end hover:text-primary-400 data-[state=open]:text-primary-400">
- <FontAwesomeIcon size="sm" icon={faEllipsis} />
- </div>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-1">
- <DropdownMenuItem
- onClick={(e) => {
- e.stopPropagation();
-
- handlePopUpOpen("integrationDetails", {
- id: workflowIntegration.id,
- platform: workflowIntegration.integration
- });
- }}
- >
- More details
- </DropdownMenuItem>
-
- {workflowIntegration.integration === WorkflowIntegrationPlatform.SLACK && (
- <OrgPermissionCan
- I={OrgPermissionActions.Create}
- an={OrgPermissionSubjects.Settings}
- >
- {(isAllowed) => (
- <DropdownMenuItem
- disabled={!isAllowed}
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
- onClick={async (e) => {
- e.stopPropagation();
-
- await triggerSlackReinstall(workflowIntegration.id);
- }}
- >
- Reinstall
- </DropdownMenuItem>
- )}
- </OrgPermissionCan>
- )}
-
- {workflowIntegration.integration ===
- WorkflowIntegrationPlatform.MICROSOFT_TEAMS && (
- <OrgPermissionCan
- I={OrgPermissionActions.Edit}
- an={OrgPermissionSubjects.Settings}
- >
- {(isAllowed) => (
- <DropdownMenuItem
- disabled={!isAllowed}
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
- onClick={async (e) => {
- e.stopPropagation();
-
- await triggerMicrosoftTeamsInstallationStatusCheck(
- workflowIntegration.id
- );
- }}
- >
- Check Installation Status
- </DropdownMenuItem>
- )}
- </OrgPermissionCan>
- )}
-
- <OrgPermissionCan
- I={OrgPermissionActions.Delete}
- an={OrgPermissionSubjects.Settings}
- >
- {(isAllowed) => (
- <DropdownMenuItem
- disabled={!isAllowed}
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
- onClick={(e) => {
- e.stopPropagation();
-
- handlePopUpOpen("removeIntegration", {
- id: workflowIntegration.id,
- slug: workflowIntegration.slug,
- platform: workflowIntegration.integration
- });
- }}
- >
- Delete
- </DropdownMenuItem>
- )}
- </OrgPermissionCan>
- </DropdownMenuContent>
- </DropdownMenu>
- </Td>
- </Tr>
- ))}
- </TBody>
- </Table>
- </TableContainer>
- <IntegrationFormDetails
- isOpen={popUp.integrationDetails?.isOpen}
- workflowPlatform={popUp.integrationDetails?.data?.platform}
- id={popUp.integrationDetails?.data?.id}
- onOpenChange={(state) => handlePopUpToggle("integrationDetails", state)}
- />
- <DeleteActionModal
- isOpen={popUp.removeIntegration.isOpen}
- title={`Are you sure you want to remove ${popUp?.removeIntegration?.data?.slug}?`}
- onChange={(isOpen) => handlePopUpToggle("removeIntegration", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={handleRemoveIntegration}
- />
- </>
- );
-};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/index.ts b/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/index.ts
deleted file mode 100644
index 5b08ec28f3..0000000000
--- a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./OrgIntegrationTab";
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
index c27a00afa8..bdf79ee996 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgTabGroup/OrgTabGroup.tsx
@@ -10,12 +10,12 @@ import { AuditLogStreamsTab } from "../AuditLogStreamTab";
import { ExternalMigrationsTab } from "../ExternalMigrationsTab";
import { OrgEncryptionTab } from "../OrgEncryptionTab";
import { OrgGeneralTab } from "../OrgGeneralTab";
-import { OrgIntegrationTab } from "../OrgIntegrationTab";
import { OrgProductSettingsTab } from "../OrgProductSettingsTab";
import { OrgProvisioningTab } from "../OrgProvisioningTab";
import { OrgSecurityTab } from "../OrgSecurityTab";
import { OrgSsoTab } from "../OrgSsoTab";
import { OrgSubOrgsTab } from "../OrgSubOrgsTab";
+import { OrgWorkflowIntegrationTab } from "../OrgWorkflowIntegrationTab";
import { ProjectTemplatesTab } from "../ProjectTemplatesTab";
export const OrgTabGroup = () => {
@@ -53,9 +53,9 @@ export const OrgTabGroup = () => {
component: OrgEncryptionTab
},
{
- name: "Integrations",
- key: "integrations",
- component: OrgIntegrationTab
+ name: "Workflow Integrations",
+ key: "workflow-integrations",
+ component: OrgWorkflowIntegrationTab
},
{ name: "Audit Log Streams", key: "tag-audit-log-streams", component: AuditLogStreamsTab },
{
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/AddWorkflowIntegrationForm.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/AddWorkflowIntegrationForm.tsx
new file mode 100644
index 0000000000..15acf5c975
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/AddWorkflowIntegrationForm.tsx
@@ -0,0 +1,115 @@
+import { useState } from "react";
+import { BsMicrosoftTeams } from "react-icons/bs";
+import { faSlack } from "@fortawesome/free-brands-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { AnimatePresence, motion } from "framer-motion";
+
+import { Modal, ModalContent } from "@app/components/v2";
+import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";
+
+import { MicrosoftTeamsIntegrationForm } from "./MicrosoftTeamsIntegrationForm";
+import { SlackIntegrationForm } from "./SlackIntegrationForm";
+
+type Props = {
+ isOpen?: boolean;
+ onToggle: (isOpen: boolean) => void;
+};
+
+enum WizardSteps {
+ SelectPlatform = "select-platform",
+ PlatformInputs = "platform-inputs"
+}
+
+const PLATFORM_LIST = [
+ {
+ icon: <FontAwesomeIcon icon={faSlack} size="lg" />,
+ platform: WorkflowIntegrationPlatform.SLACK,
+ title: "Slack"
+ },
+ {
+ icon: <BsMicrosoftTeams className="text-lg" />,
+ platform: WorkflowIntegrationPlatform.MICROSOFT_TEAMS,
+ title: "Microsoft Teams"
+ }
+];
+
+export const AddWorkflowIntegrationForm = ({ isOpen, onToggle }: Props) => {
+ const [wizardStep, setWizardStep] = useState(WizardSteps.SelectPlatform);
+ const [selectedPlatform, setSelectedPlatform] = useState<string | null>(null);
+
+ const handleFormReset = (state: boolean = false) => {
+ onToggle(state);
+ setWizardStep(WizardSteps.SelectPlatform);
+ setSelectedPlatform(null);
+ };
+
+ return (
+ <Modal isOpen={isOpen} onOpenChange={(state) => handleFormReset(state)}>
+ <ModalContent
+ title={`Add a ${selectedPlatform?.replace("-", " ").replace(/\b\w/g, (char) => char.toUpperCase()) ?? "workflow"} integration`}
+ className="my-4"
+ >
+ <AnimatePresence mode="wait">
+ {wizardStep === WizardSteps.SelectPlatform && (
+ <motion.div
+ key="select-type-step"
+ transition={{ duration: 0.1 }}
+ initial={{ opacity: 0, translateX: 30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: -30 }}
+ >
+ <div className="mb-4 text-mineshaft-300">Select a platform</div>
+ <div className="flex items-center space-x-4">
+ {PLATFORM_LIST.map(({ icon, platform, title }) => (
+ <div
+ key={platform}
+ className="flex h-28 w-32 cursor-pointer flex-col items-center space-y-4 rounded-sm border border-mineshaft-500 bg-bunker-600 p-6 transition-all hover:border-primary/70 hover:bg-primary/10 hover:text-white"
+ role="button"
+ tabIndex={0}
+ onClick={() => {
+ setSelectedPlatform(platform);
+ setWizardStep(WizardSteps.PlatformInputs);
+ }}
+ onKeyDown={(evt) => {
+ if (evt.key === "Enter") {
+ setSelectedPlatform(platform);
+ setWizardStep(WizardSteps.PlatformInputs);
+ }
+ }}
+ >
+ <div>{icon}</div>
+ <div className="text-center text-sm whitespace-pre-wrap">{title}</div>
+ </div>
+ ))}
+ </div>
+ </motion.div>
+ )}
+ {wizardStep === WizardSteps.PlatformInputs &&
+ selectedPlatform === WorkflowIntegrationPlatform.SLACK && (
+ <motion.div
+ key="slack-platform"
+ transition={{ duration: 0.1 }}
+ initial={{ opacity: 0, translateX: 30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: -30 }}
+ >
+ <SlackIntegrationForm onClose={() => onToggle(false)} />
+ </motion.div>
+ )}
+ {wizardStep === WizardSteps.PlatformInputs &&
+ selectedPlatform === WorkflowIntegrationPlatform.MICROSOFT_TEAMS && (
+ <motion.div
+ key="microsoft-teams-platform"
+ transition={{ duration: 0.1 }}
+ initial={{ opacity: 0, translateX: 30 }}
+ animate={{ opacity: 1, translateX: 0 }}
+ exit={{ opacity: 0, translateX: -30 }}
+ >
+ <MicrosoftTeamsIntegrationForm onClose={() => onToggle(false)} />
+ </motion.div>
+ )}
+ </AnimatePresence>
+ </ModalContent>
+ </Modal>
+ );
+};
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/IntegrationFormDetails.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/IntegrationFormDetails.tsx
similarity index 100%
rename from frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/IntegrationFormDetails.tsx
rename to frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/IntegrationFormDetails.tsx
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/MicrosoftTeamsIntegrationForm.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/MicrosoftTeamsIntegrationForm.tsx
similarity index 100%
rename from frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/MicrosoftTeamsIntegrationForm.tsx
rename to frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/MicrosoftTeamsIntegrationForm.tsx
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx
new file mode 100644
index 0000000000..2bf8fd5d30
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx
@@ -0,0 +1,317 @@
+import { BsMicrosoftTeams, BsSlack } from "react-icons/bs";
+import { faEllipsis, faGear, faInfoCircle, faPlus } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import axios from "axios";
+import { twMerge } from "tailwind-merge";
+
+import { createNotification } from "@app/components/notifications";
+import { OrgPermissionCan } from "@app/components/permissions";
+import {
+ Button,
+ DeleteActionModal,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+ EmptyState,
+ Table,
+ TableContainer,
+ TableSkeleton,
+ TBody,
+ Td,
+ THead,
+ Tooltip,
+ Tr
+} from "@app/components/v2";
+import { Badge } from "@app/components/v3";
+import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
+import { withPermission } from "@app/hoc";
+import { usePopUp } from "@app/hooks";
+import {
+ fetchSlackReinstallUrl,
+ useCheckMicrosoftTeamsIntegrationInstallationStatus,
+ useDeleteMicrosoftTeamsIntegration,
+ useDeleteSlackIntegration,
+ useGetWorkflowIntegrations
+} from "@app/hooks/api";
+import {
+ WorkflowIntegrationPlatform,
+ WorkflowIntegrationStatus
+} from "@app/hooks/api/workflowIntegrations/types";
+
+import { AddWorkflowIntegrationForm } from "./AddWorkflowIntegrationForm";
+import { IntegrationFormDetails } from "./IntegrationFormDetails";
+
+const renderStatus = (status: WorkflowIntegrationStatus) => {
+ if (status === WorkflowIntegrationStatus.Installed) {
+ return <Badge variant="success">Installed</Badge>;
+ }
+
+ if (status === WorkflowIntegrationStatus.Pending) {
+ return <Badge variant="warning">Pending</Badge>;
+ }
+
+ return <Badge variant="danger">Failed</Badge>;
+};
+
+export const OrgWorkflowIntegrationTab = withPermission(
+ () => {
+ const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
+ "addWorkflowIntegration",
+ "integrationDetails",
+ "removeIntegration"
+ ] as const);
+
+ const { currentOrg } = useOrganization();
+ const { data: workflowIntegrations, isPending: isWorkflowIntegrationsLoading } =
+ useGetWorkflowIntegrations(currentOrg?.id);
+
+ const { mutateAsync: deleteSlackIntegration } = useDeleteSlackIntegration();
+ const { mutateAsync: deleteMicrosoftTeamsIntegration } = useDeleteMicrosoftTeamsIntegration();
+ const { mutateAsync: checkMicrosoftTeamsInstallationStatus } =
+ useCheckMicrosoftTeamsIntegrationInstallationStatus();
+
+ const handleRemoveIntegration = async () => {
+ if (!currentOrg) {
+ return;
+ }
+
+ const { platform, id } = popUp.removeIntegration.data;
+ if (platform === WorkflowIntegrationPlatform.SLACK) {
+ await deleteSlackIntegration({
+ id,
+ orgId: currentOrg?.id
+ });
+ }
+
+ if (platform === WorkflowIntegrationPlatform.MICROSOFT_TEAMS) {
+ await deleteMicrosoftTeamsIntegration({
+ id,
+ orgId: currentOrg?.id
+ });
+ }
+
+ handlePopUpClose("removeIntegration");
+ createNotification({
+ text: "Successfully deleted integration",
+ type: "success"
+ });
+ };
+
+ const triggerSlackReinstall = async (id: string) => {
+ try {
+ const slackReinstallUrl = await fetchSlackReinstallUrl({
+ id
+ });
+
+ if (slackReinstallUrl) {
+ window.location.href = slackReinstallUrl;
+ }
+ } catch (err) {
+ if (axios.isAxiosError(err)) {
+ createNotification({
+ text: (err.response?.data as { message: string })?.message,
+ type: "error"
+ });
+ }
+ }
+ };
+
+ const triggerMicrosoftTeamsInstallationStatusCheck = async (id: string) => {
+ await checkMicrosoftTeamsInstallationStatus({
+ workflowIntegrationId: id,
+ orgId: currentOrg?.id
+ });
+
+ createNotification({
+ text: "The Microsoft Teams bot is successfully installed in your Microsoft Teams tenant",
+ type: "success"
+ });
+ };
+
+ return (
+ <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
+ <div className="flex justify-between">
+ <p className="text-xl font-medium text-mineshaft-100">Workflow Integrations</p>
+ <OrgPermissionCan I={OrgPermissionActions.Create} an={OrgPermissionSubjects.Settings}>
+ {(isAllowed) => (
+ <Button
+ onClick={() => {
+ handlePopUpOpen("addWorkflowIntegration");
+ }}
+ isDisabled={!isAllowed}
+ leftIcon={<FontAwesomeIcon icon={faPlus} />}
+ >
+ Add
+ </Button>
+ )}
+ </OrgPermissionCan>
+ </div>
+ <p className="mb-4 text-gray-400">
+ Connect Infisical to other platforms for notification and workflow integrations.
+ </p>
+ <TableContainer>
+ <Table>
+ <THead>
+ <Tr>
+ <Td>Provider</Td>
+ <Td>Alias</Td>
+ <Td>Status</Td>
+ </Tr>
+ </THead>
+ <TBody>
+ {isWorkflowIntegrationsLoading && (
+ <TableSkeleton columns={2} innerKey="integrations-loading" />
+ )}
+ {!isWorkflowIntegrationsLoading &&
+ workflowIntegrations &&
+ workflowIntegrations.length === 0 && (
+ <Tr>
+ <Td colSpan={5}>
+ <EmptyState title="No workflow integrations found" icon={faGear} />
+ </Td>
+ </Tr>
+ )}
+ {workflowIntegrations?.map((workflowIntegration) => (
+ <Tr key={workflowIntegration.id}>
+ <Td className="flex max-w-xs items-center gap-2 overflow-hidden text-ellipsis hover:overflow-auto hover:break-all">
+ {workflowIntegration.integration === WorkflowIntegrationPlatform.SLACK ? (
+ <BsSlack />
+ ) : (
+ <BsMicrosoftTeams />
+ )}
+ <div className="capitalize">
+ {workflowIntegration.integration.replaceAll("-", " ")}
+ </div>
+ {workflowIntegration.description && (
+ <Tooltip content={workflowIntegration.description}>
+ <FontAwesomeIcon icon={faInfoCircle} className="text-gray-400" size="sm" />
+ </Tooltip>
+ )}
+ </Td>
+ <Td>{workflowIntegration.slug}</Td>
+ <Td>{renderStatus(workflowIntegration.status)}</Td>
+ <Td>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild className="rounded-lg">
+ <div className="flex justify-end hover:text-primary-400 data-[state=open]:text-primary-400">
+ <FontAwesomeIcon size="sm" icon={faEllipsis} />
+ </div>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="start" className="p-1">
+ <DropdownMenuItem
+ onClick={(e) => {
+ e.stopPropagation();
+
+ handlePopUpOpen("integrationDetails", {
+ id: workflowIntegration.id,
+ platform: workflowIntegration.integration
+ });
+ }}
+ >
+ More details
+ </DropdownMenuItem>
+
+ {workflowIntegration.integration === WorkflowIntegrationPlatform.SLACK && (
+ <OrgPermissionCan
+ I={OrgPermissionActions.Create}
+ an={OrgPermissionSubjects.Settings}
+ >
+ {(isAllowed) => (
+ <DropdownMenuItem
+ disabled={!isAllowed}
+ className={twMerge(
+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
+ )}
+ onClick={async (e) => {
+ e.stopPropagation();
+
+ await triggerSlackReinstall(workflowIntegration.id);
+ }}
+ >
+ Reinstall
+ </DropdownMenuItem>
+ )}
+ </OrgPermissionCan>
+ )}
+
+ {workflowIntegration.integration ===
+ WorkflowIntegrationPlatform.MICROSOFT_TEAMS && (
+ <OrgPermissionCan
+ I={OrgPermissionActions.Edit}
+ an={OrgPermissionSubjects.Settings}
+ >
+ {(isAllowed) => (
+ <DropdownMenuItem
+ disabled={!isAllowed}
+ className={twMerge(
+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
+ )}
+ onClick={async (e) => {
+ e.stopPropagation();
+
+ await triggerMicrosoftTeamsInstallationStatusCheck(
+ workflowIntegration.id
+ );
+ }}
+ >
+ Check Installation Status
+ </DropdownMenuItem>
+ )}
+ </OrgPermissionCan>
+ )}
+
+ <OrgPermissionCan
+ I={OrgPermissionActions.Delete}
+ an={OrgPermissionSubjects.Settings}
+ >
+ {(isAllowed) => (
+ <DropdownMenuItem
+ disabled={!isAllowed}
+ className={twMerge(
+ !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
+ )}
+ onClick={(e) => {
+ e.stopPropagation();
+
+ handlePopUpOpen("removeIntegration", {
+ id: workflowIntegration.id,
+ slug: workflowIntegration.slug,
+ platform: workflowIntegration.integration
+ });
+ }}
+ >
+ Delete
+ </DropdownMenuItem>
+ )}
+ </OrgPermissionCan>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </Td>
+ </Tr>
+ ))}
+ </TBody>
+ </Table>
+ </TableContainer>
+ <AddWorkflowIntegrationForm
+ isOpen={popUp.addWorkflowIntegration.isOpen}
+ onToggle={(state) => handlePopUpToggle("addWorkflowIntegration", state)}
+ />
+ <IntegrationFormDetails
+ isOpen={popUp.integrationDetails?.isOpen}
+ workflowPlatform={popUp.integrationDetails?.data?.platform}
+ id={popUp.integrationDetails?.data?.id}
+ onOpenChange={(state) => handlePopUpToggle("integrationDetails", state)}
+ />
+ <DeleteActionModal
+ isOpen={popUp.removeIntegration.isOpen}
+ title={`Are you sure you want to remove ${popUp?.removeIntegration?.data?.slug}?`}
+ onChange={(isOpen) => handlePopUpToggle("removeIntegration", isOpen)}
+ deleteKey="confirm"
+ onDeleteApproved={handleRemoveIntegration}
+ />
+ </div>
+ );
+ },
+ { action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.Settings }
+);
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/SlackIntegrationForm.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx
similarity index 100%
rename from frontend/src/pages/organization/SettingsPage/components/OrgIntegrationTab/SlackIntegrationForm.tsx
rename to frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/index.ts b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/index.ts
new file mode 100644
index 0000000000..5b63fc1b8c
--- /dev/null
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/index.ts
@@ -0,0 +1 @@
+export * from "./OrgWorkflowIntegrationTab";
diff --git a/frontend/src/pages/redirects/github-manifest-callback-redirect.tsx b/frontend/src/pages/redirects/github-manifest-callback-redirect.tsx
new file mode 100644
index 0000000000..443817fe18
--- /dev/null
+++ b/frontend/src/pages/redirects/github-manifest-callback-redirect.tsx
@@ -0,0 +1,15 @@
+import { createFileRoute, redirect } from "@tanstack/react-router";
+
+export const Route = createFileRoute(
+ "/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback"
+)({
+ beforeLoad: ({ context, search }) => {
+ throw redirect({
+ to: "/organizations/$orgId/app-connections/github/manifest/callback",
+ params: {
+ orgId: context.organizationId
+ },
+ search
+ });
+ }
+});
diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts
index a8dfb5bd1d..2256e0a008 100644
--- a/frontend/src/routeTree.gen.ts
+++ b/frontend/src/routeTree.gen.ts
@@ -55,6 +55,7 @@ import { Route as organizationProjectsPageRouteImport } from './pages/organizati
import { Route as organizationBillingPageRouteImport } from './pages/organization/BillingPage/route'
import { Route as organizationAuditLogsPageRouteImport } from './pages/organization/AuditLogsPage/route'
import { Route as organizationAccessManagementPageRouteImport } from './pages/organization/AccessManagementPage/route'
+import { Route as redirectsGithubManifestCallbackRedirectImport } from './pages/redirects/github-manifest-callback-redirect'
import { Route as redirectsOauthCallbackRedirectImport } from './pages/redirects/oauth-callback-redirect'
import { Route as secretManagerIntegrationsRouteVercelOauthRedirectImport } from './pages/secret-manager/integrations/route-vercel-oauth-redirect'
import { Route as secretManagerIntegrationsRouteNetlifyOauthRedirectImport } from './pages/secret-manager/integrations/route-netlify-oauth-redirect'
@@ -86,6 +87,7 @@ import { Route as pamLayoutImport } from './pages/pam/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 organizationAppConnectionsGitHubManifestCallbackPageRouteImport } from './pages/organization/AppConnections/GitHubManifestCallbackPage/route'
import { Route as organizationAppConnectionsOauthCallbackPageRouteImport } from './pages/organization/AppConnections/OauthCallbackPage/route'
import { Route as projectAuditLogsPageRouteSshImport } from './pages/project/AuditLogsPage/route-ssh'
import { Route as projectAccessControlPageRouteSshImport } from './pages/project/AccessControlPage/route-ssh'
@@ -788,6 +790,13 @@ const organizationAccessManagementPageRouteRoute =
AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdRoute,
} as any)
+const redirectsGithubManifestCallbackRedirectRoute =
+ redirectsGithubManifestCallbackRedirectImport.update({
+ id: '/organization/app-connections/github/manifest/callback',
+ path: '/organization/app-connections/github/manifest/callback',
+ getParentRoute: () => middlewaresInjectOrgDetailsRoute,
+ } as any)
+
const redirectsOauthCallbackRedirectRoute =
redirectsOauthCallbackRedirectImport.update({
id: '/organization/app-connections/$appConnection/oauth/callback',
@@ -1095,6 +1104,14 @@ const aiLayoutRoute = aiLayoutImport.update({
AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsAiProjectIdRoute,
} as any)
+const organizationAppConnectionsGitHubManifestCallbackPageRouteRoute =
+ organizationAppConnectionsGitHubManifestCallbackPageRouteImport.update({
+ id: '/github/manifest/callback',
+ path: '/github/manifest/callback',
+ getParentRoute: () =>
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsRoute,
+ } as any)
+
const organizationAppConnectionsOauthCallbackPageRouteRoute =
organizationAppConnectionsOauthCallbackPageRouteImport.update({
id: '/$appConnection/oauth/callback',
@@ -3241,6 +3258,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof redirectsOauthCallbackRedirectImport
parentRoute: typeof middlewaresInjectOrgDetailsImport
}
+ '/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback': {
+ id: '/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback'
+ path: '/organization/app-connections/github/manifest/callback'
+ fullPath: '/organization/app-connections/github/manifest/callback'
+ preLoaderRoute: typeof redirectsGithubManifestCallbackRedirectImport
+ parentRoute: typeof middlewaresInjectOrgDetailsImport
+ }
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/gateways/$gatewayId': {
id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/gateways/$gatewayId'
path: '/gateways/$gatewayId'
@@ -3332,6 +3356,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof organizationAppConnectionsOauthCallbackPageRouteImport
parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsImport
}
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback': {
+ id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback'
+ path: '/github/manifest/callback'
+ fullPath: '/organizations/$orgId/app-connections/github/manifest/callback'
+ preLoaderRoute: typeof organizationAppConnectionsGitHubManifestCallbackPageRouteImport
+ parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsImport
+ }
'/_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: ''
@@ -5939,6 +5970,7 @@ const organizationProjectsPageRouteRouteWithChildren =
interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsRouteChildren {
organizationAppConnectionsAppConnectionsPageRouteRoute: typeof organizationAppConnectionsAppConnectionsPageRouteRoute
organizationAppConnectionsOauthCallbackPageRouteRoute: typeof organizationAppConnectionsOauthCallbackPageRouteRoute
+ organizationAppConnectionsGitHubManifestCallbackPageRouteRoute: typeof organizationAppConnectionsGitHubManifestCallbackPageRouteRoute
}
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsRouteChildren: AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsRouteChildren =
@@ -5947,6 +5979,8 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsRoute
organizationAppConnectionsAppConnectionsPageRouteRoute,
organizationAppConnectionsOauthCallbackPageRouteRoute:
organizationAppConnectionsOauthCallbackPageRouteRoute,
+ organizationAppConnectionsGitHubManifestCallbackPageRouteRoute:
+ organizationAppConnectionsGitHubManifestCallbackPageRouteRoute,
}
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdAppConnectionsRouteWithChildren =
@@ -5991,15 +6025,12 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSecretSharingRouteW
interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSettingsRouteChildren {
organizationSettingsPageRouteRoute: typeof organizationSettingsPageRouteRoute
- organizationSettingsPageGitHubAppCallbackPageRouteRoute: typeof organizationSettingsPageGitHubAppCallbackPageRouteRoute
organizationSettingsPageOauthCallbackPageRouteRoute: typeof organizationSettingsPageOauthCallbackPageRouteRoute
}
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSettingsRouteChildren: AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSettingsRouteChildren =
{
organizationSettingsPageRouteRoute: organizationSettingsPageRouteRoute,
- organizationSettingsPageGitHubAppCallbackPageRouteRoute:
- organizationSettingsPageGitHubAppCallbackPageRouteRoute,
organizationSettingsPageOauthCallbackPageRouteRoute:
organizationSettingsPageOauthCallbackPageRouteRoute,
}
@@ -6132,6 +6163,7 @@ interface middlewaresInjectOrgDetailsRouteChildren {
AuthenticateInjectOrgDetailsAdminRoute: typeof AuthenticateInjectOrgDetailsAdminRouteWithChildren
redirectsSettingsOauthCallbackRedirectRoute: typeof redirectsSettingsOauthCallbackRedirectRoute
redirectsOauthCallbackRedirectRoute: typeof redirectsOauthCallbackRedirectRoute
+ redirectsGithubManifestCallbackRedirectRoute: typeof redirectsGithubManifestCallbackRedirectRoute
pamPamAccountAccessPageRouteRoute: typeof pamPamAccountAccessPageRouteRoute
}
@@ -6143,6 +6175,8 @@ const middlewaresInjectOrgDetailsRouteChildren: middlewaresInjectOrgDetailsRoute
redirectsSettingsOauthCallbackRedirectRoute:
redirectsSettingsOauthCallbackRedirectRoute,
redirectsOauthCallbackRedirectRoute: redirectsOauthCallbackRedirectRoute,
+ redirectsGithubManifestCallbackRedirectRoute:
+ redirectsGithubManifestCallbackRedirectRoute,
pamPamAccountAccessPageRouteRoute: pamPamAccountAccessPageRouteRoute,
}
@@ -6340,6 +6374,7 @@ export interface FileRoutesByFullPath {
'/integrations/vercel/oauth2/callback': typeof secretManagerIntegrationsRouteVercelOauthRedirectRoute
'/organizations/$orgId/secret-manager/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSecretManagerProjectIdRouteWithChildren
'/organization/app-connections/$appConnection/oauth/callback': typeof redirectsOauthCallbackRedirectRoute
+ '/organization/app-connections/github/manifest/callback': typeof redirectsGithubManifestCallbackRedirectRoute
'/organizations/$orgId/networking/gateways/$gatewayId': typeof organizationNetworkingPageGatewayDetailsByIDPageRouteRoute
'/organizations/$orgId/networking/relays/$relayId': typeof organizationNetworkingPageRelayDetailsByIDPageRouteRoute
'/organizations/$orgId/settings/github-app/callback': typeof organizationSettingsPageGitHubAppCallbackPageRouteRoute
@@ -6353,6 +6388,7 @@ export interface FileRoutesByFullPath {
'/organizations/$orgId/projects/ssh/$projectId': typeof sshLayoutRouteWithChildren
'/organizations/$orgId/secret-manager/$projectId/approval': typeof secretManagerRedirectsRedirectApprovalPageRoute
'/organizations/$orgId/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
+ '/organizations/$orgId/app-connections/github/manifest/callback': typeof organizationAppConnectionsGitHubManifestCallbackPageRouteRoute
'/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
@@ -6627,6 +6663,7 @@ export interface FileRoutesByTo {
'/integrations/vercel/oauth2/callback': typeof secretManagerIntegrationsRouteVercelOauthRedirectRoute
'/organizations/$orgId/secret-manager/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSecretManagerProjectIdRouteWithChildren
'/organization/app-connections/$appConnection/oauth/callback': typeof redirectsOauthCallbackRedirectRoute
+ '/organization/app-connections/github/manifest/callback': typeof redirectsGithubManifestCallbackRedirectRoute
'/organizations/$orgId/networking/gateways/$gatewayId': typeof organizationNetworkingPageGatewayDetailsByIDPageRouteRoute
'/organizations/$orgId/networking/relays/$relayId': typeof organizationNetworkingPageRelayDetailsByIDPageRouteRoute
'/organizations/$orgId/settings/github-app/callback': typeof organizationSettingsPageGitHubAppCallbackPageRouteRoute
@@ -6640,6 +6677,7 @@ export interface FileRoutesByTo {
'/organizations/$orgId/projects/ssh/$projectId': typeof sshLayoutRouteWithChildren
'/organizations/$orgId/secret-manager/$projectId/approval': typeof secretManagerRedirectsRedirectApprovalPageRoute
'/organizations/$orgId/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
+ '/organizations/$orgId/app-connections/github/manifest/callback': typeof organizationAppConnectionsGitHubManifestCallbackPageRouteRoute
'/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
@@ -6907,6 +6945,7 @@ export interface FileRoutesById {
'/_authenticate/_inject-org-details/_org-layout/integrations/vercel/oauth2/callback': typeof secretManagerIntegrationsRouteVercelOauthRedirectRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdSecretManagerProjectIdRouteWithChildren
'/_authenticate/_inject-org-details/organization/app-connections/$appConnection/oauth/callback': typeof redirectsOauthCallbackRedirectRoute
+ '/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback': typeof redirectsGithubManifestCallbackRedirectRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/gateways/$gatewayId': typeof organizationNetworkingPageGatewayDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/relays/$relayId': typeof organizationNetworkingPageRelayDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/github-app/callback': typeof organizationSettingsPageGitHubAppCallbackPageRouteRoute
@@ -6920,6 +6959,7 @@ export interface FileRoutesById {
'/_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/app-connections/$appConnection/oauth/callback': typeof organizationAppConnectionsOauthCallbackPageRouteRoute
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback': typeof organizationAppConnectionsGitHubManifestCallbackPageRouteRoute
'/_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
@@ -7211,6 +7251,7 @@ export interface FileRouteTypes {
| '/integrations/vercel/oauth2/callback'
| '/organizations/$orgId/secret-manager/$projectId'
| '/organization/app-connections/$appConnection/oauth/callback'
+ | '/organization/app-connections/github/manifest/callback'
| '/organizations/$orgId/networking/gateways/$gatewayId'
| '/organizations/$orgId/networking/relays/$relayId'
| '/organizations/$orgId/settings/github-app/callback'
@@ -7224,6 +7265,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/ssh/$projectId'
| '/organizations/$orgId/secret-manager/$projectId/approval'
| '/organizations/$orgId/app-connections/$appConnection/oauth/callback'
+ | '/organizations/$orgId/app-connections/github/manifest/callback'
| '/organizations/$orgId/projects/ai/$projectId/overview'
| '/organizations/$orgId/projects/ai/$projectId/settings'
| '/organizations/$orgId/projects/cert-manager/$projectId/alerting'
@@ -7497,6 +7539,7 @@ export interface FileRouteTypes {
| '/integrations/vercel/oauth2/callback'
| '/organizations/$orgId/secret-manager/$projectId'
| '/organization/app-connections/$appConnection/oauth/callback'
+ | '/organization/app-connections/github/manifest/callback'
| '/organizations/$orgId/networking/gateways/$gatewayId'
| '/organizations/$orgId/networking/relays/$relayId'
| '/organizations/$orgId/settings/github-app/callback'
@@ -7510,6 +7553,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/ssh/$projectId'
| '/organizations/$orgId/secret-manager/$projectId/approval'
| '/organizations/$orgId/app-connections/$appConnection/oauth/callback'
+ | '/organizations/$orgId/app-connections/github/manifest/callback'
| '/organizations/$orgId/projects/ai/$projectId/overview'
| '/organizations/$orgId/projects/ai/$projectId/settings'
| '/organizations/$orgId/projects/cert-manager/$projectId/alerting'
@@ -7775,6 +7819,7 @@ export interface FileRouteTypes {
| '/_authenticate/_inject-org-details/_org-layout/integrations/vercel/oauth2/callback'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/secret-manager/$projectId'
| '/_authenticate/_inject-org-details/organization/app-connections/$appConnection/oauth/callback'
+ | '/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/gateways/$gatewayId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/relays/$relayId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/github-app/callback'
@@ -7788,6 +7833,7 @@ export interface FileRouteTypes {
| '/_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/app-connections/$appConnection/oauth/callback'
+ | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback'
| '/_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'
@@ -8117,6 +8163,7 @@ export const routeTree = rootRoute
"/_authenticate/_inject-org-details/admin",
"/_authenticate/_inject-org-details/organization/settings/oauth/callback",
"/_authenticate/_inject-org-details/organization/app-connections/$appConnection/oauth/callback",
+ "/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback",
"/_authenticate/_inject-org-details/organizations/$orgId/projects/pam/$projectId/resources/$resourceType/$resourceId/accounts/$accountId/access"
]
},
@@ -8333,7 +8380,8 @@ export const routeTree = rootRoute
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId",
"children": [
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/",
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/$appConnection/oauth/callback"
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/$appConnection/oauth/callback",
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback"
]
},
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking": {
@@ -8357,7 +8405,6 @@ export const routeTree = rootRoute
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId",
"children": [
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/",
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/github-app/callback",
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/settings/oauth/callback"
]
},
@@ -8448,6 +8495,10 @@ export const routeTree = rootRoute
"filePath": "redirects/oauth-callback-redirect.tsx",
"parent": "/_authenticate/_inject-org-details"
},
+ "/_authenticate/_inject-org-details/organization/app-connections/github/manifest/callback": {
+ "filePath": "redirects/github-manifest-callback-redirect.tsx",
+ "parent": "/_authenticate/_inject-org-details"
+ },
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking/gateways/$gatewayId": {
"filePath": "organization/NetworkingPage/GatewayDetailsByIDPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/networking"
@@ -8521,6 +8572,10 @@ export const routeTree = rootRoute
"filePath": "organization/AppConnections/OauthCallbackPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections"
},
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections/github/manifest/callback": {
+ "filePath": "organization/AppConnections/GitHubManifestCallbackPage/route.tsx",
+ "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/app-connections"
+ },
"/_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",
diff --git a/frontend/src/routes.ts b/frontend/src/routes.ts
index 3cf8fff59f..c1f442eef3 100644
--- a/frontend/src/routes.ts
+++ b/frontend/src/routes.ts
@@ -449,8 +449,7 @@ const organizationRoutes = route("/organizations/$orgId", [
route("/secret-sharing", [index("organization/SecretSharingPage/route.tsx")]),
route("/settings", [
index("organization/SettingsPage/route.tsx"),
- route("/oauth/callback", "organization/SettingsPage/OauthCallbackPage/route.tsx"),
- route("/github-app/callback", "organization/SettingsPage/GitHubAppCallbackPage/route.tsx")
+ route("/oauth/callback", "organization/SettingsPage/OauthCallbackPage/route.tsx")
]),
route("/groups/$groupId", "organization/GroupDetailsByIDPage/route.tsx"),
route("/members/$membershipId", "organization/UserDetailsByIDPage/route.tsx"),
@@ -461,6 +460,10 @@ const organizationRoutes = route("/organizations/$orgId", [
route(
"/$appConnection/oauth/callback",
"organization/AppConnections/OauthCallbackPage/route.tsx"
+ ),
+ route(
+ "/github/manifest/callback",
+ "organization/AppConnections/GitHubManifestCallbackPage/route.tsx"
)
]),
route("/networking", [
@@ -512,7 +515,9 @@ export const routes = rootRoute("root.tsx", [
),
route(
"/organization/settings/oauth/callback",
- "redirects/settings-oauth-callback-redirect.tsx"
+ "redirects/settings-oauth-callback-redirect.tsx",
+ "/organization/app-connections/github/manifest/callback",
+ "redirects/github-manifest-callback-redirect.tsx"
),
layout("org-layout", "organization/layout.tsx", [
organizationRoutes,