Repository navigation
Description
Phase F of the multi-tenant rollout — the UI affordances that turn "multi-user works under the hood" into "users feel it" (#28).
Why
Phases A–E (#28) give Bowire the auth foundation, per-user state, and the SCIM/migration plumbing. From the workbench UI today nothing changes when you log in: no name, no avatar, no "you're acting as X" indicator. That's a credibility cliff — an operator demoing to a Compliance team can't even point at the screen and say "yes, that's me, and these recordings are private to me".
Cruise ship can't leave preview without this layer.
Proposal — three integrated affordances
1. User chip in the topbar
Right cluster, between the AI drawer toggle and the About button:
[● api.…] [env ▾] [⟲] [☼] [✨3] [👤 Alice ▾] [?] [⚙]
- Avatar (Gravatar / OIDC
pictureclaim / generated initials fallback). - Hover or click → popover with:
- Full name + email.
- Role (
admin/userfrom SCIM Groups). - "Sign out" link.
- "Switch user" link (visible only to
adminrole).
- In single-user / standalone-CLI mode, the chip is hidden — there's nobody to identify.
2. Per-user-scoped state visibility
Recordings, environments, collections, favorites all live under the calling user's slot already (Phase B). What's missing is a visible "this is yours" cue:
- Recording list header reads "Your recordings (N)" instead of "Recordings (N)" in multi-tenant mode.
- Empty-state copy distinguishes "you have no recordings yet" from "this server has no recordings yet".
- A footer line on every per-user-state surface: "Stored under your slot · admin@example.com" — links to Settings → My account.
3. Admin → user impersonation ("Switch user")
For support / debugging. Admin clicks "Switch user" → modal with a SCIM-backed user picker → confirmation ("You'll see Alice's recordings, environments, collections. Actions you take will be logged as 'admin acting as Alice'.") → workbench reloads in impersonation mode.
Impersonation banner: yellow row above the topbar — "Acting as Alice (alice@example.com) · End session" with the end-session click reverting to the admin's own slot.
Every action under impersonation writes to ~/.bowire/.audit.jsonl with acting_as set. Surfaces in the SCIM Phase C audit log.
Sub-decisions
- Avatar source priority: OIDC
pictureclaim → Gravatar → generated initials. Configurable per-tenant via SCIMurn:ietf:params:scim:schemas:extension:bowire:2.0:User:avatarSource. - Sign-out in the chip popover defers to the configured
IBowireAuthProvider.SignOutUrl— single-sign-out via the IdP works the same way for everyone. - Switch-user UX intentionally requires explicit modal confirmation: every "act as X" path in real systems gets misused; making it a conscious action with a banner reduces both error and audit ambiguity.
- Mobile: chip collapses to avatar-only at narrow widths; popover stays full.
Acceptance
- Multi-tenant mode renders the user chip in the topbar right cluster.
- Single-user / standalone-CLI mode hides the chip (no nobody to identify).
- Chip popover shows name, email, role, sign-out; admin role sees an extra "Switch user" link.
- Recording / env / collection list headers + empty states surface "yours" wording in multi-tenant mode.
- Admin impersonation banner is yellow, unmissable, with a one-click end-session.
- Every action while impersonating writes an audit-log entry with both the admin's and the target user's ids.
- Switch-user picker uses the SCIM Users list with type-ahead + role-filter.
Refs #28 (Phase F — UI affordances)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(workbench): say who is signed in
thomas-stegemann commentedon Aug 29, 2026
First half shipped in 0da37b0 — identity
Split deliberately. The chip and the role are visible plumbing with no security surface; switch-user is a mechanism for one person to see another person's work, and that belongs in its own commit with its own review rather than riding along with an avatar.
The seam
IBowireUserDirectoryin Core, because the answer comes from two places. A token carries a name and an e-mail address; whether somebody administers the install comes from the directory that provisions them, which lives in a package Core does not reference.ClaimsUserDirectoryanswers from the token alone;ScimUserDirectory(inKuestenlogik.Bowire.Scim) replaces it and reads group membership againstBowire:Scim:AdminGroup.That also makes #96's Groups surface something that is actually read, rather than stored and ignored.
A role claim in the token confers nothing, on purpose. It is only as good as the mapping that produced it, and Bowire cannot check that mapping; group membership in the provisioned directory is something the operator configured deliberately and can audit. Without a directory that knows about roles, nobody is an administrator — rather than everybody. There is a test for exactly that.
GET /api/meMapped unconditionally. A workbench that has to know the deployment shape before it can ask who it is serving asks the question wrong: a single-user install answers
multiTenant: false, and the chip stays away.The chip
Its own fragment, appended to the topbar through a
typeofguard, so a single-user install carries the code and shows no control — no placeholder, no empty circle. Three details are load-bearing:?.IBowireAuthProvider.SignOutUrlis a new default-implemented member returning null; a scheme with no sign-out (an API key, a proxy terminating auth upstream) has nothing the workbench can do about it, and a link that clears nothing teaches people to believe they have signed out when they have not.Verification
15 node tests over the fragment, 16 over
ClaimsUserDirectoryand the initials fallback, 13 overScimUserDirectory(role, name precedence, the picker's backing search). Full CI green — all seven workflows.Acceptance
IBowireUserDirectory.Search, SCIM-backed, excludes deprovisioned identities because acting as one would show an empty workbench and look like data loss). The picker itself is second half.The second half, and one thing worth deciding first
The transport for "I am acting as X" is the decision that matters, so recording the intent here before building it:
A cookie the server re-checks on every request, rather than a signed token. The workbench has ~70 direct
fetchcall sites and no central wrapper, so a header would mean touching all of them or monkey-patching globalfetch— and Bowire's own purpose is sending requests to other people's services, which makes a global header patch exactly the wrong instinct.A cookie rides along automatically, and the authority never comes from it: on every request the server re-derives the real caller from the token and re-asks the directory whether they are an administrator. A forged cookie therefore buys nothing unless you already are one. That is a stronger property than a signed token, which is only as good as the key and the moment it was minted.
BowireTenancy.Enteralready nests, which is what impersonation needs — the scope was written with this in mind.feat(workbench): let an administrator look at somebody else's workbench
thomas-stegemann commentedon Aug 29, 2026
Second half shipped in 5a2707f — impersonation
The claim the design rests on
The cookie says whose slot to open. It never says who may open it. Who may is re-derived from the caller's own token on every request and re-checked against the directory. So:
That is a stronger property than a signed token, which is only as good as its key and as the moment it was minted.
A cookie rather than a header because the workbench has ~70 direct
fetchcall sites and no central wrapper. Patching globalfetchin a tool whose purpose is sending requests to other people's services is the wrong instinct; a cookie rides along on same-origin requests and needed no client change at all.Not
__Host-prefixed, deliberately: that prefix requiresSecure, and an embedded host on plain HTTP inside a network would then fail to set the cookie silently, with impersonation appearing to do nothing. The prefix would only stop a sibling host writing a value that is re-authorised anyway.Every check reads the real caller
While impersonating, the tenancy scope names the target. A check written against it would decide that an administrator acting as an ordinary user is an ordinary user — and they could not even end their own session. Ending one is not admin-gated at all, for the same reason: somebody who lost the role mid-session must still be able to get back.
The record
audit/actions.jsonl, naming both identities on every line: the start, the end, and every request that changed something. Reads are not recorded — burying the handful of lines that matter under a day of navigation is how an audit trail stops being readable. TheDELETEthat ends a session is skipped too, because it is already written asend; recording both put one event in the log twice in two vocabularies (that was a real bug, caught by the test that counts the lines).auditjoinsusersandscimas install state excluded from the #97 migration and reserved as aBOWIRE_INSTANCEname.The surfaces
The banner is the first child of the flex shell, so it takes its own row and pushes the workbench down rather than covering the topbar — this is a state of the whole session, not a notice about the content below it. Its exit is explicitly exempt from the overflow rules: somebody stuck in a session with the way out clipped is the one failure this cannot have.
No second hop is offered from inside a session. Two levels of "acting as" is how somebody loses track of whose workbench they are looking at; getting out is the banner's job.
Verification
27 node tests over the fragment and 18 through a TestServer over the authorisation itself — including the stolen-cookie case, the demoted-administrator case, and that a read is not written to the log. Full CI green.
Acceptance
One thing I decided not to build, and why
The role filter. A directory where two people are administrators and ninety are members gives you a control that filters nothing on one setting and hides everything on the other — a control added to satisfy a line rather than to do a job. The role is shown on every row, which is what somebody scanning the list actually needs.
If you want it anyway it is a toggle and one
filtercall inrenderUserPickerRows, with no server change. Say the word.thomas-stegemann commentedon Aug 29, 2026
Closed by 0cbb3ae
The last piece: on a multi-tenant instance the workspace sections now read "Your recordings (12)" and, when empty, "You have no recordings yet" — the difference between an empty account and an empty server, which is the first thing a new person on a shared install wonders. Single-user installs are untouched, and the wording stays neutral until
/api/mehas answered, because a label flashing "Your" into a single-user workbench would be a claim about the deployment nobody checked.Two helpers in the identity slice rather than the phrasing repeated at three call sites, so the surfaces cannot drift apart. 31 node tests over the fragment now; CI green.
Two things this issue asked for that were deliberately not built
Closing with them stated plainly rather than quietly, so the next reader is not surprised:
The per-surface footer — "Stored under your slot · someone@example.com" on every per-user-state surface. The account chip now sits in the topbar and the section label itself says "Your". A third statement of the same fact on every list is repetition rather than reassurance.
The role filter in the switch-user picker. In a directory where two people are administrators and ninety are members, one setting filters nothing and the other hides everything — a control that satisfies a line rather than doing a job. The role is shown on every row instead, which is what somebody scanning the list needs. If you want it anyway: a toggle and one
filtercall inrenderUserPickerRows, no server change.Both are one small commit each if you disagree — say so and I will add them.
Phase F, end to end
IBowireUserDirectory,GET /api/me, the chip. A role claim in a token confers nothing; group membership in the provisioned directory does, which is what made Multi-tenant Phase C — SCIM 2.0 provisioning endpoints #96's Groups surface something that is actually read.audit/actions.jsonl, a banner whose exit cannot be clipped away.With #96 and #97 already in, the only part of #28 still open is per-identity plugin installs (#284), which is a privilege decision rather than a storage one.
test(scim): how SCIM attaches to a host is covered
test(scim): how SCIM attaches to a host is covered