Repository navigation
ref(auth): Remove legacy viewer context APIs (final cleanup) - #128112
Merged
Merged
Conversation
This was referenced Oct 20, 2026
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 20, 2026 20:10
be92d63 to
93b2114
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
2 times, most recently
from
October 20, 2026 20:23
60859ce to
08f6ccc
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 20, 2026 22:04
e268834 to
f1fb280
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 20, 2026 22:06
08f6ccc to
045a13f
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
3 times, most recently
from
October 20, 2026 23:20
f9d12ce to
f3abc96
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 20, 2026 23:25
045a13f to
244303f
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 20, 2026 23:27
f3abc96 to
bd29c82
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 20, 2026 23:27
244303f to
691ffa8
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 20, 2026 23:58
bd29c82 to
0a1f6d4
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 21, 2026 04:10
691ffa8 to
34ccbc4
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 21, 2026 21:32
0a1f6d4 to
be6fc44
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 21, 2026 21:35
34ccbc4 to
88a4ed7
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 21, 2026 23:59
be6fc44 to
5deaf7c
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 22, 2026 00:01
88a4ed7 to
b910657
Compare
gricha
marked this pull request as ready for review
October 22, 2026 00:34
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 22, 2026 22:55
5deaf7c to
2ae06f5
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 22, 2026 22:55
b910657 to
1bef29c
Compare
gricha
added a commit
that referenced
this pull request
Oct 22, 2026
…28080) **1/7 — READER: Sentry. Deploy first; current GetSentry keeps working.** Use one frozen, actor-backed `ViewerContext`. Actor owns identity, delegation, and elevation. `actor.id` is an `ActorId(type, id)` named tuple; `actor.actor_id` is the scalar ID. Construction sites migrate mechanically without changing endpoint authorization policy. Read V1 and V2 into this model, while continuing to write V1. Temporarily preserve the human `user_id` accessor and the constructor/token replacement API used by current GetSentry. Legacy token input is discarded. The bridge is removed together in [Sentry cleanup #128112](#128112), after the GetSentry migration deploys. Fully deploy across web, workers, consumers, and all silos, then deploy [2/7: Seer reader #8941](getsentry/seer#8941). DB models and service-account issuance are separate work; new actor producers wait until both writer PRs deploy. --------- Co-authored-by: Codex <[email protected]>
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 22, 2026 23:31
2ae06f5 to
e2bedf4
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 22, 2026 23:31
1bef29c to
9ad527e
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 23, 2026 17:05
e2bedf4 to
0b524a6
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 23, 2026 17:05
9ad527e to
4bab5c3
Compare
gricha
force-pushed
the
feat/viewer-context-actor-cutover
branch
from
October 23, 2026 17:29
0b524a6 to
ef1f83b
Compare
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 23, 2026 17:29
4bab5c3 to
2809cd1
Compare
Contributor
Sentry Snapshot Testing
|
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
2 times, most recently
from
October 23, 2026 20:06
73d741c to
bf0be78
Compare
azulus
reviewed
Oct 23, 2026
azulus
left a comment
Member
There was a problem hiding this comment.
agent, please check for the delegated_user_id pattern and abstract appropriately, apply DRY principles
| if vc is None or vc.user_id is None: | ||
| if vc is not None: | ||
| actor = vc.actor | ||
| user_id = actor.actor_id if actor.type == ActorType.USER else actor.delegated_user_id |
Member
There was a problem hiding this comment.
should this run the other way? i.e. we shouldnt default to delegated_user_id? It feels like the default should be .actor_id unles we're in a special type that permits a delegated_user_id
| if viewer_context is not None: | ||
| actor = viewer_context.actor | ||
| actor_user_id = ( | ||
| actor.actor_id if actor.type == ActorType.USER else actor.delegated_user_id |
Member
There was a problem hiding this comment.
same case here and similar logic. This might be better as a utility function?
| if viewer_context is not None: | ||
| actor = viewer_context.actor | ||
| actor_user_id = ( | ||
| actor.actor_id if actor.type == ActorType.USER else actor.delegated_user_id |
azulus
approved these changes
Oct 23, 2026
Drop the temporary GetSentry constructor and token bridge, the human user_id accessor, and V1 wire support. Require the GetSentry caller migration and retirement of V1 work before deployment. Co-Authored-By: Codex <[email protected]>
Replace the repeated `actor_id if USER else delegated_user_id` pattern with one helper. Only agent actors resolve through delegated_user_id now; other non-user actor types return None instead of trusting a delegated id. Co-Authored-By: Jeremy Stanley <[email protected]>
gricha
force-pushed
the
ref/viewer-context-v2-only
branch
from
October 23, 2026 22:21
ac5581d to
de207a3
Compare
gricha
added a commit
that referenced
this pull request
Oct 23, 2026
Moves Sentry's ViewerContext model, contextvar and JWT encode/verify onto the shared `sentry-viewercontext` package ([getsentry/viewercontext](https://github.com/getsentry/viewercontext)), so Sentry, Seer and other services share one implementation of the wire format. `sentry.viewer_context` re-exports the library types, so call sites don't change. Sentry keeps signing-key lookup from settings, the early-adopter lookup, propagation metrics and its `set_viewer_context_*` updaters. The library's `SuperuserAccess` is a plain dataclass, so the Pydantic `sentry.types.superuser.SuperuserAccess` stays for RPC and agent tokens and is converted where it enters or leaves the ViewerContext (middleware, `ViewerContextAuthentication`, the agent token endpoint). Stacked on the cleanup PR (#128112). Locks the published `sentry-viewercontext` 0.1.0 from the internal index (getsentry/pypi#2660). --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Jeremy Stanley <[email protected]>
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.
7/7 — FINAL CLEANUP: Sentry. Deploy after Seer cleanup #8943.
Remove the temporary GetSentry constructor/token bridge and human
user_idaccessor, leaving the regular actor-backed dataclass constructor. Migrate remaining human reads to actor identity or delegation and remove V1 wire methods and serialization version arguments. Endpoint authorization policy stays the same.Stacked on Sentry writer #128111. Both writers must be fully deployed and all V1 work retired, as required by Seer cleanup.
GetSentry migration #22613 must be fully deployed, with old GetSentry web and worker processes retired, before this PR deploys. The earlier reader deliberately preserves those callers so the repositories can roll out separately.