fix(telegram): honor group user allowlists - #55496
Open
itsflownium wants to merge 1 commit into
Open
Conversation
This was referenced Jun 30, 2026
teknium1
reviewed
Jul 15, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for isolating the group/forum intake short-circuit. Current main still returns directly from the adapter-level allow_from check at plugins/platforms/telegram/adapter.py:861-865, before the gateway's scoped group-user resolution at gateway/authz_mixin.py:458-566 can run.
Problems
plugins/platforms/telegram/adapter.py:693changes explicit empty-list behavior. Current main testsallow_from is not None, soallow_from: []rejects all senders at intake. The new helper returns an empty set for both a missing key and an explicit empty value, thenif adapter_allow_from:treats both as absent. Preserve configured-vs-empty state so the change remains fail-closed.
Suggested changes
- Retain allowlist-key presence separately from normalized values and add regressions for explicit empty
allow_fromand group-scoped allowlists.
Automated hermes-sweeper review.
| ) | ||
| adapter_group_allowed_chats = self._telegram_config_allowlist("group_allowed_chats") | ||
|
|
||
| if adapter_allow_from: |
Contributor
There was a problem hiding this comment.
This truthiness check collapses an explicit allow_from: [] into “no configured allowlist.” Before this PR, the is not None check rejected every sender for that explicit empty list. Preserve key presence separately and add a regression so empty lists remain fail-closed.
This was referenced Jul 20, 2026
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
Telegram intake auth checked config allow_from before the gateway auth resolver. If the owner was in allow_from, an additional supergroup user listed in TELEGRAM_GROUP_ALLOWED_USERS or group_allow_from could be rejected before the group-scoped allowlist was considered. Users also tried allowed_users / group_allowed_users in config.yaml, but those names were not bridged.
Validation
Refs #55462