Repository navigation
Conversation
… API tokens Co-authored-by: Plane AI <no-reply@plane.so>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is identified; the change appears ready to merge after normal checks. Pre-merge checks |
|
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
|
Closing in favor of a stacked PR on WEB-9425 against #9972's branch. Blocking PAT creation for guests doesn't fix the underlying issue — it doesn't revoke tokens guests already hold, doesn't help a member later demoted to guest, and blocks legitimate guest API use (commenting, attaching files). The real fix is capping what a PAT can actually do to the holder's role, enforced at the permission layer (the same gap this PR's own ticket, WEB-9425, called 'defense-in-depth,' not the fix for WEB-9422). Replacement PR to follow, stacked on #9972 since it shares files and the restricted-guest read-scoping it depends on. |
Summary
Creating a personal API token now requires the caller to hold a role above Guest in at least one workspace.
What changed
ApiTokenEndpoint.postreturns 403 ({"error": "You don't have the required permissions."}, same shape as the permission classes) when the caller has active workspace memberships and none of them is above Guest. This runs before any token is created.apps/api/plane/tests/contract/app/test_api_token.py.Behaviour
Verification
plane/tests/contract/app/test_api_token.pythroughdocker-compose-test.yml: all pass with the change (30 tests).ruff checkandruff format --checkpass on the touched files.X-Api-Keyon/api/v1/users/me/) and to remain listable, editable and deletable.Co-authored-by: Plane AI no-reply@plane.so
Summary by CodeRabbit