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

Agent

Registers this Bowire with a central Bowire hub (#128). Off until HubUrl is set here or as Bowire:Agent:HubUrl.

public BowireAgentOptions Agent { get; }

Property Value

BowireAgentOptions

AllowedAuthUrls

Identity-provider URLs the auth helpers may call on the caller's behalf — the OAuth token proxies (/api/auth/oauth-*), the custom-token proxy (/api/auth/custom-token) and auth-flow capture. Token endpoints usually live on another host than the API, so they are listed separately from AllowedServerUrls.

public List<string> AllowedAuthUrls { get; }

Property Value

List<string>

Remarks

Checked whenever LockServerUrl is set or either allowlist is non-empty; the auth helpers may then call the server URLs plus these. A non-empty list on its own restricts only the auth helpers, not invoke/discovery. Same matching rules as AllowedServerUrls (the path is a base path, so https://idp.example.com/realms/acme covers its …/protocol/openid-connect/token). Bound from Bowire:AllowedAuthUrls and --allowed-auth-url by the CLI tool.

AllowedServerUrls

Additional server URLs the server-side endpoints may dial besides ServerUrl / ServerUrls. A non-empty list switches target enforcement on even without LockServerUrl: the UI stays editable, but a target outside the configured set is refused with a 403. Each entry is a URL whose path acts as a base path (https://api.example.com/v1 also allows https://api.example.com/v1/orders); a hint@ prefix is ignored. Bound from Bowire:AllowedServerUrls and --allowed-server-url by the CLI tool.

public List<string> AllowedServerUrls { get; }

Property Value

List<string>

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 workbench is locked to its configured server URLs: the server-URL input in the UI is read-only, and every server-side endpoint that dials a target (invoke, streaming, channels, discovery, fuzz, parallel runs) refuses any other URL with a 403 problem-details response. Use this for CI, demos, or hardened deployments where users may browse the pre-configured service but must not point the workbench — and the host it runs on — at other hosts.

public bool LockServerUrl { get; set; }

Property Value

bool

Remarks

The allowed set is ServerUrl, ServerUrls, AllowedServerUrls and, in Embedded mode, the host's own origin. See BowireTargetPolicy for how URLs are compared.

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