Skip to content

ref(issues): Narrow request.user in issue endpoints - #129419

Draft
gricha wants to merge 1 commit into
ref/sa-narrow-usersfrom
ref/sa-narrow-issues
Draft

gricha wants to merge 1 commit into
ref/sa-narrow-usersfrom
ref/sa-narrow-issues

Conversation

@gricha

@gricha gricha commented Oct 31, 2026

Copy link
Copy Markdown
Member

Issue endpoints (hashes, similar issues, notes, issue views, supergroups, release commits) read the caller through sentry.auth.principal; personal issue-view writes use require_user().

  • A service account can unmerge (was a 500: ServiceAccountId isn't serializable) and gets 404 editing notes it doesn't own; posting a note and saving issue views stay 403 user-required by design. Seer no longer receives a service-account id as the user. New tests cover unmerge and notes.
  • Legacy API keys get 401 instead of a 500 on starred issue views.
  • Users and agents see no change.

Left on the allowlist: issue search (convert_query_values, parse_query, validate_search_filter_permissions). Passing no user there makes assigned:my_teams resolve to an empty team list, and assigned_to_filter([]) matches every issue: an existing bug for users with no teams and API keys, which needs fixing first. Also get_create_issue_config in group_integration_details.py.

mypy allowlist: 94 → 83 files.

Issue endpoints (hashes, similar issues, notes, issue views, supergroups, release commits) read the caller through `sentry.auth.principal`; personal issue-view writes use `require_user()`.

- A service account can unmerge (was a 500: `ServiceAccountId` isn't serializable) and gets 404 editing notes it doesn't own; posting a note and saving issue views stay 403 `user-required` by design. Seer no longer receives a service-account id as the user. New tests cover unmerge and notes.
- Legacy API keys get 401 instead of a 500 on starred issue views.
- Users and agents see no change.

Left on the allowlist: issue search (`convert_query_values`, `parse_query`, `validate_search_filter_permissions`). Passing no user there makes `assigned:my_teams` resolve to an empty team list, and `assigned_to_filter([])` matches every issue: an existing bug for users with no teams and API keys, which needs fixing first. Also `get_create_issue_config` in `group_integration_details.py`.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 31, 2026
@gricha
gricha added this pull request to stack #129364 October 31, 2026 02:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant