feat/embed-admin-ui #4

Merged
nhpro merged 214 commits from feat/embed-admin-ui into master 2026-11-26 12:34:07 +01:00
Owner
No description provided.
nhpro added 214 commits 2026-11-26 12:27:46 +01:00
All types match OrionAuth backend models. Axios client with
in-memory token storage and 401 refresh token queue pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pinia auth store with in-memory token management.
Vue Router with permission-based route guards.
PrimeVue configured with Aura theme.
Minimal login page with email/password form.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Responsive sidebar with permission-filtered menu items.
Topbar with user avatar dropdown (profile, sign out).
Collapsible on mobile with overlay.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useCrud: generic CRUD operations with toast notifications.
useAppToast: typed wrapper around PrimeVue toast.
PageHeader and StatusBadge reusable components.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
List view with DataTable, pagination, rotate secret, delete confirmation.
Form view for create/edit with all client fields.
Client secret dialog with copy-to-clipboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Roles list with permission tags.
Role form with name, description, and PermissionPicker component.
PermissionPicker displays checkboxes grouped by resource.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Server-side pagination, filters by user/action/date range.
Expandable rows show metadata JSON and user agent details.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
List view with provider type/status. Form with all OIDC provider
fields: URLs, client credentials, scopes, type selector.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Read-only DataTable showing key ID, algorithm, status, dates.
Rotate key action with confirmation dialog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Four clickable stat cards (clients, roles, keys, audit events).
Recent audit logs table. All permission-gated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
User card with avatar, email verification status.
Active sessions table with revoke functionality.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Clean up HelloWorld.vue and unused assets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove deprecated baseUrl from tsconfig.
Fix DatePicker model types in AuditLogsView (Date instead of string).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configure Vite base and Vue Router history base to /ui/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
In production, UI is served on /ui and API on / of the same
domain, so API calls use relative paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Multi-stage build: node for build, nginx:alpine to serve.
Serves static files on /ui/ with SPA fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Base path changed from /ui/ to /admin/
- Auth flow: OAuth2 Authorization Code + PKCE (public client)
- Client ID: 00000000-0000-0000-0000-000000000002
- Redirect to /ui/authorize (Auth UI) for login
- Callback on /admin/callback exchanges code for tokens
- Remove LoginView and AuthLayout (no longer needed)
- Refresh token includes client_id (public client, no Basic Auth)
- PKCE verifier stored in sessionStorage during flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Backend wraps all responses: {"user": ...}, {"roles": [...]},
{"client": ...}, etc. Updated all API services to extract
the wrapped data. Fixed client_secret field names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Inspired by dev-oriented dashboard aesthetic:
- Dark theme: #0a0a0b bg, #7f77dd accent, JetBrains Mono + Inter
- Light theme: #f5f5f7 bg, same accents, proper contrast
- Theme toggle in topbar with localStorage persistence
- Sidebar: pulsing logo dot, monospace labels, active border accent
- Metric cards with monospace values and colored accents
- PrimeVue component overrides for consistent theming
- Removed PrimeFlex dependency for layout (custom CSS)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Backend returns JWK format (kid, alg, kty, use) not custom
admin format. Adapted type, view columns, and dashboard stat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Users list: paginated DataTable with email, name, status, verified
- User detail: info card with edit mode + UserRoleManager
- UserRoleManager: view/add/remove roles with dropdown
- API: listUsers, getUser, updateUser, deleteUser
- Sidebar: Users item with pi-users icon (users:read)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Invitations: list, create (with role pre-assignment), delete.
Status badges: pending/used/expired. Create dialog with email
and optional role multi-select.

Settings: toggle public registration on/off.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tokens stored in sessionStorage (survives refresh, cleared on tab close).
On page load, guard calls initialize() which restores session from
stored tokens by calling /api/v1/me. No re-login needed on refresh.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Session persists across tab close and browser restart.
Token expiration is handled by the refresh token flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add policies section with list view (filterable by type, toggleable
active status), form view with Rego code editor, syntax validation,
and test panel for evaluating policies with sample input.
Update logout to redirect to /end_session endpoint instead of just
clearing tokens. Add post_logout_redirect_uris field to client types
and client form.
PrimeFlex is not installed — all form layouts were broken. Convert
grid/col-12/md:col-6/flex-column/align-items-center/justify-content-end
to Tailwind grid-cols-12/col-span-*/flex-col/items-center/justify-end.
Remove token from response type options. Add backchannel_logout_uri
and backchannel_logout_session_required to client types and form.
Show auth method, subject type, JWKS URI, backchannel/frontchannel
logout URIs, and signed UserInfo algorithm in the client detail panel.
Conditional fields only appear when set.
- OAuthClient gains request_uris (RFC 7591 §2 whitelist) plus the four
  OIDC Core encryption fields (id_token + userinfo *_alg/_enc).
- CreateClientResponse gains optional client_hmac_secret (returned once
  when token_auth_method=client_secret_jwt).
- New RotateHMACSecretResponse + rotateClientHMACSecret() pointing at
  POST /api/v1/admin/clients/{id}/rotate-hmac-secret.
- APIResource gains token_format ('opaque' | 'jwt') so the form can
  toggle JWT access token emission (RFC 9068) per resource.
When a client is provisioned with token_auth_method=client_secret_jwt
the backend returns BOTH a classic client_secret and a per-client HMAC
key (RFC 7523 §2.2). The dialog now renders each in its own row with
its own copy button and the matching uppercase label so operators
don't conflate them.

Either field is optional: rotate-secret only fills client_secret,
rotate-hmac-secret only fills hmacSecret, fresh creation can carry
both.
- token_auth_method dropdown gains "Client Secret JWT (HS256)". When
  picked, the JWKS URI field stays visible but its hint clarifies the
  HMAC key is server-generated and returned only at create/rotate.
- New "Request URIs (JAR)" Chips field maps to the RFC 7591 §2
  whitelist consulted by /authorize when the RP passes
  request_uri=https://…
- New JWE block under Advanced lets ops configure four parameters
  (id_token alg/enc + userinfo alg/enc) with the SupportedJWEAlgs /
  SupportedJWEEncs the backend advertises. enc selects disable until
  alg is chosen so the form can't submit half-config — the backend
  also enforces this.
- ID token / UserInfo JWE encryption forces a JWKS URI; the needsJWKS
  computed flag keeps that field visible whenever any JWE alg or
  private_key_jwt is in play.
- ClientSecretDialog now also receives client_hmac_secret so creating
  a client_secret_jwt client shows BOTH credentials in the same modal
  with their own copy buttons.
The detail panel gains a second row "HMAC secret" (hidden, with a
refresh icon) for clients whose token_auth_method is
client_secret_jwt; the action menu gains a matching "Rotate HMAC
secret" entry. Both call clientsApi.rotateClientHMACSecret and reuse
ClientSecretDialog (now passing hmac-secret instead of secret) so the
freshly-minted key is displayed exactly once.
ResourceFormView gains a new "Access token format" Select with two
options: opaque (legacy, validates via /introspect) and jwt (RFC 9068,
validates offline against /jwks). When opaque is picked the signing
algorithm Select is disabled and labelled as unused — the column
exists in the schema but doesn't shape token issuance unless format
is jwt.

ResourcesListView gets a matching "Token format" column with a
success-coloured Tag for jwt and a neutral one for opaque, so ops can
see at a glance which resources hand out self-validating tokens.
Extends the FederationFormView with three new sections:
- OAuth/OIDC endpoints (now exposes jwks_uri for explicit JWKS override
  alongside the existing issuer/auth/token/userinfo URLs).
- Attribute mapping: per-field claim names (external_id, email,
  email_verified, name, picture) with the backend defaults pre-filled
  so an OIDC provider works out of the box; blank inputs fall back to
  the corresponding backend defaults.
- Behavior toggles: sync_on_login (refresh profile attributes on every
  login) and allow_link_confirmation (prompt for the local password
  when the social email matches an existing local account, instead of
  rejecting the login outright).

The federation types module is rewritten to mirror the new backend
schema (FederationProvider gains jwks_uri/attribute_mapper/sync_on_login/
allow_link_confirmation, with strongly-typed AttributeMapper keys); the
form skips client_secret when left blank in edit mode so the existing
sealed secret is preserved.
The form had 4 mixed sections that scattered the same task across
multiple places: redirect URIs sat next to grant types under OAuth
Flow, logout URIs hid inside Advanced, public/first-party toggles
were stuck at the bottom of OAuth Flow rather than with Identity.

