StellaOps.Router.Common
Shared Router types: frames, endpoint descriptors, options and the transport and plugin contracts used by microservices, gateways and transports. Install Installing Stella Ops packagesRouter downloads and signaturesnet10.01.0.1-20261117T070237Zdotnet add package StellaOps.
Namespaces
namespace StellaOps.Router.Common
| Type | Kind | Description |
|---|---|---|
PathMatcher | class | Matches request paths against route templates. |
PathTemplateSpecificity | class | Ranks route templates that all match the same request path, from most to least specific. |
class PathMatcher
public sealed class PathMatcher
Matches request paths against route templates.
Members
| Member | Kind | Summary |
|---|---|---|
PathMatcher( | constructor | Initializes a new instance of the PathMatcherclass. |
Template | property | Gets the route template. |
IsMatch( | method | Checks if a path matches the template. |
TryMatch( | method | Tries to match a path against the template. |
constructor PathMatcher(string, bool) #
PathMatcher(string, bool) #public PathMatcher(string template, bool caseInsensitive = true)
Initializes a new instance of the PathMatcherclass.
Parameters
template: The route template (e.g., “/api/users/{id}”). A trailing slash of the template, like one of the request path, does not take part in matching;PathMatcher.keeps it.Template caseInsensitive: Whether matching should be case-insensitive.
property Template #
Template #public string Template { get; }
Gets the route template.
method IsMatch(string) #
IsMatch(string) #public bool IsMatch(string path)
Checks if a path matches the template.
Parameters
path: The request path.
Returns
True if the path matches.
method TryMatch(string, out Dictionary<string, string>) #
TryMatch(string, out Dictionary<string, string>) #public bool TryMatch(string path, out Dictionary<string, string> parameters)
Tries to match a path against the template.
Parameters
path: The request path.parameters: The extracted path parameters if matched.
Returns
True if the path matches.
class PathTemplateSpecificity
public static class PathTemplateSpecificity
Ranks route templates that all match the same request path, from most to least specific.
Remarks
Raw template length is not a specificity signal: a parameter placeholder is usually longer than the literal it competes with, so ordering by length alone lets an unconstrained /prefix/{id} out-rank a sibling literal /prefix/export — and where the two are published by DIFFERENT services, the loser’s surface becomes unreachable through the gateway with nothing in the route table to show for it.
A route constraint (for example {artifact) removes the ambiguity at the source instead of ranking it at the gateway. The ordering applies to every template pair without such a constraint, so it is applied unconditionally rather than behind a flag.
Members
| Member | Kind | Summary |
|---|---|---|
MostSpecificFirst | property | Orders templates most-specific-first, for use as an ascending sort comparer. |
Compare( | method | Compares two templates, returning a negative value when left is the more specific of the two. |
LiteralSegmentCount( | method | Counts the segments of template that contain no parameter placeholder. |
ParameterSegmentCount( | method | Counts the segments of template that contain a parameter placeholder. |
property MostSpecificFirst #
MostSpecificFirst #public static IComparer<string> MostSpecificFirst { get; }
Orders templates most-specific-first, for use as an ascending sort comparer.
method Compare(string, string) #
Compare(string, string) #public static int Compare(string? left, string? right)
Compares two templates, returning a negative value when left is the more specific of the two.
method LiteralSegmentCount(string) #
LiteralSegmentCount(string) #public static int LiteralSegmentCount(string? template)
Counts the segments of template that contain no parameter placeholder.
method ParameterSegmentCount(string) #
ParameterSegmentCount(string) #public static int ParameterSegmentCount(string? template)
Counts the segments of template that contain a parameter placeholder.
namespace StellaOps.Router.Common.Abstractions
| Type | Kind | Description |
|---|---|---|
IGatewayConnectionTransportServer | interface | Gateway-side contract for connection-oriented Router transport servers. |
IGatewayMessagingTransportServer | interface | Gateway-side contract for queue-backed messaging transport servers. |
IGlobalRoutingState | interface | Provides global routing state derived from all live connections. |
IMicroserviceTransport | interface | Represents a transport connection from a microservice to the gateway. |
IRegionProvider | interface | Provides region information for routing decisions. |
IRoutingPlugin | interface | Provides extensibility for routing decisions. |
ITransportClient | interface | Represents a transport client for sending requests to microservices. |
ITransportServer | interface | Represents a transport server that accepts connections from microservices. |
TransportStreamingDispatch | class | The streaming dispatch of the transports whose microservice side answers each request with one response frame. |
interface IGatewayConnectionTransportServer
public interface IGatewayConnectionTransportServer : ITransportServer
Gateway-side contract for connection-oriented Router transport servers.
Members
| Member | Kind | Summary |
|---|---|---|
TransportType | property | The transport this server provides. |
OnDisconnection | event | Raised when a connection closes, with its identifier. |
OnFrame | event | Raised for each frame a connection receives, with the connection identifier. |
CloseConnection( | method | Closes a connection. |
SendFrameAsync( | method | Sends a frame on a connection. |
property TransportType #
TransportType #TransportType TransportType { get; }
The transport this server provides.
event OnDisconnection #
OnDisconnection #event Action<string>? OnDisconnection
Raised when a connection closes, with its identifier.
event OnFrame #
OnFrame #event Action<string, Frame>? OnFrame
Raised for each frame a connection receives, with the connection identifier.
method CloseConnection(string) #
CloseConnection(string) #bool CloseConnection(string connectionId)
Closes a connection.
Parameters
connectionId: The connection identifier.
Returns
true when the connection existed and was closed.
method SendFrameAsync(string, Frame, CancellationToken) #
SendFrameAsync(string, Frame, CancellationToken) #Task SendFrameAsync(string connectionId, Frame frame, CancellationToken cancellationToken = default)
Sends a frame on a connection.
Parameters
connectionId: The connection identifier.frame: The frame to send.cancellationToken: Cancels the send.
Returns
A task that completes when the frame is sent.
interface IGatewayMessagingTransportServer
public interface IGatewayMessagingTransportServer : ITransportServer
Gateway-side contract for queue-backed messaging transport servers.
Members
| Member | Kind | Summary |
|---|---|---|
OnConnectionClosed | event | Raised when a microservice connection closes, with its identifier. |
OnEndpointsUpdated | event | Raised when a microservice replays or updates its endpoints. |
OnHeartbeatReceived | event | Raised for each heartbeat of a microservice. |
OnHelloReceived | event | Raised when a microservice announces itself and its endpoints (a HELLO). |
OnResponseReceived | event | Raised for each response frame a microservice sends. |
SendToMicroserviceAsync( | method | Sends a frame to the microservice of a connection. |
event OnConnectionClosed #
OnConnectionClosed #event Func<string, Task>? OnConnectionClosed
Raised when a microservice connection closes, with its identifier.
event OnEndpointsUpdated #
OnEndpointsUpdated #event Func<ConnectionState, EndpointsUpdatePayload, Task>? OnEndpointsUpdated
Raised when a microservice replays or updates its endpoints.
event OnHeartbeatReceived #
OnHeartbeatReceived #event Func<ConnectionState, HeartbeatPayload, Task>? OnHeartbeatReceived
Raised for each heartbeat of a microservice.
event OnHelloReceived #
OnHelloReceived #event Func<ConnectionState, HelloPayload, Task>? OnHelloReceived
Raised when a microservice announces itself and its endpoints (a HELLO).
event OnResponseReceived #
OnResponseReceived #event Func<ConnectionState, Frame, Task>? OnResponseReceived
Raised for each response frame a microservice sends.
method SendToMicroserviceAsync(string, Frame, CancellationToken) #
SendToMicroserviceAsync(string, Frame, CancellationToken) #ValueTask SendToMicroserviceAsync(string connectionId, Frame frame, CancellationToken cancellationToken)
Sends a frame to the microservice of a connection.
Parameters
connectionId: The connection identifier.frame: The frame to send.cancellationToken: Cancels the send.
Returns
A task that completes when the frame is queued.
interface IGlobalRoutingState
public interface IGlobalRoutingState
Provides global routing state derived from all live connections.
Members
| Member | Kind | Summary |
|---|---|---|
AddConnection( | method | Adds a connection to the routing state. |
GetAllConnections( | method | Gets all active connections. |
GetConnection( | method | Gets a connection by its ID. |
GetConnectionsFor( | method | Finds instances of an already-resolved canonical endpoint without matching paths again. |
GetConnectionsFor( | method | Gets all connections that can handle the specified endpoint. |
MatchesEndpoint( | method | Matches a registered endpoint using its retained route matcher. |
RemoveConnection( | method | Removes a connection from the routing state. |
ResolveEndpoint( | method | Resolves an HTTP request to an endpoint descriptor. |
UpdateConnection( | method | Updates an existing connection’s state. |
method AddConnection(ConnectionState) #
AddConnection(ConnectionState) #void AddConnection(ConnectionState connection)
Adds a connection to the routing state.
Parameters
connection: The connection state to add.
method GetAllConnections() #
GetAllConnections() #IReadOnlyList<ConnectionState> GetAllConnections()
Gets all active connections.
Returns
All active connections.
method GetConnection(string) #
GetConnection(string) #ConnectionState? GetConnection(string connectionId)
Gets a connection by its ID.
Parameters
connectionId: The connection ID.
Returns
The connection state, or null if not found.
method GetConnectionsFor(EndpointDescriptor) #
GetConnectionsFor(EndpointDescriptor) #IReadOnlyList<ConnectionState> GetConnectionsFor(EndpointDescriptor endpoint)
Finds instances of an already-resolved canonical endpoint without matching paths again.
method GetConnectionsFor(string, string, string, string) #
GetConnectionsFor(string, string, string, string) #IReadOnlyList<ConnectionState> GetConnectionsFor(string serviceName, string version, string method, string path)
Gets all connections that can handle the specified endpoint.
Parameters
serviceName: The service name.version: The service version.method: The HTTP method.path: The request path.
Returns
The available connection states.
method MatchesEndpoint(EndpointDescriptor, string) #
MatchesEndpoint(EndpointDescriptor, string) #bool MatchesEndpoint(EndpointDescriptor endpoint, string path)
Matches a registered endpoint using its retained route matcher.
method RemoveConnection(string) #
RemoveConnection(string) #void RemoveConnection(string connectionId)
Removes a connection from the routing state.
Parameters
connectionId: The connection ID to remove.
method ResolveEndpoint(string, string) #
ResolveEndpoint(string, string) #EndpointDescriptor? ResolveEndpoint(string method, string path)
Resolves an HTTP request to an endpoint descriptor.
Parameters
method: The HTTP method.path: The request path.
Returns
The endpoint descriptor, or null if not found.
method UpdateConnection(string, Action<ConnectionState>) #
UpdateConnection(string, Action<ConnectionState>) #void UpdateConnection(string connectionId, Action<ConnectionState> update)
Updates an existing connection’s state.
Parameters
connectionId: The connection ID to update.update: The update action to apply.
interface IMicroserviceTransport
public interface IMicroserviceTransport
Represents a transport connection from a microservice to the gateway. This interface is used by the Microservice SDK to communicate with the router.
Members
| Member | Kind | Summary |
|---|---|---|
OnCancelReceived | event | Event raised when a CANCEL frame is received from the gateway. |
OnRequestReceived | event | Event raised when a REQUEST frame is received from the gateway. |
OnResyncRequested | event | Event raised when the router explicitly requests a fresh endpoint metadata replay. |
TransportDied | event | Raised when the transport connection is permanently lost and cannot recover. |
ConnectAsync( | method | Connects to the router and registers the microservice. |
ConnectAsync( | method | Connects to the router and registers the microservice, including schemas and OpenAPI metadata. |
DisconnectAsync( | method | Disconnects from the router. |
SendEndpointsUpdateAsync( | method | Sends the current endpoint/schema/OpenAPI metadata after the router explicitly requests a replay. |
SendGoodbyeAsync( | method | Sends a best-effort Goodbye control frame before shutdown. |
SendHeartbeatAsync( | method | Sends a heartbeat to the router. |
event OnCancelReceived #
OnCancelReceived #event Func<Guid, string?, Task>? OnCancelReceived
Event raised when a CANCEL frame is received from the gateway.
event OnRequestReceived #
OnRequestReceived #event Func<Frame, CancellationToken, Task<Frame>>? OnRequestReceived
Event raised when a REQUEST frame is received from the gateway.
event OnResyncRequested #
OnResyncRequested #event Func<RegistrationResyncRequestPayload, CancellationToken, Task>? OnResyncRequested
Event raised when the router explicitly requests a fresh endpoint metadata replay.
event TransportDied #
TransportDied #event Action? TransportDied
Raised when the transport connection is permanently lost and cannot recover. Consumers should reconnect by calling IMicroserviceTransport.again.
method ConnectAsync(InstanceDescriptor, IReadOnlyList<EndpointDescriptor>, CancellationToken) #
ConnectAsync(InstanceDescriptor, IReadOnlyList<EndpointDescriptor>, CancellationToken) #Task ConnectAsync(InstanceDescriptor instance, IReadOnlyList<EndpointDescriptor> endpoints, CancellationToken cancellationToken)
Connects to the router and registers the microservice.
Parameters
instance: The instance descriptor.endpoints: The endpoints to register.cancellationToken: Cancellation token.
method ConnectAsync(InstanceDescriptor, IReadOnlyList<EndpointDescriptor>, IReadOnlyDictionary<string, SchemaDefinition>, ServiceOpenApiInfo, CancellationToken) #
ConnectAsync(InstanceDescriptor, IReadOnlyList<EndpointDescriptor>, IReadOnlyDictionary<string, SchemaDefinition>, ServiceOpenApiInfo, CancellationToken) #Task ConnectAsync(InstanceDescriptor instance, IReadOnlyList<EndpointDescriptor> endpoints, IReadOnlyDictionary<string, SchemaDefinition>? schemas, ServiceOpenApiInfo? openApiInfo, CancellationToken cancellationToken)
Connects to the router and registers the microservice, including schemas and OpenAPI metadata.
Parameters
instance: The instance descriptor.endpoints: The endpoints to register.schemas: Optional schema definitions keyed by schema id.openApiInfo: Optional OpenAPI service metadata.cancellationToken: Cancellation token.
method DisconnectAsync() #
DisconnectAsync() #Task DisconnectAsync()
Disconnects from the router.
method SendEndpointsUpdateAsync(IReadOnlyList<EndpointDescriptor>, IReadOnlyDictionary<string, SchemaDefinition>, ServiceOpenApiInfo, CancellationToken) #
SendEndpointsUpdateAsync(IReadOnlyList<EndpointDescriptor>, IReadOnlyDictionary<string, SchemaDefinition>, ServiceOpenApiInfo, CancellationToken) #Task SendEndpointsUpdateAsync(IReadOnlyList<EndpointDescriptor> endpoints, IReadOnlyDictionary<string, SchemaDefinition>? schemas, ServiceOpenApiInfo? openApiInfo, CancellationToken cancellationToken)
Sends the current endpoint/schema/OpenAPI metadata after the router explicitly requests a replay.
method SendGoodbyeAsync(CancellationToken) #
SendGoodbyeAsync(CancellationToken) #Task SendGoodbyeAsync(CancellationToken cancellationToken)
Sends a best-effort Goodbye control frame before shutdown. Transports that do not maintain a live microservice connection may no-op.
Parameters
cancellationToken: Cancellation token.
method SendHeartbeatAsync(HeartbeatPayload, CancellationToken) #
SendHeartbeatAsync(HeartbeatPayload, CancellationToken) #Task SendHeartbeatAsync(HeartbeatPayload heartbeat, CancellationToken cancellationToken)
Sends a heartbeat to the router.
Parameters
heartbeat: The heartbeat payload.cancellationToken: Cancellation token.
interface IRegionProvider
public interface IRegionProvider
Provides region information for routing decisions.
Members
| Member | Kind | Summary |
|---|---|---|
NeighborRegions | property | Gets the neighbor regions in order of preference. |
Region | property | Gets the current gateway region. |
property NeighborRegions #
NeighborRegions #IReadOnlyList<string> NeighborRegions { get; }
Gets the neighbor regions in order of preference.
property Region #
Region #string Region { get; }
Gets the current gateway region.
interface IRoutingPlugin
public interface IRoutingPlugin
Provides extensibility for routing decisions.
Members
| Member | Kind | Summary |
|---|---|---|
ChooseInstanceAsync( | method | Chooses an instance for the routing context. |
method ChooseInstanceAsync(RoutingContext, CancellationToken) #
ChooseInstanceAsync(RoutingContext, CancellationToken) #Task<RoutingDecision?> ChooseInstanceAsync(RoutingContext context, CancellationToken cancellationToken)
Chooses an instance for the routing context.
Parameters
context: The routing context.cancellationToken: Cancellation token.
Returns
The routing decision, or null if this plugin cannot decide.
interface ITransportClient
public interface ITransportClient
Represents a transport client for sending requests to microservices.
Members
| Member | Kind | Summary |
|---|---|---|
SendCancelAsync( | method | Sends a cancellation request. |
SendRequestAsync( | method | Sends a request and waits for a response. |
SendStreamingAsync( | method | Sends a request whose body is read from a stream and hands the microservice’s response to readResponse. |
method SendCancelAsync(ConnectionState, Guid, string) #
SendCancelAsync(ConnectionState, Guid, string) #Task SendCancelAsync(ConnectionState connection, Guid correlationId, string? reason = null)
Sends a cancellation request.
Parameters
connection: The connection to use.correlationId: The correlation ID of the request to cancel.reason: Optional reason for cancellation.
method SendRequestAsync(ConnectionState, Frame, TimeSpan, CancellationToken) #
SendRequestAsync(ConnectionState, Frame, TimeSpan, CancellationToken) #Task<Frame> SendRequestAsync(ConnectionState connection, Frame requestFrame, TimeSpan timeout, CancellationToken cancellationToken)
Sends a request and waits for a response.
Parameters
connection: The connection to use.requestFrame: The request frame.timeout: The timeout for the request.cancellationToken: Cancellation token.
Returns
The response frame.
method SendStreamingAsync(ConnectionState, Frame, Stream, Func<ResponseFrame, Stream, Task>, PayloadLimits, CancellationToken) #
SendStreamingAsync(ConnectionState, Frame, Stream, Func<ResponseFrame, Stream, Task>, PayloadLimits, CancellationToken) #Task SendStreamingAsync(ConnectionState connection, Frame requestHeader, Stream requestBody, Func<ResponseFrame, Stream, Task> readResponse, PayloadLimits limits, CancellationToken cancellationToken)
Sends a request whose body is read from a stream and hands the microservice’s response to readResponse. TransportStreamingDispatch.implements it for transports whose microservice side answers a request with one response frame.
Parameters
connection: The connection to use.requestHeader: The request header frame.requestBody: The request body stream.readResponse: Callback that receives the response head (the status code and headers of the microservice’s response; itsResponseFrame.is empty) and the response body stream.Payload limits: Payload limits to enforce.cancellationToken: Cancellation token.
interface ITransportServer
public interface ITransportServer
Represents a transport server that accepts connections from microservices.
Members
| Member | Kind | Summary |
|---|---|---|
StartAsync( | method | Starts listening for incoming connections. |
StopAsync( | method | Stops accepting new connections. |
method StartAsync(CancellationToken) #
StartAsync(CancellationToken) #Task StartAsync(CancellationToken cancellationToken)
Starts listening for incoming connections.
Parameters
cancellationToken: Cancellation token.
method StopAsync(CancellationToken) #
StopAsync(CancellationToken) #Task StopAsync(CancellationToken cancellationToken)
Stops accepting new connections.
Parameters
cancellationToken: Cancellation token.
class TransportStreamingDispatch
public static class TransportStreamingDispatch
The streaming dispatch of the transports whose microservice side answers each request with one response frame. The Microservice SDK dispatches one REQUEST frame and returns one RESPONSE frame; it does not assemble REQUEST_STREAM_DATA frames into a request body. So the request body is read up to PayloadLimits.and sent as the payload of one REQUEST frame through ITransportClient., and the RESPONSE frame is handed over as its head (status code and headers) and its body.
Members
| Member | Kind | Summary |
|---|---|---|
SendBufferedAsync( | method | Sends requestBody as the payload of one request frame and passes the microservice’s response head and body to readResponse. |
method SendBufferedAsync(ITransportClient, ConnectionState, Frame, Stream, Func<ResponseFrame, Stream, Task>, PayloadLimits, CancellationToken) #
SendBufferedAsync(ITransportClient, ConnectionState, Frame, Stream, Func<ResponseFrame, Stream, Task>, PayloadLimits, CancellationToken) #public static Task SendBufferedAsync(ITransportClient client, ConnectionState connection, Frame requestHeader, Stream requestBody, Func<ResponseFrame, Stream, Task> readResponse, PayloadLimits limits, CancellationToken cancellationToken)
Sends requestBody as the payload of one request frame and passes the microservice’s response head and body to readResponse.
Parameters
client: The transport client that sends the request frame.connection: The connection to use.requestHeader: The request header frame (a REQUEST frame without a body).requestBody: The request body stream.readResponse: Receives the response head (empty payload) and the response body.limits: Payload limits to enforce.cancellationToken: Cancellation token.
Exceptions
Invalid: The header frame is not a request frame, or the reply is not a response frame.Operation Exception PayloadTooLargeException: The body exceedsPayloadLimits., or the transport refuses the request frame as too large.MaxRequestBytesPerCall
namespace StellaOps.Router.Common.Enums
| Type | Kind | Description |
|---|---|---|
FrameType | enum | Defines the frame types used in the router protocol. |
InstanceHealthStatus | enum | Defines the health status of a microservice instance. |
TransportType | enum | Defines the transport types supported for microservice-to-router communication. |
enum FrameType
public enum FrameType
Defines the frame types used in the router protocol.
enum InstanceHealthStatus
public enum InstanceHealthStatus
Defines the health status of a microservice instance.
enum TransportType
public enum TransportType
Defines the transport types supported for microservice-to-router communication. Note: HTTP is explicitly excluded per specification.
namespace StellaOps.Router.Common.Frames
| Type | Kind | Description |
|---|---|---|
ControlFrameCodec | class | Encodes and decodes the HELLO and HEARTBEAT payloads of the connection transports (TCP, TLS, UDP, RabbitMQ). |
FrameCanonicalBytes | class | Computes the canonical byte representation of a router frame for the purpose of HMAC sealing/verification. |
FrameCanonicalBytes. | record | Decoded canonical frame fields. |
FrameConverter | class | Converts between generic Frame and typed frame records. |
FrameEnvelopeOptions | class | Configuration for the frame-layer envelope HMAC pipeline (signer + verifier). |
FrameEnvelopeRejectedException | class | Thrown when an inbound frame fails envelope-HMAC verification. |
FrameEnvelopeRejectionReason | enum | Why IFrameEnvelopeVerifierrejected a frame. |
FrameEnvelopeSeal | record | Carries the gateway-issued integrity stamp attached to every router frame when frame-layer envelope HMAC is enforced. |
FrameEnvelopeServiceCollectionExtensions | class | Registers frame-envelope HMAC services when the operator supplies the FrameEnvelopeOptions.configuration section. |
HmacFrameEnvelopeSigner | class | Default IFrameEnvelopeSignerbacked by IHmacAlgorithm (HMAC-SHA256). |
HmacFrameEnvelopeVerifier | class | Default IFrameEnvelopeVerifierbacked by IHmacAlgorithm. |
IFrameEnvelopeSigner | interface | Signs a router frame with the gateway-issued envelope HMAC. |
IFrameEnvelopeVerifier | interface | Verifies that a router frame carries a valid gateway-issued envelope HMAC. |
PayloadTooLargeException | class | A frame, a datagram or a request body is larger than its transport or the configured limit accepts. |
RequestFrame | record | Represents a REQUEST frame sent from gateway to microservice. |
ResponseFrame | record | Represents a RESPONSE frame sent from microservice to gateway. |
TransportErrorResponses | class | Response frames a transport client sends in place of a response it cannot send. |
TransportFrameHeader | class | The frame header shared by the TCP, TLS and UDP transports: [1-byte frame type][1-byte correlation length N][N bytes UTF-8 correlation id]. |
class ControlFrameCodec
public static class ControlFrameCodec
Encodes and decodes the HELLO and HEARTBEAT payloads of the connection transports (TCP, TLS, UDP, RabbitMQ). Both the microservice side and the gateway side use this type, so the two ends cannot disagree on the wire format. The JSON shape (camelCase property names) is the one the Messaging transport already uses for the same records.
Members
| Member | Kind | Summary |
|---|---|---|
CreateConnectionState( | method | Builds the connection state the gateway keeps for an instance that sent HELLO. |
CreateHello( | method | Builds the HELLO payload a microservice sends when it connects. |
SerializeHeartbeat( | method | Serializes a HEARTBEAT payload. |
SerializeHello( | method | Serializes a HELLO payload. |
TryDeserializeHeartbeat( | method | Decodes a HEARTBEAT payload. |
TryDeserializeHello( | method | Decodes a HELLO payload. |
method CreateConnectionState(string, TransportType, HelloPayload, DateTime) #
CreateConnectionState(string, TransportType, HelloPayload, DateTime) #public static ConnectionState CreateConnectionState(string connectionId, TransportType transportType, HelloPayload hello, DateTime connectedAtUtc)
Builds the connection state the gateway keeps for an instance that sent HELLO.
Parameters
connectionId: The transport connection id.transportType: The transport the instance connected over.hello: The decoded HELLO payload.connectedAtUtc: The time the HELLO was received.
Returns
The connection state with the published endpoints.
method CreateHello(InstanceDescriptor, IReadOnlyList<EndpointDescriptor>, IReadOnlyDictionary<string, SchemaDefinition>, ServiceOpenApiInfo) #
CreateHello(InstanceDescriptor, IReadOnlyList<EndpointDescriptor>, IReadOnlyDictionary<string, SchemaDefinition>, ServiceOpenApiInfo) #public static HelloPayload CreateHello(InstanceDescriptor instance, IReadOnlyList<EndpointDescriptor> endpoints, IReadOnlyDictionary<string, SchemaDefinition>? schemas, ServiceOpenApiInfo? openApiInfo)
Builds the HELLO payload a microservice sends when it connects.
Parameters
instance: The instance identity.endpoints: The endpoints the instance serves.schemas: Schema definitions referenced by the endpoints, ornull.openApiInfo: OpenAPI metadata for the service, ornull.
Returns
The HELLO payload.
method SerializeHeartbeat(HeartbeatPayload) #
SerializeHeartbeat(HeartbeatPayload) #public static byte[] SerializeHeartbeat(HeartbeatPayload heartbeat)
Serializes a HEARTBEAT payload.
Parameters
heartbeat: The heartbeat payload.
Returns
The UTF-8 JSON bytes.
method SerializeHello(HelloPayload) #
SerializeHello(HelloPayload) #public static byte[] SerializeHello(HelloPayload payload)
Serializes a HELLO payload. EndpointDescriptor.is a process-local handler reference that cannot cross a process boundary; the model marks it [JsonIgnore], so it is never written.
Parameters
payload: The HELLO payload.
Returns
The UTF-8 JSON bytes.
method TryDeserializeHeartbeat(ReadOnlySpan<byte>, out HeartbeatPayload) #
TryDeserializeHeartbeat(ReadOnlySpan<byte>, out HeartbeatPayload) #public static bool TryDeserializeHeartbeat(ReadOnlySpan<byte> payload, out HeartbeatPayload? heartbeat)
Decodes a HEARTBEAT payload.
Parameters
payload: The frame payload.heartbeat: The decoded payload when the method returnstrue.
Returns
true when the payload is a well-formed heartbeat.
method TryDeserializeHello(ReadOnlySpan<byte>, out HelloPayload, out string) #
TryDeserializeHello(ReadOnlySpan<byte>, out HelloPayload, out string) #public static bool TryDeserializeHello(ReadOnlySpan<byte> payload, out HelloPayload? hello, out string error)
Decodes a HELLO payload. An empty payload is an error: every connection transport must identify the instance and publish its endpoints in HELLO.
Parameters
payload: The frame payload.hello: The decoded payload when the method returnstrue.error: The reason when the method returnsfalse.
Returns
true when the payload is a well-formed HELLO.
class FrameCanonicalBytes
public static class FrameCanonicalBytes
Computes the canonical byte representation of a router frame for the purpose of HMAC sealing/verification.
Remarks
Determinism is non-negotiable: the canonical form must be identical across processes, languages, and OS line endings, otherwise gateway and service will compute different MACs over the same frame. The encoding is therefore an explicit length-prefixed binary form with a stable header, version marker, and field order. JSON serialisation is not used here — JSON property ordering is implementation-defined and would break sealing.
Wire layout (all big-endian, explicit lengths):
- 4 bytes magic
"FECB"(Frame Envelope Canonical Bytes). - 1 byte canonical-form version (currently 1).
- 1 byte
FrameTypeas the underlying enum value. - 2-byte length + UTF-8 bytes of the correlation id (or 0 if null).
- 2-byte length + UTF-8 bytes of the key id.
- 8 bytes Unix-millisecond UTC issued-at timestamp.
- 4-byte length + payload bytes.
Members
| Member | Kind | Summary |
|---|---|---|
CanonicalVersion | constant | Canonical-form version. |
Magic | field | Magic header used to namespace the canonical bytes so a stray HMAC computation cannot accidentally validate a different binary. |
Compute( | method | Compute canonical bytes for a frame at a specific issuance timestamp using a specific signing key id. |
Decode( | method | Decodes bytes produced by FrameCanonicalBytes.back into their frame and envelope inputs. |
constant CanonicalVersion #
CanonicalVersion #public const byte CanonicalVersion = 1
Canonical-form version. Bump when the layout changes; verifiers reject frames with a future version they cannot decode.
field Magic #
Magic #public static readonly byte[] Magic
Magic header used to namespace the canonical bytes so a stray HMAC computation cannot accidentally validate a different binary.
method Compute(Frame, string, DateTimeOffset) #
Compute(Frame, string, DateTimeOffset) #public static byte[] Compute(Frame frame, string keyId, DateTimeOffset issuedAtUtc)
Compute canonical bytes for a frame at a specific issuance timestamp using a specific signing key id.
method Decode(ReadOnlySpan<byte>) #
Decode(ReadOnlySpan<byte>) #public static FrameCanonicalBytes.DecodedFrame Decode(ReadOnlySpan<byte> canonicalBytes)
Decodes bytes produced by FrameCanonicalBytes.back into their frame and envelope inputs.
record FrameCanonicalBytes.DecodedFrame
public sealed record DecodedFrame
Decoded canonical frame fields.
Parameters
Frame: The frame.KeyId: The identifier of the key the frame was signed with.IssuedAtUtc: When the frame was issued, in UTC.
Members
| Member | Kind | Summary |
|---|---|---|
DecodedFrame( | constructor | Decoded canonical frame fields. |
Frame | property | The frame. |
IssuedAtUtc | property | When the frame was issued, in UTC. |
KeyId | property | The identifier of the key the frame was signed with. |
constructor DecodedFrame(Frame, string, DateTimeOffset) #
DecodedFrame(Frame, string, DateTimeOffset) #public DecodedFrame(Frame Frame, string KeyId, DateTimeOffset IssuedAtUtc)
Decoded canonical frame fields.
Parameters
Frame: The frame.KeyId: The identifier of the key the frame was signed with.IssuedAtUtc: When the frame was issued, in UTC.
property Frame #
Frame #public Frame Frame { get; init; }
The frame.
property IssuedAtUtc #
IssuedAtUtc #public DateTimeOffset IssuedAtUtc { get; init; }
When the frame was issued, in UTC.
property KeyId #
KeyId #public string KeyId { get; init; }
The identifier of the key the frame was signed with.
class FrameConverter
public static class FrameConverter
Converts between generic Frame and typed frame records.
Members
| Member | Kind | Summary |
|---|---|---|
IsGoodbyeFrame( | method | Returns true when the frame is a valid Goodbye control frame. |
ToFrame( | method | Converts a RequestFrame to a generic Frame for transport. |
ToFrame( | method | Converts a ResponseFrame to a generic Frame for transport. |
ToGoodbyeFrame( | method | Creates a Goodbye control frame. |
ToRequestFrame( | method | Converts a generic Frame to a RequestFrame. |
ToResponseFrame( | method | Converts a generic Frame to a ResponseFrame. |
method IsGoodbyeFrame(Frame) #
IsGoodbyeFrame(Frame) #public static bool IsGoodbyeFrame(Frame frame)
Returns true when the frame is a valid Goodbye control frame.
method ToFrame(RequestFrame) #
ToFrame(RequestFrame) #public static Frame ToFrame(RequestFrame request)
Converts a RequestFrame to a generic Frame for transport.
method ToFrame(ResponseFrame) #
ToFrame(ResponseFrame) #public static Frame ToFrame(ResponseFrame response)
Converts a ResponseFrame to a generic Frame for transport.
method ToGoodbyeFrame(string) #
ToGoodbyeFrame(string) #public static Frame ToGoodbyeFrame(string? correlationId = null)
Creates a Goodbye control frame. Goodbye carries no payload beyond the standard frame envelope.
method ToRequestFrame(Frame) #
ToRequestFrame(Frame) #public static RequestFrame? ToRequestFrame(Frame frame)
Converts a generic Frame to a RequestFrame.
method ToResponseFrame(Frame) #
ToResponseFrame(Frame) #public static ResponseFrame? ToResponseFrame(Frame frame)
Converts a generic Frame to a ResponseFrame.
class FrameEnvelopeOptions
public sealed class FrameEnvelopeOptions
Configuration for the frame-layer envelope HMAC pipeline (signer + verifier). All fields are deterministic; a missing / empty key map indicates the host has not been bootstrapped and the HmacFrameEnvelopeSigner/ HmacFrameEnvelopeVerifierconstructors will refuse to operate rather than fall back to “no integrity”.
Members
| Member | Kind | Summary |
|---|---|---|
FrameEnvelopeOptions( | constructor | Creates an instance of FrameEnvelopeOptions. |
DefaultReplayWindow | field | Default replay window. |
SectionName | constant | Configuration section under which the host binds these options. |
ActiveKeyId | property | Active signing key id used by the signer. |
Keys | property | Map of key id to UTF-8 signing key material. |
ReplayWindow | property | How far the issued-at timestamp on a frame may drift from “now” before the verifier rejects it. |
constructor FrameEnvelopeOptions() #
FrameEnvelopeOptions() #public FrameEnvelopeOptions()
Creates an instance of FrameEnvelopeOptions.
field DefaultReplayWindow #
DefaultReplayWindow #public static readonly TimeSpan DefaultReplayWindow
Default replay window. The gateway and microservices share clocks loosely (NTP), and the default accepts ±5 minutes of skew so a microservice behind a slow boot sequence still verifies new frames. Configurable to widen for offline / air-gap deployments where NTP is best-effort.
constant SectionName #
SectionName #public const string SectionName = "Router:Frame:Envelope"
Configuration section under which the host binds these options.
property ActiveKeyId #
ActiveKeyId #public string ActiveKeyId { get; set; }
Active signing key id used by the signer. Must be present in FrameEnvelopeOptions.. Verifiers ignore this field — they trust the key id carried inside the seal — so rotation works by adding a new key to FrameEnvelopeOptions.on every host first, then flipping FrameEnvelopeOptions.on the gateway.
property Keys #
Keys #public Dictionary<string, string> Keys { get; set; }
Map of key id to UTF-8 signing key material. Multiple entries support a rotation window where verifiers accept frames signed by either the previous or the new key. Empty == disabled, which means any constructor that wires this up will throw at startup.
property ReplayWindow #
ReplayWindow #public TimeSpan ReplayWindow { get; set; }
How far the issued-at timestamp on a frame may drift from “now” before the verifier rejects it. Default: ±5 minutes. The window is applied symmetrically (past and future) to absorb gateway / service clock skew.
class FrameEnvelopeRejectedException
public sealed class FrameEnvelopeRejectedException : Exception
Thrown when an inbound frame fails envelope-HMAC verification. The metadata keys (frame.envelope.*) carry the rejection reason, the seal key id and the issue time, so log emitters can attach them to dead-letter records and traces without parsing the message.
Members
| Member | Kind | Summary |
|---|---|---|
FrameEnvelopeRejectedException( | constructor | Initializes a new instance of the FrameEnvelopeRejectedException. |
MetadataKeyIssuedAt | constant | Audit-metadata key carrying the issued-at timestamp (ISO-8601 UTC, when present). |
MetadataKeyKeyId | constant | Audit-metadata key carrying the seal key id (when present). |
MetadataKeyReason | constant | Audit-metadata key carrying the reason label. |
IssuedAtUtc | property | Issued-at timestamp from the seal, when one was attached. |
KeyId | property | Key id presented by the seal, when one was attached. |
Reason | property | Why the verifier rejected the frame. |
constructor FrameEnvelopeRejectedException(FrameEnvelopeRejectionReason, string, string, DateTimeOffset?) #
FrameEnvelopeRejectedException(FrameEnvelopeRejectionReason, string, string, DateTimeOffset?) #public FrameEnvelopeRejectedException(FrameEnvelopeRejectionReason reason, string message, string? keyId = null, DateTimeOffset? issuedAtUtc = null)
Initializes a new instance of the FrameEnvelopeRejectedException.
constant MetadataKeyIssuedAt #
MetadataKeyIssuedAt #public const string MetadataKeyIssuedAt = "frame.envelope.issuedAt"
Audit-metadata key carrying the issued-at timestamp (ISO-8601 UTC, when present).
constant MetadataKeyKeyId #
MetadataKeyKeyId #public const string MetadataKeyKeyId = "frame.envelope.keyId"
Audit-metadata key carrying the seal key id (when present).
constant MetadataKeyReason #
MetadataKeyReason #public const string MetadataKeyReason = "frame.envelope.reason"
Audit-metadata key carrying the reason label.
property IssuedAtUtc #
IssuedAtUtc #public DateTimeOffset? IssuedAtUtc { get; }
Issued-at timestamp from the seal, when one was attached.
property KeyId #
KeyId #public string? KeyId { get; }
Key id presented by the seal, when one was attached.
property Reason #
Reason #public FrameEnvelopeRejectionReason Reason { get; }
Why the verifier rejected the frame.
enum FrameEnvelopeRejectionReason
public enum FrameEnvelopeRejectionReason
Why IFrameEnvelopeVerifierrejected a frame. Fields double as the reason label on the router_ counter so SREs can alert on each failure mode separately.
| Value | Description |
|---|---|
Missing = 0 | No FrameEnvelopeSealattached to the frame. |
UnknownKeyId = 1 | Seal carries a key id the verifier does not recognise. |
Unsupported | Seal algorithm marker is not supported by this verifier. |
Malformed = 3 | Seal MAC is not valid Base64Url or has the wrong length for the algorithm. |
Timestamp | Issued-at timestamp is outside the configured replay window. |
MacMismatch = 5 | MAC bytes did not authenticate the canonical frame bytes (tamper or wrong key). |
Unsupported | Canonical-form version on the wire is unknown to this verifier. |
record FrameEnvelopeSeal
public sealed record FrameEnvelopeSeal
Carries the gateway-issued integrity stamp attached to every router frame when frame-layer envelope HMAC is enforced. The seal binds the canonical frame header bytes to the signing key held by the gateway so that any transport — TCP, UDP, TLS, Messaging, RabbitMq, InMemory — can detect tampering and replay before dispatching the frame.
Remarks
The seal holds a key identifier (so keys can rotate without a coordinated downtime), the issuance timestamp (used to enforce the configurable replay window), the algorithm marker and the MAC bytes. The algorithm is HMAC-SHA256, as for the gateway-issued identity envelope. The seal records the algorithm marker, so another algorithm needs no change of the wire format.
Members
| Member | Kind | Summary |
|---|---|---|
FrameEnvelopeSeal( | constructor | Creates an instance of FrameEnvelopeSeal. |
AlgorithmHs256 | constant | HMAC algorithm marker used when computing the seal. |
Algorithm | property | HMAC algorithm marker. |
IssuedAtUtc | property | UTC timestamp at which the gateway stamped the frame. |
KeyId | property | Identifier of the signing key used to compute the MAC. |
Mac | property | Base64Url-encoded MAC bytes. |
constructor FrameEnvelopeSeal() #
FrameEnvelopeSeal() #public FrameEnvelopeSeal()
Creates an instance of FrameEnvelopeSeal.
constant AlgorithmHs256 #
AlgorithmHs256 #public const string AlgorithmHs256 = "HS256"
HMAC algorithm marker used when computing the seal. Matches the wire alias used by Gateway.
property Algorithm #
Algorithm #public string Algorithm { get; init; }
HMAC algorithm marker. Currently FrameEnvelopeSeal.; widen only by adding new constants — do not repurpose existing ones, since older verifiers must continue to recognise the marker.
property IssuedAtUtc #
IssuedAtUtc #public required DateTimeOffset IssuedAtUtc { get; init; }
UTC timestamp at which the gateway stamped the frame. Used by the verifier to enforce the replay window.
property KeyId #
KeyId #public required string KeyId { get; init; }
Identifier of the signing key used to compute the MAC. Must be stable across services so verifiers can route a frame to the correct key material when more than one key is loaded (rotation window).
property Mac #
Mac #public required string Mac { get; init; }
Base64Url-encoded MAC bytes. The MAC is computed over the canonical frame header bytes produced by FrameCanonicalBytesusing the key identified by FrameEnvelopeSeal..
class FrameEnvelopeServiceCollectionExtensions
public static class FrameEnvelopeServiceCollectionExtensions
Registers frame-envelope HMAC services when the operator supplies the FrameEnvelopeOptions.configuration section.
Members
| Member | Kind | Summary |
|---|---|---|
AddConfiguredFrameEnvelopeProtection( | extension method | Binds and validates frame-envelope options, then registers the signer and verifier. |
extension method AddConfiguredFrameEnvelopeProtection(IServiceCollection, IConfiguration) #
AddConfiguredFrameEnvelopeProtection(IServiceCollection, IConfiguration) #public static IServiceCollection AddConfiguredFrameEnvelopeProtection(this IServiceCollection services, IConfiguration configuration)
Binds and validates frame-envelope options, then registers the signer and verifier. Hosts without the configuration section retain the documented bootstrap posture; a present but invalid section fails registration instead of silently disabling integrity.
Parameters
services: The service collection.configuration: The host configuration root.
Returns
The service collection for chaining.
class HmacFrameEnvelopeSigner
public sealed class HmacFrameEnvelopeSigner : IFrameEnvelopeSigner
Default IFrameEnvelopeSignerbacked by IHmacAlgorithm (HMAC-SHA256). Stamps a producer-issued envelope seal over canonical frame bytes.
Remarks
Every frame producer signs its outbound request, response, and control frames; every consumer uses HmacFrameEnvelopeVerifierto authenticate frames it receives. The HMAC primitive is taken from IHmacAlgorithm; the signer makes no direct BCL HMAC call.
Members
| Member | Kind | Summary |
|---|---|---|
HmacFrameEnvelopeSigner( | constructor | Initializes a new instance of the HmacFrameEnvelopeSignerclass. |
Sign( | method | Compute a seal for frame. |
constructor HmacFrameEnvelopeSigner(IOptions<FrameEnvelopeOptions>, IHmacAlgorithm, TimeProvider) #
HmacFrameEnvelopeSigner(IOptions<FrameEnvelopeOptions>, IHmacAlgorithm, TimeProvider) #public HmacFrameEnvelopeSigner(IOptions<FrameEnvelopeOptions> options, IHmacAlgorithm? hmac = null, TimeProvider? timeProvider = null)
Initializes a new instance of the HmacFrameEnvelopeSignerclass.
method Sign(Frame) #
Sign(Frame) #public FrameEnvelopeSeal Sign(Frame frame)
Compute a seal for frame. Implementations are expected to read “now” via the TimeProvider wired into them, so determinism tests can substitute a fake clock.
class HmacFrameEnvelopeVerifier
public sealed class HmacFrameEnvelopeVerifier : IFrameEnvelopeVerifier
Default IFrameEnvelopeVerifierbacked by IHmacAlgorithm. Recomputes canonical frame bytes against the key id presented in the seal, enforces the configured replay window using TimeProvider, and rejects on any mismatch with a structured FrameEnvelopeRejectedException.
Members
| Member | Kind | Summary |
|---|---|---|
HmacFrameEnvelopeVerifier( | constructor | Initializes a new instance of the HmacFrameEnvelopeVerifierclass. |
TryVerify( | method | Try-style overload. |
Verify( | method | Verify the seal attached to frame. |
constructor HmacFrameEnvelopeVerifier(IOptions<FrameEnvelopeOptions>, IHmacAlgorithm, TimeProvider) #
HmacFrameEnvelopeVerifier(IOptions<FrameEnvelopeOptions>, IHmacAlgorithm, TimeProvider) #public HmacFrameEnvelopeVerifier(IOptions<FrameEnvelopeOptions> options, IHmacAlgorithm? hmac = null, TimeProvider? timeProvider = null)
Initializes a new instance of the HmacFrameEnvelopeVerifierclass.
method TryVerify(Frame, FrameEnvelopeSeal, out FrameEnvelopeRejectionReason) #
TryVerify(Frame, FrameEnvelopeSeal, out FrameEnvelopeRejectionReason) #public bool TryVerify(Frame frame, FrameEnvelopeSeal? seal, out FrameEnvelopeRejectionReason reason)
Try-style overload. Returns true on success, otherwise sets reason to the failure label and returns false. Useful where a transport wants to emit a counter increment without paying the cost of throwing.
method Verify(Frame, FrameEnvelopeSeal) #
Verify(Frame, FrameEnvelopeSeal) #public void Verify(Frame frame, FrameEnvelopeSeal seal)
Verify the seal attached to frame. Throws FrameEnvelopeRejectedExceptionon failure with a structured reason; transports that rely on at-least-once delivery (Messaging, RabbitMq) catch and dead-letter on this exception.
Parameters
frame: The frame to verify.seal: The seal claimed for this frame, as transported alongside it.
interface IFrameEnvelopeSigner
public interface IFrameEnvelopeSigner
Signs a router frame with the gateway-issued envelope HMAC.
Remarks
Every router frame leaving a host must carry a FrameEnvelopeSealstamped over canonical frame bytes. The signer computes the MAC through Stella, so a host can substitute the MAC implementation.
Members
| Member | Kind | Summary |
|---|---|---|
Sign( | method | Compute a seal for frame. |
method Sign(Frame) #
Sign(Frame) #FrameEnvelopeSeal Sign(Frame frame)
Compute a seal for frame. Implementations are expected to read “now” via the TimeProvider wired into them, so determinism tests can substitute a fake clock.
interface IFrameEnvelopeVerifier
public interface IFrameEnvelopeVerifier
Verifies that a router frame carries a valid gateway-issued envelope HMAC.
Members
| Member | Kind | Summary |
|---|---|---|
TryVerify( | method | Try-style overload. |
Verify( | method | Verify the seal attached to frame. |
method TryVerify(Frame, FrameEnvelopeSeal, out FrameEnvelopeRejectionReason) #
TryVerify(Frame, FrameEnvelopeSeal, out FrameEnvelopeRejectionReason) #bool TryVerify(Frame frame, FrameEnvelopeSeal? seal, out FrameEnvelopeRejectionReason reason)
Try-style overload. Returns true on success, otherwise sets reason to the failure label and returns false. Useful where a transport wants to emit a counter increment without paying the cost of throwing.
method Verify(Frame, FrameEnvelopeSeal) #
Verify(Frame, FrameEnvelopeSeal) #void Verify(Frame frame, FrameEnvelopeSeal seal)
Verify the seal attached to frame. Throws FrameEnvelopeRejectedExceptionon failure with a structured reason; transports that rely on at-least-once delivery (Messaging, RabbitMq) catch and dead-letter on this exception.
Parameters
frame: The frame to verify.seal: The seal claimed for this frame, as transported alongside it.
class PayloadTooLargeException
public sealed class PayloadTooLargeException : Exception
A frame, a datagram or a request body is larger than its transport or the configured limit accepts. It is raised before anything is sent, so the connection stays usable; the gateway answers the caller 413 Payload Too Large.
Members
| Member | Kind | Summary |
|---|---|---|
PayloadTooLargeException( | constructor | Initializes a new instance of the PayloadTooLargeExceptionclass. |
ActualSize | property | Gets the size, in bytes, that exceeded the limit. |
MaxSize | property | Gets the limit, in bytes. |
constructor PayloadTooLargeException(long, long) #
PayloadTooLargeException(long, long) #public PayloadTooLargeException(long actualSize, long maxSize)
Initializes a new instance of the PayloadTooLargeExceptionclass.
Parameters
actualSize: The size, in bytes, that exceeded the limit.maxSize: The limit, in bytes.
property ActualSize #
ActualSize #public long ActualSize { get; }
Gets the size, in bytes, that exceeded the limit.
property MaxSize #
MaxSize #public long MaxSize { get; }
Gets the limit, in bytes.
record RequestFrame
public sealed record RequestFrame
Represents a REQUEST frame sent from gateway to microservice.
Members
| Member | Kind | Summary |
|---|---|---|
RequestFrame( | constructor | Creates an instance of RequestFrame. |
CorrelationId | property | Gets the correlation ID for distributed tracing. |
Headers | property | Gets the request headers. |
Method | property | Gets the HTTP method (GET, POST, PUT, DELETE, etc.). |
Path | property | Gets the request path. |
Payload | property | Gets the request payload (body). |
RawTarget | property | Gets the request target exactly as the gateway received it on the ingress wire (path plus query string, percent-encoding intact), after the gateway translated the route prefix the same way it translated RequestFrame.. |
RequestId | property | Gets the unique request ID for this request. |
SupportsStreaming | property | Gets whether this request supports streaming response. |
TimeoutSeconds | property | Gets the timeout in seconds for this request. |
constructor RequestFrame() #
RequestFrame() #public RequestFrame()
Creates an instance of RequestFrame.
property CorrelationId #
CorrelationId #public string? CorrelationId { get; init; }
Gets the correlation ID for distributed tracing.
property Headers #
Headers #public IReadOnlyDictionary<string, string> Headers { get; init; }
Gets the request headers.
property Method #
Method #public required string Method { get; init; }
Gets the HTTP method (GET, POST, PUT, DELETE, etc.).
property Path #
Path #public required string Path { get; init; }
Gets the request path.
property Payload #
Payload #public ReadOnlyMemory<byte> Payload { get; init; }
Gets the request payload (body).
property RawTarget #
RawTarget #public string? RawTarget { get; init; }
Gets the request target exactly as the gateway received it on the ingress wire (path plus query string, percent-encoding intact), after the gateway translated the route prefix the same way it translated RequestFrame.. Null when the ingress exposed no raw target (a gateway built before this field existed, or a synthetic caller).
Remarks
RequestFrame.is the once-decoded, re-escaped form ASP.NET hands the gateway, so a canonical %252F on the wire has already become %2F there. Endpoints that must decode a segment exactly once (product keys carrying canonical PURL escapes) read IHttp instead of the route value; the ASP.NET dispatcher populates that feature from this value and, when it is absent, from RequestFrame..
property RequestId #
RequestId #public required string RequestId { get; init; }
Gets the unique request ID for this request.
property SupportsStreaming #
SupportsStreaming #public bool SupportsStreaming { get; init; }
Gets whether this request supports streaming response.
property TimeoutSeconds #
TimeoutSeconds #public int TimeoutSeconds { get; init; }
Gets the timeout in seconds for this request.
record ResponseFrame
public sealed record ResponseFrame
Represents a RESPONSE frame sent from microservice to gateway.
Members
| Member | Kind | Summary |
|---|---|---|
ResponseFrame( | constructor | Creates an instance of ResponseFrame. |
HasMoreChunks | property | Gets whether there are more streaming chunks to follow. |
Headers | property | Gets the response headers. |
Payload | property | Gets the response payload (body). |
RequestId | property | Gets the request ID this response is for. |
StatusCode | property | Gets the HTTP status code. |
constructor ResponseFrame() #
ResponseFrame() #public ResponseFrame()
Creates an instance of ResponseFrame.
property HasMoreChunks #
HasMoreChunks #public bool HasMoreChunks { get; init; }
Gets whether there are more streaming chunks to follow.
property Headers #
Headers #public IReadOnlyDictionary<string, string> Headers { get; init; }
Gets the response headers.
property Payload #
Payload #public ReadOnlyMemory<byte> Payload { get; init; }
Gets the response payload (body).
property RequestId #
RequestId #public required string RequestId { get; init; }
Gets the request ID this response is for.
property StatusCode #
StatusCode #public int StatusCode { get; init; }
Gets the HTTP status code.
class TransportErrorResponses
public static class TransportErrorResponses
Response frames a transport client sends in place of a response it cannot send.
Members
| Member | Kind | Summary |
|---|---|---|
ResponseTooLargeType | constant | The type of the problem a TransportErrorResponses.frame carries. |
ResponseTooLarge( | method | A 502 response frame for a response whose frame is larger than the transport carries (PayloadTooLargeExceptionon the write). |
constant ResponseTooLargeType #
ResponseTooLargeType #public const string ResponseTooLargeType = "urn:stellaops:router:response-too-large"
The type of the problem a TransportErrorResponses.frame carries.
method ResponseTooLarge(string, long, long) #
ResponseTooLarge(string, long, long) #public static Frame ResponseTooLarge(string correlationId, long actualBytes, long maxBytes)
A 502 response frame for a response whose frame is larger than the transport carries (PayloadTooLargeExceptionon the write). The gateway passes it to the caller at once instead of waiting for the endpoint timeout.
Parameters
correlationId: The correlation id of the request.actualBytes: The size of the refused response frame, in bytes.maxBytes: The transport’s frame or datagram limit, in bytes.
Returns
The response frame.
class TransportFrameHeader
public static class TransportFrameHeader
The frame header shared by the TCP, TLS and UDP transports: [1-byte frame type][1-byte correlation length N][N bytes UTF-8 correlation id]. The correlation id is carried exactly as the sender set it (the gateway issues ULIDs), so a response can be matched to its request. A zero length means no correlation id.
Members
| Member | Kind | Summary |
|---|---|---|
MaxCorrelationIdBytes | constant | The largest correlation id, in UTF-8 bytes, that fits the one-byte length field. |
MinimumSize | constant | The size of a header without a correlation id. |
GetSize( | method | Gets the header size for a correlation id. |
TryRead( | method | Reads the header. |
Write( | method | Writes the header. |
constant MaxCorrelationIdBytes #
MaxCorrelationIdBytes #public const int MaxCorrelationIdBytes = 255
The largest correlation id, in UTF-8 bytes, that fits the one-byte length field.
constant MinimumSize #
MinimumSize #public const int MinimumSize = 2
The size of a header without a correlation id.
method GetSize(string) #
GetSize(string) #public static int GetSize(string? correlationId)
Gets the header size for a correlation id.
Parameters
correlationId: The correlation id, ornull.
Returns
The number of header bytes.
Exceptions
ArgumentException: The correlation id is longer thanTransportFrameHeader.bytes.MaxCorrelationIdBytes
method TryRead(ReadOnlySpan<byte>, out FrameType, out string, out int, out string) #
TryRead(ReadOnlySpan<byte>, out FrameType, out string, out int, out string) #public static bool TryRead(ReadOnlySpan<byte> source, out FrameType frameType, out string? correlationId, out int headerSize, out string error)
Reads the header.
Parameters
source: The frame bytes, starting with the header.frameType: The frame type.correlationId: The correlation id, ornullwhen the length is zero.headerSize: The number of header bytes read.error: The reason when the method returnsfalse.
Returns
true when the header is well formed.
method Write(Span<byte>, FrameType, string) #
Write(Span<byte>, FrameType, string) #public static int Write(Span<byte> destination, FrameType frameType, string? correlationId)
Writes the header.
Parameters
destination: The buffer; at leastTransportFrameHeader.bytes.GetSize( string) frameType: The frame type.correlationId: The correlation id, ornull.
Returns
The number of bytes written.
Exceptions
ArgumentException: The correlation id is too long or the buffer too small.
namespace StellaOps.Router.Common.Identity
| Type | Kind | Description |
|---|---|---|
GatewayIdentityEnvelope | record | Signed gateway-issued identity envelope used for trusted user impersonation when requests are dispatched through the Router gateway. |
GatewayIdentityEnvelopeCodec | class | Codec for creating and verifying signed identity envelopes. |
GatewayIdentityEnvelopeSignature | struct | Result of envelope signing operation. |
record GatewayIdentityEnvelope
public sealed record GatewayIdentityEnvelope
Signed gateway-issued identity envelope used for trusted user impersonation when requests are dispatched through the Router gateway.
Members
| Member | Kind | Summary |
|---|---|---|
GatewayIdentityEnvelope( | constructor | Creates an instance of Gateway. |
Claims | property | Gateway-validated non-scope claims that downstream services need for resource-level authorization decisions. |
CorrelationId | property | Correlation identifier for audit traceability. |
ExpiresAtUtc | property | Envelope expiry timestamp (UTC). |
IssuedAtUtc | property | Envelope issuance timestamp (UTC). |
Issuer | property | Gateway issuer identifier. |
Project | property | Project identifier, when available. |
Roles | property | Effective roles enforced by the gateway. |
Scopes | property | Effective scopes enforced by the gateway. |
SenderConfirmation | property | Sender confirmation thumbprint (for example DPoP JKT) when available. |
Subject | property | Subject (authenticated actor). |
Tenant | property | Tenant identifier, when available. |
Version | property | Envelope schema version. |
constructor GatewayIdentityEnvelope() #
GatewayIdentityEnvelope() #public GatewayIdentityEnvelope()
Creates an instance of Gateway.
property Claims #
Claims #public Dictionary<string, string[]> Claims { get; init; }
Gateway-validated non-scope claims that downstream services need for resource-level authorization decisions.
property CorrelationId #
CorrelationId #public string CorrelationId { get; init; }
Correlation identifier for audit traceability.
property ExpiresAtUtc #
ExpiresAtUtc #public DateTimeOffset ExpiresAtUtc { get; init; }
Envelope expiry timestamp (UTC).
property IssuedAtUtc #
IssuedAtUtc #public DateTimeOffset IssuedAtUtc { get; init; }
Envelope issuance timestamp (UTC).
property Issuer #
Issuer #public string Issuer { get; init; }
Gateway issuer identifier.
property Project #
Project #public string? Project { get; init; }
Project identifier, when available.
property Roles #
Roles #public IReadOnlyList<string> Roles { get; init; }
Effective roles enforced by the gateway.
property Scopes #
Scopes #public IReadOnlyList<string> Scopes { get; init; }
Effective scopes enforced by the gateway.
property SenderConfirmation #
SenderConfirmation #public string? SenderConfirmation { get; init; }
Sender confirmation thumbprint (for example DPoP JKT) when available.
property Subject #
Subject #public string Subject { get; init; }
Subject (authenticated actor).
property Tenant #
Tenant #public string? Tenant { get; init; }
Tenant identifier, when available.
property Version #
Version #public int Version { get; init; }
Envelope schema version.
class GatewayIdentityEnvelopeCodec
public static class GatewayIdentityEnvelopeCodec
Codec for creating and verifying signed identity envelopes.
Remarks
The gateway seals every request it dispatches with this envelope, and every downstream service verifies it.
The MAC is computed through the ICryptoHmac abstraction for the authentication purpose (Hmac), not for document signing. The gateway and the services resolve the same implementation, so both sides compute the same algorithm and verification needs no further configuration.
Callers that omit the ICryptoHmac argument (or pass a DI lookup that found none) get Default: HMAC-SHA256, through the dependency-free Sha2CryptoHmac unless the host deploys its own crypto provider.
Members
| Member | Kind | Summary |
|---|---|---|
AlgorithmHs256 | constant | Algorithm marker used for generated signatures under the default world compliance profile. |
Sign( | method | Creates a signed identity envelope. |
TryVerify( | method | Tries to verify and decode a signed identity envelope using the supplied compliance-aware HMAC primitive. |
TryVerify( | method | Tries to verify and decode a signed identity envelope. |
constant AlgorithmHs256 #
AlgorithmHs256 #public const string AlgorithmHs256 = "HS256"
Algorithm marker used for generated signatures under the default world compliance profile. Retained for backwards compatibility with existing tests and downstream consumers; the GatewayIdentityEnvelopeSignature.field of new signatures is populated dynamically from ICrypto.
method Sign(GatewayIdentityEnvelope, string, ICryptoHmac) #
Sign(GatewayIdentityEnvelope, string, ICryptoHmac) #public static GatewayIdentityEnvelopeSignature Sign(GatewayIdentityEnvelope envelope, string signingKey, ICryptoHmac? hmac = null)
Creates a signed identity envelope. The HMAC algorithm is chosen by the active regional compliance profile via ICryptoHmac, for the purpose Hmac.
Parameters
envelope: Envelope payload to sign.signingKey: Shared signing key.hmac: Compliance-aware HMAC primitive. Whennull, falls back toDefaultso callers without DI (tests, ad-hoc helpers, hosts that register none) keep working unchanged.Crypto Primitives. Hmac
method TryVerify(string, string, string, ICryptoHmac, out GatewayIdentityEnvelope) #
TryVerify(string, string, string, ICryptoHmac, out GatewayIdentityEnvelope) #public static bool TryVerify(string payload, string signature, string signingKey, ICryptoHmac? hmac, out GatewayIdentityEnvelope? envelope)
Tries to verify and decode a signed identity envelope using the supplied compliance-aware HMAC primitive.
method TryVerify(string, string, string, out GatewayIdentityEnvelope) #
TryVerify(string, string, string, out GatewayIdentityEnvelope) #public static bool TryVerify(string payload, string signature, string signingKey, out GatewayIdentityEnvelope? envelope)
Tries to verify and decode a signed identity envelope. The HMAC algorithm matches the active regional compliance profile resolved through ICryptoHmac.
struct GatewayIdentityEnvelopeSignature
public readonly struct GatewayIdentityEnvelopeSignature : IEquatable<GatewayIdentityEnvelopeSignature>
Result of envelope signing operation.
Parameters
Payload: The encoded envelope payload.Signature: The signature of the payload.Algorithm: The algorithm the signature was made with.
Members
| Member | Kind | Summary |
|---|---|---|
GatewayIdentityEnvelopeSignature( | constructor | Result of envelope signing operation. |
Algorithm | property | The algorithm the signature was made with. |
Payload | property | The encoded envelope payload. |
Signature | property | The signature of the payload. |
constructor GatewayIdentityEnvelopeSignature(string, string, string) #
GatewayIdentityEnvelopeSignature(string, string, string) #public GatewayIdentityEnvelopeSignature(string Payload, string Signature, string Algorithm)
Result of envelope signing operation.
Parameters
Payload: The encoded envelope payload.Signature: The signature of the payload.Algorithm: The algorithm the signature was made with.
property Algorithm #
Algorithm #public string Algorithm { get; init; }
The algorithm the signature was made with.
property Payload #
Payload #public string Payload { get; init; }
The encoded envelope payload.
property Signature #
Signature #public string Signature { get; init; }
The signature of the payload.
namespace StellaOps.Router.Common.Models
| Type | Kind | Description |
|---|---|---|
CancelPayload | record | Payload for the Cancel frame. |
CancelReasons | class | Standard reasons for request cancellation. |
ClaimRequirement | record | Represents a claim requirement for endpoint authorization. |
ConnectionState | class | Represents the state of a connection between a microservice and the router. |
EndpointAuthorizationSemantics | class | Resolves effective authorization semantics for endpoint descriptors. |
EndpointAuthorizationSource | enum | Source of authorization metadata for an endpoint descriptor. |
EndpointDescriptor | record | Describes an endpoint’s identity and metadata. |
EndpointSchemaInfo | record | Schema metadata for an endpoint, referencing schemas by ID. |
EndpointsUpdatePayload | record | Payload for the EndpointsUpdate frame sent by a microservice after the router requests a metadata replay. |
Frame | record | Represents a protocol frame in the router transport layer. |
HeartbeatPayload | record | Payload for the Heartbeat frame sent periodically by microservices. |
HelloPayload | record | Payload for the Hello frame sent by microservices on connection. |
InstanceDescriptor | record | Describes a microservice instance’s identity. |
PayloadLimits | class | Configuration for payload and memory limits. |
QueryParameterInfo | record | Lightweight query parameter descriptor that can be serialized in the HELLO payload. |
RegistrationResyncRequestPayload | record | Payload for the ResyncRequest frame sent by the router when it needs a fresh endpoint metadata replay. |
RouterTransportCapabilities | class | Canonical capability identifiers advertised by router transport connections. |
RoutingContext | record | Neutral routing context that does not depend on ASP.NET. |
RoutingDecision | record | Represents the outcome of a routing decision. |
SchemaDefinition | record | A JSON Schema definition for request or response validation. |
ServiceOpenApiInfo | record | OpenAPI metadata for a microservice. |
StreamDataPayload | record | Payload for streaming data frames (REQUEST_STREAM_DATA/RESPONSE_STREAM_DATA). |
StreamingOptions | record | Configuration options for streaming operations. |
TransportDefaultPorts | class | The default ports of the connection transports. |
record CancelPayload
public sealed record CancelPayload
Payload for the Cancel frame.
Members
| Member | Kind | Summary |
|---|---|---|
CancelPayload( | constructor | Creates an instance of CancelPayload. |
Reason | property | Gets the reason for cancellation. |
constructor CancelPayload() #
CancelPayload() #public CancelPayload()
Creates an instance of CancelPayload.
property Reason #
Reason #public string? Reason { get; init; }
Gets the reason for cancellation.
class CancelReasons
public static class CancelReasons
Standard reasons for request cancellation.
Members
| Member | Kind | Summary |
|---|---|---|
ClientDisconnected | constant | The HTTP client disconnected before the request completed. |
ConnectionClosed | constant | The transport connection was closed unexpectedly. |
PayloadLimitExceeded | constant | The request or response payload exceeded configured limits. |
Shutdown | constant | The gateway or microservice is shutting down. |
Timeout | constant | The request exceeded its timeout. |
constant ClientDisconnected #
ClientDisconnected #public const string ClientDisconnected = "ClientDisconnected"
The HTTP client disconnected before the request completed.
constant ConnectionClosed #
ConnectionClosed #public const string ConnectionClosed = "ConnectionClosed"
The transport connection was closed unexpectedly.
constant PayloadLimitExceeded #
PayloadLimitExceeded #public const string PayloadLimitExceeded = "PayloadLimitExceeded"
The request or response payload exceeded configured limits.
constant Shutdown #
Shutdown #public const string Shutdown = "Shutdown"
The gateway or microservice is shutting down.
constant Timeout #
Timeout #public const string Timeout = "Timeout"
The request exceeded its timeout.
record ClaimRequirement
public sealed record ClaimRequirement
Represents a claim requirement for endpoint authorization.
Members
| Member | Kind | Summary |
|---|---|---|
ClaimRequirement( | constructor | Creates an instance of ClaimRequirement. |
AllowedValues | property | When non-null and non-empty, the requirement is satisfied if the principal presents ANY one of these values for ClaimRequirement.. |
Type | property | Gets the claim type that must be present. |
Value | property | Gets the optional claim value that must match. |
constructor ClaimRequirement() #
ClaimRequirement() #public ClaimRequirement()
Creates an instance of ClaimRequirement.
property AllowedValues #
AllowedValues #public IReadOnlyList<string>? AllowedValues { get; init; }
When non-null and non-empty, the requirement is satisfied if the principal presents ANY one of these values for ClaimRequirement.. Used for any-of scope policies (e.g. orch:read OR script:read). Takes precedence over ClaimRequirement..
property Type #
Type #public required string Type { get; init; }
Gets the claim type that must be present.
property Value #
Value #public string? Value { get; init; }
Gets the optional claim value that must match. Used for single-value AND-style requirements. Ignored when ClaimRequirement.is set.
class ConnectionState
public sealed class ConnectionState
Represents the state of a connection between a microservice and the router.
Members
| Member | Kind | Summary |
|---|---|---|
ConnectionState( | constructor | Creates an instance of ConnectionState. |
AveragePingMs | property | Gets or sets the average ping time in milliseconds. |
ConnectedAtUtc | property | Gets the UTC timestamp when this connection was established. |
ConnectionId | property | Gets the unique identifier for this connection. |
Endpoints | property | Gets the endpoints served by this connection. |
Instance | property | Gets the instance descriptor for the connected microservice. |
LastHeartbeatUtc | property | Gets or sets the UTC timestamp of the last heartbeat. |
OpenApiInfo | property | Gets the OpenAPI metadata for this connection’s service. |
Schemas | property | Gets the schema definitions for this connection’s service. |
Status | property | Gets or sets the health status of this connection. |
TransportCapabilities | property | Gets the transport capabilities advertised by this exact connection. |
TransportType | property | Gets the transport type used for this connection. |
constructor ConnectionState() #
ConnectionState() #public ConnectionState()
Creates an instance of ConnectionState.
property AveragePingMs #
AveragePingMs #public double AveragePingMs { get; set; }
Gets or sets the average ping time in milliseconds.
property ConnectedAtUtc #
ConnectedAtUtc #public DateTime ConnectedAtUtc { get; init; }
Gets the UTC timestamp when this connection was established.
property ConnectionId #
ConnectionId #public required string ConnectionId { get; init; }
Gets the unique identifier for this connection.
property Endpoints #
Endpoints #public Dictionary<(string Method, string Path), EndpointDescriptor> Endpoints { get; }
Gets the endpoints served by this connection.
property Instance #
Instance #public required InstanceDescriptor Instance { get; init; }
Gets the instance descriptor for the connected microservice.
property LastHeartbeatUtc #
LastHeartbeatUtc #public DateTime LastHeartbeatUtc { get; set; }
Gets or sets the UTC timestamp of the last heartbeat.
property OpenApiInfo #
OpenApiInfo #public ServiceOpenApiInfo? OpenApiInfo { get; init; }
Gets the OpenAPI metadata for this connection’s service.
property Schemas #
Schemas #public IReadOnlyDictionary<string, SchemaDefinition> Schemas { get; init; }
Gets the schema definitions for this connection’s service. Keys are schema IDs referenced by EndpointDescriptor.SchemaInfo.
property Status #
Status #public InstanceHealthStatus Status { get; set; }
Gets or sets the health status of this connection.
property TransportCapabilities #
TransportCapabilities #public IReadOnlyList<string> TransportCapabilities { get; init; }
Gets the transport capabilities advertised by this exact connection.
property TransportType #
TransportType #public required TransportType TransportType { get; init; }
Gets the transport type used for this connection.
class EndpointAuthorizationSemantics
public static class EndpointAuthorizationSemantics
Resolves effective authorization semantics for endpoint descriptors.
Members
| Member | Kind | Summary |
|---|---|---|
ResolveRequiresAuthentication( | method | Resolves whether an endpoint should require an authenticated principal. |
ResolveRequiresAuthentication( | method | Resolves whether an endpoint should require an authenticated principal. |
method ResolveRequiresAuthentication(EndpointDescriptor) #
ResolveRequiresAuthentication(EndpointDescriptor) #public static bool ResolveRequiresAuthentication(EndpointDescriptor endpoint)
Resolves whether an endpoint should require an authenticated principal.
method ResolveRequiresAuthentication(bool, bool, EndpointAuthorizationSource, IReadOnlyList<ClaimRequirement>, IReadOnlyList<string>, IReadOnlyList<string>) #
ResolveRequiresAuthentication(bool, bool, EndpointAuthorizationSource, IReadOnlyList<ClaimRequirement>, IReadOnlyList<string>, IReadOnlyList<string>) #public static bool ResolveRequiresAuthentication(bool allowAnonymous, bool requiresAuthentication, EndpointAuthorizationSource source, IReadOnlyList<ClaimRequirement>? requiringClaims = null, IReadOnlyList<string>? authorizationPolicies = null, IReadOnlyList<string>? roles = null)
Resolves whether an endpoint should require an authenticated principal.
enum EndpointAuthorizationSource
public enum EndpointAuthorizationSource
Source of authorization metadata for an endpoint descriptor.
record EndpointDescriptor
public sealed record EndpointDescriptor
Describes an endpoint’s identity and metadata.
Members
| Member | Kind | Summary |
|---|---|---|
EndpointDescriptor( | constructor | Creates an instance of EndpointDescriptor. |
AnyMethod | constant | The EndpointDescriptor.of an endpoint that accepts any HTTP method: an ASP.NET Core endpoint mapped without an HTTP method filter, or a wildcard. |
AllowAnonymous | property | Gets a value indicating whether this endpoint explicitly allows anonymous access. |
AuthorizationFullyMapped | property | Gets a value indicating whether the publishing service resolved and translated EVERY authorization rule it declared on this endpoint. |
AuthorizationPolicies | property | Gets named authorization policies discovered for this endpoint. |
AuthorizationSource | property | Gets the source of the authorization metadata. |
DefaultTimeout | property | Gets the default timeout for this endpoint. |
HandlerType | property | Gets the handler type that processes requests for this endpoint. |
Method | property | Gets the HTTP method token as the endpoint configures it (GET, POST, PUT, PATCH, DELETE or another token), or EndpointDescriptor.. |
Path | property | Gets the path template (e.g., “/billing/invoices/{id}”), with its letter case, its slashes and its catch-all, optional and default-value markers as configured. |
RequiresAuthentication | property | Gets a value indicating whether this endpoint requires an authenticated principal. |
RequiringClaims | property | Gets the claim requirements for authorization. |
Roles | property | Gets role names required by endpoint metadata. |
SchemaInfo | property | Gets the schema information for this endpoint. |
ServiceName | property | Gets the name of the service that owns this endpoint. |
SupportsStreaming | property | Gets a value indicating whether this endpoint supports streaming. |
UnmappedAuthorizationRequirements | property | Gets the requirement type names the publishing service DECLARED and could not translate into a claim requirement — an AssertionRequirement from Require, an unresolvable named policy, a custom requirement exposing no scope property. |
Version | property | Gets the semantic version of the service. |
constructor EndpointDescriptor() #
EndpointDescriptor() #public EndpointDescriptor()
Creates an instance of EndpointDescriptor.
constant AnyMethod #
AnyMethod #public const string AnyMethod = "*"
The EndpointDescriptor.of an endpoint that accepts any HTTP method: an ASP.NET Core endpoint mapped without an HTTP method filter, or a wildcard. The gateway routes every request method to it, after an endpoint of the same path that names the method.
property AllowAnonymous #
AllowAnonymous #public bool AllowAnonymous { get; init; }
Gets a value indicating whether this endpoint explicitly allows anonymous access.
property AuthorizationFullyMapped #
AuthorizationFullyMapped #public bool AuthorizationFullyMapped { get; init; }
Gets a value indicating whether the publishing service resolved and translated EVERY authorization rule it declared on this endpoint.
Remarks
The gateway is the only enforcement point on the router-dispatched path (the ASP.NET Core bridge dispatches a request without the host’s authorization middleware), and it enforces exactly EndpointDescriptor.. When that list is empty, the gateway cannot tell “this endpoint requires only authentication” from “this endpoint declared a rule the service could not translate”. This flag makes that distinction, and it is the service’s own assurance: false is the default, so the gateway refuses a request to an endpoint that declares a named authorization policy unless the service reports its authorization as fully mapped.
property AuthorizationPolicies #
AuthorizationPolicies #public IReadOnlyList<string> AuthorizationPolicies { get; init; }
Gets named authorization policies discovered for this endpoint.
property AuthorizationSource #
AuthorizationSource #public EndpointAuthorizationSource AuthorizationSource { get; init; }
Gets the source of the authorization metadata.
property DefaultTimeout #
DefaultTimeout #public TimeSpan DefaultTimeout { get; init; }
Gets the default timeout for this endpoint.
property HandlerType #
HandlerType #public Type? HandlerType { get; init; }
Gets the handler type that processes requests for this endpoint. This is used by the Microservice SDK for handler resolution. It is a process-local reference: it is not serialized (System.Text.Json does not serialize Type), so a HELLO or an endpoints update never carries it.
property Method #
Method #public required string Method { get; init; }
Gets the HTTP method token as the endpoint configures it (GET, POST, PUT, PATCH, DELETE or another token), or EndpointDescriptor..
property Path #
Path #public required string Path { get; init; }
Gets the path template (e.g., “/billing/invoices/{id}”), with its letter case, its slashes and its catch-all, optional and default-value markers as configured.
property RequiresAuthentication #
RequiresAuthentication #public bool RequiresAuthentication { get; init; }
Gets a value indicating whether this endpoint requires an authenticated principal.
property RequiringClaims #
RequiringClaims #public IReadOnlyList<ClaimRequirement> RequiringClaims { get; init; }
Gets the claim requirements for authorization.
property Roles #
Roles #public IReadOnlyList<string> Roles { get; init; }
Gets role names required by endpoint metadata.
property SchemaInfo #
SchemaInfo #public EndpointSchemaInfo? SchemaInfo { get; init; }
Gets the schema information for this endpoint. Contains references to request/response schemas and OpenAPI documentation.
property ServiceName #
ServiceName #public required string ServiceName { get; init; }
Gets the name of the service that owns this endpoint.
property SupportsStreaming #
SupportsStreaming #public bool SupportsStreaming { get; init; }
Gets a value indicating whether this endpoint supports streaming.
property UnmappedAuthorizationRequirements #
UnmappedAuthorizationRequirements #public IReadOnlyList<string> UnmappedAuthorizationRequirements { get; init; }
Gets the requirement type names the publishing service DECLARED and could not translate into a claim requirement — an AssertionRequirement from Require, an unresolvable named policy, a custom requirement exposing no scope property.
Remarks
Diagnostic only: the gateway’s decision is driven by EndpointDescriptor., so an old descriptor that carries neither field still fails closed. This list is what names the offending requirement in the refusal log.
property Version #
Version #public required string Version { get; init; }
Gets the semantic version of the service.
record EndpointSchemaInfo
public sealed record EndpointSchemaInfo
Schema metadata for an endpoint, referencing schemas by ID.
Members
| Member | Kind | Summary |
|---|---|---|
EndpointSchemaInfo( | constructor | Creates an instance of EndpointSchemaInfo. |
Deprecated | property | Gets a value indicating whether this endpoint is deprecated. |
Description | property | Gets the OpenAPI operation description. |
QueryParameters | property | Gets the query parameter descriptors for this endpoint. |
RequestSchemaId | property | Gets the schema ID for request validation. |
ResponseSchemaId | property | Gets the schema ID for response validation. |
ResponseStatusCode | property | Gets the preferred success HTTP status code for the response schema. |
Summary | property | Gets the OpenAPI operation summary. |
Tags | property | Gets the OpenAPI tags for this endpoint. |
constructor EndpointSchemaInfo() #
EndpointSchemaInfo() #public EndpointSchemaInfo()
Creates an instance of EndpointSchemaInfo.
property Deprecated #
Deprecated #public bool Deprecated { get; init; }
Gets a value indicating whether this endpoint is deprecated.
property Description #
Description #public string? Description { get; init; }
Gets the OpenAPI operation description.
property QueryParameters #
QueryParameters #public IReadOnlyList<QueryParameterInfo> QueryParameters { get; init; }
Gets the query parameter descriptors for this endpoint. Each entry contains the parameter name, JSON Schema type, and whether it is required. Propagated via HELLO and consumed by the gateway OpenAPI generator.
property RequestSchemaId #
RequestSchemaId #public string? RequestSchemaId { get; init; }
Gets the schema ID for request validation. References a key in HelloPayload.Schemas.
property ResponseSchemaId #
ResponseSchemaId #public string? ResponseSchemaId { get; init; }
Gets the schema ID for response validation. References a key in HelloPayload.Schemas.
property ResponseStatusCode #
ResponseStatusCode #public int? ResponseStatusCode { get; init; }
Gets the preferred success HTTP status code for the response schema.
property Summary #
Summary #public string? Summary { get; init; }
Gets the OpenAPI operation summary.
property Tags #
Tags #public IReadOnlyList<string> Tags { get; init; }
Gets the OpenAPI tags for this endpoint.
record EndpointsUpdatePayload
public sealed record EndpointsUpdatePayload
Payload for the EndpointsUpdate frame sent by a microservice after the router requests a metadata replay.
Members
| Member | Kind | Summary |
|---|---|---|
EndpointsUpdatePayload( | constructor | Creates an instance of Endpoints. |
Endpoints | property | Gets the endpoints registered by this instance. |
OpenApiInfo | property | Gets the OpenAPI metadata for this service. |
Schemas | property | Gets the schema definitions for request/response validation. |
constructor EndpointsUpdatePayload() #
EndpointsUpdatePayload() #public EndpointsUpdatePayload()
Creates an instance of Endpoints.
property Endpoints #
Endpoints #public required IReadOnlyList<EndpointDescriptor> Endpoints { get; init; }
Gets the endpoints registered by this instance.
property OpenApiInfo #
OpenApiInfo #public ServiceOpenApiInfo? OpenApiInfo { get; init; }
Gets the OpenAPI metadata for this service.
property Schemas #
Schemas #public IReadOnlyDictionary<string, SchemaDefinition> Schemas { get; init; }
Gets the schema definitions for request/response validation. Keys are schema IDs referenced by EndpointDescriptor.SchemaInfo.
record Frame
public sealed record Frame
Represents a protocol frame in the router transport layer.
Members
| Member | Kind | Summary |
|---|---|---|
Frame( | constructor | Creates an instance of Frame. |
CorrelationId | property | Gets the correlation ID for request/response matching. |
EnvelopeSeal | property | Gets the gateway-issued envelope HMAC seal attached to this frame. |
Payload | property | Gets the raw payload bytes. |
Type | property | Gets the type of this frame. |
constructor Frame() #
Frame() #public Frame()
Creates an instance of Frame.
property CorrelationId #
CorrelationId #public string? CorrelationId { get; init; }
Gets the correlation ID for request/response matching.
property EnvelopeSeal #
EnvelopeSeal #public FrameEnvelopeSeal? EnvelopeSeal { get; init; }
Gets the gateway-issued envelope HMAC seal attached to this frame.
Remarks
Every frame leaving the gateway must carry a seal so that any transport — TCP, UDP, TLS, Messaging, RabbitMq, InMemory — can verify integrity at the application layer. Verifiers reject frames where this is null with rejection reason FrameEnvelopeRejectionReason..
property Payload #
Payload #public ReadOnlyMemory<byte> Payload { get; init; }
Gets the raw payload bytes.
property Type #
Type #public required FrameType Type { get; init; }
Gets the type of this frame.
record HeartbeatPayload
public sealed record HeartbeatPayload
Payload for the Heartbeat frame sent periodically by microservices.
Members
| Member | Kind | Summary |
|---|---|---|
HeartbeatPayload( | constructor | Creates an instance of HeartbeatPayload. |
ErrorRate | property | Gets the error rate (0.0 to 1.0). |
InFlightRequestCount | property | Gets the current in-flight request count. |
Instance | property | Gets the instance descriptor. |
InstanceId | property | Gets the instance ID. |
Status | property | Gets the health status. |
TimestampUtc | property | Gets the timestamp when this heartbeat was created. |
TransportCapabilities | property | Gets transport-specific capabilities supported by this connection. |
constructor HeartbeatPayload() #
HeartbeatPayload() #public HeartbeatPayload()
Creates an instance of HeartbeatPayload.
property ErrorRate #
ErrorRate #public double ErrorRate { get; init; }
Gets the error rate (0.0 to 1.0).
property InFlightRequestCount #
InFlightRequestCount #public int InFlightRequestCount { get; init; }
Gets the current in-flight request count.
property Instance #
Instance #public InstanceDescriptor? Instance { get; init; }
Gets the instance descriptor.
property InstanceId #
InstanceId #public required string InstanceId { get; init; }
Gets the instance ID.
property Status #
Status #public required InstanceHealthStatus Status { get; init; }
Gets the health status.
property TimestampUtc #
TimestampUtc #public DateTime TimestampUtc { get; init; }
Gets the timestamp when this heartbeat was created.
property TransportCapabilities #
TransportCapabilities #public IReadOnlyList<string> TransportCapabilities { get; init; }
Gets transport-specific capabilities supported by this connection. Heartbeats repeat capabilities so gateway state rebuilt after a restart does not lose rolling-upgrade delivery semantics.
record HelloPayload
public sealed record HelloPayload
Payload for the Hello frame sent by microservices on connection.
Members
| Member | Kind | Summary |
|---|---|---|
HelloPayload( | constructor | Creates an instance of HelloPayload. |
Endpoints | property | Gets the endpoints registered by this instance. |
Instance | property | Gets the instance descriptor. |
OpenApiInfo | property | Gets the OpenAPI metadata for this service. |
Schemas | property | Gets the schema definitions for request/response validation. |
TransportCapabilities | property | Gets transport-specific capabilities supported by this connection. |
constructor HelloPayload() #
HelloPayload() #public HelloPayload()
Creates an instance of HelloPayload.
property Endpoints #
Endpoints #public required IReadOnlyList<EndpointDescriptor> Endpoints { get; init; }
Gets the endpoints registered by this instance.
property Instance #
Instance #public required InstanceDescriptor Instance { get; init; }
Gets the instance descriptor.
property OpenApiInfo #
OpenApiInfo #public ServiceOpenApiInfo? OpenApiInfo { get; init; }
Gets the OpenAPI metadata for this service.
property Schemas #
Schemas #public IReadOnlyDictionary<string, SchemaDefinition> Schemas { get; init; }
Gets the schema definitions for request/response validation. Keys are schema IDs referenced by EndpointDescriptor.SchemaInfo.
property TransportCapabilities #
TransportCapabilities #public IReadOnlyList<string> TransportCapabilities { get; init; }
Gets transport-specific capabilities supported by this connection. Unknown values are ignored so mixed-version deployments remain compatible.
record InstanceDescriptor
public sealed record InstanceDescriptor
Describes a microservice instance’s identity.
Members
| Member | Kind | Summary |
|---|---|---|
InstanceDescriptor( | constructor | Creates an instance of InstanceDescriptor. |
InstanceId | property | Gets the unique identifier for this instance. |
Region | property | Gets the region where this instance is deployed. |
ServiceName | property | Gets the name of the service. |
Version | property | Gets the semantic version of the service. |
Weight | property | Gets the routing weight used for intra-tier weighted canary selection. |
constructor InstanceDescriptor() #
InstanceDescriptor() #public InstanceDescriptor()
Creates an instance of InstanceDescriptor.
property InstanceId #
InstanceId #public required string InstanceId { get; init; }
Gets the unique identifier for this instance.
property Region #
Region #public required string Region { get; init; }
Gets the region where this instance is deployed.
property ServiceName #
ServiceName #public required string ServiceName { get; init; }
Gets the name of the service.
property Version #
Version #public required string Version { get; init; }
Gets the semantic version of the service.
property Weight #
Weight #public int Weight { get; init; }
Gets the routing weight used for intra-tier weighted canary selection.
class PayloadLimits
public sealed class PayloadLimits
Configuration for payload and memory limits.
Members
| Member | Kind | Summary |
|---|---|---|
PayloadLimits( | constructor | Creates an instance of PayloadLimits. |
Default | field | Default payload limits. |
MaxAggregateInflightBytes | property | Gets or sets the maximum aggregate in-flight bytes across all requests. |
MaxRequestBytesPerCall | property | Gets or sets the maximum request bytes per call. |
MaxRequestBytesPerConnection | property | Gets or sets the maximum request bytes per connection. |
constructor PayloadLimits() #
PayloadLimits() #public PayloadLimits()
Creates an instance of PayloadLimits.
field Default #
Default #public static readonly PayloadLimits Default
Default payload limits.
property MaxAggregateInflightBytes #
MaxAggregateInflightBytes #public long MaxAggregateInflightBytes { get; set; }
Gets or sets the maximum aggregate in-flight bytes across all requests. Default: 1 GB.
property MaxRequestBytesPerCall #
MaxRequestBytesPerCall #public long MaxRequestBytesPerCall { get; set; }
Gets or sets the maximum request bytes per call. Default: 10 MB.
property MaxRequestBytesPerConnection #
MaxRequestBytesPerConnection #public long MaxRequestBytesPerConnection { get; set; }
Gets or sets the maximum request bytes per connection. Default: 100 MB.
record QueryParameterInfo
public sealed record QueryParameterInfo
Lightweight query parameter descriptor that can be serialized in the HELLO payload.
Members
| Member | Kind | Summary |
|---|---|---|
QueryParameterInfo( | constructor | Creates an instance of QueryParameterInfo. |
Description | property | Optional description for OpenAPI documentation. |
Name | property | Parameter name as it appears in the query string. |
Required | property | Whether the parameter is required. |
Type | property | JSON Schema type (string, integer, boolean, array, etc.). |
constructor QueryParameterInfo() #
QueryParameterInfo() #public QueryParameterInfo()
Creates an instance of QueryParameterInfo.
property Description #
Description #public string? Description { get; init; }
Optional description for OpenAPI documentation.
property Name #
Name #public required string Name { get; init; }
Parameter name as it appears in the query string.
property Required #
Required #public bool Required { get; init; }
Whether the parameter is required.
property Type #
Type #public string Type { get; init; }
JSON Schema type (string, integer, boolean, array, etc.).
record RegistrationResyncRequestPayload
public sealed record RegistrationResyncRequestPayload
Payload for the ResyncRequest frame sent by the router when it needs a fresh endpoint metadata replay.
Members
| Member | Kind | Summary |
|---|---|---|
RegistrationResyncRequestPayload( | constructor | Creates an instance of Registration. |
Reason | property | Gets the reason for the replay request. |
constructor RegistrationResyncRequestPayload() #
RegistrationResyncRequestPayload() #public RegistrationResyncRequestPayload()
Creates an instance of Registration.
property Reason #
Reason #public string Reason { get; init; }
Gets the reason for the replay request.
class RouterTransportCapabilities
public static class RouterTransportCapabilities
Canonical capability identifiers advertised by router transport connections.
Members
| Member | Kind | Summary |
|---|---|---|
MessagingCancelControlV1 | constant | The messaging client consumes authenticated CANCEL frames from its connection-specific control queue independently of the request queue. |
constant MessagingCancelControlV1 #
MessagingCancelControlV1 #public const string MessagingCancelControlV1 = "messaging.cancel-control.v1"
The messaging client consumes authenticated CANCEL frames from its connection-specific control queue independently of the request queue.
record RoutingContext
public sealed record RoutingContext
Neutral routing context that does not depend on ASP.NET. Gateway will adapt from HttpContext to this neutral model.
Members
| Member | Kind | Summary |
|---|---|---|
RoutingContext( | constructor | Creates an instance of RoutingContext. |
AvailableConnections | property | Gets the available connections for routing. |
CancellationToken | property | Gets the cancellation token for the request. |
Endpoint | property | Gets the resolved endpoint descriptor. |
GatewayRegion | property | Gets the gateway’s region for routing decisions. |
Headers | property | Gets the request headers. |
Method | property | Gets the HTTP method (GET, POST, PUT, PATCH, DELETE). |
Path | property | Gets the request path. |
RequestedVersion | property | Gets the requested version, if specified. |
RouteDefaultTimeout | property | Gets the gateway route default timeout selected for this request path. |
constructor RoutingContext() #
RoutingContext() #public RoutingContext()
Creates an instance of RoutingContext.
property AvailableConnections #
AvailableConnections #public IReadOnlyList<ConnectionState> AvailableConnections { get; init; }
Gets the available connections for routing.
property CancellationToken #
CancellationToken #public CancellationToken CancellationToken { get; init; }
Gets the cancellation token for the request.
property Endpoint #
Endpoint #public EndpointDescriptor? Endpoint { get; init; }
Gets the resolved endpoint descriptor.
property GatewayRegion #
GatewayRegion #public required string GatewayRegion { get; init; }
Gets the gateway’s region for routing decisions.
property Headers #
Headers #public IReadOnlyDictionary<string, string> Headers { get; init; }
Gets the request headers.
property Method #
Method #public required string Method { get; init; }
Gets the HTTP method (GET, POST, PUT, PATCH, DELETE).
property Path #
Path #public required string Path { get; init; }
Gets the request path.
property RequestedVersion #
RequestedVersion #public string? RequestedVersion { get; init; }
Gets the requested version, if specified.
property RouteDefaultTimeout #
RouteDefaultTimeout #public TimeSpan? RouteDefaultTimeout { get; init; }
Gets the gateway route default timeout selected for this request path.
record RoutingDecision
public sealed record RoutingDecision
Represents the outcome of a routing decision.
Members
| Member | Kind | Summary |
|---|---|---|
RoutingDecision( | constructor | Creates an instance of RoutingDecision. |
Connection | property | Gets the selected connection. |
EffectiveTimeout | property | Gets the effective timeout for the request: the gateway answers the caller with 504 when it elapses. |
Endpoint | property | Gets the selected endpoint. |
TransportType | property | Gets the transport type to use. |
constructor RoutingDecision() #
RoutingDecision() #public RoutingDecision()
Creates an instance of RoutingDecision.
property Connection #
Connection #public required ConnectionState Connection { get; init; }
Gets the selected connection.
property EffectiveTimeout #
EffectiveTimeout #public required TimeSpan EffectiveTimeout { get; init; }
Gets the effective timeout for the request: the gateway answers the caller with 504 when it elapses.
Remarks
The request frame carries it to the microservice in whole seconds, rounded up and at least one second; the Messaging transport’s service side stops the request at that rounded-up timeout.
property Endpoint #
Endpoint #public required EndpointDescriptor Endpoint { get; init; }
Gets the selected endpoint.
property TransportType #
TransportType #public required TransportType TransportType { get; init; }
Gets the transport type to use.
record SchemaDefinition
public sealed record SchemaDefinition
A JSON Schema definition for request or response validation.
Members
| Member | Kind | Summary |
|---|---|---|
SchemaDefinition( | constructor | Creates an instance of SchemaDefinition. |
ETag | property | Gets the ETag for cache validation (SHA256 truncated). |
SchemaId | property | Gets the unique schema identifier (e.g., “CreateInvoiceRequest”). |
SchemaJson | property | Gets the JSON Schema document (draft 2020-12 compatible). |
constructor SchemaDefinition() #
SchemaDefinition() #public SchemaDefinition()
Creates an instance of SchemaDefinition.
property ETag #
ETag #public string? ETag { get; init; }
Gets the ETag for cache validation (SHA256 truncated).
property SchemaId #
SchemaId #public required string SchemaId { get; init; }
Gets the unique schema identifier (e.g., “CreateInvoiceRequest”).
property SchemaJson #
SchemaJson #public required string SchemaJson { get; init; }
Gets the JSON Schema document (draft 2020-12 compatible).
record ServiceOpenApiInfo
public sealed record ServiceOpenApiInfo
OpenAPI metadata for a microservice.
Members
| Member | Kind | Summary |
|---|---|---|
ServiceOpenApiInfo( | constructor | Creates an instance of ServiceOpenApiInfo. |
Contact | property | Gets the contact information for the service. |
Description | property | Gets the service description for OpenAPI info. |
License | property | Gets the license name for the service. |
Title | property | Gets the service title for OpenAPI info. |
constructor ServiceOpenApiInfo() #
ServiceOpenApiInfo() #public ServiceOpenApiInfo()
Creates an instance of ServiceOpenApiInfo.
property Contact #
Contact #public string? Contact { get; init; }
Gets the contact information for the service.
property Description #
Description #public string? Description { get; init; }
Gets the service description for OpenAPI info.
property License #
License #public string? License { get; init; }
Gets the license name for the service.
property Title #
Title #public string? Title { get; init; }
Gets the service title for OpenAPI info.
record StreamDataPayload
public sealed record StreamDataPayload
Payload for streaming data frames (REQUEST_STREAM_DATA/RESPONSE_STREAM_DATA).
Members
| Member | Kind | Summary |
|---|---|---|
StreamDataPayload( | constructor | Creates an instance of StreamDataPayload. |
CorrelationId | property | Gets the correlation ID linking stream data to the original request. |
Data | property | Gets the stream data chunk. |
EndOfStream | property | Gets a value indicating whether this is the final chunk. |
SequenceNumber | property | Gets the sequence number for ordering. |
constructor StreamDataPayload() #
StreamDataPayload() #public StreamDataPayload()
Creates an instance of StreamDataPayload.
property CorrelationId #
CorrelationId #public required Guid CorrelationId { get; init; }
Gets the correlation ID linking stream data to the original request.
property Data #
Data #public byte[] Data { get; init; }
Gets the stream data chunk.
property EndOfStream #
EndOfStream #public bool EndOfStream { get; init; }
Gets a value indicating whether this is the final chunk.
property SequenceNumber #
SequenceNumber #public int SequenceNumber { get; init; }
Gets the sequence number for ordering.
record StreamingOptions
public sealed record StreamingOptions
Configuration options for streaming operations.
Members
| Member | Kind | Summary |
|---|---|---|
StreamingOptions( | constructor | Creates an instance of StreamingOptions. |
Default | field | Gets the default streaming options. |
ChannelCapacity | property | Gets the channel capacity for buffered stream data. |
ChunkSize | property | Gets the size of each chunk when streaming data. |
MaxConcurrentStreams | property | Gets the maximum number of concurrent streams per connection. |
StreamIdleTimeout | property | Gets the timeout for idle streams (no data flowing). |
constructor StreamingOptions() #
StreamingOptions() #public StreamingOptions()
Creates an instance of StreamingOptions.
field Default #
Default #public static readonly StreamingOptions Default
Gets the default streaming options.
property ChannelCapacity #
ChannelCapacity #public int ChannelCapacity { get; init; }
Gets the channel capacity for buffered stream data. Default: 16 chunks.
property ChunkSize #
ChunkSize #public int ChunkSize { get; init; }
Gets the size of each chunk when streaming data. Default: 64 KB.
property MaxConcurrentStreams #
MaxConcurrentStreams #public int MaxConcurrentStreams { get; init; }
Gets the maximum number of concurrent streams per connection. Default: 100.
property StreamIdleTimeout #
StreamIdleTimeout #public TimeSpan StreamIdleTimeout { get; init; }
Gets the timeout for idle streams (no data flowing). Default: 5 minutes.
class TransportDefaultPorts
public static class TransportDefaultPorts
The default ports of the connection transports. The gateway’s listener options and the transports’ own options (which the transport plugins bind from the same configuration section) take their defaults from here, so a listener configured without a port uses the port the gateway’s options describe.
Members
| Member | Kind | Summary |
|---|---|---|
Tcp | constant | The TCP transport’s default port. |
Tls | constant | The TLS transport’s default port. |
Udp | constant | The UDP transport’s default port. |
constant Tcp #
Tcp #public const int Tcp = 9100
The TCP transport’s default port.
constant Tls #
Tls #public const int Tls = 9443
The TLS transport’s default port.
constant Udp #
Udp #public const int Udp = 5102
The UDP transport’s default port.
namespace StellaOps.Router.Common.Plugins
| Type | Kind | Description |
|---|---|---|
IRouterTransportPlugin | interface | Plugin contract for router transport implementations. |
RouterTransportConfigurationBinder | class | Binding helpers for transport option values the configuration binder cannot convert. |
RouterTransportMode | enum | Transport mode flags indicating whether to register server, client, or both capabilities. |
RouterTransportPluginLoader | class | Loads and discovers router transport plugins from assemblies the host passes in (RouterTransportPluginLoader.). |
RouterTransportRegistrationContext | class | Context provided to transport plugins during registration. |
interface IRouterTransportPlugin
public interface IRouterTransportPlugin
Plugin contract for router transport implementations. A plugin provides one side of a transport (IRouterTransportPlugin.): the client side that a microservice uses to connect, the server side that a gateway listens with, or both for an in-process transport. A network transport ships its client side in Stella and its server side in Stella; both plugins carry the same IRouterTransportPlugin., and RouterTransportPluginLoaderkeys plugins by name and mode.
Members
| Member | Kind | Summary |
|---|---|---|
DisplayName | property | Gets the human-readable display name for this transport. |
Mode | property | Gets the side of the transport this plugin registers: RouterTransportMode., RouterTransportMode., or RouterTransportMode.. |
TransportName | property | Gets the transport name (e.g., “tcp”, “tls”, “udp”, “rabbitmq”, “inmemory”, “messaging”), shared by the client and the server plugin of one transport. |
Register( | method | Registers transport services into the DI container for the side the context asks for. |
property DisplayName #
DisplayName #string DisplayName { get; }
Gets the human-readable display name for this transport.
property Mode #
Mode #RouterTransportMode Mode { get; }
Gets the side of the transport this plugin registers: RouterTransportMode., RouterTransportMode., or RouterTransportMode.. IRouterTransportPlugin.refuses a context that asks for a side outside this value (RouterTransportRegistrationContext.).
property TransportName #
TransportName #string TransportName { get; }
Gets the transport name (e.g., “tcp”, “tls”, “udp”, “rabbitmq”, “inmemory”, “messaging”), shared by the client and the server plugin of one transport.
method Register(RouterTransportRegistrationContext) #
Register(RouterTransportRegistrationContext) #void Register(RouterTransportRegistrationContext context)
Registers transport services into the DI container for the side the context asks for.
Parameters
context: The registration context containing services, configuration, and transport mode.
Exceptions
Invalid: The context asks for a side this plugin does not provide.Operation Exception
class RouterTransportConfigurationBinder
public static class RouterTransportConfigurationBinder
Binding helpers for transport option values the configuration binder cannot convert.
Members
| Member | Kind | Summary |
|---|---|---|
BindIPAddress( | method | Reads an IP address setting. |
method BindIPAddress(IConfigurationSection, string, Action<IPAddress>) #
BindIPAddress(IConfigurationSection, string, Action<IPAddress>) #public static void BindIPAddress(IConfigurationSection section, string key, Action<IPAddress> apply)
Reads an IP address setting. The configuration binder has no converter from a string to IPAddress and leaves the default in place without an error, so a configured BindAddress such as 127.0.0.1 was ignored and the listener bound every interface. An absent or empty value keeps the default; a value that is not an IP address fails closed.
Parameters
section: The transport’s configuration section.key: The setting name, for exampleBindAddress.apply: Receives the parsed address.
Exceptions
Invalid: The value is not an IP address.Operation Exception
enum RouterTransportMode
public enum RouterTransportMode
Transport mode flags indicating whether to register server, client, or both capabilities.
class RouterTransportPluginLoader
public sealed class RouterTransportPluginLoader
Loads and discovers router transport plugins from assemblies the host passes in (RouterTransportPluginLoader.).
Remarks
AppDomain-resident transports loaded by the build system live inside the gateway image, which is signed at build time (Authenticode on Windows, signed RPM/DEB on Linux), and so do not need a directory-level trust pipeline.
This library loads nothing from disk. Stella Ops hosts load a transport directory with a signed transports. manifest through Router in Stella, which verifies the directory and then passes each admitted assembly to RouterTransportPluginLoader..
Members
| Member | Kind | Summary |
|---|---|---|
RouterTransportPluginLoader( | constructor | Creates an instance of Router. |
RouterTransportPluginLoader( | constructor | Creates a loader. |
Plugins | property | Gets all loaded transport plugins. |
DescribeLoadOutcome( | method | Describes what this loader holds, for the startup error a host raises when no plugin provides a transport: the loaded plugins with their sides, and each assembly whose types failed to load with its distinct load errors (for example a plugin built against an older IRouter: "Method ‘get_Mode’ … |
GetPlugin( | method | Gets the loaded plugin that provides mode for a transport name (case-insensitive): the client plugin for RouterTransportMode., the server plugin for RouterTransportMode.. |
LoadFromAssembly( | method | Loads transport plugins from the specified assembly. |
RecordLoadFailure( | method | Records an assembly the host could not hand to RouterTransportPluginLoader., for example a signed transport file whose Assembly.LoadFrom failed. |
constructor RouterTransportPluginLoader() #
RouterTransportPluginLoader() #public RouterTransportPluginLoader()
Creates an instance of Router.
constructor RouterTransportPluginLoader(ILogger<RouterTransportPluginLoader>) #
RouterTransportPluginLoader(ILogger<RouterTransportPluginLoader>) #public RouterTransportPluginLoader(ILogger<RouterTransportPluginLoader>? logger = null)
Creates a loader.
Parameters
logger: Receives the load diagnostics; none when not set.
property Plugins #
Plugins #public IReadOnlyList<IRouterTransportPlugin> Plugins { get; }
Gets all loaded transport plugins.
method DescribeLoadOutcome() #
DescribeLoadOutcome() #public string DescribeLoadOutcome()
Describes what this loader holds, for the startup error a host raises when no plugin provides a transport: the loaded plugins with their sides, and each assembly whose types failed to load with its distinct load errors (for example a plugin built against an older IRouter: “Method ‘get_Mode’ … does not have an implementation”). Assemblies are named by file name; rooted paths inside the runtime’s messages (quoted, or as a whole word) are reduced to file names.
Returns
One sentence for plugins and one for load failures.
method GetPlugin(string, RouterTransportMode) #
GetPlugin(string, RouterTransportMode) #public IRouterTransportPlugin? GetPlugin(string transportName, RouterTransportMode mode)
Gets the loaded plugin that provides mode for a transport name (case-insensitive): the client plugin for RouterTransportMode., the server plugin for RouterTransportMode.. RouterTransportMode.finds only a plugin that provides both sides (an in-process transport).
Parameters
transportName: The transport name.mode: The side the caller registers.
Returns
The plugin, or null when no loaded plugin provides that side.
method LoadFromAssembly(Assembly) #
LoadFromAssembly(Assembly) #public void LoadFromAssembly(Assembly assembly)
Loads transport plugins from the specified assembly. Used for AppDomain-resident transports that ship inside the gateway image (the gateway image is the trust boundary for these).
Parameters
assembly: The assembly to scan for IRouterTransportPlugin implementations.
method RecordLoadFailure(string, Exception) #
RecordLoadFailure(string, Exception) #public void RecordLoadFailure(string assemblyFile, Exception exception)
Records an assembly the host could not hand to RouterTransportPluginLoader., for example a signed transport file whose Assembly.LoadFrom failed. RouterTransportPluginLoader.reports it with the file name only.
Parameters
assemblyFile: The assembly file name or path; only the file name is kept.exception: The load error.
class RouterTransportRegistrationContext
public sealed class RouterTransportRegistrationContext
Context provided to transport plugins during registration.
Members
| Member | Kind | Summary |
|---|---|---|
RouterTransportRegistrationContext( | constructor | Creates a new registration context. |
Configuration | property | Gets the configuration root. |
ConfigurationSection | property | Gets or sets the configuration section path for this transport (e.g., “Router:Transports:Tcp”). |
Mode | property | Gets the transport mode (server, client, or both). |
Services | property | Gets the service collection for registering services. |
EnsureSupportedBy( | method | Throws when RouterTransportRegistrationContext.asks for a side of the transport that plugin does not provide. |
constructor RouterTransportRegistrationContext(IServiceCollection, IConfiguration, RouterTransportMode) #
RouterTransportRegistrationContext(IServiceCollection, IConfiguration, RouterTransportMode) #public RouterTransportRegistrationContext(IServiceCollection services, IConfiguration configuration, RouterTransportMode mode)
Creates a new registration context.
Parameters
services: The service collection for registering services.configuration: The configuration root.mode: The transport mode (server, client, or both).
property Configuration #
Configuration #public IConfiguration Configuration { get; }
Gets the configuration root.
property ConfigurationSection #
ConfigurationSection #public string? ConfigurationSection { get; init; }
Gets or sets the configuration section path for this transport (e.g., “Router:Transports:Tcp”).
property Mode #
Mode #public RouterTransportMode Mode { get; }
Gets the transport mode (server, client, or both).
property Services #
Services #public IServiceCollection Services { get; }
Gets the service collection for registering services.
method EnsureSupportedBy(IRouterTransportPlugin) #
EnsureSupportedBy(IRouterTransportPlugin) #public void EnsureSupportedBy(IRouterTransportPlugin plugin)
Throws when RouterTransportRegistrationContext.asks for a side of the transport that plugin does not provide. A network transport’s client plugin registers the client side only; its server side is a separate plugin in Stella.
Parameters
plugin: The plugin about to register.
Exceptions
Invalid: The context asks for a side the plugin does not provide.Operation Exception