Skip to content

feat(admin): P2-1d upstream identity-provider registry console - #354

Merged
voidvec merged 1 commit into
masterfrom
feat/p2-1d-admin-providers-ui
Nov 19, 2026
Merged

voidvec merged 1 commit into
masterfrom
feat/p2-1d-admin-providers-ui

Conversation

@voidvec

@voidvec voidvec commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Purpose

P2-1 batch D (final): the admin console UI for the OIDC-in upstream registry — the management surface P2-1a's CRUD shipped without.

What lands

UpstreamProvidersPage (/admin/upstream-providers, nav "Upstream Providers", en/zh-CN):

  • Table: provider key / display name / type badge (oidc vs social for the three config-seeded legacy rows) / issuer / row-level enable toggle / edit & delete.
  • Create modal: provider_key pattern-validated in-form, credential fields, scopes default openid profile email, advanced JSON textareas (claims mapping, endpoint overrides) with local object validation so a typo gets an inline message instead of the server's 400 envelope.
  • Edit modal: key immutable (matches the server contract), empty client_secret keeps the current one (write-only semantics; the secret text never appears anywhere in the DOM — the table/e2e assert that).
  • Delete via the shared confirm dialog, wording spells the P2-1c link-survival semantics (historical links stay; re-registering the key re-attaches them).
  • Reserved-key CREATE rejection is the server's call — its catalog 400 surfaces in the error banner instead of a silent client-side guard.

Tests

6 new e2e specs over an in-memory mock that mirrors the server contract (write-only secret, reserved-key 400, 404 on unknown PUT): listing + type badges + no-secret-in-DOM, exact create request body, reserved-key error surfacing, edit keep-secret full-replace body, toggle PUT body, confirm-then-delete. Full admin e2e suite: 213 passed / 6 skipped; admin size gate OK (488.2/501.6 KB).

With this, P2-1 (OIDC-in 通用上游联邦) is fully delivered: registry + protocol (#347), real-upstream Keycloak E2E (#349), legacy-social migration onto the registry (#352), and the admin console (this PR).

- UpstreamProvidersPage: registry table (type badges: oidc vs the three
  config-seeded social rows), row enable/disable toggle, create modal
  (provider_key pattern-validated, advanced claims-mapping/endpoint-
  overrides JSON textareas with local validation), edit modal (key
  immutable, empty client_secret keeps the current one), delete with
  the shared confirm dialog spelling the link-survival semantics
- write-only secret honored end to end (no secret text anywhere in the
  DOM; reserved-key CREATE rejection surfaces the server catalog 400
  instead of a silent client-side guard)
- router + nav (Upstream Providers) + en/zh-CN i18n
- e2e: 6 specs (listing/badges/no-secret-in-DOM, exact create contract,
  reserved-key 400, edit keep-secret full-replace, toggle PUT body,
  confirm-then-delete) over an in-memory mock mirroring the server
  contract; full admin e2e suite 213 passed / 6 skipped; size gate OK
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T04:34:36.117559Z 2bbd17a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bbd17a62c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +171 to +172
claims_mapping: claims,
endpoint_overrides: overrides,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Encode cleared advanced fields as empty JSON objects

When an administrator removes an existing claims mapping or endpoint override by clearing its textarea, parseOptionalJson() produces an empty string and this PUT reports success without removing the configuration. PostgresUpstreamProviderRepository::updateRecord() only updates those columns when the supplied strings are nonempty, so the old mappings or pinned endpoints remain active and reappear after refresh. Send '{}' for cleared advanced fields on update, or otherwise explicitly implement clearing, so removing an override actually restores discovery/default claim behavior.

Useful? React with 👍 / 👎.

@voidvec
voidvec merged commit f720d5d into master Nov 19, 2026
9 checks passed
@voidvec
voidvec deleted the feat/p2-1d-admin-providers-ui branch November 19, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant