Skip to content

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

Merged
gricha merged 1 commit into
ref/sa-narrow-usersfrom
ref/sa-narrow-issues
Nov 3, 2026
Merged

gricha merged 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 #129402's mypy 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, fixed in #129424. 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
@gricha
gricha removed this pull request from stack #129364 November 1, 2026 04:24
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from bbad7ce to 679945d Compare November 1, 2026 04:24
@gricha
gricha added this pull request to stack #129440 November 1, 2026 04:24
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from 679945d to 92a1184 Compare November 1, 2026 04:57
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from 92a1184 to 20e6610 Compare November 2, 2026 19:55
@sentry

sentry Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 780 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@gricha
gricha force-pushed the ref/sa-narrow-issues branch 2 times, most recently from 011288f to ae961a3 Compare November 2, 2026 20:29
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from ae961a3 to 4d4ee3f Compare November 2, 2026 20:33
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from 4d4ee3f to c225c3d Compare November 2, 2026 20:35
@gricha
gricha marked this pull request as ready for review November 2, 2026 21:02
@gricha
gricha requested review from a team as code owners November 2, 2026 21:02
@gricha
gricha requested review from azulus, cvxluo and skaasten November 2, 2026 21:12
@gricha
gricha removed this pull request from stack #129440 November 2, 2026 21:45
@gricha
gricha added this pull request to stack #129572 November 2, 2026 21:45
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from c225c3d to d99029a Compare November 2, 2026 22:08
@gricha
gricha force-pushed the ref/sa-narrow-issues branch 2 times, most recently from 07c20d1 to 19fadc6 Compare November 2, 2026 23:08
@gricha
gricha force-pushed the ref/sa-narrow-issues branch 4 times, most recently from c7cff5b to dcb6c7f Compare November 3, 2026 00:34
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from dcb6c7f to f4e7695 Compare November 3, 2026 04:03
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from f4e7695 to a6698d7 Compare November 3, 2026 04:41
@gricha
gricha removed this pull request from stack #129572 November 3, 2026 06:52
@gricha
gricha added this pull request to stack #129650 November 3, 2026 06:52
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from a6698d7 to 1773603 Compare November 3, 2026 19:53
@gricha
gricha removed this pull request from stack #129650 November 3, 2026 19:53
@gricha
gricha added this pull request to stack #129747 November 3, 2026 19:54
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from 1773603 to f8a2ee9 Compare November 3, 2026 20:09
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.
@gricha
gricha force-pushed the ref/sa-narrow-issues branch from f8a2ee9 to 81112f9 Compare November 3, 2026 20:51
@gricha
gricha merged commit da90ff3 into master Nov 3, 2026
79 of 121 checks passed
@gricha
gricha deleted the ref/sa-narrow-issues branch November 3, 2026 21:09
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.

2 participants