StellaOps.Microservice.AspNetCore

ASP.NET Core endpoint bridge for StellaOps Router SDK. Enables ASP.NET endpoints to be automatically registered and dispatched via the Router.

library
Component
Router
Licence
Apache-2.0
Target framework
net10.0
Latest release
1.0.1-20261117T070237Z

Install

dotnet add package StellaOps.Microservice.AspNetCore --version 1.0.1-20261117T070237Z

Namespaces

NamespaceTypes
StellaOps.Microservice.AspNetCore22

namespace StellaOps.Microservice.AspNetCore

TypeKindDescription
AspNetCoreEndpointDiscoveryProviderclassDiscovers ASP.NET Core endpoints and converts them to Router endpoint descriptors.
AspNetEndpointDescriptorrecordExtended endpoint descriptor with full ASP.NET metadata.
AspNetEndpointOverrideMergerclassMerges endpoint overrides from YAML configuration with ASP.NET-discovered endpoints, supporting different authorization mapping strategies.
AspNetRouterRequestDispatcherclassDispatches Router request frames through the ASP.NET Core pipeline.
AuthorizationMappingResultrecordResult of authorization mapping for an endpoint.
AuthorizationMappingStrategyenumStrategy for mapping ASP.NET authorization metadata to Router claim requirements.
AuthorizationSourceenumSource of authorization metadata for an endpoint.
DefaultAuthorizationClaimMapperclassDefault implementation of IAuthorizationClaimMapper.
GatewayAuthorizationTrustModeenumService-side trust mode for gateway authorization and identity envelopes.
IAspNetEndpointDiscoveryProviderinterfaceProvides ASP.NET endpoint discovery with full metadata extraction.
IAspNetEndpointOverrideMergerinterfaceInterface for merging endpoint overrides with ASP.NET-specific authorization mapping strategy support.
IAspNetRouterRequestDispatcherinterfaceDispatches Router request frames through the ASP.NET Core pipeline.
IAuthorizationClaimMapperinterfaceMaps ASP.NET authorization metadata to Router claim requirements.
IRouterTenantResolverinterfaceBinds the tenant of a request that the Router dispatches into ASP.NET Core.
MissingAuthorizationBehaviorenumBehavior when an endpoint has no authorization metadata.
ParameterDescriptorrecordDescribes a parameter for an endpoint.
ParameterSourceenumSource of a parameter value.
ResponseDescriptorrecordDescribes a response for an endpoint.
RouterPublicationExclusionMetadataclassEndpoint metadata that keeps one ASP.NET endpoint off the Router entirely: the bridge does not publish it in the HELLO payload, so the gateway cannot resolve it, and the router request dispatcher refuses it (404), so a frame that names its path still cannot reach it.
StellaRouterBridgeExtensionsclassExtension methods for configuring the StellaOps Router ASP.NET Core bridge.
StellaRouterBridgeOptionsclassConfiguration options for the ASP.NET Core Router bridge.
UnsupportedConstraintBehaviorenumBehavior for unsupported route constraints.

class AspNetCoreEndpointDiscoveryProvider

public sealed class AspNetCoreEndpointDiscoveryProvider : IAspNetEndpointDiscoveryProvider, IEndpointSchemaDefinitionProvider

Discovers ASP.NET Core endpoints and converts them to Router endpoint descriptors.

Members

MemberKindSummary
AspNetCoreEndpointDiscoveryProvider(EndpointDataSource, StellaRouterBridgeOptions, IAuthorizationClaimMapper, ILogger<AspNetCoreEndpointDiscoveryProvider>)constructorCreates the provider over the endpoints of the ASP.NET Core application.
DiscoverAspNetEndpoints()methodDiscover all ASP.NET endpoints with full metadata.
DiscoverEndpoints()methodDiscovers all endpoints in the application.
DiscoverSchemaDefinitions()methodGets schema definitions keyed by schema identifier.
RefreshEndpoints()methodForce a refresh of the discovered endpoints.

constructor AspNetCoreEndpointDiscoveryProvider(EndpointDataSource, StellaRouterBridgeOptions, IAuthorizationClaimMapper, ILogger<AspNetCoreEndpointDiscoveryProvider>) #

public AspNetCoreEndpointDiscoveryProvider(EndpointDataSource endpointDataSource, StellaRouterBridgeOptions options, IAuthorizationClaimMapper authMapper, ILogger<AspNetCoreEndpointDiscoveryProvider> logger)

Creates the provider over the endpoints of the ASP.NET Core application.

Parameters

  • endpointDataSource: The application’s endpoints.
  • options: The bridge options.
  • authMapper: Maps the authorization metadata of an endpoint to claim requirements.
  • logger: Receives the discovery diagnostics.

method DiscoverAspNetEndpoints() #

public IReadOnlyList<AspNetEndpointDescriptor> DiscoverAspNetEndpoints()

