Description
Several endpoints across the backend are documented or clearly intended to be privileged but have no actual role enforcement today, because no role/admin concept exists anywhere in the auth layer: UserProfileController.verifyUser() (src/user-profile/user-profile.controller.ts) is doc'd 'Admin only' but only requires JwtAuthGuard; MigrationController (src/migration/migration.controller.ts) lets any authenticated user trigger/roll back schema migrations; DisputeSagaController.assignJurors() (src/dispute/dispute-saga.controller.ts) lets any authenticated user assign arbitrary juror addresses to a dispute. JwtPayload (src/auth/jwt.strategy.ts) currently carries only { address, sub, iat, exp } — no role/permission claim at all. This spike should scope the actual design: where do roles live (issued in the JWT at login time vs. looked up server-side per request), what roles exist (e.g. admin, juror-pool-manager), and how does it interact with the wallet-signature auth flow in AuthService.
Component
Backend
Difficulty
Spike
Tasks
Acceptance Criteria
Estimated Time
2-3 days
Description
Several endpoints across the backend are documented or clearly intended to be privileged but have no actual role enforcement today, because no role/admin concept exists anywhere in the auth layer:
UserProfileController.verifyUser()(src/user-profile/user-profile.controller.ts) is doc'd 'Admin only' but only requiresJwtAuthGuard;MigrationController(src/migration/migration.controller.ts) lets any authenticated user trigger/roll back schema migrations;DisputeSagaController.assignJurors()(src/dispute/dispute-saga.controller.ts) lets any authenticated user assign arbitrary juror addresses to a dispute.JwtPayload(src/auth/jwt.strategy.ts) currently carries only{ address, sub, iat, exp }— no role/permission claim at all. This spike should scope the actual design: where do roles live (issued in the JWT at login time vs. looked up server-side per request), what roles exist (e.g.admin,juror-pool-manager), and how does it interact with the wallet-signature auth flow inAuthService.Component
Backend
Difficulty
Spike
Tasks
Acceptance Criteria
verifyUser, migration execution, and juror assignmentEstimated Time
2-3 days