feat(bridge): add admin impersonation functionality#63
Merged
Conversation
- Add ADMIN_USERS configuration option - Implement the !impersonate command allowing administrators to operate as other users - Resolve target users by username or user ID - Support clearing impersonations with '!impersonate clear/off/stop' - Direct sessions, !stop, and !context commands to the impersonated user's context - Add robust configuration and bridge unit tests
mrazza
approved these changes
Jun 26, 2026
mrazza
approved these changes
Jun 26, 2026
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.
This PR adds the admin impersonation feature to goose-mm-bridge.
Changes:
ADMIN_USERSparameter parsed from environment variables (comma-separated usernames or user IDs). Supports overrides via user-specific.envconfigurations.self.impersonationsin-memory dictionary.!impersonate <target>command to impersonate another user (by ID or username via automated search).!impersonate clear,!impersonate off, or!impersonate stop.!stop, and!contextactions under the context of the impersonated user's session key, user mapping, and metadata.ADMIN_USERSintest_config.py.test_mattermost_bridge.pycovering permission denial, user search/resolution, target lookup failure, bot impersonation prevention, successful impersonation session flow, stop, and context actions.Reviewer: @mrazza