docs(bridges): distributed Discord app design spike - #473
Draft
lbangalosbt wants to merge 1 commit into
Draft
lbangalosbt wants to merge 1 commit into
lbangalosbt wants to merge 1 commit into
Conversation
Design and plan only — no implementation. The Discord counterpart to the distributed Slack app (in flight): a customer installs Switch's own app by clicking Add to Server, and events route to the installing tenant. Reuses the messaging-app machinery (messaging_installs, the signed single-use install state, the RLS-exempt tenant lookup) and argues only what differs from Slack: one application bot token rather than one per install, so no per-install credential and a nullable encrypted_bot_token; message events over the Gateway rather than an HTTP webhook, so no public inbound surface beyond the OAuth callback; and — because one bot token forces a single connection that multiplexes every tenant — an isolation story that rests on four guards (per-event scoping, tenant-scoped identity, no default tenant, no guild-less routing) with a test each. DMs are out of scope for the first version, dropped explicitly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Design and plan only — no implementation. The Discord counterpart to the
distributed Slack app (in flight, #435): a customer clicks Add to Server and
events route to the installing tenant, without anyone pasting a token.
Adds
docs/old/bridges/DISCORD_DISTRIBUTED_APP.md. It reuses the messaging-appmachinery (
messaging_installs, the signed single-use install state, theRLS-exempt tenant lookup) and argues only what differs from Slack:
credential;
encrypted_bot_tokenbecomes nullable.inbound surface beyond the OAuth callback; no signature/status-code layer.
the isolation story rests on four guards (per-event scoping, tenant-scoped
identity, no default tenant, no guild-less routing), each with a test.
guild_id→ nottenant-routable).
Open questions flagged in the doc: mention-only vs. full message content
(decides whether Discord app verification is needed for v1), and the Phase-2
self-serve tenant-resolution wrapper.
Intended as a review artifact in the style of #391 / #408 — close after review,
or land later via a follow-up
docs(...)PR.