Repository navigation
Conversation
…ints Reads of `request.user` in 14 API endpoints (API tokens, applications, authorizations, auth index, assistant, broadcasts, invites, project transfer, attachments, internal mail) go through `sentry.auth.principal`: - "Mine" lookups (apps, authorizations, guides, seen broadcasts) use `owned_by_acting_user()`. - Logs, analytics and the nullable Activity/Broadcast creator use `acting_user_id()`. - Personal writes and user-only reads (tokens, assistant state, invite accept, transfer, email, 2FA) use `require_user()`. Users, agents and token callers see no change. A service account gets empty personal state on reads and 403 `user-required` on personal writes; most of these endpoints are control-silo, where service accounts don't authenticate yet. The files leave the `request.user` mypy allowlist.
This branch has not been deployed
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.
Reads of
request.userin 14 API endpoints (API tokens, applications, authorizations, auth index, assistant, broadcasts, invites, project transfer, attachments, internal mail) go throughsentry.auth.principal:owned_by_acting_user().acting_user_id().require_user().Users, agents and token callers see no change. A service account gets empty personal state on reads and 403
user-requiredon personal writes; most of these endpoints are control-silo, where service accounts don't authenticate yet.The files leave the
request.usermypy allowlist.mypy allowlist: 161 → 147 files.