Skip to main content
Table of Contents

Namespace Stratara.Abstractions.Messaging

Classes

BusEnvelopeCanonical

Canonical payload projection helpers used by both publishers (when signing) and consumers (when verifying) so the two sides hash identical bytes. The projection covers every field of the message except the signature itself.

BusEnvelopeIntegrityOptions

Configuration for opt-in HMAC integrity protection on bus envelopes. Mitigates tenant / actor spoofing and payload tampering on a compromised message bus by signing every outbound CommandEnvelope and EventBundle, and verifying it on the consumer side.

BusEnvelopeIntegrityVerifier

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.

BusEnvelopeJsonGuard

Static helpers that enforce BusEnvelopeJsonOptions limits at the boundary between the message-bus transport and the JSON deserialiser. Implementations of IMessageBus and command-dispatch workers call into this guard before invoking JsonSerializer so the deserialiser is never handed an over-large or over-deeply-nested payload.

BusEnvelopeJsonOptions

Limits applied when deserialising bus envelopes (CommandEnvelope, EventBundle) and their embedded JSON strings (for example SessionContextJson). Mitigates denial of service via deeply-nested or oversized JSON payloads from a hostile publisher.

Interfaces

IBusEnvelopeSigner

Computes and verifies opaque signatures over the canonical projection of a bus envelope. Implementations are registered via services.AddBusEnvelopeIntegrity(...); the default is HMAC-SHA256 backed by SharedKey.

IEventBusConsumer

Marker for components that consume from the framework's event bus (event-bundle topic). DI uses this to discover + register consumers in the projection / saga workers.

IEventBusPublisher

Marker for components that publish to the framework's event bus (event-bundle topic). DI uses this to wire publishers from event-source save flows.

IMessageBus

Provider-agnostic pub/sub abstraction over the underlying message bus (RabbitMQ in dev, Azure Service Bus in prod). Topic + subscription names follow IMessagingIdentifier.

IMessagingIdentifier

Centralises topic + subscription names so every producer/consumer agrees on the wire-level identifiers. Names typically include a per-environment prefix to keep shared infrastructure isolated between dev / test / prod.

Enums

BusEnvelopeIntegrityFailure

Why an inbound envelope did not verify, reported alongside the BusEnvelopeIntegrityResult that decides whether it is dispatched.

BusEnvelopeIntegrityMode

Controls how IBusEnvelopeSigner-based integrity protection is enforced on inbound bus envelopes. See BusEnvelopeIntegrityOptions for binding.

BusEnvelopeIntegrityResult

Outcome of Verify(IBusEnvelopeSigner?, BusEnvelopeIntegrityMode, string, string?) for a single inbound envelope. Callers translate the value into the appropriate logger call and dispatch decision.