Discover all ASP.NET endpoints with full metadata. This includes authorization, parameters, responses, and OpenAPI metadata.

Returns

List of discovered endpoints with full ASP.NET metadata.

method DiscoverEndpoints() #

public IReadOnlyList<EndpointDescriptor> DiscoverEndpoints()

Discovers all endpoints in the application.

Returns

The discovered endpoints.

method DiscoverSchemaDefinitions() #

public IReadOnlyDictionary<string, SchemaDefinition> DiscoverSchemaDefinitions()

Gets schema definitions keyed by schema identifier.

method RefreshEndpoints() #

public void RefreshEndpoints()

Force a refresh of the discovered endpoints. Call this after endpoints are registered (e.g., after MapControllers).

record AspNetEndpointDescriptor

public sealed record AspNetEndpointDescriptor

Extended endpoint descriptor with full ASP.NET metadata. Captures all discoverable information from ASP.NET endpoints for Router registration.

Members

MemberKindSummary
AspNetEndpointDescriptor()constructorCreates an instance of AspNetEndpointDescriptor.
AllowAnonymouspropertyWhether anonymous access is explicitly allowed ([AllowAnonymous]).
AuthorizationFullyMappedpropertyTrue when every authorization rule declared on this endpoint was resolved and translated: each named policy was found, and each of its requirements became a claim requirement or is a pure authentication requirement.
AuthorizationPoliciespropertyNamed authorization policies applied to this endpoint.
AuthorizationSourcepropertySource of the authorization metadata.
DefaultTimeoutpropertyDefault timeout for this endpoint.
DescriptionpropertyDescription for OpenAPI (from .WithDescription()).
MethodpropertyHTTP method (GET, POST, PUT, PATCH, DELETE, etc.).
OperationIdpropertyOperation ID for OpenAPI (from .WithName() or endpoint name).
ParameterspropertyParameter metadata for this endpoint (route, query, header, body).
PathpropertyNormalized path template (e.g., “/api/scans/{id}”).
RequiresAuthenticationpropertyWhether an authenticated principal is required.
RequiringClaimspropertyClaim requirements for authorization, derived from ASP.NET metadata and/or YAML.
ResponsespropertyResponse metadata for this endpoint (status codes, types).
RolespropertyRole names required for this endpoint (from [Authorize(Roles = “…”)]).
SchemaInfopropertySchema information for request/response validation.
ServiceNamepropertyName of the service that owns this endpoint.
SummarypropertySummary for OpenAPI (from .WithSummary() or display name).
SupportsStreamingpropertyWhether this endpoint supports streaming responses.
TagspropertyTags for OpenAPI grouping (from .WithTags()).
UnmappedAuthorizationRequirementspropertyRequirement type names this endpoint’s authorization declared and the claim mapper could NOT translate into a published claim requirement.
VersionpropertySemantic version of the service.
ToEndpointDescriptor()methodConvert to standard Router EndpointDescriptor for HELLO payload.

constructor AspNetEndpointDescriptor() #

public AspNetEndpointDescriptor()

Creates an instance of AspNetEndpointDescriptor.

property AllowAnonymous #

public bool AllowAnonymous { get; init; }

Whether anonymous access is explicitly allowed ([AllowAnonymous]).

property AuthorizationFullyMapped #

public bool AuthorizationFullyMapped { get; init; }

True when every authorization rule declared on this endpoint was resolved and translated: each named policy was found, and each of its requirements became a claim requirement or is a pure authentication requirement. False is the fail-closed default; see EndpointDescriptor.AuthorizationFullyMapped.

property AuthorizationPolicies #

public IReadOnlyList<string> AuthorizationPolicies { get; init; }

Named authorization policies applied to this endpoint.

property AuthorizationSource #

public AuthorizationSource AuthorizationSource { get; init; }

Source of the authorization metadata.

property DefaultTimeout #

public TimeSpan DefaultTimeout { get; init; }

Default timeout for this endpoint.

property Description #

public string? Description { get; init; }

Description for OpenAPI (from .WithDescription()).

property Method #

public required string Method { get; init; }

HTTP method (GET, POST, PUT, PATCH, DELETE, etc.).

property OperationId #

public string? OperationId { get; init; }

Operation ID for OpenAPI (from .WithName() or endpoint name).

property Parameters #

public IReadOnlyList<ParameterDescriptor> Parameters { get; init; }

Parameter metadata for this endpoint (route, query, header, body).

property Path #

public required string Path { get; init; }

Normalized path template (e.g., “/api/scans/{id}”). Constraints are stripped; catch-all markers are normalized.

property RequiresAuthentication #

public bool RequiresAuthentication { get; init; }

Whether an authenticated principal is required.

property RequiringClaims #

public IReadOnlyList<ClaimRequirement> RequiringClaims { get; init; }

Claim requirements for authorization, derived from ASP.NET metadata and/or YAML.

property Responses #

public IReadOnlyList<ResponseDescriptor> Responses { get; init; }

Response metadata for this endpoint (status codes, types).

property Roles #

public IReadOnlyList<string> Roles { get; init; }

Role names required for this endpoint (from [Authorize(Roles = “…”)]).

property SchemaInfo #

public EndpointSchemaInfo? SchemaInfo { get; init; }

Schema information for request/response validation.

property ServiceName #

public required string ServiceName { get; init; }

Name of the service that owns this endpoint.

property Summary #

public string? Summary { get; init; }

Summary for OpenAPI (from .WithSummary() or display name).

property SupportsStreaming #

public bool SupportsStreaming { get; init; }

Whether this endpoint supports streaming responses.

property Tags #

public IReadOnlyList<string> Tags { get; init; }

Tags for OpenAPI grouping (from .WithTags()).

property UnmappedAuthorizationRequirements #

public IReadOnlyList<string> UnmappedAuthorizationRequirements { get; init; }

Requirement type names this endpoint’s authorization declared and the claim mapper could NOT translate into a published claim requirement. Non-empty means the gateway would otherwise enforce less than the host declared, so it refuses instead.

property Version #

public required string Version { get; init; }

Semantic version of the service.

method ToEndpointDescriptor() #

public EndpointDescriptor ToEndpointDescriptor()

Convert to standard Router EndpointDescriptor for HELLO payload.

class AspNetEndpointOverrideMerger

public sealed class AspNetEndpointOverrideMerger : IAspNetEndpointOverrideMerger

Merges endpoint overrides from YAML configuration with ASP.NET-discovered endpoints, supporting different authorization mapping strategies.

Members

MemberKindSummary
AspNetEndpointOverrideMerger(StellaRouterBridgeOptions, ILogger<AspNetEndpointOverrideMerger>)constructorInitializes a new instance of the AspNetEndpointOverrideMergerclass.
Merge(IReadOnlyList<EndpointDescriptor>, MicroserviceYamlConfig)methodMerges YAML overrides with code-defined endpoints.

constructor AspNetEndpointOverrideMerger(StellaRouterBridgeOptions, ILogger<AspNetEndpointOverrideMerger>) #

public AspNetEndpointOverrideMerger(StellaRouterBridgeOptions bridgeOptions, ILogger<AspNetEndpointOverrideMerger> logger)

Initializes a new instance of the AspNetEndpointOverrideMergerclass.

method Merge(IReadOnlyList<EndpointDescriptor>, MicroserviceYamlConfig) #

public IReadOnlyList<EndpointDescriptor> Merge(IReadOnlyList<EndpointDescriptor> codeEndpoints, MicroserviceYamlConfig? yamlConfig)

Merges YAML overrides with code-defined endpoints.

Parameters

  • codeEndpoints: The endpoints discovered from code.
  • yamlConfig: The YAML configuration, if any.

Returns

The merged endpoints.

class AspNetRouterRequestDispatcher

public sealed class AspNetRouterRequestDispatcher : IAspNetRouterRequestDispatcher

Dispatches Router request frames through the ASP.NET Core pipeline.

Members

MemberKindSummary
AspNetRouterRequestDispatcher(IServiceProvider, EndpointDataSource, StellaRouterBridgeOptions, ILogger<AspNetRouterRequestDispatcher>)constructorCreates the dispatcher that runs Router requests through the ASP.NET Core endpoints.
DispatchAsync(RequestFrame, CancellationToken)methodDispatch a Router request frame through the ASP.NET pipeline.

constructor AspNetRouterRequestDispatcher(IServiceProvider, EndpointDataSource, StellaRouterBridgeOptions, ILogger<AspNetRouterRequestDispatcher>) #

public AspNetRouterRequestDispatcher(IServiceProvider serviceProvider, EndpointDataSource endpointDataSource, StellaRouterBridgeOptions options, ILogger<AspNetRouterRequestDispatcher> logger)

Creates the dispatcher that runs Router requests through the ASP.NET Core endpoints.

Parameters

  • serviceProvider: The application services.
  • endpointDataSource: The application’s endpoints.
  • options: The bridge options.
  • logger: Receives the dispatch diagnostics.

method DispatchAsync(RequestFrame, CancellationToken) #

public Task<ResponseFrame> DispatchAsync(RequestFrame request, CancellationToken cancellationToken = default)

Dispatch a Router request frame through the ASP.NET pipeline.

Parameters

  • request: The incoming Router request frame.
  • cancellationToken: Cancellation token.

Returns

The response frame after ASP.NET processing.

record AuthorizationMappingResult

public sealed record AuthorizationMappingResult

Result of authorization mapping for an endpoint.

Members

MemberKindSummary
AuthorizationMappingResult()constructorCreates an instance of AuthorizationMappingResult.
AllowAnonymouspropertyWhether [AllowAnonymous] was found.
ClaimspropertyClaim requirements for Router authorization.
FullyMappedpropertyTrue when every declared authorization rule was resolved and translated: every named policy was found and every requirement became a claim requirement or is a pure authentication requirement (DenyAnonymousAuthorizationRequirement).
HasAuthorizationpropertyWhether any authorization metadata was found.
PoliciespropertyNamed policies found on the endpoint.
RolespropertyRoles found on the endpoint.
SourcepropertySource of the authorization metadata.
UnmappedRequirementspropertyRequirement type names the mapper could not translate into a claim requirement, plus the names of policies it could not resolve at all.

constructor AuthorizationMappingResult() #

public AuthorizationMappingResult()

Creates an instance of AuthorizationMappingResult.

property AllowAnonymous #

public bool AllowAnonymous { get; init; }

Whether [AllowAnonymous] was found.

property Claims #

public IReadOnlyList<ClaimRequirement> Claims { get; init; }

Claim requirements for Router authorization.

property FullyMapped #

public bool FullyMapped { get; }

True when every declared authorization rule was resolved and translated: every named policy was found and every requirement became a claim requirement or is a pure authentication requirement (DenyAnonymousAuthorizationRequirement). The gateway allows a zero-claim endpoint only on this assurance.

property HasAuthorization #

public bool HasAuthorization { get; }

Whether any authorization metadata was found.

property Policies #

public IReadOnlyList<string> Policies { get; init; }

Named policies found on the endpoint.

property Roles #

public IReadOnlyList<string> Roles { get; init; }

Roles found on the endpoint.

property Source #

public AuthorizationSource Source { get; init; }

Source of the authorization metadata.

property UnmappedRequirements #

public IReadOnlyList<string> UnmappedRequirements { get; init; }

Requirement type names the mapper could not translate into a claim requirement, plus the names of policies it could not resolve at all. An AssertionRequirement from RequireAssertion(...) is the common entry. Non-empty means the published claim set is WEAKER than what the host declared.

enum AuthorizationMappingStrategy

public enum AuthorizationMappingStrategy

Strategy for mapping ASP.NET authorization metadata to Router claim requirements.

ValueDescription
YamlOnly = 0Use only YAML overrides for RequiringClaims. ASP.NET metadata is ignored. Use this when you want full control via configuration.
AspNetMetadataOnly = 1Extract RequiringClaims from ASP.NET authorization metadata only. YAML overrides are ignored for claims (but still used for timeout, streaming).
Hybrid = 2Merge ASP.NET metadata with YAML overrides. When both specify claims for the same endpoint, YAML takes precedence. This is the recommended default for gradual migration.

enum AuthorizationSource

public enum AuthorizationSource

Source of authorization metadata for an endpoint.

ValueDescription
None = 0No authorization metadata found.
AspNetMetadata = 1Authorization derived from ASP.NET metadata ([Authorize], .RequireAuthorization()).
YamlOverride = 2Authorization specified in YAML override file.
Hybrid = 3Authorization from both sources, merged according to strategy.

class DefaultAuthorizationClaimMapper

public sealed class DefaultAuthorizationClaimMapper : IAuthorizationClaimMapper

Default implementation of IAuthorizationClaimMapper. Extracts authorization metadata from ASP.NET endpoints and maps to Router claims.

Members

MemberKindSummary
DefaultAuthorizationClaimMapper(IAuthorizationPolicyProvider, ILogger<DefaultAuthorizationClaimMapper>, StellaRouterBridgeOptions)constructorCreates the mapper.
Map(RouteEndpoint)methodSynchronous version of MapAsync for scenarios where async is not needed.
MapAsync(RouteEndpoint, CancellationToken)methodMap ASP.NET authorization metadata from a RouteEndpoint to Router claims.

constructor DefaultAuthorizationClaimMapper(IAuthorizationPolicyProvider, ILogger<DefaultAuthorizationClaimMapper>, StellaRouterBridgeOptions) #

public DefaultAuthorizationClaimMapper(IAuthorizationPolicyProvider policyProvider, ILogger<DefaultAuthorizationClaimMapper> logger, StellaRouterBridgeOptions? bridgeOptions = null)

Creates the mapper.

Parameters

  • policyProvider: Resolves the authorization policies endpoints name.
  • logger: Receives a warning, once per policy, for a policy that cannot be mapped.
  • bridgeOptions: The bridge options; the defaults apply when not set.

method Map(RouteEndpoint) #

public AuthorizationMappingResult Map(RouteEndpoint endpoint)

Synchronous version of MapAsync for scenarios where async is not needed.

Parameters

  • endpoint: The ASP.NET RouteEndpoint to analyze.

Returns

The authorization mapping result.

method MapAsync(RouteEndpoint, CancellationToken) #

public Task<AuthorizationMappingResult> MapAsync(RouteEndpoint endpoint, CancellationToken cancellationToken = default)

Map ASP.NET authorization metadata from a RouteEndpoint to Router claims.