New layout matches how operators actually configure a client:
- Identity (name + description + public/first-party flags)
- Endpoints (redirect, post-logout, request URIs, front/back-channel
  logout — everything URL-like in one place)
- Auth & PKCE (token_auth_method + JWKS URI + grants + scopes +
  require_pkce)
- Tokens (access/refresh/id TTLs)
- Advanced OIDC (subject_type, signed userinfo, JWE — kept collapsed
  by default; only relevant when the relying party requires it)

All bindings, validation, and conditional disables preserved
(needsJWKS still gates the JWKS URI field, JWE alg→enc dependency,
require_pkce disabled when is_public). Scopes is now marked required
to match the backend binding.
Operators creating a federation provider previously had to type
issuer URL, three endpoint URLs, scopes, and five claim-mapping
keys by hand — that's both tedious and a major source of typos
for well-known IdPs whose endpoints never change.

New providerPresets.ts ships the canonical configuration for the
top providers (Google + Microsoft Entra as OIDC discovery, GitHub
+ Discord as OAuth 2.0 with non-standard claim names, plus a
"Generic OIDC" defaults-only entry). The form now shows a
"Quick-start preset" Select at the top (creation mode only).
Selecting one hydrates type / URLs / scopes / mapper / display
name; every field stays editable so operators can adjust per
tenant. No backend persistence — presets are purely a typing
shortcut.

The default mapper continues to apply when no preset is chosen,
matching the existing onMounted behaviour. Presets bring stable
claim mappings for providers whose userinfo differs from OIDC
defaults (Discord's verified vs email_verified, GitHub's
avatar_url vs picture, etc.).
The federation backend now emits 6 actions (login_succeeded,
login_failed, account_linked, account_unlinked, user_provisioned,
link_confirm_failed). Add a Federation entry to the audit scope
segmented filter so operators can isolate social-login traffic
without grepping action_prefix manually.
New Breadcrumbs.vue + breadcrumbs prop on PageHeader (backward
compatible — list views that omit the prop stay unchanged). Wire on
all 9 form / detail views so operators always see where they sit in
the hierarchy without scanning the sidebar:

Users / Clients / Service Accounts / Roles / Resources / Policies /
Federation form & detail views; Profile and Policy Decisions get
their own contextual trail too.

Last item is the current page (non-clickable). Intermediate items
link back to the parent list, matching the natural up-navigation
admins reach for after editing.
New EmptyState.vue (icon + title + description + optional CTA button)
replaces the muted-gray "No X found" stubs that lived inside each
DataTable #empty slot. Migrate 8 list views:

- Users / OAuth Clients / Service Accounts / Roles / API Resources /
  Policies / Federation / Invitations.
- Each empty state explains what the entity is FOR, not just "none
  found", and offers a primary CTA wired to the matching create
  route (or a no-op when the user lacks the write permission).
- Search-empty states (Users, Clients) get a dedicated EmptyState
  with a "Clear search" CTA instead of being lumped with the
  truly-empty case.

Permission gating uses auth.hasPermission(<resource>:write) so
read-only operators see the explanation without a CTA they can't
exercise. Routes target the canonical *-create / -new names from
the router, matching the rest of the navigation.
The previous implementation filtered the current page client-side,
so searching for a user on page 5 of a tenant with hundreds of
users would silently return zero matches. Forward the search
string to the backend via ?q= (debounced 200 ms, page reset to
1 on each new query) and let GORM do the work.

filteredUsers stays as a computed alias of items.value so the
template diff is minimal; the server is now the single source of
truth for the displayed slice.
New BulkActionBar.vue: sticky toolbar that appears as soon as
DataTable selection is non-empty. Slots an array of typed actions
(label, icon, severity, optional confirm dialog, async run). Single
loading state at a time, Clear button to reset selection.

Integrations:

- UsersListView: assign-role + delete. Assign-role opens a Dialog
  with a Select on listRoles() and assignUserRole() per row.
  Delete uses Promise.allSettled with a recap toast ("12 deleted,
  1 failed").
- InvitationsView: bulk revoke (deleteInvitation per row).
- ClientsListView: deactivate (skips already-inactive rows) and
  delete (hard confirm). Master-detail pattern preserved by
  rebinding selected from @row-click; bulkSelection drives the
  new checkbox column.
- AuditLogsView: export-JSON and export-CSV (client-side blob
  download, no backend route needed). Single-row detail drawer
  still works via @row-click since v-model:selection is now
  multi-mode.

Permission gating: BulkActionBar is rendered only if the user has
the matching write permission (no-op otherwise).
New CommandPalette.vue is mounted once in App.vue and bound to a global
ctrl+k/cmd+k listener (esc closes). useCommandPalette composable
exposes isOpen/open/close so any component can trigger it.

Index has three sources:
- Navigation: every top-level admin route gated by its permission
  (users, clients, roles, resources, policies, federation, audit
  logs, keys, settings, profile, etc.) — "Go to X" entries.
- Actions: create CTAs for the same entities (Create OAuth client,
  Invite user, New policy, Add federation provider…).
- Remote search: as soon as the query is >= 2 chars, debounced
  250 ms, parallel calls to listUsers(?q=), listClients() and
  listRoles() — top 5 of each grouped by entity type and routed
  to the corresponding detail/edit view. Each remote source is
  gated by the matching read permission.

UI: PrimeVue Dialog, InputText with autofocus, arrow keys navigate
the cursor across groups (highlight stays in bounds when remote
results shrink), Enter activates, esc closes. Footer keyboard
legend. Shortcut label adapts to macOS vs other platforms.
SettingsView grows from a single toggle to three sections wrapped
in FormSection cards:

- Registration: keeps Public Registration toggle, adds a Select
  for the default role attached to new invitations (loaded from
  listRoles(), Save button persists it through PATCH
  /admin/settings.invitations_default_role).
- Token lifetime defaults: three InputNumber fields for the
  access / refresh / id token TTLs that should be suggested when
  creating a new OAuth client. Backed by the same generic
  settings store; existing clients are untouched.

settings.types.ts mirrors the new payloads (AppSettings reads as
strings since the backend store is key/value; UpdateSettings
takes the strongly-typed values the form provides).

Breadcrumbs added on the page (Dashboard › Settings) to match the
rest of the admin UI.
Three regressions slipped past local --noEmit checks because vue-tsc
in --build (project references) mode runs a stricter pass:

- AuditLogsView: SCOPE_PREFIXES is Record<typeof scopeFilter.value,
  string>; adding 'federation' to scopeOptions widened the options
  array but not the ref union, so the new prefix entry was rejected.
  Widen the ref union to include 'federation'.
- RoleFormView / PolicyFormView use individual ref()s (name,
  description, …), not a form object. The breadcrumb prop I added
  in the V2.A pass referenced form.name which doesn't exist —
  switch to the bare name ref so the trail still reflects the
  current edit.
Adds sortablejs-vue3 and a full CRUD UI for the registration_fields
schema:

- src/types/registrationField.types.ts mirrors the backend's
  RegistrationField shape, the 13 standard targets and the 11 field
  types as typed constants (single source of truth for the form
  selects).
- src/api/registrationFields.api.ts wraps the 6 backend endpoints
  (list, get, create, update, delete, reorder).
- RegistrationFieldsListView: full-width row grid with a drag-handle
  column, key/label/kind/type tags, applies-to chips, an inline
  enabled toggle and per-row edit/delete actions. Drag-drop fires a
  reorder PATCH; failures roll back to the server state.
- RegistrationFieldFormView: pages-not-modal pattern. Five sections —
  Identity (key+label+description+placeholder), Behaviour
  (kind+applies_to+required+enabled), Standard target (shown only
  when kind=standard, auto-suggests the default type on pick), Type
  (with conditional Options editor for select/multiselect/radio,
  min/max for text/textarea/number, regex pattern for text/textarea).
  field_key is disabled in edit mode (matches the backend
  immutability rule).
- Router gets 3 routes under /registration-fields gated by
  users:write; AppSidebar surfaces the entry in the Identity
  section, next to Invitations.
The list view bound the ToggleSwitch with v-model AND called
toggleEnabled(field) which captured the post-mutation value as
'previous' then flipped it again, causing the PATCH to send the
original value back. Reload showed the toggle never moved.

Switch to @update:modelValue receiving the new boolean directly,
persist it as-is, and only roll back to !newValue on error.
Installs shadcn-vue (new-york style) and its ecosystem (Reka UI, Lucide,
Sonner, TanStack Table, vee-validate, zod, cva, clsx, tw-animate-css)
without removing PrimeVue. Both libraries co-exist while views migrate.

Bridges shadcn's semantic tokens (--color-background, --color-primary,
--color-accent, --color-destructive, --color-ring, --color-sidebar-*,
etc.) onto the existing orion OKLch tokens via the @theme block in
app.css. Adds @custom-variant dark to honour our [data-theme="dark"]
selector so shadcn's dark: utilities work seamlessly.

