fix(commands): add requires_auth guard to Advanced/Debugging handlers#4762
Merged
Conversation
Override requires_auth() to return true in TrajectoryCommand, ScopeCommand, LoopCommand, FocusCommand, SideQuestCommand, StatusCommand, GuardrailCommand, LspCommand, CacheStatsCommand, and NotifyTestCommand. Handlers left intentionally public: HelpCommand. Also adds /trajectory and /scope entries to the COMMANDS registry (they were registered in the agent but missing from the command list). Closes #4755
90d9af5 to
578dabc
Compare
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
requires_auth() -> bool { true }override to 10 command handlers that were accessible from remote channels (Telegram, Discord, Slack) without authorization after PR fix(security): add dispatch auth guard and complete URL redaction #4751/trajectoryand/scopeentries to theCOMMANDSregistry (they were registered in the agent but absent from the command list)Handlers now guarded
LoopCommand/loopNotifyTestCommand/notify-testTrajectoryCommand/trajectoryScopeCommand/scopeStatusCommand/statusGuardrailCommand/guardrailFocusCommand/focusSideQuestCommand/sidequestLspCommand/lspCacheStatsCommand/cache-statsHelpCommandremains intentionally public.Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler— cleancargo nextest run --workspace --lib --bins— 10435/10435 passedCloses #4755