Repository navigation
Closed
Description
Builds on: #31, #32 — multi-tenant SCIM extends the auth foundation.
Once Bowire knows who's calling (Phase A: auth-provider SPI + OIDC plugin, both shipped), the next ceiling is "everyone shares one ~/.bowire/". For real multi-user installs each authenticated identity needs its own slice of state — recordings, environments, collections, flows, plugin installs.
Phases
| Phase | Status | What ships |
|---|---|---|
| Phase A — Auth-provider SPI + OIDC plugin | ✅ shipped | IBowireAuthProvider, OIDC plugin, UseBowireAuth middleware, --auth-provider CLI flag. |
Phase B (Phase 2 of this issue) — IBowireUserStore seam |
✅ shipped on main |
IBowireUserStore + BowireUserContext static facade; EnvironmentStore, RecordingStore, CollectionStore, FlowStore, PluginManager, PluginUpdateCheckService, schema-hints all route through the seam. Standalone single-user mode keeps the flat ~/.bowire/ layout by binding to a synthetic "default" user. |
| Phase C - SCIM 2.0 endpoints | shipped (#96) | Kuestenlogik.Bowire.Scim serves /scim/v2/Users + /scim/v2/Groups with discovery, bearer auth, eq/pr/and/or filtering and 1-based paging, in a sibling package that mounts only when Bowire:Scim:Enabled says so. Deactivating an identity is enforced rather than recorded: the person is refused at the door and their slot is moved aside, reversibly, until PurgeAfter closes. PATCH handles both the Okta and the Entra dialects. A userName index makes provisioning linear rather than quadratic, and listing pages before it stamps locations. The live round-trips against a real Okta org and Entra tenant are #639, deferred to v2.7 — what remains there is evidence, not code. |
| Phase D — Per-user plugin installs | shipped (#284) | Two OS tiers: the machine-wide %ProgramData%\Bowire\plugins / /var/lib/bowire/plugins an admin manages, and the running account's overlay on top. Loader, workbench listing, update check and sidecar discovery all walk them through one precedence rule. Per-identity installs were deliberately not built: plugins load into the shared server process and share the host's own assemblies, so "your own plugins" would arrive together with "everyone else's code runs beside your data". The intent split into the two questions it actually contained — who may change the install (an administrator, #636; it had been open to every authenticated identity) and what an individual sees (hidden-protocols.json in their own slot, #638). The defect underneath both: disabled-plugins.json was written per identity while its effect was process-wide, and now lives at the storage root where that effect lands. For installs that genuinely need per-identity plugins the answer is a process per identity, documented in docs/setup/multi-user.md. |
| Phase E - Migration path | shipped (#97) | ScopedBowireUserStore plus BowireTenancy give each authenticated identity a slot under <storage root>/users/<slug>/ - the implementation Phase B named but never shipped, and without which there was nothing for a migration to migrate into. BowireUserMigrator then offers to copy a single-user install's state into that slot, once per identity, recorded in the slot itself. Copies rather than moves; excludes what is not a person's state rather than listing what is; stages beside the slot and moves it into place last. Reversible from Settings and from bowire users migrate <subject> --undo. |
| Phase F - UI affordances | shipped (#98) | An account chip that names who is signed in and whether they administer the install, read from the provisioned directory rather than from a role claim. Administrators can look at another identity's workbench: the cookie names whose slot, the authority is re-derived from the caller's own token on every request, and both identities land in audit/actions.jsonl. Lists on a shared instance say whose they are. |
Downstream consumers of the IBowireUserStore seam (Phase B)
The seam already enables:
- AI Nuclei-template suggestion: generate scan templates per endpoint #60 — AI Nuclei-template suggestion (save generated templates per-user via
IBowireUserStore). - AI findings triage: real-vs-false-positive + fix suggestion per Nuclei hit #61 — AI findings triage (Phase C disk-cache follow-up; in-memory cache works without this).
- AI Settings UI: pick provider + model from the workbench (#25 follow-up) #63 — AI Settings UI (persists
ai-config.jsonacross restart).
Anything new that wants user-scoped disk state goes through BowireUserContext.GetUserPath(filename) — no direct Path.Combine(home, ".bowire", ...) allowed.
Tracked in ROADMAP.md.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(auth): Configure(IApplicationBuilder) hook + UseBowireAuth() (#31)
feat(auth): IBowireUserStore seam + EnvironmentStore pilot (#28 Phase 1)
thomas-stegemann commentedon Jun 4, 2026
Phase 1 landed (commit bdf662f).
Shipped:
IBowireUserStoreinterface +DefaultBowireUserStore(legacy single-user layout).BowireUserContextstatic facade -- stores call through it for path resolution.EnvironmentStorepilot: still lands at~/.bowire/environments.jsonin single-user mode (zero behaviour change for current installs); the path is now seam-resolved so the multi-tenant variant can swap in later.Open follow-ups for this issue:
RecordingStore,CollectionStore(collections),FlowStore, plugin install path through the same seam. Same one-line shape as EnvironmentStore; staged across follow-up commits.IBowireUserStore-- pullsHttpContext.User.FindFirst(ClaimTypes.NameIdentifier)and routes to~/.bowire-server/users/<sub>/./scim/v2/Users+/scim/v2/Groups) per RFC 7644.~/.bowire/-> calling user's slot in~/.bowire-server/.Issue stays open.
feat(collections): backend persistence + flow-to-collection export (#30)
refactor(auth): migrate remaining user-state stores onto IBowireUserS…
thomas-stegemann commentedon Jun 5, 2026
Phase 2 landed (commit 39b71d9).
Migrated through the IBowireUserStore seam:
~/.bowire/recordings.json)~/.bowire/schema-hints.json)~/.bowire/state/update-check.json)All four user-state stores (Environment + Recording + Collection + the cache) plus the schema-hints path now route through
BowireUserContext.GetUserPath. Single-user installs see unchanged paths; multi-tenant Phase C can drop in an AsyncLocal resolver without touching the stores again.Held for Phase C:
~/.bowire/plugins/-- 'Per-user plugin installs (system-wide tier + per-user overlay)' is its own checklist item; half-state migration would defeat the seam's purpose.IBowireUserStoreimpl + SCIM 2.0 endpoints + migration path.8 remaining items
feat(server): #144 Phase 1.5 + 1.6 — per-step endpoints + per-workspa…
thomas-stegemann commentedon Jun 10, 2026
Status nach Wide-Audit (10.06.2026)
Phase A (Authentifizierungsbasis) + Phase B (Data-Model + Tenant-Isolation in
IBowireUserStore) shipped. Open: Phase C (SCIM 2.0 endpoints — #96), Phase D (per-user plugins), Phase E (Single-User → Multi-Tenant Migration — #97), Phase F (User-Chip + Impersonation — #98).thomas-stegemann commentedon Jun 24, 2026
Audit-Sweep 2026-06-24 — Phase B geliefert; Epic bleibt offen.
Phase A + B sind auf
maingeliefert:src/Kuestenlogik.Bowire/Auth/IBowireUserStore.cs—IBowireUserStore+DefaultBowireUserStore+BowireUserContext(statische Fassade)EnvironmentStore.cs:31/RecordingStore.cs:33/CollectionStore.cs:39— alle überGetUserPath()src/Kuestenlogik.Bowire.Ai/BowireAiUserConfigStore.cs— AI-Settings (AI Settings UI: pick provider + model from the workbench (#25 follow-up) #63) persistiert über die SeamDie verbleibenden Phasen sind als eigene Issues ausgelagert und laufen unter v2.6 weiter:
Dieses Issue bleibt als Tracking-Epic offen, bis C–F geliefert sind.
feat(plugins): a machine-wide plugin tier under the user's own
feat(plugins): refuse to uninstall what is not this account's to remove
thomas-stegemann commentedon Aug 28, 2026
Phase D shipped on
main, CI green on31d628e2.BowireStorageScope.Machinealready modelled the tier — the same scope #616 added after Kuestenlogik/Surgewave#157, where an admin installed a plugin, the tool confirmed it, and the broker never saw it because~meant two different profiles. So this phase was mostly about who reads it.Finding and loading (
f7212662).BowirePluginRoot.EnumeratePackages()walks both tiers, user first, and yields each package id once. Four readers go through it — the loader, the workbench listing, the daily update check and sidecar discovery — so the overlay rule is stated once rather than re-decided in four places, which is how the readers in #549 came to disagree. On the loader the precedence lands for free: it already skipped a package id it had loaded, so the machine-tier twin arrives second and is skipped asAlreadyLoaded.The surface (
d0e6e186). Uninstall used to look in one directory and report "not installed" about anything absent from it — for a machine-wide plugin the one thing it certainly is not, since it is loaded, listed and working. CLI and endpoint now recognise the case, refuse, and name the directory and the command that would work. The endpoint answers 403 rather than shelling out: reaching the CLI would either repeat that misleading message or, running elevated, remove the plugin for every account on the host from a button the user thought applied to themselves. In the workbench those rows read like bundled ones — dimmed, actions disabled, with a title saying why — and the Update tooltip names the way out that exists: install from the catalogue, and your copy takes precedence.Two decisions worth recording:
--systemflag.--plugin-diralready targets a directory, so an elevatedbowire plugin install <id> --plugin-dir /var/lib/bowire/pluginsis the administrator's path — and the same command the refusal prints. A second flag would have spelled one thing two ways.--plugin-dir /tmp/isolatedis an operator saying which plugins are in play; adding a machine tier they did not ask for would make an isolated run stop being isolated.BowirePluginOptionscarriesIsExplicitso the loader can pass that along instead of trusting that some earlier call pushed the answer intoApply.17 tests across the two commits, including the case every existing fixture creates:
BOWIRE_DATA_DIRcollapses all scopes onto one directory, where a naive two-pass walk lists every package twice.Remaining in this issue: Phase C (SCIM endpoints) and Phase E (migration).
thomas-stegemann commentedon Sep 1, 2026
Where the umbrella stands
Five of six phases are closed. The table above is updated: Phase D is shipped (#284), with the part that changed rather than shipped written into the row rather than left implied.
IBowireUserStoreseamSo this closes when #96 does, and #96 has three unchecked boxes. Only one of them actually needs something I cannot get to:
Okta + Azure AD provisioning round-trips green— needs credentials for a real tenant. Genuinely blocked on the operator.Pagination + filtering at scale(10k users, ≤500 ms warm) — not blocked. It is a benchmark against the file-per-record store, and the answer may well be "no, not at that shape", which is worth knowing before a customer finds out. Nobody has run it.IBowireUserStoreprovisioning side-effect — mostly built and unverified rather than missing. Deactivation archives the slot (Archive/Restore), purge deletes it, and every mutation appends toscim/events.jsonl. The one part that does not match the wording is creating a user: the slot is created lazily on first write rather than eagerly on provisioning. That is arguably better — no empty directory for every provisioned identity who never signs in — and the security property holds either way, because the deactivation gate reads the record and not the directory. But the box says "creating a SCIM user creates the disk slot", so either the code or the criterion should move, and that is a decision rather than an oversight.Two of the three are workable without a tenant. Leaving this open and pointing at #96.
thomas-stegemann commentedon Sep 1, 2026
Six phases, and the two that turned out to be different questions
All six are shipped. The table above is current.
IBowireUserStoreseamTwo of them did not ship what they were written to ship, and both are worth carrying forward as a lesson rather than a footnote.
Phase D asked for per-identity plugin installs. It could not have them, and the reason is structural:
plugins.Load()runs before the host is built, plugins contribute to the process-wide container and map endpoints at build time, and the load context shares the host's own assemblies with them by design. "Your own plugins" would have arrived together with "everyone else's code runs beside your data". The intent split into the two questions it actually contained — who may change the install (an administrator; it had been open to every authenticated identity, which made it a privilege-escalation path) and what an individual sees (a preference in their own slot, nowhere near an execution path). Installs that genuinely need per-identity plugins get a process per identity, documented rather than approximated.Phase C's last box asked for eager slot creation. The code creates the slot on first write, and that is better: 10 000 provisioned people would otherwise mean 10 000 empty directories. The criterion moved, with a test pinning the behaviour so the rewording is checked rather than asserted.
Underneath both sat the same shape of defect, found by asking where state's effect lands rather than where its file sits:
disabled-plugins.jsonwas written per identity while unloading a plugin swapped the registry every session reads, so the last person to touch it decided for everybody.What is not claimed
SCIM has not been driven by a live Okta org or Entra tenant — #639, v2.7. The surface is complete and tested against both dialects' fixtures; the evidence from a real directory is scheduled, not done.
Closing.