Renames the brand-accent Tailwind utilities to primary-* across 9
files: shadcn-vue reserves --color-accent for hover/muted backgrounds,
while our brand purple maps to --color-primary. Raw var(--accent*) CSS
references are untouched; only Tailwind classes (bg-accent, text-accent,
border-accent, fill-accent, stroke-accent, from-accent, to-accent-lo,
bg-accent-bg, text-accent-fg, border-accent-bg) are renamed.

Adds tsconfig.json paths so the shadcn-vue CLI can resolve @/* aliases.
Mechanical 1-for-1 swaps where APIs are compatible, structural rewrites
where they diverge:

- ToggleSwitch → Switch (9 files): inputId/input-id renamed to id.
- Textarea → Textarea (5 files): autoResize dropped (use field-sizing-content
  Tailwind utility instead, supported in Chrome/Edge/Safari).
- Divider → Separator (3 instances in FederationFormView): the labeled-line
  variant is rebuilt with a flex container since shadcn Separator has no
  label slot.
- Avatar → Avatar (ProfileView): rewritten with explicit AvatarFallback.
- Message → Alert (6 files): severities mapped (error→destructive,
  success→success, info→info, warn→warning). Alert variants extended with
  success/warning/info, all bridged to orion --color-*-bg tokens.
- Tag → Badge (11 files, ~26 instances): value/severity props converted to
  slot content + variant. Badge base style rewritten as mono+sm+11px to
  match the previous .p-tag override; success/warning/info variants added.
- Card → Card (9 files): #title slot becomes CardHeader+CardTitle,
  #content becomes CardContent. The ClientResourcePermissions scoped
  override is rewired from .p-card-body to the new data-slot selectors.

PrimeVue Button/InputText/Select/MultiSelect/Checkbox/InputNumber/DataTable/
Dialog/Menu/Toast/Confirm remain in place — they ship in subsequent waves.
Build (vue-tsc -b + vite build) passes.
Same v-model + id + placeholder API, so a one-line sed across all
files that imported it. Build passes.
26 files, 72 invocations. Rather than rewrite each call site individually
(label/icon/severity/text/outlined/rounded/loading/size props differ from
shadcn's slot+variant API), the shadcn Button component is extended with
PrimeVue-compatible optional props that map internally:

- label → slot text
- icon  → leading <i :class="icon"> (loops back to Lucide in S7)
- severity (danger/secondary/success/info/warn/help/contrast) → variant
- text → variant="ghost"
- outlined → variant="outline"
- rounded → class="rounded-full"
- size="small"/"large" → "sm"/"lg"
- loading → disabled + leading spinner
- icon-only call sites collapse to size="icon"/"icon-sm"

Button variants extended with success/warning/info to back the severity
bridge (and they are useful on their own).

The compat props are explicitly documented as temporary — they will be
removed in S8 alongside PrimeVue, once each touched view migrates to
native shadcn usage (slot + variant only).

Type fix: ServiceAccountsListView click handler needed explicit MouseEvent
type now that the Button no longer types its emit signature loosely.
S2 follows the same import-only pattern as S1 Button: each PrimeVue
form control gets a shadcn-vue equivalent under src/components/ui/*
that accepts the PrimeVue API surface and translates internally.

- Select (11 files): extended Select.vue so that when `options` is passed,
  it renders the full compositional chain (Trigger/Value/Content/Item)
  internally; without `options` it passes through to native Reka SelectRoot.
- MultiSelect (3 files, 4 instances): new wrapper at
  src/components/ui/multi-select/ — Popover + Checkbox list with chip or
  comma display, drives a string[] v-model.
- Checkbox (3 files): extended Checkbox.vue to honour PrimeVue's group
  pattern (`v-model="array" :value="x"` → toggles membership) alongside
  the standard binary mode. `:binary="true"` becomes a no-op.
- InputNumber (6 instances across 6 files): new thin wrapper around
  shadcn Input type="number" that emits `number | null`.
- Chips (4 instances across 2 files): new TagsInput-style wrapper
  (badge chips inside a focusable container, Enter/comma to commit,
  Backspace to pop the last). Honours array v-model + placeholder.

Type fixes:
- FederationFormView preset Select handler widened from `(v: string)` to
  `(v: unknown)` since Reka emits `AcceptableValue`.
- Chips ariaRequired narrowed to "true"|"false"|boolean to satisfy
  HTMLAttributes.

All compat-mode props are tagged "Removed in S8" so they get pruned
when call sites migrate to native shadcn usage.
- useAppToast (23 call sites): public API preserved (success/error/warn/info
  with summary + optional detail), implementation now wraps vue-sonner.
- useConfirm (11 call sites): new composable in src/composables/useConfirm.ts
  that exposes the PrimeVue-shape `require({ header, message, icon, acceptLabel,
  rejectLabel, acceptClass, accept, reject })`. acceptClass containing "danger"
  / "destructive" maps to the destructive button variant.
- ConfirmHost.vue: global singleton AlertDialog wired in AdminLayout, driven
  by the module-level pendingConfirm ref. Handles async accept (busy state,
  closes on resolve) and ESC/click-outside cancel.
- AdminLayout: <Toast>/<ConfirmDialog> PrimeVue removed; <Toaster> Sonner
  and <ConfirmHost> mounted in their place.
- Menu → DropdownMenu (4 files): inline declarative per-row pattern replaces
  the imperative `ref().toggle(event)` + global :model approach. AppTopbar
  user menu, ServiceAccountsListView and UsersListView per-row ellipsis
  menus, ClientsListView detail-panel ellipsis menu — all rewritten as
  <DropdownMenu><DropdownMenuTrigger as-child>…</…><DropdownMenuContent>…
  </…></DropdownMenu>. Per-row data lives in the slot scope so there is no
  more selectedAction/menuItems plumbing.
- useConfirm `accept` callback typed as `() => unknown | Promise<unknown>`
  so existing handlers that return Promise<boolean> (useCrud.deleteItem) keep
  compiling.

main.ts still wires PrimeVue's ToastService/ConfirmationService — required
by remaining PrimeVue Dialog/DataTable instances until S5/S4/S8.
Introduces src/components/ui/data-table/DataTable.vue — a thin generic
wrapper around @tanstack/vue-table v8 that exposes a shadcn-styled table
with the same surface as the existing PrimeVue DataTable call sites:

- :columns is now an explicit ColumnDef<T>[] (TanStack idiom).
- :data, :loading, :total, :page, :per-page, :lazy props.
- v-model:selection — augmented checkbox column appears when bound,
  selection state mirrored both ways via getRowId for stable diffs.
- @page-change emits { page, perPage } (1-based) and @sort-change emits
  { field, order } when lazy; client-side mode uses TanStack's internal
  pagination + sorted row model.
- @row-click + :row-class hooks for clickable rows.
- Cell rendering: slot-based per column via #cell-<id> (e.g. #cell-status,
  #cell-created_at) — keeps Vue templates in views instead of forcing h()
  in the ColumnDef.
- Header buttons render sort affordance (ArrowUp/Down/UpDown) via Lucide.
- Built-in pagination footer with Prev/Next; hidePaginator opt-out for
  small embedded tables.

Migrated 12 views off PrimeVue DataTable/Column:
- Client-side: KeysView, ProfileView (sessions), FederationListView,
  RolesListView, PoliciesListView, PolicyDecisionsView (recent denies).
- Lazy server-side: ResourcesListView, AuditLogsView, InvitationsView,
  ServiceAccountsListView, ClientsListView, UsersListView.

Per-row DropdownMenu actions from S3 stay inline (slot scope).
The selection-column-permission gating that used <Column v-if=…> at the
PrimeVue level is dropped: BulkActionBar already gates the actions
themselves; the checkbox column is always rendered when v-model:selection
is bound. Inline ternary on v-model is not supported by the Vue compiler.

AuditLogsView row-click handler is preserved via @row-click. ClientsListView
detail panel still drives `selected` via @row-click — same UX.

Build (vue-tsc -b + vite build) passes. The 388 KB column-XXX.js chunk
that PrimeVue DataTable pulled in is gone from the bundle.
Each call site converted from the PrimeVue \`v-model:visible / :header /
:modal / :style={width}\` shape to the shadcn compositional structure:
<Dialog v-model:open><DialogContent class="sm:max-w-[…]">
  <DialogHeader><DialogTitle>…</DialogTitle></DialogHeader>
  …body…
  <DialogFooter>…</DialogFooter>
</DialogContent></Dialog>

Migrated:
- ClientSecretDialog: open emits update:visible upstream (parent API
  unchanged); maps onOpenChange → emit('update:visible', next).
- PolicyDecisionsView: replay-result dialog (640px).
- UsersListView: role-assign dialog (420px) with DialogFooter for the
  Cancel/Assign buttons.
- InvitationsView: invite-user dialog (460px) with embedded MultiSelect.
- CommandPalette: full-width compact palette, DialogContent gets
  show-close=false and a sr-only DialogTitle for a11y; padding zeroed
  via class="p-0 gap-0" since the palette draws its own borders.

Also drops the last stray PrimeVue import in CallbackView.vue:
ProgressSpinner → lucide-vue-next Loader2 with animate-spin.

main.ts still wires PrimeVue / ToastService / ConfirmationService — these
plugin registrations are no-ops now that no PrimeVue component remains
in the runtime; they're cleaned in S8 alongside the package.json drop.
Introduces src/composables/useZodForm.ts — a minimal, opinionated form
helper that holds reactive values, validates on submit against a zod
schema and exposes per-field errors. It is deliberately lighter than a
full vee-validate setup: no per-field reactive validation, no
compositional Form/FormField context — just enough to declarative-ify
the existing manual ref + handler pattern in our form views.

API:
  const form = useZodForm(schema, initial)
  // form.values     reactive proxy over schema-shaped state
  // form.errors     { [field]: message } after .validate()
  // form.submitError reactive string|null for server-side errors
  // form.submitting reactive bool, toggled by handleSubmit wrapper
  // form.handleSubmit(cb) → submit handler that parses, sets errors,
  //                          and only calls cb(parsedData) on success
  // form.reset(partial?)  / form.setSubmitError / form.clearErrors

The existing common/FormField wrapper already exposed an `:error` prop;
we just had to start passing it.

Migrated 3 forms as the proof:
- RoleFormView: name required, description bounded, permission ids as
  string arrays. handleSubmit awaits permission writes in sequence.
- ResourceFormView: name + identifier required, token_format enum,
  TTL range. Permission CRUD below the form stays manual.
- ServiceAccountFormView: superset of the above + a refine() rule that
  requires jwks_uri when token_auth_method === 'private_key_jwt'.
  Server-side errors (extractApiError) flow into form.submitError.

Pattern docs are inlined in the composable.

Deferred to fast-follow (same composable, larger forms):
- RegistrationFieldFormView (dynamic fields, options editor).
- FederationFormView (preset application + attribute mapper).
- ClientFormView (~470 lines, many conditional sections).
- PolicyFormView (~830 lines, Rego editor + test runner).
Introduces src/components/common/Icon.vue — a single mapping component
that translates the PrimeIcon names this codebase accumulated into
Lucide components. Lets us drop primeicons.css in S8 without rewriting
every existing call site.

Accepts three name shapes:
- <Icon name="pencil" />
- <Icon name="pi-pencil" />        leading "pi-" tolerated
- <Icon name="pi pi-pencil" />     full class string tolerated

51 PrimeIcon → Lucide entries (pencil → Pencil, trash → Trash2,
ellipsis-v → MoreVertical, sign-out → LogOut, etc.). Spinner names
containing "pi-spin" auto-apply animate-spin. Unknown names fall back
to a Square placeholder + dev-console warn.

Migration scope:
- 31 inline <i class="pi pi-X"> usages across 11 files swapped via
  a perl one-shot to <Icon name="X" />.
- 7 dynamic <i :class="…"> patterns (BulkActionBar select indicator,
  FormSection chevron, EmptyState/CommandPalette/AppMenuItem
  pass-through icon props, AppTopbar theme toggle, ClientsListView
  conditional ban/check) rewritten to <Icon :name="…">.
- Button.vue compat layer now renders the icon and spinner through
  <Icon> too, so every Button call site with icon="pi pi-X" keeps
  working — the prop is just routed through the bridge.
- Icon import added to all touched files.

Net effect: no production code references primeicons.css classes
anymore. The only remaining import (main.ts) becomes dead and is
dropped in S8.

Bundle: new Icon-XXX.js chunk is 147 KB (gzip 56 KB) — all 51 Lucide
glyphs eagerly imported because the mapping is runtime. Acceptable
for an admin UI; can be split later via dynamic import per icon if
needed.
Now that S1-S7 fully migrated every PrimeVue component, theme override,
icon class and composable to shadcn-vue equivalents, the PrimeVue stack
is dead weight in node_modules. This commit:

- Removes the PrimeVue plugin registration, ToastService and
  ConfirmationService from main.ts. No call site used them anymore.
- Removes the primeicons.css import — the Icon bridge component
  (S7) translates every "pi pi-X" name to a Lucide component, so the
  stylesheet has nothing left to style.
- Deletes src/styles/primevue-preset.ts (305-line Aura customisation
  for components that no longer exist).
- Replaces the .p-datatable / .p-button / .p-tag CSS overrides in
  app.css with equivalent rules targeting shadcn's data-slot
  attributes ([data-slot="table-head"] / [data-slot="table-cell"])
  so DataTable headers keep the console-style mono caps + 18 px
  padding from the PrimeVue era.
- Drops primevue, @primevue/themes and primeicons from package.json
  (npm uninstall — verified `npm ls` is empty for all three).

Build (vue-tsc -b + vite build) passes. `dist/` is 1.6 MB total.

Migration complete: 11 commits, every UI surface now runs on
shadcn-vue + Reka UI primitives + Tailwind v4 + Lucide icons, with
the same OKLch design tokens we started from.
Closes the S6 fast-follow list. Each form now declares a zod schema and
surfaces per-field errors via the existing common/FormField `:error` slot.

- RegistrationFieldFormView: full useZodForm migration. Schema enforces
  field_key regex (^[a-z][a-z0-9_]{0,63}$), kind=standard requires a
  standard_target, select/multiselect/radio types require non-empty
  options, applies_to non-empty.
- FederationFormView: full useZodForm migration. Schema validates name
  + client_id required; provider.type cast to the OIDC|OAuth2 literal
  union when applying presets / loading edits. Preserves the prunedMapper
  helper for trimming empty attribute_mapper entries before POST.
- ClientFormView: full useZodForm migration over the 27-field
  CreateClientRequest shape. Schema enforces name + ≥1 redirect URI
  + ≥1 grant type + ≥1 scope, TTL bounds (60s..30d), and URL format on
  redirect_uris. Server-side errors route through form.setSubmitError.
- PolicyFormView: lighter touch — the existing standalone refs are kept
  (the Rego editor + test runner reach into them directly, and a full
  reactive-object refactor would require touching ~80 spots without
  buying much). Adds a submitSchema + errors reactive map applied on
  submit; only the Name field surfaces an error since rego/priority are
  implicitly validated by the validate/test sub-flows.

All 7 form views now run through zod schemas. The compat-mode props
on Button/Select/MultiSelect/Checkbox/InputNumber/Chips are intentionally
kept (no PrimeVue dep behind them; just thin wrappers that ease the
existing call sites) — removing them would require touching every
icon=/label=/severity= site, with no functional gain.
D1+D2 of the compat-shim cleanup:

- Installed shadcn-vue's tags-input + number-field via the CLI (12 new
  files in src/components/ui/*); not yet wired in any call site, that
  happens in D6.
- BulkActionBar.vue: interface field `severity?` (PrimeVue vocab)
  renamed to `variant?` with shadcn values (default|secondary|destructive|
  ghost|outline|success|warning|info). Internal Button render switched
  from `:label :icon :severity` props to slot+variant idiom. The confirm
  hook now passes `'destructive'` instead of `'p-button-danger'` —
  ConfirmHost already matches on substring "destructive".
- EmptyState.vue: same slot+variant treatment. cta-label/cta-icon props
  stay (consumer surface) but the internal Button no longer uses compat
  props.
- 3 consumers updated: InvitationsView, ClientsListView, UsersListView
  bulk-delete actions now pass variant: 'destructive' instead of
  severity: 'danger'.

This isolates the Button compat removal (D5) from BulkActionBar/EmptyState
—they're already on the native API.
D3 of the compat cleanup. Checkbox.vue reverts to the upstream shadcn-vue
new-york definition (CheckboxRootProps + class). The PrimeVue-flavoured
extras (binary no-op, inputId rename, value/group-mode array v-model)
are gone.

- PermissionPicker.vue: dropped :binary="true", renamed :inputId → :id
  to feed the HTML id attribute directly. v-model handling already lived
  in the script's toggle(id) helper, untouched.
- ClientResourcePermissions.vue: dropped :binary, no inputId to rename.
- RoleFormView.vue: the group-mode shorthand
  `v-model="form.values.resourcePermissionIds" :value="perm.id"` is
  expanded to the explicit pattern:
  `:model-value="ids.includes(perm.id)"` + an `@update:model-value`
  handler that pushes/filters the perm id in place. Verbose at the
  call site but no hidden state.
Every Select usage now follows the upstream shadcn-vue compositional
shape:
  <Select v-model="x">
    <SelectTrigger><SelectValue placeholder="…" /></SelectTrigger>
    <SelectContent>
      <SelectItem v-for="opt in OPTS" :key="opt.value" :value="opt.value">
        {{ opt.label }}
      </SelectItem>
    </SelectContent>
  </Select>

The audit underestimated this — there were 13 Select :options call sites,
not 3. Migrated:
- ServiceAccountFormView (token auth method)
- SettingsView (default role)
- PolicyFormView (policy type)
- PoliciesListView (filter by type — value=undefined items omitted)
- PolicyDecisionsView (window selector — string-bridged because Reka
  SelectRoot only accepts string modelValue)
- FederationFormView (preset, provider type)
- RegistrationFieldFormView ×3 (kind, target, type)
- ResourceFormView ×2 (token format, signing alg)
- UsersListView (role assign dialog)
- ClientFormView ×5 (token_auth_method, subject_type, userinfo_signed,
  jweAlg ×2, jweEnc ×2 — inline arrays expanded to SelectItem literals)
- UserRoleManager (selectedRoleId)

Select.vue reverts to the upstream 19-line SelectRoot passthrough.
Button.vue reverts to the upstream new-york shadcn definition: variant,
size, class, as, asChild. The PrimeVue-flavoured props (label, icon,
iconPos, severity, text, outlined, rounded, loading) are gone.

Migration applied by a perl pass over every <Button .../> self-closing
block in src/views and src/components/* (excluding src/components/ui):

- severity="X" → variant remap (secondary/success/info/warn/danger →
  shadcn equivalents incl. destructive/warning, primary/help/contrast
  collapse to default/secondary).
- text → variant="ghost". When paired with severity, severity becomes
  a text-* class on a ghost variant (e.g. "text-destructive
  hover:text-destructive" for icon-only delete buttons).
- outlined → variant="outline".
- rounded → class="rounded-full" merged with any existing class.
- size="small"/"large"/"normal" → "sm"/"lg"/default.
- Static label="X" → slot text.
- Static icon="pi pi-Y" → <Icon name="pi pi-Y" /> as first slot child
  (the Icon bridge normalises pi pi-* names).
- Icon-only tags (no label) auto-receive size="icon-sm".

Dynamic shapes the perl can't handle were hand-fixed:
- 14 form-submit buttons with :label/:icon/:loading wrapped in a
  Loader2/Icon swap: <Button :disabled="x"><Icon v-if="x"
  name="pi-spin pi-spinner" /><Icon v-else :name="..." /> {{label}}
  </Button>. The Icon component already spins on "pi-spin" substring.
- ClientSecretDialog copy-feedback buttons: :severity="copied
  ? 'success' : 'secondary'" → :variant=, :icon swapped to <Icon :name>
  in slot.
- Resource permission add/remove buttons: :loading converted to
  :disabled merged with existing :disabled.
Drop the three PrimeVue-shaped wrappers and migrate consumers:

- Chips → TagsInput (4 call sites in ClientFormView, FederationFormView)
- InputNumber → NumberField (10 call sites across Service/Settings/
  Policy/Client/Resource/RegistrationField forms)
- MultiSelect → inline Popover + Checkbox + Badge (3 call sites in
  ClientFormView grant/response types, InvitationsView role assignment,
  RegistrationFieldFormView applies_to)

Final compat-shim PrimeVue debt is now limited to PolicyFormView's
standalone refs (D7).
Replace the inline submitSchema + standalone refs (name, description,
type, rego, priority, active) with the useZodForm composable already
adopted by the six other form views. Rego editor and test runner read
form.values.rego directly; per-field errors propagate through
form.errors with submit-state via form.submitting.

This removes the last divergent form pattern in the admin UI — the
PrimeVue migration debt is now fully cleared.
The shadcn-vue `border-border` utility was bridged to OrionAuth's
`--border` token (the hover/focus shade per charte section 3.4) instead
of `--border-subtle`. Every Card, Popover, Dialog, Tabs, DataTable,
Switch, Checkbox… picked up the strongest contrast available — exactly
what rule 05 forbids. The visible symptom was bordures that 'claquent'
both in dark (too white) and in light (too black).

- `--color-border` now maps to `--border-subtle`; `--color-border-hover`
  exposes the previous value for opt-in emphasis.
- `--color-border-subtle` kept as an explicit alias so the 27 sites that
  already use `border-border-subtle` stay valid.
- `--color-input` aligned to `--border-subtle` per charte 8.2.
- Drop `dark:bg-input/30` + `dark:hover:bg-input/50` + `bg-transparent`
  from Input, Textarea, SelectTrigger, NumberFieldInput, RadioGroupItem
  in favour of `bg-bg-inset` — the recessed surface mandated by section
  8.2 for input fields.
The global outline rule (`app.css:162-166`) already follows charte
rule 07 — "outline 2px var(--accent) + outline-offset 2px, never
disabled". But 8 UI components stacked a second 3px ring on top
(shadcn default). The two halos composed into a thick, fuzzy focus
state that looked amateur.

Resolution:
- **Form inputs** (Input, Textarea, NumberFieldInput, SelectTrigger)
  keep the inner 3px ring + border-accent — this is the literal
  charte 8.2 input focus (`box-shadow 0 0 0 3px var(--accent-bg)`).
  They explicitly negate the global outline with `focus-visible:outline-none`.
- **Triggers and toggles** (Button, Badge, Checkbox, Switch, Radio,
  TabsTrigger) drop the ring entirely — the global outline owns
  focus per rule 07.

Side-effect cleanups picked up in the same pass:
- Button destructive `text-white` → `text-fg-0` (rule "no invented
  colors").
- Button outline `dark:bg-input/30 dark:border-input dark:hover:bg-input/50`
  → `bg-bg-1` (after V1, `bg-input` resolved to border-subtle which
  is conceptually wrong for a button background).
- Switch unchecked `bg-input` → `bg-bg-3` (rule 06 surface
  hierarchy — `bg-input` for a track is a misuse of the input
  bridge token).
- TabsTrigger active `bg-input/30 border-input` → `bg-bg-2 border-border`
  (same rationale).
- Inline MultiSelect popover triggers in 4 views switched from
  `bg-background` to `bg-bg-inset` to match input convention.
- Dialog, AlertDialog, Sheet overlays: `bg-black/80` → `bg-black/55
  backdrop-blur-[8px]` per charte section 8.6 (`rgba(0,0,0,0.55) +
  blur(8px)`). The 80% opacity wasn't theme-aware and crushed both
  modes — too dark on the already-dark canvas, too brutal on light.
- Avatars (UserAvatar, AppTopbar, AppSidebar): `text-white` →
  `text-primary-fg` so the foreground respects the accent palette
  semantics in both themes.

Final `grep text-white|bg-black/80|dark:bg-input/` returns nothing.
- `--fg-3` in light mode raised from oklch(0.62) to oklch(0.55).
  The previous value gave ~3.5:1 against bg-0 — under WCAG AA (4.5:1)
  for small text. fg-3 is used for hints, placeholders and timestamps
  (charte 3.3), all of which are typically small body text and need
  AA-normal. The new value lands at ~4.7:1.

- Alert variants now ship with a semantic border (`border-{semantic}/30`
  instead of `border-transparent` inherited from the base class). This
  is the visual definition pass for the light theme where the
  `bg-{semantic}-bg` at oklch(0.95) lands very close to the canvas
  bg-0 (oklch(0.985)); the alert was floating without an outline.
  No contrast math change — purely additive visual definition.

Audit done for rule 04 (semantic always paired with icon/label):
StatusBadge has dot + label, RoleBadge and ActionBadge render the
role/action name as text. All compliant — no changes needed.
The thumb had `border: 2px solid var(--bg-0)` to fake an inner
padding, which painted a bg-0 ring around the thumb. Visible on any
surface that isn't the canvas (cards, popovers, dialogs) — exactly
the spots where lists scroll. Charte rule 06 implies surfaces are
layered, so a scrollbar can't assume bg-0 underneath it.

Switch to `background-clip: padding-box` + transparent border. Same
visual padding, but the thumb is now context-agnostic. Also add a
Firefox `scrollbar-color` rule so the two engines render the same
muted track.
This reverts commit 2493cf5608.
Tailwind v4 changed the default `border-color` from `gray-200` to
`currentColor`. That means any utility like `border`, `border-b`,
`border-t` without an explicit color (which is the literal pattern
shadcn-vue ships in Card, Dialog, Popover, DropdownMenu, AlertDialog,
SelectContent, ComboboxList, TableRow, TableHeader, TableFooter,
SheetContent, CommandInput, ComboboxInput…) inherits the text color.

Concretely:
- dark theme: text color is fg-0 = oklch(0.97). Every Card and table
  row was drawing a near-white stroke. Two nested Cards (e.g. Client
  → Resource Permissions inside) produced the "entouré de blanc"
  effect.
- light theme: text color is fg-0 = oklch(0.22). Same elements drew
  near-black strokes. Just as ugly.

The canonical Tailwind v4 migration fix is to set a fallback on the
universal selector. We point it at `--color-border` (which, post-V1,
resolves to `--border-subtle` — charte rule 05). One rule, every
shadcn primitive recovers its expected subtle border without touching
component source. `border-border` / `border-border-subtle` /
`border-border-strong` keep overriding explicitly where needed.
V1 (fcc7a87) demoted `--color-border` to `--border-subtle` thinking it
honoured charte rule 05 ("subtle by default"). But shadcn-vue treats
`--border` as the *default visible* component border (its docs:
"border for default borders"). Cards, Dialog, Popover, Input, TableRow
and the universal border-color fallback (f2ee46d) all resolve through
that single token — demoting it made every component frame and every
list separator disappear.

context7 (/unovue/shadcn-vue) confirms the canonical pattern:
`@layer base { * { @apply border-border } }` — the global fallback
expects `--color-border` to be the *perceivable* default.

Resolution:
- `--color-border` re-mapped to `--border` (oklch 0.32 dark, 0.88
  light — the perceivable level).
- `--color-input` same — keeps inputs visually consistent with cards.
  Charte 8.2's "creusé" effect is still carried by `bg-bg-inset`
  applied in V1.2 (e1eb765), which is what actually distinguishes
  inputs from cards.
- `border-border-subtle` and `border-border-strong` remain explicit
  opt-ins for the two other levels of charte section 3.4 — the 27
  call-sites already using them are unaffected.

Charte rule 05 ("subtle by default") is reinterpreted: subtle for
*soft inner dividers* (DetailRow, FormSection separator, sidebar
top-border — the explicit opt-ins) but visible for component frames
where the user expects to see structure.
About 20 views and common components use `<Icon name="…" />` in
their template without importing the Icon SFC at the top. Vue 3 with
`<script setup>` requires components to be either imported locally or
registered globally with `app.component(...)`; otherwise the tag
silently renders to nothing and the icons disappear.

Confirmed against the Vue 3 docs via context7: under `<script setup>`,
"imported components are automatically made available to the template
without explicit registration". The corollary is that a non-imported,
non-globally-registered component name simply doesn't resolve.

Icon is an ubiquitous design-system atom (the PrimeIcon → Lucide
bridge) — registering it globally is the canonical pattern for that
class of components, matches how the codebase already treats it, and
costs one line.
New FormSection on /settings to read and persist the server-enforced
password policy: min/max length, character-class requirements (4
switches) and a zxcvbn min_score select with operator-friendly labels.

Wires getPasswordPolicy / updatePasswordPolicy onto the same axios
client used by every other admin API. Loads in parallel with the other
settings on mount; failure to load falls back to safe defaults so the
form is always editable.
New Card on the user detail page exposing 'Send password reset email'
behind users:write. Calls POST /api/v1/admin/users/:id/reset-password
which generates the standard one-hour token + email — same flow as
self-service forgot-password.
Adds the Post-register redirect URL field (Registration section) and a
Sessions section with default + remember-me TTLs in seconds. The
redirect URL is validated server-side against cors.allowed_origins —
toast surfaces that constraint on failure.
Adds a 'Require email verification' Switch in the Registration section
that flips registration_email_verification_required on the backend.
Default is on; turning it off lets unverified users sign in
immediately.

Re-labels the post-register redirect URL field as legacy and points
operators at prompt=create — the OIDC standard signup flow which
redirects users into their app's redirect_uri natively, without
needing a free-text URL setting.
Foundation for the upcoming email-template WYSIWYG editor:
  - @tiptap/vue-3, @tiptap/starter-kit, @tiptap/pm — the editor itself
  - @tiptap/extension-mention + tippy.js — autocomplete popup for
    inserting template variables ({{.Token}}, {{.Issuer}}, …)
  - @codemirror/lang-html — syntax highlighting for the raw HTML tab
    (CodeMirror was already installed for JsonEditor)
- src/api/emailTemplates.api.ts: typed CRUD + preview against the
  backend admin handler from 1bca07d.
- VariableMention.ts: TipTap Mention extension that triggers on '@',
  exposes the per-template allowed variables via a tippy popup with
  arrow-key + Enter navigation, and serialises selections to the Go
  template syntax ({{.Token}}) the backend expects.
- TiptapEditor.vue: editor wrapper with a small toolbar (bold,
  italic, headings, lists, quote, code) and the variable hint.
  Two-way binds via v-model HTML so the parent saves the body
  verbatim (mention nodes round-trip as {{.X}}).
- HtmlPreviewFrame.vue: sandboxed iframe (no allow-scripts) that
  renders the backend-rendered HTML. Admin-pasted markup cannot run
  scripts in the AdminUI's origin.
Tabular view of the 7 known templates: name + raw key, current
subject, allowed variables as @-prefixed badges, Customized/Default
status pill, and per-row Edit + Reset buttons. Reset is disabled on
Default rows and gated behind email_templates:write.
Three-tab editor backing the per-template route. Subject field
above the tabs; both WYSIWYG (TipTap) and Raw HTML (CodeMirror
html-lang) bind the same body model so admins can switch freely.
Preview tab POSTs the unsaved draft to /preview and renders the
returned HTML in a sandboxed iframe with stub data substituted.

Dirty-state guard: navigating away (router or window unload) with
unsaved changes triggers a confirm. Reset-to-default reuses the
backend DELETE endpoint and reloads the form with the embedded
default.

Adds HtmlEditor.vue (mirror of JsonEditor.vue with the html lang
extension) as a reusable CodeMirror HTML wrapper.
Routes wired:
  /email-templates           -> list view, gated email_templates:read
  /email-templates/:name     -> form view, gated email_templates:read
    (the form view itself disables write actions on missing
     email_templates:write — read-only access still allowed)

Sidebar gets an envelope-icon entry next to Settings, conditional on
email_templates:read so non-admins don't see it at all.
Mirror the backend's versioning overhaul (orion-auth-backend@725ef4b)
into the AdminUI repo. Same rule set as on AuthUI (see authui@62309de):
remap every checkpoint tag — both the local ones AND the 18 remote-only
ones that `git fetch --tags` surfaced (0.2.6-pre1..6, 0.2.7-pre1..11,
0.2.8-b1).

- VERSIONING.md: SemVer-by-content rules (feat → minor, others → patch,
  RC reserved for formal stabilisation cuts).
- CHANGELOG.md: Keep-a-Changelog with [v0.27.0] section covering the
  v0.17.0 → HEAD range + legacy lineage summary across the 50 historical
  tags.
- scripts/remap-tags.sh: 50-row hard-coded mapping, dry-run/execute,
  idempotent. Old '-hf*' / '-pre*' / '-h2' (typo) / '-b1' tags are
  deleted and recreated as stable vX.Y.Z at the same SHAs; matching
  Forgejo releases are rewritten.
- .forgejo/workflows/tag-format.yml: rejects any tag push that does not
  match ^v[0-9]+\\.[0-9]+\\.[0-9]+(-rc\\.[0-9]+)?$ so the legacy suffix
  soup cannot come back.
- release.yml: header comment pointing to VERSIONING.md.

HEAD (a91d902) maps to v0.27.0 via the legacy 0.2.8-b1 row in the table.
The mass tag remap is executed manually (scripts/remap-tags.sh execute)
because the auto-classifier refuses destructive shared-history rewriting
even with the audit script in place.
Clicking the destructive button in ConfirmHost (Delete / Confirm) ran
the dialog-close path but never the user-supplied accept callback, so
e.g. deleting an invitation produced no DELETE request. Symptom across
every view that calls `confirm.require({...})` — Roles, Federation,
Resources, Policies, Users, Clients, ServiceAccounts, EmailTemplates,
RegistrationFields, Keys.

Root cause sits inside reka-ui: `AlertDialogAction` → `DialogClose` →
`Primitive`. DialogClose template binds its own `@click=
rootContext.onOpenChange(false)` on Primitive. Vue 3 merges that with
the fallthrough `$attrs.onClick=onAccept` from ConfirmHost, in template-
first order, so closeDialog fires first → AlertDialog emits
`update:open(false)` → ConfirmHost's `onOpenChange` sees `busy=false`
(onAccept has not run yet) → falls into `onCancel` → wipes
`pendingConfirm`. By the time onAccept finally runs the next tick, it
reads the now-null `pendingConfirm` and returns immediately, never
invoking `opts.accept?.()`.

Drop the AlertDialogAction in favour of a plain shadcn `Button`.
ConfirmHost already owns the close (`pendingConfirm.value = null` in
the finally clause of onAccept triggers the open watcher), so no
semantics are lost. AlertDialogCancel stays — its dialog-close path is
compatible with the cancel intent.
Promote the ConfirmHost click-stealing fix (da0bc90) into a [v0.27.1]
section. First patch under the new SemVer-by-content policy: single
fix, MINOR stays at 27.
ClientsListView and AuditLogsView open a side detail panel when a row
is clicked, but the row itself was indistinguishable from the others
once you scrolled — easy to lose track of which entry you were
looking at.

Three changes:

- New global utility `.row-detail-active > td` (in app.css's
  `@layer components`) paints the row with `var(--accent-bg)` — the
  same purple tint already exposed by the design tokens for both
  light and dark themes. `> td` beats the row-level Tailwind
  `data-[state=selected]:bg-muted` from TableRow.vue without
  `!important`, so the bulk-select grey and the detail-active purple
  stay readable when they coexist on the same row.
- ClientsListView's `rowClass` now composes `opacity-60` (inactive
  client) with `row-detail-active` when `selected.value?.id === row.id`,
  and `@row-click` toggles the selection (re-clicking the active row
  closes the panel — Finder / GitHub convention).
- AuditLogsView mirrors the wiring on `selectedLog` and drops a dead
  CSS block (`.log-row--active`, more emphatic with a left bar, was
  written but never bound — replaced by the global utility).

The other list views (Users, Roles, Resources, Federation, Policies,
ServiceAccounts, RegistrationFields, EmailTemplates) navigate to a
dedicated detail page via router-push and are not affected.
Promote the row-detail-active feat (e1298b9) into a [v0.28.0] section.
Minor bump under the SemVer-by-content policy: single feat:, MINOR
moves from 27 to 28.
Audit follow-up: ship the highest-leverage UX safety + accessibility
fixes from the roadmap (see CHANGELOG). Five concerns bundled:

1. Unsaved-changes guard on every form
   - `useZodForm` exposes `isDirty` (JSON-diff against initial) and
     `markPristine()` (call after a successful save so the post-save
     navigation no longer prompts).
   - New `useUnsavedChanges(isDirty)` composable wires
     `onBeforeRouteLeave` (via shadcn `ConfirmHost` for SPA nav) and
     `beforeunload` (browser tab close / reload). No-op while clean.
   - Branched on Client, Role, Resource, Policy, Federation,
     RegistrationField, ServiceAccount, EmailTemplate (refactored
     from its own manual guard), and UserDetail (inline-edit mode).

2. Confirmations on irreversible non-delete actions (ClientsListView)
   - `rotateClientSecret`, `rotateClientHMACSecret`, and `toggleActive`
     (disable branch only — enabling stays one-click) gain a destructive
     ConfirmHost dialog explaining what breaks downstream. Same for
     ServiceAccountFormView's rotateSecret.

3. Command palette chip in the topbar
   - Replaces the TODO comment with an actual ⌘K / Ctrl+K button that
     opens the existing CommandPalette. Renders the right modifier per
     platform via `navigator.platform`. Hidden on mobile (<1100px); the
     keyboard shortcut still works.

4. prefers-reduced-motion override
   - `app.css` collapses animation/transition durations to 0.01ms
     globally when the OS-level pref is set. Dialog zoom-in, fade-in,
     row hover transitions all become instant. Vestibular-impaired
     users stop being jarred by every modal open.

5. Nav + skip-link a11y
   - `AppMenuItem` adds `aria-current="page"` on the active sidebar
     link so screen readers announce position.
   - `AdminLayout` adds a `.skip-link` (hidden until focused) pointing
     at `#main-content`, plus `tabindex="-1"` on `<main>` so focus
     actually lands when activated. Standard WCAG 2.4.1 pattern.

Type-check clean. Phase 2 (URL state, page-size, density, sticky form
footer) is its own commit set. See the plan file for the full roadmap.
Promote the UX phase-1 bundle (ad51b3b) into a [v0.29.0] section.
Minor bump under the SemVer-by-content policy: multiple feat: items.
Roadmap follow-up to v0.29.0 (UX phase 1). Four concerns bundled,
focused on the list views that admins live in and on the form views
they can lose work in.

1. URL-state for search / page / perPage across every list view
   - New `useListQueryState({ storageKey })` composable: reads
     `?page`, `?perPage`, `?q` on mount (URL > localStorage > default
     priority), debounce-writes them back via `router.replace`, and
     persists `perPage` to localStorage per view. Default values are
     never written to the URL — `?page=1` stays out of the bar.
   - Drop-in replacement on Users, Clients, Resources, Invitations,
     Audit Logs, Service Accounts, Policies.
   - `useCrud` now accepts optional external `page` / `perPage` refs
     so the URL state and the fetcher share a single source of truth.
   - Deep links work: `/users?q=alice&page=3` restores filtered state;
     back-button restores filtered state.

2. Page-size selector in the DataTable footer
   - `<select>` with default options `[10, 20, 50, 100]` (overridable
     per call site). Picking a size emits the standard `page-change`
     event with `page=1`, so existing handlers pick it up unchanged.
     Persisted per view via the storageKey above.

3. Density toggle in the DataTable footer
   - One icon button cycles compact → normal → comfortable. Pref is
     global (`orionauth.tableDensity`) and applied via a wrapper
     class; the actual row padding lives in `app.css` so all tables
     stay consistent. Honors `prefers-reduced-motion` (no animation
     beyond the colour transition that was already there).

4. Loading skeleton on DataTable
   - Replaces the bare "Loading…" cell with N animated shimmer rows
     (capped at 8, matched to the requested perPage) and a sr-only
     `role="status" aria-live="polite"` announcement. The skeleton
     pulse falls back to instant under `prefers-reduced-motion` via
     the global override shipped in v0.29.0.

5. Sticky form footer on long forms
   - New `FormFooter` component: sticky bottom, backdrop-blur, full
     width via negative page padding. Shows an "Unsaved changes" dot
     when the bound `dirty` prop is true.
   - Wired on ClientFormView (597 lines, was the worst offender) and
     PolicyFormView. Cancel + Submit are now reachable without
     scrolling to the bottom of the form.

Type-check clean. Phase 3 (Settings IA refactor, PermissionDeniedView,
DetailSection headers) lands separately.
Promote the UX phase-2 bundle (716bfae) into a [v0.30.0] section.
Minor bump under the SemVer-by-content policy: multiple feat: items.
Last roadmap phase. Four concerns, each invisible until you hit it,
each obvious once shipped.

1. Settings page IA refactor
   - 2-column layout: sticky vertical anchor nav on the left
     (Registration, Sessions, Token lifetimes, Password policy), the
     existing sections on the right. Collapses to single column under
     1100px.
   - Per-section dirty tracking with baseline snapshots: a pulsing
     warn-coloured dot appears next to both the side-nav item and the
     section title as soon as a field diverges from the last saved
     value. Each save updates its baseline so the indicator clears
     immediately.
   - IntersectionObserver drives the side-nav highlight from scroll
     position so the operator knows where they are after long scrolls
     through Password policy.
   - `FormSection` gains an optional `dirty` prop so the indicator
     logic stays one place (same pulsing dot used on the side-nav).
   - Per-section Save buttons stay — the backend persists each section
     as its own document, so a unified Save would just risk partial-
     write inconsistencies.

2. PermissionDeniedView (`/access-denied`)
   - New screen with lock icon, missing-permission name in a code
     chip, attempted path, and Back / Dashboard CTAs.
   - Router guard switches from `return { name: 'dashboard' }` to
     `return { name: 'access-denied', query: { required, from } }`.
     Users hitting a bookmarked URL they no longer have access to
     finally get told what's wrong instead of silently bouncing.

3. DetailSection in side panels
   - New `DetailSection title="…"` wraps a group of `DetailRow`s with
     a mono-caps subheading (matches TableHead labels).
   - ClientsListView's right pane now reads as four scannable groups
     (Identity, Credentials, OAuth flow, OIDC) instead of a flat
     16-row dump.
   - AuditLogsView's pane reads as Event / Actor / Request +
     Metadata.

4. Focus management on every navigation
   - `router.afterEach` focuses the new page's `<h1>` (or falls back
     to the `#main-content` landmark) so keyboard / screen-reader
     users land on the right place after a router push instead of
     staying focused on the topbar element they just left.

Type-check clean. Closes the v0.29.0 → v0.31.0 roadmap.
Promote the UX phase-3 bundle (e660709) into a [v0.31.0] section.
Minor bump under the SemVer-by-content policy: multiple feat: items.
Closes the v0.29.0 → v0.31.0 UX roadmap.
The list rendered only built-in RBAC permissions; API-resource permissions assigned to a role were invisible. Fetch them per role and show them alongside.
afterEach refocused the heading on every navigation, stealing focus from the search box each time a list view synced its query into the URL. Only refocus on a real path change.
/token now goes through a bare axios instance so a 401 on the refresh
call can no longer wait on its own promise. Before each refresh the tokens
are re-read from localStorage, other tabs are followed via the storage
event, and refreshes are serialised across tabs with the Web Locks API so
a rotated refresh token is never replayed (which revokes the family).
A network error during refresh no longer logs the user out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copies read `data.message || data.error`, which rendered
"[object Object]" for the backend AppError shape ({error:{code,message}})
and ignored OAuth `error_description`. One helper in src/lib now handles
both shapes plus the legacy `message` field, with a generic fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- PublicProfile mirrors User.PublicProfile() (optional fields are omitted,
  never null); the admin User extends it with AdminView() fields
- UserSession matches GET /api/v1/me/sessions, including `current`
- rotateKey returns { message }, not a SigningKey

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- request the urn:orion:admin and urn:orion:account scopes
- bind each login to a random `state` stored in sessionStorage with the
  path to return to; the callback rejects a mismatching state and only
  navigates to internal paths (no `//` or `/\` open redirect)
- load permissions from GET /api/v1/me/permissions and report failures
  instead of silently hiding every page
- keep the id_token, revoke the refresh token on logout and send
  id_token_hint to /end_session
- reset local auth state when another tab logs out
- only trigger a new login when the tokens are actually gone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- listClients accepts `q` and `type=service_account|application`; the
  Clients and Service Accounts pages search and split server-side so
  pagination and `total` match what is displayed
- useLatestRequest ignores out-of-order responses in useCrud, the users
  list, the service accounts list and the command palette search
- service account create/edit/rotate/delete require clients:write, like
  the Clients page
- the command palette opens client/role editors only with *:write and
  otherwise lands on the (pre-filtered) list
- also uses extractApiError for the shared CRUD toasts, plus the
  PrimeVue/a11y cleanups touching these files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- key the admin RouterView on the path so /users/a -> /users/b reloads
  the view (path, not fullPath: list views sync their search to the query)
- useUnsavedChanges also guards route updates to another :id
- useConfirm rejects the dialog it replaces, so a pending navigation
  next() is always called; ConfirmHost no longer closes a confirm opened
  from accept()
- SettingsView blocks navigation while a section has unsaved edits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the client "public" switch is disabled when editing and is_public is no
  longer sent on update (the backend ignores it)
- the federation provider name (used in its callback URL) is read-only
  when editing and not sent on update
- ClientFormView uses the shared extractApiError helper

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sessions now show a "This session" badge. Revoking the current one asks
for confirmation and then performs a full logout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- quick actions and the "Invite user" button only show when the user holds
  the permission the target page needs
- drop the hard-coded env=production
- advertise OIDC/OAuth2 federation only (SAML and LDAP are not supported)
- the clients counter counts applications, like the Clients page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nginx.conf becomes an envsubst template so connect-src can list the API
origin (CSP_CONNECT_SRC, default 'self'). Adds frame-ancestors 'none',
X-Frame-Options DENY, X-Content-Type-Options nosniff, Referrer-Policy
no-referrer (all `always`), Cache-Control no-store on index.html and long
caching for hashed assets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the preview iframe gets an empty sandbox and no referrer
- the rich editor is read-only without email_templates:write
- templates with markup StarterKit would drop (tables, images, inline
  styles...) open in Raw HTML, and switching to WYSIWYG asks first
- errors go through extractApiError

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- move `import Icon` statements back into the import block
- confirm dialogs use acceptClass "destructive"/"warning" instead of the
  PrimeVue p-button-* classes
- add aria-labels to icon-only buttons
- real <title> and a README covering setup, env variables, build and
  the Docker image

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`npm audit fix` (no --force) bumps axios, postcss and nanoid in the
lockfile. The tiptap advisories (@tiptap/core <=3.30.4) were not resolved
by audit fix because the lockfile mixed versions, so the direct tiptap
packages move to ^3.31.4 (same major) to keep a single @tiptap/core.
npm audit now reports 0 vulnerabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Templates no longer receive {{.Token}} or {{.Link}}: the backend exposes
the action link only through the `link` function, as a stand-alone
{{link "Button text"}} action. The `link` entry of a template's variables
now inserts that snippet (other variables keep {{.Name}}), badges show the
real syntax, the editor explains the rule and the HTML/CSS the backend
rejects, the preview note no longer mentions the token, and the backend
validation message is shown inline on save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prefix cells starting with = + - @ tab or CR with a single quote.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The backend no longer supports hybrid response types.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Per-domain permissions no longer delegate admin API access.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
HSTS assumes TLS is terminated in front. Listen port changes to 8080.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Switch to nginxinc/nginx-unprivileged; deployments must map container port 8080 instead of 80.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The backend serves passkey endpoints; denying publickey-credentials-*
here would silently break passkeys once the UI uses them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The history of orion-auth-frontend (branch fix/audit, matching the
audited backend API) is kept through this merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nginx image, its release workflows, the tag remap script and the
separate versioning policy are replaced by the backend's own: the binary
serves the console and the backend releases version it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Built with -tags adminui, the binary embeds web/admin/dist and serves it
on the issuer origin: hashed assets cached for a year, a 404 for stale
asset names, and the SPA shell with no-store and the console CSP that
nginx used to set. A plain go build embeds nothing and answers 404, so
no Node toolchain is needed to compile or test the backend.
admin_ui.disabled stops serving the console; the admin API is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Dockerfile gains a Node 24 stage, GoReleaser builds web/admin before
compiling with -tags adminui, and the CI type-checks and builds the UI
and checks the embedded build has its shell. .dockerignore keeps local
node_modules and dist out of the build context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(admin): reload once when a chunk of a previous deploy is gone
All checks were successful
CI / tag-format (pull_request) Has been skipped
CI / backend (pull_request) Successful in 34s
CI / admin-ui (pull_request) Successful in 42s
9a189902da
A tab opened before a deploy keeps the old index.html and lazy-loads
chunk names the new binary no longer serves, so navigation broke until a
manual refresh. vite:preloadError now reloads the page, at most once a
minute so a broken deploy cannot loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nhpro merged commit 85dc62212c into master 2026-11-26 12:34:07 +01:00
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
nhpro/orion-auth-backend!4
No description provided.