Skip to content

feat: allow all users via wildcard in Slack dm_allowed_users#499

Open
aspotton wants to merge 2 commits intospacedriveapp:mainfrom
aspotton:slack-dm-wildcard
Open

feat: allow all users via wildcard in Slack dm_allowed_users#499
aspotton wants to merge 2 commits intospacedriveapp:mainfrom
aspotton:slack-dm-wildcard

Conversation

@aspotton
Copy link
Copy Markdown

Summary

Add support for using "*" wildcard in configuration to permit any Slack user to message the agent via DM.

Changes

Code Changes

  • src/messaging/slack.rs: Check for "*" in and skip user validation when present

Documentation

  • docs/content/docs/(messaging)/slack-setup.mdx: Document wildcard feature for both UI and TOML config

Usage

TOML Config

Spacebot UI

Go to Settings → Messaging Platforms → Slack card and add to the DM Allowed Users list.

Benefits

Allows administrators to open DM access to all workspace members without maintaining a list of individual user IDs. Permission changes hot-reload within seconds - no restart needed.

Testing

  • Verified wildcard check works correctly in DM filter logic
  • Documentation updated with clear examples

Add support for using "*" in the dm_allowed_users configuration to
permit any Slack user to message the agent via DM.

Changes:
- src/messaging/slack.rs: Check for "*" wildcard in dm_allowed_users
  and skip user validation when present
- docs/content/docs/(messaging)/slack-setup.mdx: Document the wildcard
  feature in both UI and TOML config examples

This allows administrators to open DM access to all workspace members
without listing individual user IDs.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 58e45176-59b1-4eb0-8297-da1f269a4781

📥 Commits

Reviewing files that changed from the base of the PR and between b7d5dd2 and 5410967.

📒 Files selected for processing (2)
  • docs/content/docs/(messaging)/slack-setup.mdx
  • src/messaging/slack.rs

Walkthrough

The PR adds support for a wildcard (*) configuration to allow all users to send direct messages in Slack. This includes both code changes to the Slack messaging handler and documentation updates explaining the new configuration option.

Changes

Cohort / File(s) Summary
Documentation
docs/content/docs/(messaging)/slack-setup.mdx
Updated DM filtering section to document wildcard support. Added explanation that * allows all users, updated Spacebot UI instructions, and added TOML configuration examples for both allowlist and "allow all" scenarios.
Code
src/messaging/slack.rs
Modified handle_message_event to detect wildcard entry in dm_allowed_users. When * is present, sender-user membership check is bypassed by adding && !is_wildcard condition to the filtering logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • jamiepine
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main feature added: allowing all Slack users via wildcard in dm_allowed_users configuration.
Description check ✅ Passed The description provides relevant context on the wildcard feature, code changes, documentation updates, and benefits, all directly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants