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 packages/react/src (2 of 8 files). Show all

Unified · Split

2 files
  1. packages/react/src/components/oauth-app-setup.ts +4 −29
  2. packages/react/src/lib/slack-mcp-oauth.ts +32 −0
packages/react/src/components/oauth-app-setup.ts+4−29
@@ -1,3 +1,7 @@
1import { slackMcpUserScopes } from "../lib/slack-mcp-oauth";
2
3export { slackMcpUserScopes } from "../lib/slack-mcp-oauth";
4
1export interface OAuthAppSetup {5export interface OAuthAppSetup {
2 readonly id: string;6 readonly id: string;
3 readonly title: string;7 readonly title: string;
@@ -29,35 +33,6 @@ interface SlackManifest { · 25 unmodified lines
29 };33 };
30}34}
31 35
32export const slackMcpUserScopes = [
33 "search:read.public",
34 "search:read.private",
35 "search:read.mpim",
36 "search:read.im",
37 "search:read.files",
38 "search:read.users",
39 "chat:write",
40 "channels:history",
41 "groups:history",
42 "mpim:history",
43 "im:history",
44 "canvases:read",
45 "canvases:write",
46 "users:read",
47 "users:read.email",
48 "reactions:write",
49 "reactions:read",
50 "emoji:read",
51 "files:read",
52 "channels:write",
53 "groups:write",
54 "im:write",
55 "mpim:write",
56 "channels:read",
57 "groups:read",
58 "mpim:read",
59] as const;
60
61const slackManifest = (callbackUrl: string): SlackManifest => ({36const slackManifest = (callbackUrl: string): SlackManifest => ({
62 display_information: { name: "Executor" },37 display_information: { name: "Executor" },
63 oauth_config: {38 oauth_config: {
packages/react/src/lib/slack-mcp-oauth.ts+32−0
@@ -0,0 +1,32 @@
1/** User scopes approved on Executor's Slack MCP OAuth app and embedded in the
2 * BYO-app creation manifest. Cloud uses the same list as its first-party
3 * discovery cap so Slack metadata cannot expand the requested grant beyond
4 * the provider-side registration. */
5export const slackMcpUserScopes = [
6 "search:read.public",
7 "search:read.private",
8 "search:read.mpim",
9 "search:read.im",
10 "search:read.files",
11 "search:read.users",
12 "chat:write",
13 "channels:history",
14 "groups:history",
15 "mpim:history",
16 "im:history",
17 "canvases:read",
18 "canvases:write",
19 "users:read",
20 "users:read.email",
21 "reactions:write",
22 "reactions:read",
23 "emoji:read",
24 "files:read",
25 "channels:write",
26 "groups:write",
27 "im:write",
28 "mpim:write",
29 "channels:read",
30 "groups:read",
31 "mpim:read",
32] as const;