feat(interface): add Microsoft Teams to the Channels settings UI#608
Draft
slvnlrt wants to merge 8 commits into
Draft
feat(interface): add Microsoft Teams to the Channels settings UI#608slvnlrt wants to merge 8 commits into
slvnlrt wants to merge 8 commits into
Conversation
Add a Microsoft Teams channel adapter built on the Azure Bot Service / Bot Framework Connector protocol. Inbound: an axum webhook server (POST /api/messages) validates the Azure-signed JWT (RS256, JWKS from login.botframework.com, iss/aud/exp), parses Activities into InboundMessage, and enforces per-conversation permissions (DM allowlist with a "*" wildcard; channels open on @mention). Outbound: replies and proactive broadcasts go to the Bot Connector with an Azure AD client-credentials token, guarded by a serviceUrl SSRF allowlist (*.botframework.com / *.trafficmanager.net), with a per-conversation serviceUrl sidecar so proactive sends survive restarts. Capabilities: text and @mentions; Adaptive Cards and card buttons (interactive_elements render as Action.Submit; a click returns as MessageContent::Interaction); a typing indicator; inbound file and image attachments (MessageContent::Media, with the download bearer gated to allowlisted hosts). Config: a [messaging.teams] section (shaped like the other adapters), hot-reloadable permissions via the config watcher, and the client secret sourced from the environment. Setup guide in docs/content/docs/(messaging). Adds one dependency, jsonwebtoken (ring-based). One Teams bot per instance.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ing, doc - target.rs: Teams runs a single listener in v1, so broadcast/delivery target resolution always uses the adapter "teams" and keeps the full conversation id (colons preserved). Drop the instance-name heuristic that misread opaque ids like a DM "a:1-..." as a named instance "teams:a" and mis-routed proactive sends to a non-existent adapter. Update tests; add DM-id regressions. - watcher.rs: warn on named [[messaging.teams.instances]] during hot reload, matching cold start (named instances are not started in v1). - permissions.rs: correct the dm_allowed_users doc to match the actual compare target (the inbound activity.from.id MRI), not AAD object IDs. Note: the hot-reload "fail-open on disable" raised in review is the shared behavior of every adapter (removing config never stops a running adapter), not Teams-specific; tightening only Teams would break cross-adapter parity, so it is intentionally out of scope here.
Collapse a nested if in card_to_adaptive and annotate build_teams_adapter with #[allow(clippy::too_many_arguments)] (discrete args mirror TeamsAdapter::new). Keeps the clippy-all gate clean.
Connect, update, and remove a Teams bot from Settings -> Channels, matching the other single-instance adapters. - Frontend: a Teams credential form (App ID, Client Secret, Tenant ID), the platform catalog entry and icon, and single-instance gating. - Messaging API: create / delete / status handlers for Teams. The create handler writes the [messaging.teams] config; the config watcher (added with the adapter) starts it. Regenerates the OpenAPI TypeScript bindings. - Docs: adds the Spacebot UI tab to the Teams setup guide.
3aa699d to
3ed9334
Compare
slvnlrt
added a commit
to slvnlrt/spacebot
that referenced
this pull request
Jun 29, 2026
Mirror the fixes landed on the upstream PR branches (spacedriveapp#607/spacedriveapp#608): - target.rs: single-instance broadcast/delivery routing — the adapter is always "teams" and the full conversation id is preserved; no instance is inferred from opaque ids (a DM "a:1-..." was misread as "teams:a"). Tests updated + DM-id regressions added. - watcher.rs: warn on named [[messaging.teams.instances]] during hot reload. - permissions.rs: dm_allowed_users doc now matches the actual compare target (the inbound activity.from.id MRI). - teams.rs + api/messaging.rs: clippy cleanups (collapsible-if, too_many_arguments).
slvnlrt
added a commit
to slvnlrt/spacebot
that referenced
this pull request
Jun 29, 2026
…acklog Roadmap: add an 'Upstream delivery' block (spacedriveapp#605/spacedriveapp#607/spacedriveapp#608 + state) and a single 'Deferred / out-of-scope — tracked backlog' table (outbound/inbound reactions, select menus, streaming, multi-bot, v3 approval cards, the cross-adapter hot-reload teardown follow-up from the spacedriveapp#607 review, richer identity, facilitation). Handoff: refresh TL;DR/NEXT/branch-map for the upstreaming state (HEADs, the three PR branches).
slvnlrt
added a commit
to slvnlrt/spacebot
that referenced
this pull request
Jun 29, 2026
Plan for the Download-Teams-app-package feature (spacedriveapp#608): backend builder (manifest + Spacebot icons via image crate + zip) + endpoint + UI button + doc. Opus review applied: drop speculative permissions field, src/api.rs module decl, mandatory Query import, ZipArchive reader, &instance_dir deref, mdx-exists-on-spacedriveapp#608. Executes on pr/teams-channels-ui.
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.
What
Adds Microsoft Teams to the Channels settings UI, so a Teams bot can be connected, updated, and removed from Settings → Channels like the other single-instance adapters.
Changes
create/delete/statushandlers for Teams. The create handler writes the[messaging.teams]config; the config watcher (added with the adapter in feat(messaging): add Microsoft Teams channel adapter #607) starts it. Regenerates the OpenAPI TypeScript bindings (schema.d.ts).Verification
just gate-prpasses (969 lib tests,cargo check --all-targets, clippy, fmt, and the typegen schema diff).Notes
Note
Frontend and API handlers for Teams channel management in Settings. The UI adds a credential form (App ID, Client Secret, Tenant ID) with single-instance gating, while the backend provides create/delete/status endpoints that wire to the config and watcher. Also updates the Teams setup guide with Spacebot UI instructions.
Written by Tembo for commit 3aa699d. This will update automatically on new commits.