Table of Contents

Class DefaultAcknowledgmentChallengeService

Namespace
AsiBackbone.AspNetCore.Acknowledgments
Assembly
AsiBackbone.AspNetCore.dll

Provides the default ASP.NET Core-friendly acknowledgment challenge service.

public sealed class DefaultAcknowledgmentChallengeService : IAcknowledgmentChallengeService
Inheritance
DefaultAcknowledgmentChallengeService
Implements
Inherited Members

Constructors

DefaultAcknowledgmentChallengeService(IOptions<AcknowledgmentChallengeOptions>)

Initializes a new instance of the DefaultAcknowledgmentChallengeService class.

public DefaultAcknowledgmentChallengeService(IOptions<AcknowledgmentChallengeOptions> options)

Parameters

options IOptions<AcknowledgmentChallengeOptions>

The acknowledgment challenge options.

Methods

CreateChallenge(IGovernanceActorContext, string, GovernanceDecision, IReadOnlyDictionary<string, string>?)

Creates an acknowledgment challenge from an acknowledgment-required governance decision.

public AcknowledgmentChallenge CreateChallenge(IGovernanceActorContext actor, string operationName, GovernanceDecision decision, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

actor IGovernanceActorContext

The actor associated with the challenge.

operationName string

The operation name requiring acknowledgment.

decision GovernanceDecision

The governance decision requiring acknowledgment.

metadata IReadOnlyDictionary<string, string>

Optional host-provided challenge metadata.

Returns

AcknowledgmentChallenge

A host-friendly acknowledgment challenge.

Exceptions

InvalidOperationException

Thrown when the decision does not require acknowledgment or the actor lacks a distinct, known, authenticated binding. The latter failure includes the stable acknowledgment.challenge.actor_unbound code.

HandleResponse(AcknowledgmentChallenge, IGovernanceActorContext, AcknowledgmentChallengeRequest, DateTimeOffset?)

Handles a host-submitted acknowledgment challenge response.

public AcknowledgmentChallengeResult HandleResponse(AcknowledgmentChallenge challenge, IGovernanceActorContext actor, AcknowledgmentChallengeRequest response, DateTimeOffset? occurredUtc = null)

Parameters

challenge AcknowledgmentChallenge

The original acknowledgment challenge.

actor IGovernanceActorContext

The actor responding to the challenge.

response AcknowledgmentChallengeRequest

The submitted response.

occurredUtc DateTimeOffset?

Optional response timestamp.

Returns

AcknowledgmentChallengeResult

The result of handling the response. An insufficient challenged or responding actor binding fails with acknowledgment.challenge.actor_unbound and does not create an acknowledgment.