Parameters

  • endpoint: The ASP.NET RouteEndpoint to analyze.
  • cancellationToken: Cancellation token.

Returns

The authorization mapping result with claims, policies, and roles.

enum GatewayAuthorizationTrustMode

public enum GatewayAuthorizationTrustMode

Service-side trust mode for gateway authorization and identity envelopes. In no mode does the bridge take the caller identity from request headers such as X-StellaOps-Actor.

ValueDescription
ServiceEnforced = 0The bridge sets no caller identity, not even from a valid envelope. No authentication middleware runs for a dispatched request, so only endpoint code that authenticates the request itself sees a caller.
Hybrid = 1A valid gateway-signed identity envelope sets the caller identity; without one the request runs without a caller identity (anonymous).
GatewayEnforced = 2Require a valid gateway-signed identity envelope. Missing/invalid envelopes fail closed.

interface IAspNetEndpointDiscoveryProvider

public interface IAspNetEndpointDiscoveryProvider : IEndpointDiscoveryProvider

Provides ASP.NET endpoint discovery with full metadata extraction. Extends the base IEndpointDiscoveryProvider to include ASP.NET-specific details.

Members

MemberKindSummary
DiscoverAspNetEndpoints()methodDiscover all ASP.NET endpoints with full metadata.
RefreshEndpoints()methodForce a refresh of the discovered endpoints.

method DiscoverAspNetEndpoints() #

IReadOnlyList<AspNetEndpointDescriptor> DiscoverAspNetEndpoints()

Discover all ASP.NET endpoints with full metadata. This includes authorization, parameters, responses, and OpenAPI metadata.

Returns

List of discovered endpoints with full ASP.NET metadata.

method RefreshEndpoints() #

void RefreshEndpoints()

Force a refresh of the discovered endpoints. Call this after endpoints are registered (e.g., after MapControllers).

interface IAspNetEndpointOverrideMerger

public interface IAspNetEndpointOverrideMerger : IEndpointOverrideMerger

Interface for merging endpoint overrides with ASP.NET-specific authorization mapping strategy support. Extends the base IEndpointOverrideMergerto support strategy-aware claim merging.

interface IAspNetRouterRequestDispatcher

public interface IAspNetRouterRequestDispatcher

Dispatches Router request frames through the ASP.NET Core pipeline.

Members

MemberKindSummary
DispatchAsync(RequestFrame, CancellationToken)methodDispatch a Router request frame through the ASP.NET pipeline.

method DispatchAsync(RequestFrame, CancellationToken) #

Task<ResponseFrame> DispatchAsync(RequestFrame request, CancellationToken cancellationToken = default)

Dispatch a Router request frame through the ASP.NET pipeline.

Parameters

  • request: The incoming Router request frame.
  • cancellationToken: Cancellation token.

Returns

The response frame after ASP.NET processing.

interface IAuthorizationClaimMapper

public interface IAuthorizationClaimMapper

Maps ASP.NET authorization metadata to Router claim requirements.

Members

MemberKindSummary
Map(RouteEndpoint)methodSynchronous version of MapAsync for scenarios where async is not needed.
MapAsync(RouteEndpoint, CancellationToken)methodMap ASP.NET authorization metadata from a RouteEndpoint to Router claims.

method Map(RouteEndpoint) #

AuthorizationMappingResult Map(RouteEndpoint endpoint)

Synchronous version of MapAsync for scenarios where async is not needed.

Parameters

  • endpoint: The ASP.NET RouteEndpoint to analyze.

Returns

The authorization mapping result.

method MapAsync(RouteEndpoint, CancellationToken) #

Task<AuthorizationMappingResult> MapAsync(RouteEndpoint endpoint, CancellationToken cancellationToken = default)

Map ASP.NET authorization metadata from a RouteEndpoint to Router claims.

Parameters

  • endpoint: The ASP.NET RouteEndpoint to analyze.
  • cancellationToken: Cancellation token.

Returns

The authorization mapping result with claims, policies, and roles.

interface IRouterTenantResolver

public interface IRouterTenantResolver

Binds the tenant of a request that the Router dispatches into ASP.NET Core.

Remarks

A dispatched request does not run the host’s middleware pipeline, so tenant middleware never sees it. A host that resolves its tenant in middleware registers one implementation of this interface. AspNetRouterRequestDispatcherresolves it from the request services and calls it once per request whose identity came from a verified gateway identity envelope, after the dispatcher has authenticated the request and before it matches the endpoint.

The implementation reads HttpContext.User and the request headers and stores the tenant in the host’s own request state. The dispatcher does not read a result. When no implementation is registered, the dispatcher binds no tenant.

The call is synchronous, so a value the implementation writes to an AsyncLocal<T> stays visible to the endpoint that the dispatcher runs next.

Members

MemberKindSummary
ResolveTenant(HttpContext)methodResolves the tenant of the dispatched request and binds it for the endpoint.

