feat: delete UI-managed providers and purge their links #1

Closed
mxm wants to merge 0 commits from mxm/feat/delete-provider into main AGit
Owner

Adds deletion of UI-managed OIDC providers.

What

  • Danger zone at the bottom of the provider editor with a red-outlined "Delete provider" button; no delete control on the provider card.
  • POST /admin/delete (provider, revision): same owner session, CSRF, 5-minute password grant and revision checks as other mutations. Returns { result: 'deleted', unlinked } and audits provider_deleted.
  • Purges identity links for the provider's issuer (links are keyed by issuer, so keeping them would let a re-added issuer silently revive old sign-ins). Links are purged before the provider row, synchronously, so a failure never leaves orphaned links.
  • Enabled providers can be deleted directly: the active entry is dropped, so the sign-in button disappears and in-flight logins/links fail at the existing final assertCurrent check. Already-issued native sessions are unchanged.
  • Confirmation: typing the display name is required when the provider is enabled or has linked accounts; otherwise a plain confirm. /admin/state now includes linkedAccounts per provider.
  • Removes the encrypted secret (secure_delete=ON) and frees a slot under the 8-provider limit. File-managed mode rejects delete.
  • Fixes the provider ID input pattern, which current browsers rejected as an invalid v-mode regex.
  • Docs and CHANGELOG updated.

Testing

  • npm test: 75/75 pass, including new registry and HTTP tests (stale revision, failed purge keeps provider, missing grant, enabled delete fails in-flight login with no session issued, other issuers' links intact, restart persistence, file mode / member rejection).
  • npm run release:check passes.
  • Manually exercised in Chromium against the real bridge routes and stores (fake native owner session, no IdP): enabled-provider delete with typed name, plain confirm for a draft, Escape cancel, password prompt after grant expiry, 390px layout.
  • Not run: the full packaged n8n 2.27.4 e2e harness.

Out of scope

  • "Discard draft" action and a ⋯ card shortcut.

🤖 Generated with Claude Code

Adds deletion of UI-managed OIDC providers. ## What - **Danger zone** at the bottom of the provider editor with a red-outlined "Delete provider" button; no delete control on the provider card. - **POST /admin/delete** (`provider`, `revision`): same owner session, CSRF, 5-minute password grant and revision checks as other mutations. Returns `{ result: 'deleted', unlinked }` and audits `provider_deleted`. - **Purges identity links** for the provider's issuer (links are keyed by issuer, so keeping them would let a re-added issuer silently revive old sign-ins). Links are purged before the provider row, synchronously, so a failure never leaves orphaned links. - **Enabled providers can be deleted directly**: the active entry is dropped, so the sign-in button disappears and in-flight logins/links fail at the existing final `assertCurrent` check. Already-issued native sessions are unchanged. - **Confirmation**: typing the display name is required when the provider is enabled or has linked accounts; otherwise a plain confirm. `/admin/state` now includes `linkedAccounts` per provider. - Removes the encrypted secret (`secure_delete=ON`) and frees a slot under the 8-provider limit. File-managed mode rejects delete. - Fixes the provider ID input `pattern`, which current browsers rejected as an invalid `v`-mode regex. - Docs and CHANGELOG updated. ## Testing - `npm test`: 75/75 pass, including new registry and HTTP tests (stale revision, failed purge keeps provider, missing grant, enabled delete fails in-flight login with no session issued, other issuers' links intact, restart persistence, file mode / member rejection). - `npm run release:check` passes. - Manually exercised in Chromium against the real bridge routes and stores (fake native owner session, no IdP): enabled-provider delete with typed name, plain confirm for a draft, Escape cancel, password prompt after grant expiry, 390px layout. - Not run: the full packaged n8n 2.27.4 e2e harness. ## Out of scope - "Discard draft" action and a `⋯` card shortcut. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add a danger-zone "Delete provider" action to the provider editor. Deletion
removes the stored configuration and encrypted secret, purges every identity
link for the provider's issuer and frees a provider slot. Enabled providers
can be deleted directly: their sign-in stops immediately and in-flight
logins/links fail at the existing final assertCurrent check.

The confirmation requires typing the display name when the provider is
enabled or has linked accounts. POST /admin/delete follows the existing
owner, CSRF, grant and revision checks; /admin/state now lists
linkedAccounts per provider.

Also fix the provider ID input pattern, which current browsers rejected as
an invalid v-mode regular expression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The danger-zone text for an enabled provider without links read as
"stops its sign-in immediately and its stored client secret". Keep the
removal sentence intact and append "Its sign-in stops immediately."

admin-browser.cjs gains a `delete` stage for the packaged n8n fixture:
typed-name confirmation, Escape cancel, owner step-up, native sign-in
button removal, unchanged native session/account and removed provider row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into main by fast-forward: main is now dc60e3a (provider deletion plus the n8n 2.39.6 adapter). Forgejo kept this PR's head at 88367bd and refused the merge with "try again later", so it is closed by hand.

Merged into `main` by fast-forward: `main` is now `dc60e3a` (provider deletion plus the n8n 2.39.6 adapter). Forgejo kept this PR's head at `88367bd` and refused the merge with "try again later", so it is closed by hand.
mxm closed this pull request 2026-10-13 15:26:31 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mxm/n8n-oidc-bridge!1
No description provided.