Skip to content

feat(service-accounts): Add service account list and details settings pages - #131795

Merged
skaasten merged 6 commits into
masterfrom
feat/service-accounts-settings-ui-list
Nov 19, 2026
Merged

skaasten merged 6 commits into
masterfrom
feat/service-accounts-settings-ui-list

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Adds Service Accounts page in the Org Settings Section, with a details page showing its projects and permissions.

image image

The service account API is done, but orgs have no way to see or manage their service accounts in Sentry. This is the first PR in a stack that builds the settings UI on the real API, using @marthalyndon's prototype (#131034, #131689) as the UI template. The stack is split so each PR stays small to review.

Adds Settings → Service Accounts (next to Members), gated by organizations:service-accounts. The nav item is hidden without the flag, and a layout route renders Not Found for every page under service-accounts/.

  • List (GET /service-accounts/): name, owner, permission count, project access and created date.
  • Details (GET /service-accounts/:id/): owner, permissions, project access, created date, and a read-only Resource | Access table.

Both pages show the account's ownerKind the same way: Organization, Seer automation, or Unknown when the API returns null.

Permissions use the same resources and levels as the Seer automation form, so the two never disagree: the table is built from PERMISSIONS and getPermissionLevel in seerWorkflows/automations/serviceAccountAccess.tsx, now exported. The prototype's fixed permission levels, description, creator, token count and last-activity fields aren't in the API, so they're left out.

Nothing changes for orgs without the flag.

Next in the stack: create, edit and delete, then the tokens section.

Refs ENG-9091

via automation evt_96f99ce311a0097e57d5a80fb82b61c7 · Run ID dispatch_9cc8f0b969117bd3a2195ff4f0c32807, @skaasten.

--

View Session [Sentry]

… pages

Add Settings > Service Accounts behind organizations:service-accounts, with
a list of the org's service accounts and a read-only details page. Permissions
are shown with the same resource levels the Seer automation form uses.

Refs ENG-9091
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

ENG-9091

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

No findings on the latest commit.

@skaasten
skaasten marked this pull request as ready for review November 19, 2026 18:49
@skaasten
skaasten requested review from a team as code owners November 19, 2026 18:49

@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 and found 2 potential issues.

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 1526a94. Configure here.

@skaasten
skaasten merged commit bf48166 into master Nov 19, 2026
87 checks passed
@skaasten
skaasten deleted the feat/service-accounts-settings-ui-list branch November 19, 2026 19:39
skaasten added a commit that referenced this pull request Nov 20, 2026
…ettings (#131876)

UI for creating / editing / deleting service accounts, behind feature
flag.

Service accounts attached to Seer Workflow Configs cannot be edited. 

<img width="1109" height="655" alt="image"
src="https://github.com/user-attachments/assets/8bbd18c6-5f2a-4a85-a1fd-67e56172203b"
/>

<img width="1109" height="655" alt="image"
src="https://github.com/user-attachments/assets/516a1d7f-41a0-4888-a1c6-db9e9f141ac6"
/>

----------------
Orgs can now see their service accounts in settings (#131795), but
creating, editing or deleting one still means calling the API directly.
This is the second PR in the service account settings stack, and it adds
those actions to **Settings → Service Accounts**. The UI follows
@marthalyndon's prototype (#131689), and everything stays behind
`organizations:service-accounts`.

- **New** (`service-accounts/new/`) and **Edit**
(`service-accounts/:id/edit/`) pages share one form: name, permissions,
and project access (All projects or specific projects).
- **Delete** on the details page asks for confirmation, then goes back
to the list.
- Permissions use the Seer automation form's `ServiceAccountPermissions`
picker and the same default scopes, so the two places never offer
different access. `DEFAULT_SERVICE_ACCOUNT_SCOPES` moves from
`metricAutomationForm.tsx` into `serviceAccountAccess.tsx` so both forms
share it.
- `useServiceAccountAccess` mirrors the API's checks: write actions need
`service_account:write`, and only a role with access to every project
can pick All projects. Without access, the buttons are disabled with a
tooltip.
- Accounts owned by a Seer automation (`ownerKind:
seer_workflow_config`) can't be edited or deleted here, because the
automation manages their access.
- API errors come back nested under `detail`, and the form shows them on
the matching field.

Nothing changes for orgs without the flag.

Next in the stack: the tokens section (token list, create-token dialog
that shows the secret once, revoke).

Refs ENG-9091

<!-- junior-request-attribution:start -->
via @skaasten.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!--
junior-conversation-id:agent-dispatch%3Adispatch_9cc8f0b969117bd3a2195ff4f0c32807
-->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_9cc8f0b969117bd3a2195ff4f0c32807)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_9cc8f0b969117bd3a2195ff4f0c32807/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Shaun Kaasten <[email protected]>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
skaasten added a commit that referenced this pull request Nov 23, 2026
…ngs (#132066)

<summary>
Adds UI for showing/creating/revoking service account access tokens,
gated by service-accounts feature flag.

<img width="866" height="756" alt="image"
src="https://github.com/user-attachments/assets/c3d73a57-cba3-49f1-81da-2a1fcd148953"
/>

<img width="892" height="756" alt="image"
src="https://github.com/user-attachments/assets/9b8f1572-ec3c-46d4-bea1-a28f04cb2f21"
/>

<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.

</details>
</summary>
Refs ENG-9091

<!-- junior-request-attribution:start -->
via @skaasten.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A37638c005805f15c953512fe5dd9cd22 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A37638c005805f15c953512fe5dd9cd22)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A37638c005805f15c953512fe5dd9cd22/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Shaun Kaasten <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — a5692cde Deployed Nov 19, 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.

3 participants