Class DefaultBowireUserStore

Namespace
Kuestenlogik.Bowire.Auth
Assembly
Kuestenlogik.Bowire.dll

Default IBowireUserStore implementation -- the legacy single-user layout under ~/.bowire/. Installations that don't opt into multi-tenant mode (issue #28) use this transparently and see no behavioural change.

public sealed class DefaultBowireUserStore : IBowireUserStore, IBowireStorageRootProvider
Inheritance
DefaultBowireUserStore
Implements
Inherited Members

Constructors

DefaultBowireUserStore(string)

A store rooted at root.

public DefaultBowireUserStore(string root)

Parameters

root string

Remarks

The root used to be a static readonly field, which made the location a property of the process rather than of anything the operator controls. That is what made "start the CLI in the workspace and .bowire/ lands next to the code" false: the working directory never entered into it (#591). A constructor parameter lets a host root the data at a project without the rest of the code knowing or caring.

Fields

Instance

The store used until a host says otherwise: ~/.bowire/, or wherever BOWIRE_DATA_DIR points.

public static readonly DefaultBowireUserStore Instance

Field Value

DefaultBowireUserStore

Remarks

The variable is honoured here, in the fallback, and not only where a host is built. BowireStorageRoot.Apply ranks the same inputs, but it has to be called; anything reaching this instance is by definition code that never called it. That was every bare CLI subcommand and every test that had not replaced the store, so a run that set the variable to isolate itself still read — and wrote — the developer's own ~/.bowire. #643 moved the plugin directory for the same reason and stopped there; the workspace-scoped artifacts behind it did not follow.

Read once, at first use. A process-wide storage location that could change halfway through would be worse than one that ignores the variable, because half the files would already be in the other place.

Properties

Root

The directory this store resolves paths under.

public string Root { get; }

Property Value

string

StorageRoot

The storage root this store resolves under — the directory the Data scope means, not the per-identity slot inside it.

public string StorageRoot { get; }

Property Value

string

Remarks

The same directory as Root: the flat layout puts a person's state directly in the storage root, so for this store the two questions have one answer. They come apart in ScopedBowireUserStore.

UserProfileRoot

~/.bowire.

public static string UserProfileRoot { get; }

Property Value

string

Methods

GetUserPath(string)

Absolute path to the file filename under the active user's scope. Implementations are free to colocate users (single shared dir, the default) or partition by identity (per-user subdirectory, the multi-tenant case).

public string GetUserPath(string filename)

Parameters

filename string

Trailing-component file name without any directory prefix -- e.g. "environments.json", "recordings.json". Implementations decorate it with whatever path makes sense for their model.

Returns

string