fix(mattermost): bridge allow_from config key to MATTERMOST_ALLOWED_USERS - #35531
Open
AhmetArif0 wants to merge 1 commit into
Open
fix(mattermost): bridge allow_from config key to MATTERMOST_ALLOWED_USERS#35531AhmetArif0 wants to merge 1 commit into
AhmetArif0 wants to merge 1 commit into
Conversation
…SERS _apply_yaml_config() translated require_mention, free_response_channels, and allowed_channels from config.yaml to env vars, but omitted allow_from → MATTERMOST_ALLOWED_USERS. Users who set mattermost.allow_from in config.yaml got no user filtering: the adapter read the empty env var and left access open to everyone. Fix: add allow_from → MATTERMOST_ALLOWED_USERS translation using the same list-join pattern as the sibling keys. Env var still takes precedence over YAML (guarded by not os.getenv). Parity fix — Discord received the identical allow_from bridge in PR NousResearch#35329.
tonydwb
approved these changes
May 30, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved ✅
Bridges the allow_from config key to MATTERMOST_ALLOWED_USERS environment variable for the Mattermost adapter. Small, correct, well-tested.
Reviewed by Hermes Agent
Contributor
|
Thanks — current main still needs the Mattermost Problems
Suggested changes
This is an automated hermes-sweeper review. |
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.
What does this PR do?
Root cause:
_apply_yaml_config()in the Mattermost adapter translatesconfig.yamlkeys into env vars, but it was missing theallow_from→MATTERMOST_ALLOWED_USERSmapping. Users who setmattermost.allow_from: [user1, user2]inconfig.yamlgot no user filtering — the adapter readMATTERMOST_ALLOWED_USERSas empty and left access open to all users (fail-open security issue).Fix: Add the
allow_from→MATTERMOST_ALLOWED_USERStranslation using the same list-join pattern asallowed_channels. Env var takes precedence over YAML (guarded bynot os.getenv()), matching all other keys in the function.Parity fix — Discord received the identical
allow_frombridge in PR #35329 today; Mattermost was missed.Related Issue
Parity fix — same pattern as PR #35329 (Discord
allow_frombridge).Type of Change
Changes Made
plugins/platforms/mattermost/adapter.py: add 5-lineallow_from→MATTERMOST_ALLOWED_USERSblock to_apply_yaml_config()tests/gateway/test_mattermost.py: addTestApplyYamlConfigwith 7 tests covering list, single string, env precedence, absent key, and regression for existing keysHow to Test
Checklist