fix(discord): gate tool targets by channel allowlist - #58450
Conversation
|
Thanks for the careful work here — the implementation is clean and the tests are good. Closing on scope rather than quality grounds. The The underlying concern (channel allowlist enforcement) is real for the live gateway adapter, and the related config-vs-env allowlist issue (#32263) is on our radar for the gateway-side auth cluster. Appreciate the continued hardening contributions — the other three in this batch (#54747, #54969, #55209) are all being merged with your authorship preserved. |
Fixes #58449.
Summary
channel_idis outsideDISCORD_ALLOWED_CHANNELSProof
DISCORD_ALLOWED_CHANNELS=11+discord_core(action=fetch_messages, channel_id=99)returns an error and does not call_discord_requestDISCORD_ALLOWED_CHANNELS=11+discord_admin_handler(action=list_channels, guild_id=111)returns an error and does not call_discord_requestDISCORD_ALLOWED_CHANNELS=*keeps guild-wide reads workingTests
TEMP=./.tmp/pytest TMP=./.tmp/pytest ./.venv/Scripts/python.exe -m pytest tests/tools/test_discord_tool.py -q-> 95 passed./.venv/Scripts/python.exe -m py_compile tools/discord_tool.py tests/tools/test_discord_tool.pygit diff --check