fix(api): document readonly mutation scope exceptions#113119
Conversation
Add a guardrail for published mutation endpoints that still accept readonly scopes. Previously, write methods could keep readonly scopes in scope_map without any explicit marker in code, which made the policy debt hard to audit and easy to expand accidentally. Require those endpoints to carry a readonly_mutation_scope_exceptions note, and fail the invariant test when a published mutation endpoint accepts readonly scopes without that note. Co-Authored-By: OpenAI Codex <noreply@openai.com>
Backend Test FailuresFailures on
|
|
@wedamija do you mean mention in a comment that the ones that we expect to tighten up are TODO? i dont think this should actually break anything its mostly just calling out the ones that are explicitly "wrong" per the design guidelines |
I'm not saying anything in this pr is wrong, just that more places might need to be added as exceptions. Let me leave a comment on #113120 because that's where my actual concerns are |
|
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Add a guardrail for published mutation endpoints that still accept readonly scopes.
Previously, a published
POST,PUT,PATCH, orDELETEendpoint could accept a readonly scope likeorg:read,project:read, orevent:readwithout any explicit marker in code explaining why. That made the policy debt hard to audit and easy to grow accidentally.After this change, published mutation endpoints that still accept a readonly scope must carry an explicit
readonly_mutation_scope_exceptionsnote explaining the current behavior. The new test fails when a mutation endpoint accepts a readonly scope without that note.This PR does not change runtime permission behavior. It makes the remaining exceptions explicit so the later tightening PRs are easier to review and so new readonly-mutation regressions cannot land silently.
Refs getsentry/getsentry#19897