method ResolveTenant(HttpContext) #

void ResolveTenant(HttpContext httpContext)

Resolves the tenant of the dispatched request and binds it for the endpoint.

Parameters

  • httpContext: The request context the dispatcher built from the Router frame.

enum MissingAuthorizationBehavior

public enum MissingAuthorizationBehavior

Behavior when an endpoint has no authorization metadata.

ValueDescription
RequireExplicit = 0Fail discovery if endpoint has no authorization and no YAML override. This is the safest option to prevent accidental exposure of privileged endpoints.
AllowAuthenticated = 1Allow endpoint with empty RequiringClaims, meaning only authentication is required. Any authenticated user can access the endpoint.
WarnAndAllow = 2Log a warning but allow endpoint with empty RequiringClaims. Useful during migration when some endpoints may not have authorization yet.

record ParameterDescriptor

public sealed record ParameterDescriptor

Describes a parameter for an endpoint.

Members

MemberKindSummary
ParameterDescriptor()constructorCreates an instance of ParameterDescriptor.
DefaultValuepropertyDefault value if the parameter is optional.
DescriptionpropertyDescription for documentation.
IsRequiredpropertyWhether the parameter is required.
JsonSchemaTypepropertyJSON Schema type name (for OpenAPI).
NamepropertyParameter name.
SourcepropertySource of the parameter value (route, query, header, body, services).
TypepropertyCLR type of the parameter.

constructor ParameterDescriptor() #

public ParameterDescriptor()

Creates an instance of ParameterDescriptor.

property DefaultValue #

public object? DefaultValue { get; init; }

Default value if the parameter is optional.

property Description #

public string? Description { get; init; }

Description for documentation.

property IsRequired #

public bool IsRequired { get; init; }

Whether the parameter is required.

property JsonSchemaType #

public string? JsonSchemaType { get; init; }

JSON Schema type name (for OpenAPI).

property Name #

public required string Name { get; init; }

Parameter name.

property Source #

public required ParameterSource Source { get; init; }

Source of the parameter value (route, query, header, body, services).

property Type #

public required Type Type { get; init; }

CLR type of the parameter.

enum ParameterSource

public enum ParameterSource

Source of a parameter value.

ValueDescription
Route = 0From route template (e.g., {id} in /api/items/{id}).
Query = 1From query string (e.g., ?page=1).
Header = 2From request header.
Body = 3From request body (JSON deserialization).
Services = 4From dependency injection container.

record ResponseDescriptor

public sealed record ResponseDescriptor

Describes a response for an endpoint.

Members

MemberKindSummary
ResponseDescriptor()constructorCreates an instance of ResponseDescriptor.
ContentTypepropertyContent type (default: application/json).
DescriptionpropertyDescription for documentation.
ResponseTypepropertyCLR type of the response body (null for no content).
SchemaRefpropertyJSON Schema reference for the response type.
StatusCodepropertyHTTP status code.

constructor ResponseDescriptor() #

public ResponseDescriptor()

Creates an instance of ResponseDescriptor.

property ContentType #

public string ContentType { get; init; }

Content type (default: application/json).

property Description #

public string? Description { get; init; }

Description for documentation.

property ResponseType #

public Type? ResponseType { get; init; }

CLR type of the response body (null for no content).

property SchemaRef #

public string? SchemaRef { get; init; }

JSON Schema reference for the response type.

property StatusCode #

public required int StatusCode { get; init; }

HTTP status code.

class RouterPublicationExclusionMetadata

public sealed class RouterPublicationExclusionMetadata

Endpoint metadata that keeps one ASP.NET endpoint off the Router entirely: the bridge does not publish it in the HELLO payload, so the gateway cannot resolve it, and the router request dispatcher refuses it (404), so a frame that names its path still cannot reach it. The endpoint stays served by the host’s own HTTP listener.

Remarks

Attach it at the mapping site with ASP.NET’s own convention: .WithMetadata(new RouterPublicationExclusionMetadata("<reason>")).

This differs from StellaRouterBridgeOptions.ExcludedPathPrefixesin two ways. It is declared at the mapping site of one endpoint, not estate-wide by prefix. And it makes the endpoint unreachable through the Router, where a prefix exclusion only unpublishes (the dispatcher still serves an excluded prefix).

Use it only for a service-to-service endpoint that callers inside the network reach directly and that must not be exposed at the gateway. The reason is required and is logged at discovery, because an exclusion without a recorded reason cannot be told apart from an oversight (the rule stated on StellaRouterBridgeOptions.ExcludedPathPrefixes).

Members

MemberKindSummary
RouterPublicationExclusionMetadata(string)constructorCreates the marker.
ReasonpropertyWhy the endpoint is kept off the Router.

constructor RouterPublicationExclusionMetadata(string) #

public RouterPublicationExclusionMetadata(string reason)

Creates the marker.

