History

Add Slack first-party OAuth (#1640)

Rhys Sullivan committed 2 months ago

Commit 63ea0281 parent f64028a8 files · +141 −49Browse files

Showing the changes to apps/cloud/src/engine (1 of 8 files). Show all

Unified · Split

apps/cloud/src/engine/execution-stack.ts+20−1
@@ -43,8 +43,13 @@ import { · 42 unmodified lines
43 collectTables,43 collectTables,
44} from "@executor-js/api/server";44} from "@executor-js/api/server";
45import { googleCatalogOAuthScopesForPreset } from "@executor-js/plugin-openapi/providers/google";45import { googleCatalogOAuthScopesForPreset } from "@executor-js/plugin-openapi/providers/google";
46import { slackMcpUserScopes } from "@executor-js/react/lib/slack-mcp-oauth";
46import { makeDynamicWorkerExecutor } from "@executor-js/runtime-dynamic-worker";47import { makeDynamicWorkerExecutor } from "@executor-js/runtime-dynamic-worker";
47import type { AnyPlugin, FirstPartyOAuthClientConfig } from "@executor-js/sdk";48import {
49 IntegrationSlug,
50 type AnyPlugin,
51 type FirstPartyOAuthClientConfig,
52} from "@executor-js/sdk";
48 53
49import executorConfig from "../../executor.config";54import executorConfig from "../../executor.config";
50import { DbService } from "../db/db";55import { DbService } from "../db/db";
@@ -136,6 +141,20 @@ const cloudFirstPartyOAuthClients = (): readonly FirstPartyOAuthClientConfig[] = · 85 unmodified lines
136 },141 },
137 ]142 ]
138 : []),143 : []),
144 ...(env.FIRST_PARTY_SLACK_CLIENT_ID && env.FIRST_PARTY_SLACK_CLIENT_SECRET
145 ? [
146 {
147 name: "slack",
148 authorizationUrl: "https://slack.com/oauth/v2_user/authorize",
149 tokenUrl: "https://slack.com/api/oauth.v2.user.access",
150 resource: "https://mcp.slack.com",
151 clientId: env.FIRST_PARTY_SLACK_CLIENT_ID,
152 clientSecret: env.FIRST_PARTY_SLACK_CLIENT_SECRET,
153 integrations: [IntegrationSlug.make("slack")],
154 allowedScopes: slackMcpUserScopes,
155 },
156 ]
157 : []),
139];158];
140 159
141export const CloudHostConfig: Layer.Layer<HostConfig> = Layer.sync(HostConfig, () => ({160export const CloudHostConfig: Layer.Layer<HostConfig> = Layer.sync(HostConfig, () => ({