fix(api): document readonly mutation scope exceptions#113119
Draft
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>
Contributor
Backend Test FailuresFailures on
|
Member
Author
|
@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 |
Member
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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