Skip to content

feat(backend): document 403 response for GET /api/tasks/{id}#198

Merged
devJaja merged 1 commit into
Epta-Node:mainfrom
DevSolex:feat/task-auth-161-v2
Jul 24, 2026
Merged

feat(backend): document 403 response for GET /api/tasks/{id}#198
devJaja merged 1 commit into
Epta-Node:mainfrom
DevSolex:feat/task-auth-161-v2

Conversation

@DevSolex

Copy link
Copy Markdown
Contributor

Summary

The ownership check for GET /api/tasks/:id and DELETE /api/tasks/:id was already implemented in the route handlers (the walletpublickey header is required and must match the task owner, returning HTTP 403 otherwise). This PR adds the missing 403 response entry to the OpenAPI JSDoc annotation for GET /api/tasks/{id} so the generated spec accurately documents the auth behaviour for API consumers.

Closes #161

What changed

backend/src/api/routes/tasks.ts — added 403 response block to the GET /api/tasks/{id} JSDoc:

403:
  description: Access denied — walletpublickey header is missing or does not match the task owner

Tests

All 34 tasks tests pass (the 8 pre-existing WebSocket stream failures in tests/e2e/stream.test.ts are unrelated to this PR and exist on main before this change):

PASS tests/tasks.test.ts
Tests: 34 passed, 34 total

Auth coverage in tests/tasks.test.ts:

Scenario Expected
GET own task with correct wallet key 200 ✅
GET task with wrong wallet key 403 ✅
GET task with missing wallet key 403 ✅
GET unknown task 404 ✅
DELETE own task (queued) 200 ✅
DELETE with wrong wallet key 403 ✅
DELETE with missing wallet key 403 ✅
DELETE non-queued task 409 ✅
DELETE unknown task 404 ✅

…d} (Epta-Node#161)

The ownership check (walletpublickey header required, must match task
owner) was already implemented in the route handler. This commit adds
the missing HTTP 403 response to the JSDoc annotation so the generated
OpenAPI spec accurately documents the auth behaviour for consumers.

Closes Epta-Node#161
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

@DevSolex is attempting to deploy a commit to the Jaja's projects Team on Vercel.

A member of the Team first needs to authorize it.

@devJaja
devJaja self-requested a review July 24, 2026 11:57

@devJaja devJaja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid Implementation @DevSolex

LGTM

@devJaja
devJaja merged commit 5ac7eda into Epta-Node:main Jul 24, 2026
6 of 7 checks 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.

[Backend] Add Authentication to GET /api/tasks/:id and DELETE /api/tasks/:id Endpoints

2 participants