Parameters

  • reason: Why the endpoint must not be reachable through the Router.

property Reason #

public string Reason { get; }

Why the endpoint is kept off the Router.

class StellaRouterBridgeExtensions

public static class StellaRouterBridgeExtensions

Extension methods for configuring the StellaOps Router ASP.NET Core bridge.

Members

MemberKindSummary
AddStellaRouterBridge(IServiceCollection, Action<StellaRouterBridgeOptions>, bool)extension methodAdds StellaOps Router bridge services to the service collection.
AddStellaRouterBridge<TMapper>(IServiceCollection, Action<StellaRouterBridgeOptions>)extension methodAdds StellaOps Router bridge services with a custom authorization claim mapper.
RefreshStellaRouterEndpoints(IApplicationBuilder)extension methodRefreshes the endpoint discovery cache.
UseStellaRouterBridge(IApplicationBuilder)extension methodEnables the StellaOps Router bridge middleware.

extension method AddStellaRouterBridge(IServiceCollection, Action<StellaRouterBridgeOptions>, bool) #

public static IServiceCollection AddStellaRouterBridge(this IServiceCollection services, Action<StellaRouterBridgeOptions> configure, bool registerMicroserviceServices = true)

Adds StellaOps Router bridge services to the service collection. This enables ASP.NET Core endpoints to be automatically registered and dispatched via the Router.

Parameters

  • services: The service collection.
  • configure: Action to configure the bridge options.
  • registerMicroserviceServices: If true (default), also registers the base microservice services. Set to false when using AddStellaRouter() which handles this separately.

Returns

The service collection for chaining.

Exceptions

  • ArgumentNullException: Thrown if services or configure is null.
  • InvalidOperationException: Thrown if required options are not configured.

extension method AddStellaRouterBridge<TMapper>(IServiceCollection, Action<StellaRouterBridgeOptions>) #

public static IServiceCollection AddStellaRouterBridge<TMapper>(this IServiceCollection services, Action<StellaRouterBridgeOptions> configure) where TMapper : class, IAuthorizationClaimMapper

Adds StellaOps Router bridge services with a custom authorization claim mapper.

Type parameters

  • TMapper: The custom authorization claim mapper type.

Parameters

  • services: The service collection.
  • configure: Action to configure the bridge options.

Returns

The service collection for chaining.

extension method RefreshStellaRouterEndpoints(IApplicationBuilder) #

public static IApplicationBuilder RefreshStellaRouterEndpoints(this IApplicationBuilder app)

Refreshes the endpoint discovery cache. Call this after all endpoints are registered (e.g., after MapControllers).

Parameters

  • app: The application builder.

Returns

The application builder for chaining.

extension method UseStellaRouterBridge(IApplicationBuilder) #

public static IApplicationBuilder UseStellaRouterBridge(this IApplicationBuilder app)

Enables the StellaOps Router bridge middleware. This should be called after UseRouting() and before endpoint registration.

Parameters

  • app: The application builder.

Returns

The application builder for chaining.

Exceptions

  • InvalidOperationException: Thrown if called before UseRouting() or if bridge services are not configured.

class StellaRouterBridgeOptions

public sealed class StellaRouterBridgeOptions

Configuration options for the ASP.NET Core Router bridge.

Members

MemberKindSummary
StellaRouterBridgeOptions()constructorCreates an instance of StellaRouterBridgeOptions.
AuthorizationMappingpropertyStrategy for mapping ASP.NET authorization to Router claims.
AuthorizationTrustModepropertyHow the bridge sets the caller identity (HttpContext.User) of a dispatched request.
DefaultTimeoutpropertyDefault timeout for bridged endpoints (overridable per-endpoint via YAML).
EnableStreamingpropertyEnable streaming support for endpoints marked as streaming-capable.
EndpointFilterpropertyEndpoint path filter.
ExcludedPathPrefixespropertyPath prefixes withheld from the HELLO payload (publication only — the dispatcher still matches the raw ASP.NET EndpointDataSource, so an excluded path is unpublished, not unservable).
ExtractOpenApiMetadatapropertyExtract OpenAPI metadata (summary, description, tags).
ExtractSchemaspropertyExtract JSON schemas from Produces/Accepts metadata.
IdentityEnvelopeClockSkewpropertyAllowed clock skew when validating gateway identity envelope timestamps.
IdentityEnvelopeSigningKeypropertyShared signing key used to verify gateway identity envelopes.
IncludeExcludedPathsInRouterpropertyWhether to include excluded paths in the Router registration.
InstanceIdpropertyUnique instance identifier.
OnMissingAuthorizationpropertyBehavior when endpoint has no authorization metadata and no YAML override.
OnUnsupportedConstraintpropertyBehavior for unsupported route constraints.
RegionpropertyDeployment region.
RouterspropertyThe gateways to connect to.
ServiceDescriptionpropertyService description for documentation.
ServiceNamepropertyService name for Router registration.
VersionpropertyService version (semver).
YamlConfigPathpropertyPath to microservice.yaml for endpoint overrides.

