Skip to content

fix(validator): enforce validator role on milestone endpoints (closes #210)#241

Merged
Petah1 merged 1 commit into
scout-off:mainfrom
marshalfleet:fix/210-enforce-validator-role
Jun 20, 2026
Merged

fix(validator): enforce validator role on milestone endpoints (closes #210)#241
Petah1 merged 1 commit into
scout-off:mainfrom
marshalfleet:fix/210-enforce-validator-role

Conversation

@marshalfleet

Copy link
Copy Markdown
Contributor

Summary

  • POST /api/validators/milestone and GET /api/validators/milestones/pending both use requireRole('validator'), rejecting any non-validator JWT with 403 before hitting the controller or IPFS layer
  • Adds missing admin-role test cases: admin JWTs now explicitly asserted to receive 403 on both endpoints (player and scout cases were already covered)

Test plan

  • returns 403 when user is an admin — POST /api/validators/milestone
  • returns 403 when user is an admin — GET /api/validators/milestones/pending
  • All 324 existing tests continue to pass (npm test)

Closes #210

@Petah1 Petah1 merged commit a373c27 into scout-off:main Jun 20, 2026
2 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.

Enforce validator role on POST /api/validators/milestone

2 participants