Skip to main content
Table of Contents

Class BusEnvelopeIntegrityVerifier

Namespace
Stratara.Abstractions.Messaging
Assembly
Stratara.Abstractions.dll

Static helper that resolves the integrity-verification decision for a single inbound bus envelope (CommandEnvelope or EventBundle). Centralises the rules so the three consuming workers (Mediator-command, projection, saga) share identical Off / Permissive / Strict semantics.

public static class BusEnvelopeIntegrityVerifier
Inheritance
BusEnvelopeIntegrityVerifier
Inherited Members

Remarks

The helper is logger-free on purpose — each worker owns its own structured-logging vocabulary (command vs event bundle) and decides which extension method to invoke on the BusEnvelopeIntegrityResult the helper returns.

Methods

Verify(IBusEnvelopeSigner?, BusEnvelopeIntegrityMode, string, string?)

Returns the verification outcome for an envelope given the configured mode and the supplied signer / canonical payload / signature.

public static BusEnvelopeIntegrityResult Verify(IBusEnvelopeSigner? signer, BusEnvelopeIntegrityMode mode, string canonical, string? signature)

Parameters

signer IBusEnvelopeSigner

The signer to delegate to, or null when no signer is registered.

mode BusEnvelopeIntegrityMode

The current Mode.

canonical string

The canonical projection of the envelope as produced by BusEnvelopeCanonical.

signature string

The signature read off the envelope; null or empty for an unsigned envelope.

Returns

BusEnvelopeIntegrityResult

Use the overload with a BusEnvelopeIntegrityFailure parameter to learn which of the two rejection reasons applied.

Verify(IBusEnvelopeSigner?, BusEnvelopeIntegrityMode, string, string?, out BusEnvelopeIntegrityFailure)

Returns the verification outcome for an envelope and reports why it did not verify, so that a caller can tell an unsigned envelope from one whose signature is present but wrong.

public static BusEnvelopeIntegrityResult Verify(IBusEnvelopeSigner? signer, BusEnvelopeIntegrityMode mode, string canonical, string? signature, out BusEnvelopeIntegrityFailure failure)

Parameters

signer IBusEnvelopeSigner

The signer to delegate to, or null when no signer is registered.

mode BusEnvelopeIntegrityMode

The current Mode.

canonical string

The canonical projection of the envelope as produced by BusEnvelopeCanonical.

signature string

The signature read off the envelope; null or empty for an unsigned envelope.

failure BusEnvelopeIntegrityFailure

Absent when the envelope carried no signature (null or empty), Invalid when it carried one the signer refused, and None when the result is Skipped or Verified.

Returns

BusEnvelopeIntegrityResult

The same value the four-parameter overload returns.

Remarks

An absent signature is decided here and never reaches the signer. A present signature of any content — including whitespace — is handed to the signer, and refusal is reported as Invalid: a publisher that emits a malformed signature is not one that has not started signing yet.