Skip to content

Check deployment ownership against the caller's org - #416

Merged
Priyanshu-u07 merged 1 commit into
mainfrom
fix/deployment-route-ownership
Oct 18, 2026
Merged

Priyanshu-u07 merged 1 commit into
mainfrom
fix/deployment-route-ownership

Conversation

@Priyanshu-u07

Copy link
Copy Markdown
Collaborator

Deployment routes now act only on deployments that belong to the caller's organisation.

  • A shared ownership rule (orchestration/ownership.py) compares a record's org with the one the gateway forwards. A missing, empty or "None" org owns nothing. Pools stored as owner_type: "user" with the org's id count as the org's; system pools belong to no org.
  • status, update, terminate, start and delete answer 404 for a deployment outside the caller's org, before any work.
  • GET /deployments lists the caller's org only; the org_id query parameter is ignored, and a caller with no org gets an empty list.
  • The worker shell and node-log check and the deployment log routes use the same rule. Older pools stored as user-typed are now reachable by their org.

Deployments stored without an org are owned by no one and are no longer reachable through the API.

Tests cover each route for another org, an empty org, "None", no org, and the owning org; the cross-org cases fail on main. Verified on a local stack through the gateway.

Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
@Priyanshu-u07
Priyanshu-u07 merged commit 04ae459 into main Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant