Class BowireOptions

Namespace
Kuestenlogik.Bowire
Assembly
Kuestenlogik.Bowire.dll

Runtime configuration for a Bowire instance.

public sealed class BowireOptions
Inheritance
BowireOptions
Inherited Members

Examples

app.MapBowire(options =>
{
    options.Title        = "Payments API workbench";
    options.Description  = "Internal staging environment";
    options.Theme        = BowireTheme.Dark;
    options.ServerUrls.Add("https://payments.staging:443");
    options.ServerUrls.Add("https://notifications.staging:443");
    options.ShowInternalServices = false;
});

Remarks

Passed to MapBowire(IEndpointRouteBuilder, string, Action<BowireOptions>?) via the configure callback. Defaults are chosen so that a zero-config app.MapBowire() produces a working embedded UI at /bowire.

All protocol-specific settings (gRPC proto sources, REST base URLs, SignalR hub mappings, …) live either in protocol-plugin options classes or on the plugin's own BowirePluginSetting contributions — not here.

Constructors

BowireOptions()

public BowireOptions()

Properties

AutoCreateInitialWorkspace

Host stance on seeding a workspace for first-run users. Tri-state:

  • null (the default) — no host stance. The workbench resolves it from Mode: an Embedded host seeds one workspace named after the host app and lands on the Discover rail, because the host's own API is already the subject and an empty Home reads as a dead end. A Standalone install keeps the empty Home + "Create your first workspace" CTA so the operator learns the concept before pointing at anything.
  • true / false — an explicit host stance. It wins over the per-browser Settings → General toggle, which is then shown read-only.

Set from appsettings.json (Bowire:AutoCreateInitialWorkspace), the --auto-create-initial-workspace CLI flag, or directly on the options object in an embedded host.

public bool? AutoCreateInitialWorkspace { get; set; }

Property Value

bool?

ContentSecurityPolicy