constructor StellaRouterBridgeOptions() #

public StellaRouterBridgeOptions()

Creates an instance of StellaRouterBridgeOptions.

property AuthorizationMapping #

public AuthorizationMappingStrategy AuthorizationMapping { get; set; }

Strategy for mapping ASP.NET authorization to Router claims. Default: Hybrid (ASP.NET metadata + YAML overrides, YAML wins on conflict).

property AuthorizationTrustMode #

public GatewayAuthorizationTrustMode AuthorizationTrustMode { get; set; }

How the bridge sets the caller identity (HttpContext.User) of a dispatched request. The identity comes only from the identity envelope the gateway signs with StellaRouterBridgeOptions.IdentityEnvelopeSigningKey; identity request headers such as X-StellaOps-Actor or X-StellaOps-Scopes are never read, whatever the mode. Default: Hybrid.

property DefaultTimeout #

public TimeSpan DefaultTimeout { get; set; }

Default timeout for bridged endpoints (overridable per-endpoint via YAML). Default: 30 seconds.

property EnableStreaming #

public bool EnableStreaming { get; set; }

Enable streaming support for endpoints marked as streaming-capable. Default: false (all responses are buffered).

property EndpointFilter #

public Func<RouteEndpoint, bool>? EndpointFilter { get; set; }

Endpoint path filter. Only endpoints matching this predicate are bridged. Default: all endpoints (null).

property ExcludedPathPrefixes #

public IList<string> ExcludedPathPrefixes { get; set; }

Path prefixes withheld from the HELLO payload (publication only — the dispatcher still matches the raw ASP.NET EndpointDataSource, so an excluded path is unpublished, not unservable).

Remarks

Matching is StartsWith, so a prefix also withholds every endpoint below it; add the narrowest prefix that applies. The defaults withhold the health, readiness and liveness probes, the metrics, the API description documents, the build information and the catalog change feed: per-instance signals, or paths that the gateway serves itself or routes explicitly.

property ExtractOpenApiMetadata #

public bool ExtractOpenApiMetadata { get; set; }

Extract OpenAPI metadata (summary, description, tags). Default: true.

property ExtractSchemas #

public bool ExtractSchemas { get; set; }

Extract JSON schemas from Produces/Accepts metadata. Default: true.

property IdentityEnvelopeClockSkew #

public TimeSpan IdentityEnvelopeClockSkew { get; set; }

Allowed clock skew when validating gateway identity envelope timestamps.

property IdentityEnvelopeSigningKey #

public string? IdentityEnvelopeSigningKey { get; set; }

Shared signing key used to verify gateway identity envelopes. The gateway signs with the same key. Without it no envelope verifies: Hybrid requests run without a caller identity and GatewayEnforced requests are refused.

property IncludeExcludedPathsInRouter #

public bool IncludeExcludedPathsInRouter { get; set; }

Whether to include excluded paths in the Router registration. When false (default), excluded endpoints are not registered with Router.

property InstanceId #

public string? InstanceId { get; set; }

Unique instance identifier. Auto-generated if not set.

property OnMissingAuthorization #

public MissingAuthorizationBehavior OnMissingAuthorization { get; set; }

Behavior when endpoint has no authorization metadata and no YAML override. Default: RequireExplicit (fail discovery if no auth metadata).

property OnUnsupportedConstraint #

public UnsupportedConstraintBehavior OnUnsupportedConstraint { get; set; }

Behavior for unsupported route constraints. Default: WarnAndStrip (log warning, strip constraint, continue).

property Region #

public required string Region { get; set; }

Deployment region. Required.

property Routers #

public List<RouterEndpointConfig> Routers { get; set; }

The gateways to connect to. StellaRouterBridgeExtensions.AddStellaRouterBridge(IServiceCollection, Action<StellaRouterBridgeOptions>, bool)passes them to the microservice options; at least one is required when it registers the microservice services.

property ServiceDescription #

public string? ServiceDescription { get; set; }

Service description for documentation.

property ServiceName #

public required string ServiceName { get; set; }

Service name for Router registration. Required.

property Version #

public required string Version { get; set; }

Service version (semver). Required.

property YamlConfigPath #

public string? YamlConfigPath { get; set; }

Path to microservice.yaml for endpoint overrides. Optional.

enum UnsupportedConstraintBehavior

public enum UnsupportedConstraintBehavior

Behavior for unsupported route constraints.

ValueDescription
Fail = 0Fail discovery if route has an unsupported constraint. The constraint cannot be enforced by the Router.
WarnAndStrip = 1Log a warning, strip the constraint from the normalized path, and continue. The ASP.NET matcher will still enforce the constraint during dispatch.
SilentStrip = 2Silently strip the constraint without warning. Use only when you understand the implications.