Repository navigation
Replace OWNER_USER_ID with ADMIN_CHAT_IDS for admin commands - #18
Merged
Merged
Conversation
…to common and advanced One list now receives MCP-down alerts and authorizes /credits and /usage (a DM chat ID equals the user ID; group IDs are negative so they can never match a user). OWNER_USER_ID is still read with a startup warning. ENV_VARS and the README tables share one order. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
ADMIN_CHAT_IDS is the only variable now; the deprecated alias, its startup warning, its README note and its test are gone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw
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.
Consolidate admin access control by replacing the single-user
OWNER_USER_IDsetting with the existingADMIN_CHAT_IDSsetting, which already handles MCP server down-alerts. This simplifies configuration and makes admin command access consistent with alert routing.Key changes:
OWNER_USER_IDenvironment variable andSettings.owner_idfield/creditsand/usagecommand access control to checkuser.id in ctx.st.admin_chatsinstead of comparing againstowner_idADMIN_CHAT_IDSdocumentation to clarify that user IDs in the set can use admin commands (/credits,/usage) while group chat IDs only receive MCP down-alertsADMIN_CHAT_IDSinstead ofOWNER_USER_IDif st.admin_chatsinstead ofif st.owner_idwhen registering command handlersImplementation details:
admin_chatsfield already existed and was being used for alert routing; this change extends it to also gate admin commandsADMIN_CHAT_IDSnow grant both alert notifications and admin command accessADMIN_CHAT_IDScontinue to receive only alert notificationsADMIN_CHAT_IDS(default) disables both alerts and admin commands, matching previous behavior whereOWNER_USER_IDwas unsethttps://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw