Skip to content

Comments

SLACK_DM_POLICY support for Slack DM access control#278

Open
cmbalaji3 wants to merge 2 commits intocloudflare:mainfrom
cmbalaji3:feat/slack-dm-policy
Open

SLACK_DM_POLICY support for Slack DM access control#278
cmbalaji3 wants to merge 2 commits intocloudflare:mainfrom
cmbalaji3:feat/slack-dm-policy

Conversation

@cmbalaji3
Copy link

Summary

Add Slack DM policy support to match existing Telegram/Discord DM policy handling in moltworker.

This introduces a new SLACK_DM_POLICY env var, passes it through to the container, and applies it in the startup config patch so Slack DM access can be configured as pairing (default) or open.

Why

Users can already configure DM policy behavior for Telegram and Discord, but Slack lacked the same control. This PR brings Slack parity and documents the new setting.

Changes

  • Startup config patch
    • Update start-openclaw.sh to apply Slack DM policy under Slack channel config.
    • Default policy is pairing.
    • For open, set Slack allowlist wildcard to permit open DM access.
  • Environment wiring
    • Add SLACK_DM_POLICY to MoltbotEnv in src/types.ts.
    • Pass SLACK_DM_POLICY through buildEnvVars() in src/gateway/env.ts.
  • Tests
    • Extend src/gateway/env.test.ts to verify SLACK_DM_POLICY passthrough.
  • Docs / config references
    • Update secret references in README.md, AGENTS.md, .dev.vars.example, and wrangler.jsonc.
    • Add Slack matrix env coverage in .github/workflows/test.yml.

Test Plan

  • npm run typecheck
  • npm test -- src/gateway/env.test.ts
  • Deploy and verify SLACK_DM_POLICY is forwarded into startup env
  • Validate startup patch writes Slack DM policy config
  • Validate runtime behavior end-to-end:
    • SLACK_DM_POLICY=pairing requires pairing flow
    • SLACK_DM_POLICY=open allows DM access without pairing

Notes

  • This change is intentionally scoped to Slack DM policy parity with existing channel DM policy support.
  • Includes docs + CI/env coverage updates so the new variable is discoverable and testable.

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.

1 participant