Repository navigation
🔐 feat: Add Admin-Assigned Slack Bot Managers - #17836
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19fce38ac8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
There was a problem hiding this comment.
🔵 Needs a closer look
The revocation guarantee depends on MongoDB retries and shared write fences across ACL updates and assignments, requiring confirmation through replica-set concurrency tests that could not run in this review environment.
No open issues 🎉
What changed in this PR
Adds administrator-assigned managers for organization-installed Slack bots, separating bot assignment authority from agent-sharing permission while preserving existing assignments after access is revoked.
Changes:
- Adds tenant-scoped bot-manager grants, revision-checked updates, and transactional assignment authorization.
- Adds an administrator management dialog and limits members’ bot choices to installations they can manage.
- Extends storage, HTTP, component, and browser tests for grants, revocation, replacement, and recovery.
| File | Description |
|---|---|
packages/data-schemas/src/methods/slackWorkspace.ts |
Integrates grants, filters workspace lists, and clears grants on disconnect. |
packages/data-schemas/src/methods/slackRoute.ts |
Checks bot-management authority inside assignment transactions. |
packages/data-schemas/src/methods/slackRoute.spec.ts |
Tests grants, revocation races, replacement, pagination, and installation lifecycle. |
packages/data-schemas/src/methods/slackBotAccess.ts |
Implements tenant-scoped manager search, reads, and revision-checked writes. |
packages/data-schemas/src/admin/capabilities.ts |
Maps Slack bot resources to agent-management capability. |
packages/data-provider/src/types/channels.ts |
Adds manager types and bot-management metadata. |
packages/data-provider/src/data-service.ts |
Adds manager read, search, and update API clients. |
packages/data-provider/src/config.ts |
Adds the configurable manager limit, defaulting to 50. |
packages/data-provider/src/accessPermissions.ts |
Defines the Slack bot resource type. |
packages/api/src/middleware/share.ts |
Excludes Slack bots from generic sharing. |
packages/api/src/middleware/share.spec.ts |
Tests generic-sharing rejection for Slack bots. |
packages/api/src/channels/workspaces.spec.ts |
Tests administrator-only manager endpoints and tenant isolation. |
packages/api/src/channels/workspaceRuntime.ts |
Supplies the configured manager limit to handlers. |
packages/api/src/channels/workspaceHttp.ts |
Adds manager endpoints and permission-aware workspace responses. |
packages/api/src/channels/workspaceBindings.ts |
Requires bot-management authority for connection creation and assignment. |
packages/api/src/channels/slackDispatch.spec.ts |
Tests manager assignment, forged authority rejection, and post-revocation cleanup. |
e2e/specs/mock/scenarios/slack-workspaces.spec.ts |
Exercises manager selection, search recovery, saving, and reopening across themes. |
client/src/utils/channelErrors.ts |
Maps bot-access failures to localized guidance. |
client/src/locales/en/translation.json |
Adds manager-dialog copy and updates assignment guidance. |
client/src/components/SidePanel/Agents/WorkspaceChannel.tsx |
Gates assignment controls on bot access and explains missing permission. |
client/src/components/SidePanel/Agents/Channels.tsx |
Offers only active, manageable bots for new connections. |
client/src/components/SidePanel/Agents/__tests__/Channels.spec.tsx |
Tests hidden ungranted bots and revoked-access handling. |
client/src/components/Channels/Workspaces.tsx |
Adds the administrator’s Manage bot access entry point. |
client/src/components/Channels/BotManagers.tsx |
Implements manager selection, removal, saving, and error recovery. |
client/src/components/Channels/BotManagers.spec.tsx |
Tests dialog actions, stale saves, and read/search failures. |
api/server/routes/slack-workspaces.js |
Registers authenticated manager routes with same-origin protection for writes. |
api/server/controllers/__tests__/deleteUserResourceCoverage.spec.js |
Records existing principal cleanup as handling bot grants. |
Review effort: Balanced
|
@codex review |
|
Replica-set validation completed locally: all 45 storage cases passed using MongoMemoryReplSet. The revocation test pauses the original database write, commits manager revocation, then releases it; MongoDB retries the conflicted assignment transaction and the revoked grant is denied, leaving no route. Grant refresh, disconnect/reinstallation and tenant-isolation cases also pass. The final HTTP suite additionally verifies that an administrator retains capability-based authority when a redundant direct manager grant is removed during preflight. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
2d87f24 to
c36dd71
Compare
c36dd71 to
1789e4c
Compare
1789e4c to
cf157c1
Compare
cf157c1 to
7f298cf
Compare
7f298cf to
f337bea
Compare
f337bea to
de813e1
Compare
de813e1 to
d18355b
Compare
Summary
Agent sharing permission currently lets a member claim an unassigned destination for any organization-installed Slack bot. A connection's creator then controls replacement, rather than an administrator choosing who may manage the bot.
Administrators can now select Manage bot access on a connected workspace and grant named users management of that app/workspace installation. Those managers can assign agents and explicitly replace another manager's assignment, provided they also have permission to share the agent they choose. Managing a bot does not grant Slack credentials, installation administration, Agent access or permission to manage other managers.
How it works
slackBotresource and direct user grants. Dedicated, fresh-admin-authorized endpoints manage membership; generic sharing does not support this resource.Testing
VIEW_USERS, tenant-local candidate filtering, administrator-only grants, forged permissions, member assignment and cleanup after revocation; generic sharing remains denied.Screenshots / recordings
The bot-access dialog is new; there is no corresponding dialog on the base revision. These captures show the running application with a selected manager, before saving.
Grant bot management
Retry a failed search
A failed lookup displays an actionable error and keeps unsaved management changes in the dialog.
Risk / compatibility
Non-administrators require an explicit bot-manager grant before creating or changing assignments, including previously unclaimed destinations. Existing assignments keep running. The configurable
channels.maxBotManagersdefaults to 50 per installation. No deployment configuration changes are required.Checklist