fix(gateway): enforce session kill HTTP scopes#58467
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e1525fb44
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR hardens the HTTP session-kill endpoint by enforcing the operator scope model already present on the WebSocket RPC path. It switches from Key changes:
Logic correctness: The No issues found that would block merging. Confidence Score: 5/5This PR is safe to merge; the scope enforcement is logically sound and the new regression tests cover all critical paths. All findings are P2 or below. The scope-method mapping is consistent with the execution branches, resolveTrustedHttpOperatorScopes correctly drops scopes for shared-secret bearer auth, and the test suite covers bearer-denial, untrusted-header rejection, and trusted-scope success for both kill paths. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/gateway/session-kill-http.ts | Replaced boolean auth helper with AuthorizedGatewayHttpRequest-returning helper; added scope enforcement gate for both admin and requester-owned kill paths using correct scope names. |
| src/gateway/session-kill-http.test.ts | Updated existing tests to supply trusted-proxy auth method and admin scope header; added four new regression tests covering bearer-auth denial and trusted-scope success on both kill branches. |
Reviews (1): Last reviewed commit: "fix(gateway): enforce session kill HTTP ..." | Re-trigger Greptile
9f781b0 to
1831f3d
Compare
Co-authored-by: Jacob Tomlinson <jtomlinson@nvidia.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
1831f3d to
6e73376
Compare
|
Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
|
It looks like this was already fixed in 54a0878 |
Summary
Changes
src/gateway/session-kill-http.tsto the hardened HTTP request-auth path that only trusts declared scopes on trusted auth surfacessessions.deletescope for local admin kills andsessions.abortscope for requester-owned killsx-openclaw-scopesheaders, and trusted-scope success cases on both branchesValidation
corepack pnpm test -- src/gateway/session-kill-http.test.tsPATH="/app/.local/bin:$PATH" corepack pnpm buildclaude -p "/review"; the command requested PR context and returned no actionable code feedbackNotes