Repository navigation
feat(connectors): create the Slack app from a prefilled manifest - #162
Merged
Merged
Conversation
Canopy builds a Slack app manifest (user scopes of Slack's MCP tools, no public distribution, no socket mode, org deploy or token rotation) and opens Slack's "create app from manifest" page prefilled. The connect dialog offers "Create the Slack app" with numbered steps and "Copy manifest", or "Use an existing Slack app" with the owner's client ID and secret. The scopes field starts with the same scopes. Registered apps (Slack, GitHub OAuth apps) now use one fixed redirect URL, a static page on the repository's GitHub Pages site (CANOPY_OAUTH_REDIRECT_URL overrides it). The gateway puts the way back into state: this installation's callback, or canopy://oauth/callback for the desktop app, which hands the code to Settings → Connectors over the desktop bridge. The page also offers the code to paste into the connect dialog. The gateway still checks state as before: single-use, owner-bound, short-lived, hashed as a whole.
nixuuu
marked this pull request as ready for review
November 5, 2026 10:41
nixuuu
force-pushed
the
feat/slack-app-manifest
branch
from
November 5, 2026 10:41
3ac9fc5 to
6d53649
Compare
nixuuu
added a commit
that referenced
this pull request
Nov 5, 2026
…167) The fixed sign-in redirect from #162 (`https://itsoltech.github.io/canopy/oauth/callback`) now covers every OAuth connector where it is safe, not just apps registered by hand. **Which connectors use it** - Slack and GitHub OAuth apps, as before. - Dynamic client registration (DCR) servers when their metadata advertises PKCE S256: Notion, Linear, Atlassian, custom MCP servers, and configured Microsoft 365 / Google Workspace endpoints. Their DCR registration uses `redirect_uris = [fixed URL]`, and the authorize request and token exchange send the same `redirect_uri`. **Which keep the installation's own callback** - Servers that don't advertise S256. - Existing DCR registrations, until the user reconnects. On reconnect the client is registered again, but only when the redirect or issuer changed. - Hand-registered apps saved with the installation callback. - Everything, when `CANOPY_OAUTH_REDIRECT_URL` is set to the installation's own callback. **What every connector on the fixed redirect gets:** the desktop return through `canopy://oauth/callback` and the paste-code fallback. The gateway checks state as before: single-use, owner-bound, short-lived, with the full-state hash. **Tests:** gateway integration with the fake OAuth and local MCP fixtures: - a DCR server with S256 gets the fixed redirect; - a server without S256 keeps the installation callback; - an old registration keeps working, and reconnect migrates it; - paste-code works for DCR; - the desktop state routes to the deep link. `docs/connectors.md` is updated. Copy audit (`docs/copy.md` §8): no UI text changed. **Still needs a live check:** DCR acceptance by real providers, reconnect migration, opening the desktop deep link, and paste-code.
This was referenced Nov 5, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 5, 2026
…177) After Slack sign-in, the redirect page at `itsoltech.github.io/canopy/oauth/callback` stayed on "Returning to Canopy…". It didn't open Canopy and showed no code to copy. The console said: "Executing inline script violates the following Content Security Policy directive 'script-src sha256-UQzX…'". **Cause:** `build-site.ts` hashed the minified script, but the template wraps it in indentation and a `;`. The browser hashes the exact text between the tags, so the hashes differed and the script never ran. **Fix** - The build hashes the exact inline script and style bodies of the finished page. `scripts/build-site.test.ts` checks the built page; it fails on the old code. - The page shows the code to copy right away. For the desktop app it also shows an "Open Canopy" link, because a browser may refuse to open the app without a click. The automatic return still runs first. - The "Sign-in code" field also accepts the whole redirect address, or just its query, as well as the code. The gateway checks `state` exactly as before. Copy audit (`docs/copy.md` §8): - New "Open Canopy" link. - The status after 3 s now names both ways back. - The field hint is now "Paste the code from the sign-in page, or that page's whole address." Fixes: #162
nixuuu
added a commit
that referenced
this pull request
Nov 5, 2026
Stage 5 of 7 of shared configuration across linked computers. The design is in `docs/linked-computers.md`. **What changes** - **Shared:** - connected accounts: type, name, URL, transport, all-workers/all-bots access and tool list; - their credentials and headers, encrypted with each receiver's own key; - OAuth apps (client id and secret). - **OAuth refresh:** a refresh replicates as a secret field change. A computer that holds an older refresh token defers to the newer clock. The rare "needs reconnect" race in the design is accepted. - **Identity merge:** accounts with the same type, URL and account merge and get aliases. A skill source's `credentialAccountId` maps through those aliases. - **Stays local:** - per-computer status, last use and namespace, shown as "This computer"; - worker grants, which come in stage 6; - bot grants, which stay with the bot's home. - **Notices:** conflicts and deletions show a notice with Restore. Delete keeps the encrypted credentials for the 90-day restore. Disconnect revokes access. - **Fixed OAuth redirect:** the behaviour from #162 and #167 is kept (deep link, paste-code). **Migration:** `0077_config_connectors` (`updated_at` on OAuth apps). No new proto fields. **Tests:** the connector integration suite (8 tests) covers: - an account connected on A works on B without a reconnect; - a refresh on A replicates to B, and B's older token loses; - a rename conflict, and delete with Restore; - secrets never reach history, logs or the BFF, and never cross a link with sharing off; - the source-account alias; - owner scoping; - the migration. Copy audit (`docs/copy.md` §8): - The obsolete local-only text is removed. - Delete and disconnect are worded so each says what it does.
nixuuu
added a commit
that referenced
this pull request
Nov 5, 2026
Signing in to a connector no longer ends in a misleading "This code did not work" error, and new Slack apps have MCP access turned on. **What happened** - **The dialog stayed open.** The sign-in page opened Canopy through `canopy://`, and the deep link completed the sign-in. The Connect dialog did not notice and kept asking for a code. Pasting that code (already used) showed the generic "It works once and expires after 10 minutes. Start sign-in again." - **Slack MCP access was off.** Test then failed with HTTP 400, `-32600` "App is not enabled for Slack MCP server access", because the generated Slack app manifest did not set `settings.is_mcp_enabled`, so Slack created the app with MCP access off. **Fix** - **Deep link:** when the deep link completes the sign-in, the open Connect dialog closes and the account refreshes. - **Pasting a code:** gives a specific result instead of one generic error: - "Already connected." when the code was used and the account is now connected; - separate messages for a code that was already used, an expired code, a code from another window, and text that is not a sign-in code; - provider rejections, with the redacted reason under **Show details**. - **Security:** state stays single-use, owner-bound and valid for 10 minutes. A desktop BFF restart still needs a fresh sign-in. - **Slack manifest:** gains `settings.is_mcp_enabled: true` (checked against Slack's app manifest reference). The error from an app with MCP access off has its own message: "Slack MCP access is off for this app. Turn it on in the app's settings, then test again." - **Setup docs:** the setup steps and `docs/connectors.md` explain how to turn MCP access on for an existing app. **Tests** Gateway and BFF integration with a fake OAuth provider: - a paste after the deep link completed; - a valid code; - an expired code; - a code from another window; - a malformed code; - a provider error that shows its reason; - the Slack MCP-off classification. `check:tmp`: 1353 passed, 0 failed. **Checked** in a browser with the real BFF and gateway, a fake provider and the built bounce page, including a second completion of the same sign-in. Light and dark, desktop, narrow and phone. **Copy audit (§8):** each message gives the reason and the next action; technical details stay collapsed. Fixes: #162
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Canopy installation can now connect Slack in one click. All installations share one fixed OAuth redirect URL.
One-click Slack app
api.slack.com/apps?new_app=1&manifest_json=…, prefilled with name, description, the fixed redirect URL and all 30 Slack MCP user scopes.Fixed redirect
https://itsoltech.github.io/canopy/oauth/callback, a static page built fromsite/oauth/by the new Pages workflow.statecarries the way back (<nonce>.w.<base64url callback>for web,<nonce>.dfor desktop). The gateway stores a hash of the whole state, so a foreign callback never matches.CANOPY_OAUTH_REDIRECT_URLoverrides the URL.The redirect page
http(s)target whose path is exactly/api/connectors/oauth/callback, with no credentials.Desktop
canopy://oauth/callbackreuses the existingdesktopLink()parser, accepting only known keys and a desktop state.Paste-code fallback
Tests: connectors integration covers:
redirect_uriin both OAuth steps;oauth-returnformat;Pages: enabled for the repo (GitHub Actions source). The workflow publishes the redirect page when this merges.
Copy audit (
docs/copy.md§8):