Table of Contents

Class EndpointGovernanceOptions

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

Provides options for ergonomic ASP.NET Core endpoint governance integration.

public sealed class EndpointGovernanceOptions
Inheritance
EndpointGovernanceOptions
Inherited Members

Properties

AcknowledgmentChallengeStatusCode

Gets or sets the HTTP status code used when a governance decision requires acknowledgment and the endpoint requested a acknowledgment.

public int AcknowledgmentChallengeStatusCode { get; set; }

Property Value

int

CapabilityFailureStatusCode

Gets or sets the HTTP status code used when endpoint capability validation fails before policy evaluation returns a stricter status.

public int CapabilityFailureStatusCode { get; set; }

Property Value

int

ConfigurationFailureStatusCode

Gets or sets the HTTP status code used when endpoint governance is missing required host configuration.

public int ConfigurationFailureStatusCode { get; set; }

Property Value

int

DefaultForbiddenResultFactory

Gets or sets an optional factory for the generic 403 response used by middleware when no explicit failure result was supplied.

public Func<HttpContext, IResult>? DefaultForbiddenResultFactory { get; set; }

Property Value

Func<HttpContext, IResult>

Remarks

Leave this unset for the low-allocation, bodyless default 403 response. Hosts that prefer richer API responses may provide a safe factory, such as a ProblemDetails result, while avoiding sensitive governance details.

DevelopmentDiagnosticsDocumentationBaseUrl

Gets or sets the documentation base URL used when development diagnostics include a troubleshooting link.

public string? DevelopmentDiagnosticsDocumentationBaseUrl { get; set; }

Property Value

string

DevelopmentDiagnosticsRedactedMetadataKeys

Gets a collection of metadata keys whose values should be redacted from development diagnostics.

public ISet<string> DevelopmentDiagnosticsRedactedMetadataKeys { get; }

Property Value

ISet<string>

EnableDevelopmentDiagnostics

Gets or sets a value indicating whether local-development ProblemDetails diagnostics should be emitted for endpoint governance failures.

public bool EnableDevelopmentDiagnostics { get; set; }

Property Value

bool

FailClosedWhenAuditSinkMissing

Gets or sets a value indicating whether audit metadata should fail closed when no host-owned decision receipt sink is configured.

public bool FailClosedWhenAuditSinkMissing { get; set; }

Property Value

bool

FailClosedWhenCapabilityValidatorMissing

Gets or sets a value indicating whether capability metadata should fail closed when no capability validator is configured.

public bool FailClosedWhenCapabilityValidatorMissing { get; set; }

Property Value

bool

FailClosedWhenPolicyEvaluatorMissing

Gets or sets a value indicating whether policy metadata should fail closed when no policy evaluator is configured.

public bool FailClosedWhenPolicyEvaluatorMissing { get; set; }

Property Value

bool

IncludeDevelopmentDiagnosticsMetadataValues

Gets or sets a value indicating whether non-sensitive metadata values may be included in development diagnostics.

public bool IncludeDevelopmentDiagnosticsMetadataValues { get; set; }

Property Value

bool

MetadataMode

Gets or sets the endpoint metadata mode used for governance evaluation contexts, decision receipt, acknowledgment challenges, and diagnostics.

public EndpointGovernanceMetadataMode MetadataMode { get; set; }

Property Value

EndpointGovernanceMetadataMode

Remarks

The default keeps complete endpoint metadata for traceability. High-throughput hosts may choose Reduced to forward only the endpoint operation name through the hot path after they have confirmed host policies do not require the omitted metadata values.

PolicyHash

Gets or sets the policy hash attached to generated endpoint governance evaluation contexts.

public string? PolicyHash { get; set; }

Property Value

string

PolicyVersion

Gets or sets the policy version attached to generated endpoint governance evaluation contexts.

public string? PolicyVersion { get; set; }

Property Value

string

RequireGovernanceMetadata

Gets or sets a value indicating whether selected endpoints without AsiBackbone governance metadata should fail closed.

public bool RequireGovernanceMetadata { get; set; }

Property Value

bool

Methods

Validate()

Validates endpoint governance options.

public void Validate()