mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-11-10 05:53:05 +09:00
POST /api/v1/workspaces/ was gated only by @jwt_required(), so any authenticated user - including the read-only viewer role - could create a workspace, automatically become its owner, then add arbitrary members and mint workspace-scoped API keys (GHSA-r4q7-x795-vr4j, CWE-862). Add @admin_required, matching the owner/admin checks every other mutating workspace route already enforces, plus a regression test asserting viewer and developer JWTs get 403 while an admin still creates. Co-authored-by: Alex <134992700+campguyuz@users.noreply.github.com>