Skip to content

fix: correct Slack identity fields for RBAC and DMs#19

Merged
houko merged 5 commits into
mainfrom
fix/slack-rbac-dm-fields
Mar 13, 2026
Merged

fix: correct Slack identity fields for RBAC and DMs#19
houko merged 5 commits into
mainfrom
fix/slack-rbac-dm-fields

Conversation

@houko

@houko houko commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • store the Slack sender user ID in message metadata
  • use sender identity metadata for Slack RBAC and per-user rate limiting
  • classify D channels as DMs and exempt them from the Slack channel allowlist

Why

Slack currently uses the channel ID everywhere, which is correct for the send path but wrong for user-based RBAC and per-user limits. It also treats Slack DMs as group messages, so dm_policy cannot apply correctly.

Upstream reference

Testing

  • cargo fmt --all --check
  • cargo check -p librefang-channels
  • cargo test -p librefang-channels test_sender_user_id_from_metadata
  • cargo test -p librefang-channels test_sender_user_id_fallback_to_platform_id
  • cargo test -p librefang-channels test_parse_slack_event_dm_detected

Closes #18

@houko
houko force-pushed the fix/slack-rbac-dm-fields branch from b0b87f7 to d9284fb Compare March 13, 2026 03:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Prevents infinite retry loops on permanent failures and guards against
concurrent connection attempts.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Resolve merge conflicts in slack.rs and whatsapp-gateway/index.js:
- slack.rs: combine PR#19 sender_user_id metadata + is_group field with
  main's app_mention was_mentioned metadata from PR#17
- index.js: keep PR#19's try/finally isConnecting guard and reconnect
  logic, add main's connStatus tracking during reconnection

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@houko
houko merged commit 4e32639 into main Mar 13, 2026
7 checks passed
@houko
houko deleted the fix/slack-rbac-dm-fields branch March 13, 2026 04:44
houko added a commit that referenced this pull request Apr 17, 2026
… key overwrite

**Hook-layer conformance (#19, #54)**: WizardPage now imports from
`lib/queries/providers` and `lib/mutations/providers` instead of
calling `api.ts` functions directly. That brings it in line with
the contract in `dashboard/AGENTS.md` — centralised staleTime,
shared query keys, and onSuccess invalidations. The direct-call
path was diverging from the rest of the dashboard on provider
cache behaviour every time the shared hooks were tuned.

**Guarded overwrite of a working key (#9)**: when the selected
provider already has `auth_status = ready` and the user types a
new key, a warning checkbox must be acknowledged before the
Connect button is enabled. Previously the wizard wrote the new
key first and then ran the test; a typo destroyed the working
credential with no recovery path (the backend only reads from
env/vault — it has no rollback). The checkbox forces explicit
consent so a mistyped key doesn't silently brick a working
install. Any edit in the input resets the confirmation so stale
approvals don't carry over to different strings.
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.

Fix Slack adapter identity fields for RBAC and DM policy

1 participant