Skip to content

backend: add GET single task endpoint #105

Description

@el-amin-dev

Gap

The CLI needs to fetch one task by ID for tflowctl task show. Currently no such route exists.

Path probed Result
GET /v1/workspaces/{ws}/tasks/{id} 405 Method Not Allowed (PATCH and DELETE live here)
GET /v1/tasks/{id} 404 Not Found

Proposed

Add a handler at the existing workspace-scoped path:

GET /v1/workspaces/{workspace_id}/tasks/{task_id}

Aspect Shape
Auth Same as existing PATCH/DELETE on this path: bearer token, workspace membership required
Path params workspace_id (UUID), task_id (UUID)
Response 200 TaskResponse (same shape as POST/PATCH return values)
Response 404 Task does not exist in this workspace; preserves non-disclosure for cross-tenant probes
Response 403 Caller is not a member of the workspace

Why not flat /v1/tasks/{id}

Tenancy boundary is the workspace. A flat path would either leak cross-workspace existence on 403-vs-404, or require an extra round-trip to determine ownership. Workspace-scoped path keeps RBAC at the URL level and matches the existing PATCH/DELETE convention.

Consumer

The CLI Issue #104 currently omits tflowctl task show. Once this lands, that command becomes a thin call to the new endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions