fix(gateway): honor SIGNAL_GROUP_ALLOWED_USERS at gateway authorization - #52240
fix(gateway): honor SIGNAL_GROUP_ALLOWED_USERS at gateway authorization#52240Que0x wants to merge 1 commit into
Conversation
Signal group messages that passed the adapter's SIGNAL_GROUP_ALLOWED_USERS filter were rejected as "Unauthorized user" unless the sender was also in SIGNAL_ALLOWED_USERS: the gateway's chat-scoped allowlist map only covered Telegram and QQBot. Add Signal to the map and match chat_id_alt (the raw group id), since Signal sets chat_id to "group:<id>".
Duplicate of #44706 — same mechanism and same file: both add |
|
Thanks — this is a sound, narrow fix for a current Signal authorization gap. Current main's chat-scoped authorization gate only maps Telegram and QQBot at The tests exercise the real #44706 overlaps this narrow fix, while #53348 carries a broader Signal-group proposal; that is a maintainer selection question, not a defect in this patch. Automated hermes-sweeper review. |
What & why
Signal group messages that passed the adapter's
SIGNAL_GROUP_ALLOWED_USERSfilter were still rejected at the gateway as "Unauthorized user" unless the
sender was also in
SIGNAL_ALLOWED_USERS. The gateway's chat-scopedallowlist map in
_is_user_authorizedonly covered Telegram and QQBot, andSignal does not set
enforces_own_access_policy, so an allowlisted group fellthrough to default-deny. This contradicts the docs, where
SIGNAL_GROUP_ALLOWED_USERS=groupId1,groupId2is documented to enable thosegroups.
Fix
Platform.SIGNAL: "SIGNAL_GROUP_ALLOWED_USERS"to the chat-scopedallowlist map — parity with Telegram's
TELEGRAM_GROUP_ALLOWED_CHATS.chat_id_alt(the raw group id) in addition tochat_id, sinceSignal sets
chat_idtogroup:<id>while the env var lists raw ids.Telegram/QQBot leave
chat_id_altNone, so their behavior is unchanged.Scope is intentionally limited to group authorization; DM pairing behavior is
untouched.
Tests
Added to
tests/gateway/test_signal.py::TestSignalAuthorization:test_signal_group_authorized_by_group_allowlist— group in the allowlistauthorizes its senders even without
SIGNAL_ALLOWED_USERS.test_signal_group_authorized_by_wildcard—*authorizes any group.test_signal_group_not_in_allowlist_denied— a group not listed is denied(no fail-open).
Results
test_signal,test_unauthorized_dm_behavior,test_telegram_group_gating,test_allowlist_startup_check,test_config_driven_access_policy,test_relay_upstream_authz): 274 passed, 1 skipped.