Skip to content

feat(admin): show authorized applications on user detail page#117540

Draft
souredoutlook wants to merge 1 commit into
masterfrom
feat/admin-authorized-apps-card
Draft

feat(admin): show authorized applications on user detail page#117540
souredoutlook wants to merge 1 commit into
masterfrom
feat/admin-authorized-apps-card

Conversation

@souredoutlook

Copy link
Copy Markdown
Contributor

Summary

Implements the user feedback asking to show authorized (OAuth) applications in the admin UI.

Adds an Authorized Applications panel to the gsAdmin user detail page, appearing after the Emails section — showing the same data a user sees on their own account settings page:

  • Application name
  • Homepage URL (linked)
  • Granted scopes
  • Organization scope (if limited to one org)

Changes

Backend — src/sentry/api/endpoints/api_authorizations.py

Extends GET /api-authorizations/ to accept a userId query param when the requester is in elevated (superuser) mode. Mirrors the existing pattern in /api-tokens/ (get_appropriate_user_id).

Frontend

  • New static/gsAdmin/components/users/userAuthorizedApps.tsxUserAuthorizedApps panel component
  • Updated static/gsAdmin/views/userDetails.tsx — fetches /api-authorizations/?userId=… and renders the new panel as a bottom section
  • Updated static/gsAdmin/views/userDetails.spec.tsx — adds the required mock response for /api-authorizations/

Testing

  • Added backend tests for superuser userId lookup and regression test confirming non-superusers can't view other users' authorizations
  • Existing frontend spec updated to include the new mock

View Session in Sentry

Add an Authorized Applications card to the gsAdmin user details page,
showing each OAuth app the user has granted access to (app name,
homepage URL, scopes, and org scope if limited).

Backend: extend GET /api-authorizations/ to accept a userId query
param when the requester is in elevated (superuser) mode, mirroring
the existing pattern in /api-tokens/.

Frontend: new UserAuthorizedApps component rendered as a panel section
in UserDetails alongside Customers and Emails.

Refs: https://sentry.sentry.io/issues/?project=1

Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.70% 93.70% ±0%
Typed 132,996 133,002 🟢 +6
Untyped 8,940 8,942 🔴 +2
🔍 2 new type safety issues introduced

any-typed symbols (2 new)

File Line Detail
static/gsAdmin/views/userDetails.tsx 87 authorizations (var(binding))
static/gsAdmin/views/userDetails.tsx 90 refetchAuthorizations (var(binding))

This is informational only and does not block the PR.

@getsantry

getsantry Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Jul 4, 2026
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 Scope: Frontend Automatically applied to PRs that change frontend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant