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.
| Package | StellaOps.Microservice.AspNetCore |
| Component | Router |
| Licence | Apache-2.0 |
| Package kind | Library |
| Target framework | net10.0 |
To add the package to a project, see Installing Stella Ops packages.
Namespaces
| Namespace | Types |
|---|---|
StellaOps.Microservice.AspNetCore | 22 |
StellaOps.Microservice.AspNetCore namespace
| Type | Kind | Description |
|---|---|---|
AspNetCoreEndpointDiscoveryProvider | class | Discovers ASP.NET Core endpoints and converts them to Router endpoint descriptors. |
AspNetEndpointDescriptor | record | Extended endpoint descriptor with full ASP.NET metadata. |
AspNetEndpointOverrideMerger | class | Merges endpoint overrides from YAML configuration with ASP.NET-discovered endpoints, supporting different authorization mapping strategies. |
AspNetRouterRequestDispatcher | class | Dispatches Router request frames through the ASP.NET Core pipeline. |
AuthorizationMappingResult | record | Result of authorization mapping for an endpoint. |
AuthorizationMappingStrategy | enum | Strategy for mapping ASP.NET authorization metadata to Router claim requirements. |
AuthorizationSource | enum | Source of authorization metadata for an endpoint. |
DefaultAuthorizationClaimMapper | class | Default implementation of IAuthorizationClaimMapper. |
GatewayAuthorizationTrustMode | enum | Service-side trust mode for gateway authorization and identity envelopes. |
IAspNetEndpointDiscoveryProvider | interface | Provides ASP.NET endpoint discovery with full metadata extraction. |
IAspNetEndpointOverrideMerger | interface | Interface for merging endpoint overrides with ASP.NET-specific authorization mapping strategy support. |
IAspNetRouterRequestDispatcher | interface | Dispatches Router request frames through the ASP.NET Core pipeline. |
IAuthorizationClaimMapper | interface | Maps ASP.NET authorization metadata to Router claim requirements. |
IRouterTenantResolver | interface | Binds the tenant of a request that the Router dispatches into ASP.NET Core. |
MissingAuthorizationBehavior | enum | Behavior when an endpoint has no authorization metadata. |
ParameterDescriptor | record | Describes a parameter for an endpoint. |
ParameterSource | enum | Source of a parameter value. |
ResponseDescriptor | record | Describes a response for an endpoint. |
RouterPublicationExclusionMetadata | class | 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. |
StellaRouterBridgeExtensions | class | Extension methods for configuring the StellaOps Router ASP.NET Core bridge. |
StellaRouterBridgeOptions | class | Configuration options for the ASP.NET Core Router bridge. |
UnsupportedConstraintBehavior | enum | Behavior for unsupported route constraints. |
AspNetCoreEndpointDiscoveryProvider class
public sealed class AspNetCoreEndpointDiscoveryProvider : IAspNetEndpointDiscoveryProvider, IEndpointSchemaDefinitionProvider
Discovers ASP.NET Core endpoints and converts them to Router endpoint descriptors.
AspNetCoreEndpointDiscoveryProvider(EndpointDataSource, StellaRouterBridgeOptions, IAuthorizationClaimMapper, ILogger<AspNetCoreEndpointDiscoveryProvider>) constructor
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.
DiscoverAspNetEndpoints() method
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.
DiscoverEndpoints() method
public IReadOnlyList<EndpointDescriptor> DiscoverEndpoints()
Discovers all endpoints in the application.
Returns
The discovered endpoints.
DiscoverSchemaDefinitions() method
public IReadOnlyDictionary<string, SchemaDefinition> DiscoverSchemaDefinitions()
Gets schema definitions keyed by schema identifier.
RefreshEndpoints() method
public void RefreshEndpoints()
Force a refresh of the discovered endpoints. Call this after endpoints are registered (e.g., after MapControllers).
AspNetEndpointDescriptor record
public sealed record AspNetEndpointDescriptor
Extended endpoint descriptor with full ASP.NET metadata. Captures all discoverable information from ASP.NET endpoints for Router registration.
AspNetEndpointDescriptor() constructor
public AspNetEndpointDescriptor()
Creates an instance of AspNetEndpointDescriptor.
AllowAnonymous property
public bool AllowAnonymous { get; init; }
Whether anonymous access is explicitly allowed ([AllowAnonymous]).
AuthorizationFullyMapped property
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.
AuthorizationPolicies property
public IReadOnlyList<string> AuthorizationPolicies { get; init; }
Named authorization policies applied to this endpoint.
AuthorizationSource property
public AuthorizationSource AuthorizationSource { get; init; }
Source of the authorization metadata.
DefaultTimeout property
public TimeSpan DefaultTimeout { get; init; }
Default timeout for this endpoint.
Description property
public string? Description { get; init; }
Description for OpenAPI (from .WithDescription()).
Method property
public required string Method { get; init; }
HTTP method (GET, POST, PUT, PATCH, DELETE, etc.).
OperationId property
public string? OperationId { get; init; }
Operation ID for OpenAPI (from .WithName() or endpoint name).
Parameters property
public IReadOnlyList<ParameterDescriptor> Parameters { get; init; }
Parameter metadata for this endpoint (route, query, header, body).
Path property
public required string Path { get; init; }
Normalized path template (e.g., “/api/scans/{id}”). Constraints are stripped; catch-all markers are normalized.
RequiresAuthentication property
public bool RequiresAuthentication { get; init; }
Whether an authenticated principal is required.
RequiringClaims property
public IReadOnlyList<ClaimRequirement> RequiringClaims { get; init; }
Claim requirements for authorization, derived from ASP.NET metadata and/or YAML.
Responses property
public IReadOnlyList<ResponseDescriptor> Responses { get; init; }
Response metadata for this endpoint (status codes, types).
Roles property
public IReadOnlyList<string> Roles { get; init; }
Role names required for this endpoint (from [Authorize(Roles = “…”)]).
SchemaInfo property
public EndpointSchemaInfo? SchemaInfo { get; init; }
Schema information for request/response validation.
ServiceName property
public required string ServiceName { get; init; }
Name of the service that owns this endpoint.
Summary property
public string? Summary { get; init; }
Summary for OpenAPI (from .WithSummary() or display name).
SupportsStreaming property
public bool SupportsStreaming { get; init; }
Whether this endpoint supports streaming responses.
Tags property
public IReadOnlyList<string> Tags { get; init; }
Tags for OpenAPI grouping (from .WithTags()).
UnmappedAuthorizationRequirements property
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.
Version property
public required string Version { get; init; }
Semantic version of the service.
ToEndpointDescriptor() method
public EndpointDescriptor ToEndpointDescriptor()
Convert to standard Router EndpointDescriptor for HELLO payload.
AspNetEndpointOverrideMerger class
public sealed class AspNetEndpointOverrideMerger : IAspNetEndpointOverrideMerger
Merges endpoint overrides from YAML configuration with ASP.NET-discovered endpoints, supporting different authorization mapping strategies.
AspNetEndpointOverrideMerger(StellaRouterBridgeOptions, ILogger<AspNetEndpointOverrideMerger>) constructor
public AspNetEndpointOverrideMerger(StellaRouterBridgeOptions bridgeOptions, ILogger<AspNetEndpointOverrideMerger> logger)
Initializes a new instance of the AspNetEndpointOverrideMergerclass.
Merge(IReadOnlyList<EndpointDescriptor>, MicroserviceYamlConfig) method
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.
AspNetRouterRequestDispatcher class
public sealed class AspNetRouterRequestDispatcher : IAspNetRouterRequestDispatcher
Dispatches Router request frames through the ASP.NET Core pipeline.
AspNetRouterRequestDispatcher(IServiceProvider, EndpointDataSource, StellaRouterBridgeOptions, ILogger<AspNetRouterRequestDispatcher>) constructor
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.
DispatchAsync(RequestFrame, CancellationToken) method
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.
AuthorizationMappingResult record
public sealed record AuthorizationMappingResult
Result of authorization mapping for an endpoint.
AuthorizationMappingResult() constructor
public AuthorizationMappingResult()
Creates an instance of AuthorizationMappingResult.
AllowAnonymous property
public bool AllowAnonymous { get; init; }
Whether [AllowAnonymous] was found.
Claims property
public IReadOnlyList<ClaimRequirement> Claims { get; init; }
Claim requirements for Router authorization.
FullyMapped property
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.
HasAuthorization property
public bool HasAuthorization { get; }
Whether any authorization metadata was found.
Policies property
public IReadOnlyList<string> Policies { get; init; }
Named policies found on the endpoint.
Roles property
public IReadOnlyList<string> Roles { get; init; }
Roles found on the endpoint.
Source property
public AuthorizationSource Source { get; init; }
Source of the authorization metadata.
UnmappedRequirements property
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.
AuthorizationMappingStrategy enum
public enum AuthorizationMappingStrategy
Strategy for mapping ASP.NET authorization metadata to Router claim requirements.
| Value | Description |
|---|---|
YamlOnly = 0 | Use only YAML overrides for RequiringClaims. ASP.NET metadata is ignored. Use this when you want full control via configuration. |
AspNetMetadataOnly = 1 | Extract RequiringClaims from ASP.NET authorization metadata only. YAML overrides are ignored for claims (but still used for timeout, streaming). |
Hybrid = 2 | Merge 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. |
AuthorizationSource enum
public enum AuthorizationSource
Source of authorization metadata for an endpoint.
| Value | Description |
|---|---|
None = 0 | No authorization metadata found. |
AspNetMetadata = 1 | Authorization derived from ASP.NET metadata ([Authorize], .RequireAuthorization()). |
YamlOverride = 2 | Authorization specified in YAML override file. |
Hybrid = 3 | Authorization from both sources, merged according to strategy. |
DefaultAuthorizationClaimMapper class
public sealed class DefaultAuthorizationClaimMapper : IAuthorizationClaimMapper
Default implementation of IAuthorizationClaimMapper. Extracts authorization metadata from ASP.NET endpoints and maps to Router claims.
DefaultAuthorizationClaimMapper(IAuthorizationPolicyProvider, ILogger<DefaultAuthorizationClaimMapper>, StellaRouterBridgeOptions) constructor
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.
Map(RouteEndpoint) method
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.
MapAsync(RouteEndpoint, CancellationToken) method
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.
GatewayAuthorizationTrustMode enum
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.
IAspNetEndpointDiscoveryProvider interface
public interface IAspNetEndpointDiscoveryProvider : IEndpointDiscoveryProvider
Provides ASP.NET endpoint discovery with full metadata extraction. Extends the base IEndpointDiscoveryProvider to include ASP.NET-specific details.
DiscoverAspNetEndpoints() method
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.
RefreshEndpoints() method
void RefreshEndpoints()
Force a refresh of the discovered endpoints. Call this after endpoints are registered (e.g., after MapControllers).
IAspNetEndpointOverrideMerger interface
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.
IAspNetRouterRequestDispatcher interface
public interface IAspNetRouterRequestDispatcher
Dispatches Router request frames through the ASP.NET Core pipeline.
DispatchAsync(RequestFrame, CancellationToken) method
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.
IAuthorizationClaimMapper interface
public interface IAuthorizationClaimMapper
Maps ASP.NET authorization metadata to Router claim requirements.
Map(RouteEndpoint) method
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.
MapAsync(RouteEndpoint, CancellationToken) method
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.
IRouterTenantResolver interface
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.
ResolveTenant(HttpContext) method
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.
MissingAuthorizationBehavior enum
public enum MissingAuthorizationBehavior
Behavior when an endpoint has no authorization metadata.
ParameterDescriptor record
public sealed record ParameterDescriptor
Describes a parameter for an endpoint.
ParameterDescriptor() constructor
public ParameterDescriptor()
Creates an instance of ParameterDescriptor.
DefaultValue property
public object? DefaultValue { get; init; }
Default value if the parameter is optional.
Description property
public string? Description { get; init; }
Description for documentation.
IsRequired property
public bool IsRequired { get; init; }
Whether the parameter is required.
JsonSchemaType property
public string? JsonSchemaType { get; init; }
JSON Schema type name (for OpenAPI).
Name property
public required string Name { get; init; }
Parameter name.
Source property
public required ParameterSource Source { get; init; }
Source of the parameter value (route, query, header, body, services).
Type property
public required Type Type { get; init; }
CLR type of the parameter.
ParameterSource enum
public enum ParameterSource
Source of a parameter value.
ResponseDescriptor record
public sealed record ResponseDescriptor
Describes a response for an endpoint.
ResponseDescriptor() constructor
public ResponseDescriptor()
Creates an instance of ResponseDescriptor.
ContentType property
public string ContentType { get; init; }
Content type (default: application/json).
Description property
public string? Description { get; init; }
Description for documentation.
ResponseType property
public Type? ResponseType { get; init; }
CLR type of the response body (null for no content).
SchemaRef property
public string? SchemaRef { get; init; }
JSON Schema reference for the response type.
StatusCode property
public required int StatusCode { get; init; }
HTTP status code.
RouterPublicationExclusionMetadata class
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).
RouterPublicationExclusionMetadata(string) constructor
public RouterPublicationExclusionMetadata(string reason)
Creates the marker.
Parameters
reason: Why the endpoint must not be reachable through the Router.
Reason property
public string Reason { get; }
Why the endpoint is kept off the Router.
StellaRouterBridgeExtensions class
public static class StellaRouterBridgeExtensions
Extension methods for configuring the StellaOps Router ASP.NET Core bridge.
AddStellaRouterBridge(IServiceCollection, Action<StellaRouterBridgeOptions>, bool) extension method
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.
AddStellaRouterBridge<TMapper>(IServiceCollection, Action<StellaRouterBridgeOptions>) extension method
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.
RefreshStellaRouterEndpoints(IApplicationBuilder) extension method
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.
UseStellaRouterBridge(IApplicationBuilder) extension method
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.
StellaRouterBridgeOptions class
public sealed class StellaRouterBridgeOptions
Configuration options for the ASP.NET Core Router bridge.
StellaRouterBridgeOptions() constructor
public StellaRouterBridgeOptions()
Creates an instance of StellaRouterBridgeOptions.
AuthorizationMapping property
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).
AuthorizationTrustMode property
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.
DefaultTimeout property
public TimeSpan DefaultTimeout { get; set; }
Default timeout for bridged endpoints (overridable per-endpoint via YAML). Default: 30 seconds.
EnableStreaming property
public bool EnableStreaming { get; set; }
Enable streaming support for endpoints marked as streaming-capable. Default: false (all responses are buffered).
EndpointFilter property
public Func<RouteEndpoint, bool>? EndpointFilter { get; set; }
Endpoint path filter. Only endpoints matching this predicate are bridged. Default: all endpoints (null).
ExcludedPathPrefixes property
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.
ExtractOpenApiMetadata property
public bool ExtractOpenApiMetadata { get; set; }
Extract OpenAPI metadata (summary, description, tags). Default: true.
ExtractSchemas property
public bool ExtractSchemas { get; set; }
Extract JSON schemas from Produces/Accepts metadata. Default: true.
IdentityEnvelopeClockSkew property
public TimeSpan IdentityEnvelopeClockSkew { get; set; }
Allowed clock skew when validating gateway identity envelope timestamps.
IdentityEnvelopeSigningKey property
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.
IncludeExcludedPathsInRouter property
public bool IncludeExcludedPathsInRouter { get; set; }
Whether to include excluded paths in the Router registration. When false (default), excluded endpoints are not registered with Router.
InstanceId property
public string? InstanceId { get; set; }
Unique instance identifier. Auto-generated if not set.
OnMissingAuthorization property
public MissingAuthorizationBehavior OnMissingAuthorization { get; set; }
Behavior when endpoint has no authorization metadata and no YAML override. Default: RequireExplicit (fail discovery if no auth metadata).
OnUnsupportedConstraint property
public UnsupportedConstraintBehavior OnUnsupportedConstraint { get; set; }
Behavior for unsupported route constraints. Default: WarnAndStrip (log warning, strip constraint, continue).
Region property
public required string Region { get; set; }
Deployment region. Required.
Routers property
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.
ServiceDescription property
public string? ServiceDescription { get; set; }
Service description for documentation.
ServiceName property
public required string ServiceName { get; set; }
Service name for Router registration. Required.
Version property
public required string Version { get; set; }
Service version (semver). Required.
YamlConfigPath property
public string? YamlConfigPath { get; set; }
Path to microservice.yaml for endpoint overrides. Optional.
UnsupportedConstraintBehavior enum
public enum UnsupportedConstraintBehavior
Behavior for unsupported route constraints.
| Value | Description |
|---|---|
Fail = 0 | Fail discovery if route has an unsupported constraint. The constraint cannot be enforced by the Router. |
WarnAndStrip = 1 | Log a warning, strip the constraint from the normalized path, and continue. The ASP.NET matcher will still enforce the constraint during dispatch. |
SilentStrip = 2 | Silently strip the constraint without warning. Use only when you understand the implications. |
