fix(discord): propagate role authorization to gateway auth - #34993
Closed
chrometh wants to merge 1 commit into
Closed
fix(discord): propagate role authorization to gateway auth#34993chrometh wants to merge 1 commit into
chrometh wants to merge 1 commit into
Conversation
… works end-to-end DISCORD_ALLOWED_ROLES was checked by the Discord adapter (_is_allowed_user) but gateway._is_user_authorized only read DISCORD_ALLOWED_USERS, so role-authorized users were rejected with "Unauthorized user" at the gateway layer despite passing the adapter gate. - Add role_authorized: bool = False to SessionSource - Add role_authorized param to build_source (base.py) - Compute _role_authorized in on_message when user passes via role not user ID - Thread _role_authorized through _handle_message -> build_source - Check source.role_authorized early in _is_user_authorized (run.py) Fixes NousResearch#33952
Collaborator
Contributor
|
Thanks for the focused Discord authorization fix. This is already implemented on
|
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
Test Plan
env -u HERMES_CRON_SESSION -u HERMES_CRON_AUTO_DELIVER_CHAT_ID -u HERMES_CRON_AUTO_DELIVER_PLATFORM python -m pytest -q tests/gateway/test_discord_component_auth.py tests/gateway/test_discord_slash_auth.py tests/gateway/test_discord_roles_dm_scope.py tests/gateway/test_discord_bot_auth_bypass.py tests/gateway/test_discord_channel_controls.py→ 86 passedgitleaks git --redact=100 --log-opts='origin/main..HEAD'→ 0 findings