Override the Content-Security-Policy sent with the workbench page (#625). {0} is replaced with this response's script nonce.

public string? ContentSecurityPolicy { get; set; }

Property Value

string

Remarks

Null keeps DefaultContentSecurityPolicyFormat, which allows inline script only by nonce, permits inline styles because the workbench sets style attributes from script, and does not restrict egress because a tool for talking to arbitrary services has no fixed list to restrict it to.

An empty string sends no policy at all. That exists for the embedded host whose own page composes Bowire with something this default forbids — better an operator who turned it off deliberately than one who finds a blank workbench and no explanation.

Description

Short tagline rendered below the Title in the header. Defaults to "Multi-protocol API workbench"; set it to something meaningful for your service (e.g. the service name or environment).

public string Description { get; set; }

Property Value

string

DisableBuiltInDetectors

When true, the five built-in IBowireFieldDetectors shipped by Bowire core (WGS84 coordinate, GeoJSON Point, image bytes, audio bytes, timestamp) are NOT registered. Useful for hardened deployments that want to ship their own detector set without the built-ins racing them, or for tests pinning a deterministic detector list. The IFrameProber singleton is still registered — it just has nothing to run until the host adds its own detectors to the container.

public bool DisableBuiltInDetectors { get; set; }

Property Value

bool

DisabledPlugins

Plugin ids to exclude from the assembly-scan registry — handy when one of the installed plugins fails to load (broken DLL, missing dependency) or its discovery probe is too expensive for the current host's network. Wire it via Bowire:DisabledPlugins in appsettings.json, the --disable-plugin CLI flag, or by appending to this list directly when calling AddBowire(opts => opts.DisabledPlugins.Add("grpc")). Matched case- insensitively against Id.

public List<string> DisabledPlugins { get; }

Property Value

List<string>

LockServerUrl

When true, the server-URL input in the UI is read-only. Use this for CI, demos, or hardened deployments where you want users to browse the pre-configured service but not point the workbench at other hosts.

public bool LockServerUrl { get; set; }

Property Value

bool

MapBasemap

Basemap that the MapLibre map widget paints under its pins. Read from Bowire:MapBasemap when surfaced through configuration; flows out to the JS bundle as window.BOWIRE_CONFIG.mapBasemap for the widget's bowireMapBasemapSpec() to consume.

public string? MapBasemap { get; set; }

Property Value

string

Remarks

Three shapes the widget accepts:

  • Named alias — "osm" (OpenStreetMap raster tiles), "satellite" (ESRI World Imagery), "demotiles" (MapLibre's free demo vector style — the implicit default when this is null), or "none" for the true offline blank-style fallback.
  • Custom raster URL — anything with {z}/{x}/{y} placeholders is treated as a tile-server URL the widget wraps in its own raster style.
  • Custom style URL — a URL ending in .json is treated as a MapLibre style.json that the map constructor consumes directly.

Unset (the default) means "let the widget pick its built-in default" — currently the demotiles vector style. The opt-in aliases each contact exactly one documented external host (locked down by the MapLibreOfflineLockdownTests); no implicit external egress happens until an operator sets this key.

Mode

UI operating mode — controls whether the URL bar is shown and whether service discovery runs in-process or against remote URLs.

public BowireMode Mode { get; set; }

Property Value

BowireMode

Remarks

Defaults to Embedded because app.MapBowire() implies an in-process host. The standalone dotnet tool (Kuestenlogik.Bowire.Tool) flips this to Standalone explicitly.

ProtoSources

Proto file sources used when a gRPC server does not expose Server Reflection. Each ProtoSource points at a file, embedded resource, or inline proto string.

public List<ProtoSource> ProtoSources { get; }

Property Value

List<ProtoSource>

Remarks

When both reflection and proto sources are available, proto sources take precedence (they are considered the authoritative schema).

RoutePrefix

URL path prefix at which the workbench is mounted (without leading slash). Overridden by the pattern parameter of MapBowire(IEndpointRouteBuilder, string, Action<BowireOptions>?) — setting RoutePrefix in the configure callback has no effect. Default: "bowire".

public string RoutePrefix { get; set; }

Property Value

string

SchemaHintsPath

Override for the user-local schema-hints file path. When null (the default), Bowire resolves to ~/.bowire/schema-hints.json — the canonical location described by the frame-semantics-framework ADR. Set this to redirect the file (e.g. for tests that need an isolated path, or for hardened deployments that pin the location). Setting it to the empty string disables the user-local layer entirely; only the project-local file (when present) and session edits will contribute to User-priority annotations.

public string? SchemaHintsPath { get; set; }

Property Value

string

ServerUrl

Single discovery URL. Kept for backwards compatibility; when set, the value is merged into ServerUrls automatically.

public string? ServerUrl { get; set; }

Property Value

string

Remarks

Prefer ServerUrls for new code. When null (the default in embedded mode), Bowire discovers services against the host it is embedded in — no extra URL needed.

ServerUrls

One or more discovery URLs for standalone or multi-target setups. Every installed protocol plugin tries every URL in parallel; the matching plugin wins per URL.

public List<string> ServerUrls { get; }

Property Value

List<string>

Remarks

Typical uses:

  • Running Bowire as a sidecar / CLI against a deployed service.
  • Aggregating several microservices (gRPC + REST + SignalR) in one session.
  • Comparing staging vs production side-by-side.

ShowInternalServices

When true, the sidebar lists well-known internal services such as grpc.reflection.v1alpha.ServerReflection and the gRPC health endpoint. Useful for debugging reflection itself; hidden by default because it clutters the service tree for most users.

public bool ShowInternalServices { get; set; }

Property Value

bool

Theme

Initial UI theme. Users can flip theme from the header toggle at any time; the choice is persisted in localStorage, so this setting only affects the first visit from a given browser.

public BowireTheme Theme { get; set; }

Property Value

BowireTheme

Title

Title shown in the browser tab and the top-left of the workbench header. Defaults to "Bowire".

public string Title { get; set; }

Property Value

string