Repository navigation
Check node and worker ownership and require an org in the CLI - #418
Merged
Merged
Conversation
Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
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.
Node and worker routes now act only on nodes and pools that belong to the caller's organisation. This completes the ownership checks started in #416 and #417.
/v1/nodes/{node_id}route (get, log-stream, deploy-metrics, labels, delete, provisioning retry, depin-details, provisioning, provisioning-logs, ec2-console) answers 404 for a node outside the caller's org, before any work, through one_require_own_nodedependency./v1/nodes/xds-statuslists only the caller's nodes. The xDS control plane reads the repository directly and is unaffected.ownership.pygainsowns_pool_idandowns_node, used by these routes and by the worker shell and log websockets. A failed lookup, or a pool without owner fields, owns nothing.nodeandworkercommands take--org-id(orINFERIA_ORG_ID) and refuse to run without one.modelscommands are unchanged; the model cache is not per-org.Tests cover each route for another org, an empty org, "None", no org, the owning org and a system pool, plus the CLI with and without an org; the cross-org cases fail on main. Verified on a local stack through the gateway, the CLI and the dashboard's Add worker flow.