Interface IAuthFlowCapturer

Namespace
Kuestenlogik.Bowire.Mocking
Assembly
Kuestenlogik.Bowire.dll

Runs an auth-flow definition (a scriptable login → token chain) and returns the captured credential (#563). This is the seam that keeps the outbound flow-execution — which lives in the optional Kuestenlogik.Bowire.Security.Scanner sibling — reachable from Core's auth-recording endpoint and the MCP tools without Core referencing the Scanner. Hosts that don't wire it up simply don't offer flow-capture (the store's static-credential capture still works).

public interface IAuthFlowCapturer

Remarks

CaptureAsync(string, CancellationToken) makes OUTBOUND HTTP calls (it executes the login chain), so it only ever runs as a direct, explicit result of an operator action — a CLI invocation, a workbench click, or a confirmed MCP tool call.

Methods

CaptureAsync(string, Func<Uri, bool>?, CancellationToken)

Same, but every request the flow sends must pass allowTarget — the auth-recording endpoint passes the host's ForAuth(BowireOptions?, HttpRequest?) check while targets are restricted. A refused request fails the capture with an AuthFlowCaptureException whose inner exception is a BowireTargetRefusedException.

Task<AuthFlowCaptureResult> CaptureAsync(string flowJson, Func<Uri, bool>? allowTarget, CancellationToken ct)

Parameters

flowJson string
allowTarget Func<Uri, bool>
ct CancellationToken

Returns

Task<AuthFlowCaptureResult>

Remarks

The default implementation cannot restrict anything, so it runs the flow only when there is nothing to restrict and otherwise refuses outright (fail closed). Capturers that make outbound calls override it.

CaptureAsync(string, CancellationToken)

Execute the flow described by flowJson and return the captured credential. Throws when the flow is misconfigured or yields no token (fail closed — never returns an empty credential).

Task<AuthFlowCaptureResult> CaptureAsync(string flowJson, CancellationToken ct = default)

Parameters

flowJson string
ct CancellationToken

Returns

Task<AuthFlowCaptureResult>