Repository navigation
Conversation
Any caller could list every user's agents and read or drive any of them: the agent list was not per user, routes and the websocket looked an agent up by id alone, and the one token check, at creation, only decoded the token. The service now verifies a token's HS256 signature with the secret the dashboard service signs it with (AUTH_JWT_SECRET, defaulting to auth.conf's value as the backend does) before trusting its claims. Each agent records the user who created it. Every /agents route requires the token, the list returns the caller's agents only, and a route or websocket naming another user's agent answers as for an agent that does not exist. The frontend sends the token in the agent websocket's query, as the workflow websocket does, and the Kubernetes chart passes the secret to the service.
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9580 +/- ##
============================================
- Coverage 91.57% 91.57% -0.01%
Complexity 5158 5158
============================================
Files 1300 1300
Lines 58092 58126 +34
Branches 7615 7616 +1
============================================
+ Hits 53195 53226 +31
- Misses 2959 2962 +3
Partials 1938 1938
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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 changes were proposed in this PR?
Any user could list every user's agents and read or drive them.
GET /api/agentsreturned all agents, and the other routes and the websocket found an agent by id alone. The one token check, at creation, did not verify the token.AUTH_JWT_SECRETbefore trusting its claims. The default isauth.conf's, and the Kubernetes chart passes the value in./api/agentsroute needs the token and the list returns the caller's agents. A route or websocket naming another user's agent answers as for an unknown id.#9043 authenticates every agent request but lets any signed-in user reach any agent. This PR adds the owner check, and overlaps with it on verifying the token.
Any related issues, documentation, discussions?
Closes #5268
Agent ids stay sequential: a guessed id gets the same 404 as a missing one.
How was this PR tested?
New agent-service tests cover every route and the websocket with another user's token, no token, and forged tokens. Run in headless Chromium on a local stack, as two users with a real model. The second user sees none of the first user's agents or chat, and the owner's agent still builds and runs a workflow.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5.2)