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
optionsIOptions<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
actorIGovernanceActorContextThe actor associated with the challenge.
operationNamestringThe operation name requiring acknowledgment.
decisionGovernanceDecisionThe governance decision requiring acknowledgment.
metadataIReadOnlyDictionary<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_unboundcode.
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
challengeAcknowledgmentChallengeThe original acknowledgment challenge.
actorIGovernanceActorContextThe actor responding to the challenge.
responseAcknowledgmentChallengeRequestThe submitted response.
occurredUtcDateTimeOffset?Optional response timestamp.
Returns
- AcknowledgmentChallengeResult
The result of handling the response. An insufficient challenged or responding actor binding fails with
acknowledgment.challenge.actor_unboundand does not create an acknowledgment.