Support wildcard "*" in allowFrom channel config
All checks were successful
Build Nanobot OAuth / build (push) Successful in 1m57s

Allow "*" in the allowFrom list to explicitly permit all senders,
as an alternative to the empty-list-means-allow-all behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
wylab
2026-02-13 15:11:13 +01:00
parent e1a98d68ff
commit 5a8f3f772c

View File

@@ -69,11 +69,15 @@ class BaseChannel(ABC):
True if allowed, False otherwise.
"""
allow_list = getattr(self.config, "allow_from", [])
# If no allow list, allow everyone
if not allow_list:
return True
# Wildcard allows everyone
if "*" in allow_list:
return True
sender_str = str(sender_id)
if sender_str in allow_list:
return True