Table of Contents

Class EndpointGovernanceRouteBuilderExtensions

Namespace
AsiBackbone.AspNetCore.Endpoints
Assembly
AsiBackbone.AspNetCore.dll

Provides Minimal API / endpoint route-builder helpers for adding AsiBackbone governance metadata.

public static class EndpointGovernanceRouteBuilderExtensions
Inheritance
EndpointGovernanceRouteBuilderExtensions
Inherited Members

Methods

AllowMissingGovernanceMetadata<TBuilder>(TBuilder)

Allows an endpoint to pass through endpoint governance middleware when strict governance metadata enforcement is enabled.

public static TBuilder AllowMissingGovernanceMetadata<TBuilder>(this TBuilder builder) where TBuilder : IEndpointConventionBuilder

Parameters

builder TBuilder

The endpoint convention builder.

Returns

TBuilder

The same builder so calls can be chained.

Type Parameters

TBuilder

The endpoint convention builder type.

EmitGovernanceAudit<TBuilder>(TBuilder)

Adds governance-audit emission metadata to an endpoint.

public static TBuilder EmitGovernanceAudit<TBuilder>(this TBuilder builder) where TBuilder : IEndpointConventionBuilder

Parameters

builder TBuilder

The endpoint convention builder.

Returns

TBuilder

The same builder so calls can be chained.

Type Parameters

TBuilder

The endpoint convention builder type.

MarkGovernancePolicy<TPolicy>(RouteHandlerBuilder)

Marks a Minimal API route handler endpoint with the host-defined decision policy that governs it.

public static RouteHandlerBuilder MarkGovernancePolicy<TPolicy>(this RouteHandlerBuilder builder) where TPolicy : IGovernanceDecisionPolicy<GovernanceEvaluationContext>

Parameters

builder RouteHandlerBuilder

The route handler builder.

Returns

RouteHandlerBuilder

The same builder so calls can be chained.

Type Parameters

TPolicy

The host-registered decision policy that governs the endpoint.

Remarks

This records a marker, not an enforcement rule. The framework does not resolve TPolicy or select constraints from it: the registered IGovernancePolicyEvaluator evaluates every registered constraint on every governed endpoint regardless of which policy an endpoint is marked with. The marker reaches evaluation as the endpoint.policy_types metadata entry, where a host-supplied IGovernanceDecisionPolicy<TContext> can read it and vary its own outcome. Marking two endpoints with different policy types does not by itself make them evaluate differently.

MarkGovernancePolicy<TBuilder>(TBuilder, Type)

Marks an endpoint with the host-defined policy type that governs it.

public static TBuilder MarkGovernancePolicy<TBuilder>(this TBuilder builder, Type policyType) where TBuilder : IEndpointConventionBuilder

Parameters

builder TBuilder

The endpoint convention builder.

policyType Type

The host-defined policy marker or decision policy type.

Returns

TBuilder

The same builder so calls can be chained.

Type Parameters

TBuilder

The endpoint convention builder type.

Remarks

This records a marker, not an enforcement rule. See MarkGovernancePolicy<TPolicy>(RouteHandlerBuilder) for what the framework does and does not do with the recorded type. This overload accepts any type so hosts can mark endpoints with a plain marker type rather than a registered decision policy.

RequireAcknowledgment<TBuilder>(TBuilder)

Adds liability-handshake metadata to an endpoint.

public static TBuilder RequireAcknowledgment<TBuilder>(this TBuilder builder) where TBuilder : IEndpointConventionBuilder

Parameters

builder TBuilder

The endpoint convention builder.

Returns

TBuilder

The same builder so calls can be chained.

Type Parameters

TBuilder

The endpoint convention builder type.

RequireCapabilityGrant<TBuilder>(TBuilder, string)

Adds a required capability-grant scope to an endpoint.

public static TBuilder RequireCapabilityGrant<TBuilder>(this TBuilder builder, string scope) where TBuilder : IEndpointConventionBuilder

Parameters

builder TBuilder

The endpoint convention builder.

scope string

The required capability-grant scope.

Returns

TBuilder

The same builder so calls can be chained.

Type Parameters

TBuilder

The endpoint convention builder type.

ShortCircuitOnFirstDenial<TBuilder>(TBuilder, bool)

Adds endpoint-scoped metadata requesting latency-optimized fast-abort policy evaluation after the first denied constraint result.

public static TBuilder ShortCircuitOnFirstDenial<TBuilder>(this TBuilder builder, bool enabled = true) where TBuilder : IEndpointConventionBuilder

Parameters

builder TBuilder

The endpoint convention builder.

enabled bool

Whether first-denial short-circuit metadata is enabled for the endpoint.

Returns

TBuilder

The same builder so calls can be chained.

Type Parameters

TBuilder

The endpoint convention builder type.