Skip to content

feat(service-accounts): Add token management to service account settings - #132066

Merged
skaasten merged 6 commits into
masterfrom
feat/service-accounts-token-management
Nov 23, 2026
Merged

skaasten merged 6 commits into
masterfrom
feat/service-accounts-token-management

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Adds UI for showing/creating/revoking service account access tokens, gated by service-accounts feature flag. image image
Details Service accounts can be created and edited in settings, but there was no way to give one a token, so they couldn't be used from CI or scripts yet. This PR adds token management to the service account details page, using the existing token endpoints. It's the last PR in the stack after #131795, #131876 and #132041. It's frontend only and stays behind `organizations:service-accounts`. The design follows the prototype in #131689.
  • List: an Access Tokens section shows each active token's name, a masked preview (sntrym_ plus the last 4 characters), its scopes, created date, last used and expiry. Tokens that expire within 7 days or have already expired get a tag. The section has an empty state and pagination.
  • Create: a modal asks for a name, scopes (every available scope, or a chosen subset) and an expiration. Expiration defaults to 30 days, matching the API, and can be set to never. Only scopes held by both the account and the current user are offered, because the API rejects any others. Errors from the API show on the matching field.
  • Show once: after a token is created, a second modal shows its value with a copy button and says it won't be shown again. The API returns the value only in the create response, so clicking outside the modal or pressing Escape doesn't close it. The value lives only in that modal's props.
  • Revoke: a confirm dialog names the token by its masked preview.
  • Access: creating and revoking use the same useCannotManageReason check as Edit and Delete. They're disabled for accounts owned by a Seer automation, which are read-only in settings, and for users without service_account:write. Tokens are still listed for those accounts.

getFieldErrors in serviceAccountForm.tsx now takes a list of fields, so the token form can reuse it.

Refs ENG-9091

via @skaasten.

--

View Session [Sentry]

List a service account's access tokens on its details page, create tokens
in a modal that shows the value once, and revoke them after a confirm.
Accounts owned by a Seer automation stay read-only.

Refs ENG-9091

Co-Authored-By: Shaun Kaasten <[email protected]>
@linear-code

linear-code Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

ENG-9091

ENG-9118

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 20, 2026
Use the shared capitalize helper, memoize the grantable scopes and form
defaults, and use curly quotes in the token name hint to match the rest
of the copy.

Co-Authored-By: Shaun Kaasten <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c65d7ad. Configure here.

@skaasten
skaasten merged commit 03a385a into master Nov 23, 2026
74 checks passed
@skaasten
skaasten deleted the feat/service-accounts-token-management branch November 23, 2026 16:44

This branch was successfully deployed

1 active deployment
Preview — f74b6b48 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants