Repository navigation
ref(core): Narrow request.user in org, project and team endpoints - #129416
Merged
Merged
Conversation
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 1, 2026 04:24
7bae012 to
138bfdc
Compare
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 1, 2026 04:57
138bfdc to
b98b96b
Compare
Contributor
Sentry Snapshot Testing
|
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 2, 2026 19:55
b98b96b to
d07a7d5
Compare
gricha
force-pushed
the
ref/sa-narrow-core
branch
2 times, most recently
from
November 2, 2026 20:29
dc98f14 to
1d1b750
Compare
gricha
marked this pull request as ready for review
November 2, 2026 20:57
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 2, 2026 22:08
1d1b750 to
0fc8e9b
Compare
gricha
force-pushed
the
ref/sa-narrow-core
branch
3 times, most recently
from
November 2, 2026 23:18
e8cb365 to
a097225
Compare
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 2, 2026 23:31
a097225 to
cb7cadd
Compare
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 3, 2026 00:27
cb7cadd to
483dfe6
Compare
cvxluo
approved these changes
Nov 3, 2026
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 3, 2026 19:53
483dfe6 to
4afa863
Compare
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 3, 2026 20:09
4afa863 to
2afca15
Compare
azulus
reviewed
Nov 3, 2026
azulus
left a comment
Member
There was a problem hiding this comment.
owned_by_acting_user is a name which can read as a noun (i.e. which user owns this?) I'd consider broadly naming this is_owned_by_acting_user which more clearly states that it's a truthy check and/or query filters
gricha
added a commit
that referenced
this pull request
Nov 3, 2026
…29770) Renames `owned_by_acting_user` to `is_owned_by_acting_user`, as suggested in review on #129416. The old name can read as a noun ("which user owns this?"); the new one reads as a condition. It still returns the same `Q`. This is a mechanical rename of all 40 uses in 13 files, including the `src/AGENTS.md` guidance. No behavior change. getsentry doesn't use it. The service-account stack rebases onto this once it lands.
Organization, project, team and SCIM endpoints read the caller through `sentry.auth.principal`: "my projects" and own-membership lookups use `owned_by_acting_user()`, "is this mine?" uses `is_acting_user()`, nullable actor ids use `acting_user_id()`, and org creation, the owner-only org list and username/email reads use `require_user()`. - A service account gets an empty "my projects" (`is_member:1`, project counts) instead of 403. Requesting a closed team for a member now files an access request with no requester; before, it wrote the row and then returned 403. A project PUT with `isBookmarked` saves the update and skips the bookmark, as it always did for token callers; before, it saved part of the update and then returned 403. New tests cover all three. - Token callers no longer count teamless projects or invited (null-user) members as theirs. - Users and agents see no change.
gricha
force-pushed
the
ref/sa-narrow-core
branch
from
November 3, 2026 20:51
2afca15 to
559678b
Compare
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.
Organization, project, team and SCIM endpoints read the caller through
sentry.auth.principal: "my projects" and own-membership lookups useowned_by_acting_user(), "is this mine?" usesis_acting_user(), nullable actor ids useacting_user_id(), and org creation, the owner-only org list and username/email reads userequire_user().is_member:1, project counts) instead of 403. Requesting a closed team for a member still needs a user: master now refuses a service account with 403 before writing anything (feat(auth): Base service account access on allProjects #129343). A project PUT withisBookmarkedsaves the update and skips the bookmark, as it always did for token callers; before, it saved part of the update and then returned 403. New tests cover both.Member management (member details PUT/DELETE, member invites, invite requests,
get_allowed_org_roles) is deliberately unchanged: whether a service account may manage members is still open, so it keeps getting 403user-requiredand those files stay on #129402's mypy allowlist.