test(telegram): stub _is_callback_user_authorized in trigger-gating fixture

After PR #24468 made the empty-allowlist callback auth fail-closed
(and #23795 wired _is_callback_user_authorized into _should_process_message),
trigger-gating tests started failing because their fake messages from
user 111 hit the new deny-by-default path before trigger evaluation.

Force-authorize all senders in _make_adapter() so the trigger logic
under test runs.  The fail-closed behavior itself is covered by
test_telegram_callback_auth_fail_closed.py.
This commit is contained in:
Teknium 2026-05-18 22:07:43 -07:00
parent 89d32052ed
commit 8439ddc1b1

View file

@ -44,6 +44,11 @@ def _make_adapter(
adapter._pending_text_batch_tasks = {}
adapter._text_batch_delay_seconds = 0.01
adapter._mention_patterns = adapter._compile_mention_patterns()
# Trigger-gating tests don't exercise the allowlist gate (added by
# #23795 + #24468). Force-authorize all senders so the trigger logic
# under test runs. Without this, every fake message hits the new
# fail-closed auth path and gets dropped before trigger evaluation.
adapter._is_callback_user_authorized = lambda user_id, **_kw: True
return adapter