Skip to content

feat: add authenticated myAssigned bounty filter#2786

Open
D3CC wants to merge 1 commit into
stakwork:masterfrom
D3CC:feat-myassigned-filter-1778930871
Open

feat: add authenticated myAssigned bounty filter#2786
D3CC wants to merge 1 commit into
stakwork:masterfrom
D3CC:feat-myassigned-filter-1778930871

Conversation

@D3CC
Copy link
Copy Markdown

@D3CC D3CC commented May 16, 2026

Summary

Implements the myAssigned bounty filter with authentication as described in #2773.

Changes

handlers/bounty.go - GetAllBounties:

  • When myAssigned=true query param is set, require authentication
  • Extracts pubkey from JWT token (x-jwt header or token query param)
  • Returns 401 Unauthorized if no valid token is provided
  • Passes the authenticated user's pubkey as assignee query param to the DB layer

db/db.go - GetAllBounties:

  • Added assignee query parameter support
  • When assignee is set, filters bounties by matching assignee column
  • Preserves all existing status/search/language/pagination filters

Testing

  • GET /gobounties/all?myAssigned=true without token → 401
  • GET /gobounties/all?myAssigned=true with valid JWT → filtered results
  • Existing query params (Open, Assigned, search, etc.) still work alongside myAssigned

Closes #2773

When /gobounties/all?myAssigned=true is requested:
- Require authentication via x-jwt header or token query param
- Extract the authenticated user's pubkey from the JWT
- Filter bounties by assignee matching the pubkey
- Preserve existing status/search/language/pagination filters

This ensures users can only see their own assigned bounties
when using the myAssigned filter.

Closes stakwork#2773
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