Repository navigation
ref(typing): Check batched feature flags against the acting user - #129628
Merged
Merged
Conversation
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 04:03
593fc2a to
257ca85
Compare
Contributor
Sentry Snapshot Testing
|
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 04:41
257ca85 to
f78409f
Compare
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 19:53
f78409f to
5d4a6de
Compare
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 20:01
5d4a6de to
547cc8b
Compare
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 20:09
547cc8b to
d7b4491
Compare
azulus
approved these changes
Nov 3, 2026
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 20:51
d7b4491 to
8b5e30f
Compare
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 21:10
8b5e30f to
e8eab3e
Compare
cvxluo
approved these changes
Nov 3, 2026
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 3, 2026 23:19
e8eab3e to
be47279
Compare
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 4, 2026 00:44
be47279 to
3bc2cbc
Compare
The events, events-stats and trace-item-attributes endpoints pass acting_user(request.user) to features.batch_has() instead of the raw principal. Feature handlers here and in getsentry only read the actor as `actor is not None and actor.is_superuser` or through has_user(), so None and AnonymousUser behave the same and nothing changes for users or token callers. Drops the three endpoints from the request.user allowlist.
gricha
force-pushed
the
ref/sa-feature-actor
branch
from
November 4, 2026 01:15
3bc2cbc to
2360efd
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.
The events, events-stats and trace-item-attributes endpoints pass
acting_user(request.user)tofeatures.batch_has()instead of the raw principal. That drops the three endpoints from therequest.userallowlist (15 → 12).batch_has(and getsentry's handlers, which override it) type the actor asUser | RpcUser | AnonymousUser | None, so widening the manager would break getsentry's typing. Instead, the call sites resolve the caller first.Nothing changes for users or token callers. The only actor reads in the feature handlers here and in getsentry are
actor is not None and actor.is_superuser, the flagpole context'shas_user()and getsentry'sis_demo_user(actor), and all three treatNonelikeAnonymousUser. A service account becomesNone, as before throughhas_user().