< Summary

Information
Class: AsiBackbone.AspNetCore.Handshakes.AsiBackboneAcknowledgmentChallengeOptions
Assembly: AsiBackbone.AspNetCore
File(s): /home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.AspNetCore/Handshakes/AsiBackboneAcknowledgmentChallengeOptions.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 62
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_RequiredAcknowledgmentCode()100%11100%
get_RequiredAcknowledgmentText()100%11100%
.ctor()100%11100%
get_RiskLevel()100%11100%
get_RiskCategory()100%11100%
get_IncludeReasonMessage()100%11100%
get_IncludeTraceId()100%11100%
get_IncludePolicyMetadata()100%11100%
Validate()100%44100%

File(s)

/home/runner/work/AsiBackbone/AsiBackbone/src/AsiBackbone.AspNetCore/Handshakes/AsiBackboneAcknowledgmentChallengeOptions.cs

#LineLine coverage
 1using AsiBackbone.Core.Handshakes;
 2
 3namespace AsiBackbone.AspNetCore.Handshakes;
 4
 5/// <summary>
 6/// Provides host-overridable defaults for building acknowledgment challenges from Core governance decisions.
 7/// </summary>
 8public sealed class AsiBackboneAcknowledgmentChallengeOptions
 9{
 10    /// <summary>
 11    /// Gets or sets the default acknowledgment code required before continuing.
 12    /// </summary>
 27113    public string RequiredAcknowledgmentCode { get; set; } = "ACKNOWLEDGE_RESPONSIBILITY";
 14
 15    /// <summary>
 16    /// Gets or sets the default acknowledgment text shown by host applications.
 17    /// </summary>
 17018    public string RequiredAcknowledgmentText { get; set; } =
 8319        "I understand the responsibility notice and acknowledge that this operation may continue.";
 20
 21    /// <summary>
 22    /// Gets or sets the default risk level associated with acknowledgment challenges.
 23    /// </summary>
 4024    public LiabilityHandshakeRiskLevel RiskLevel { get; set; } = LiabilityHandshakeRiskLevel.Unspecified;
 25
 26    /// <summary>
 27    /// Gets or sets the optional host-defined default risk category.
 28    /// </summary>
 4029    public string? RiskCategory { get; set; }
 30
 31    /// <summary>
 32    /// Gets or sets a value indicating whether the challenge should expose the Core reason message.
 33    /// </summary>
 13334    public bool IncludeReasonMessage { get; set; } = true;
 35
 36    /// <summary>
 37    /// Gets or sets a value indicating whether trace identifiers may be exposed in challenge payloads.
 38    /// </summary>
 5039    public bool IncludeTraceId { get; set; }
 40
 41    /// <summary>
 42    /// Gets or sets a value indicating whether policy version and policy hash values may be exposed in challenge payloa
 43    /// </summary>
 9444    public bool IncludePolicyMetadata { get; set; }
 45
 46    /// <summary>
 47    /// Validates the configured challenge options.
 48    /// </summary>
 49    /// <exception cref="InvalidOperationException">Thrown when a required challenge option is invalid.</exception>
 50    public void Validate()
 51    {
 13252        if (string.IsNullOrWhiteSpace(RequiredAcknowledgmentCode))
 53        {
 1054            throw new InvalidOperationException("A required acknowledgment code must be configured.");
 55        }
 56
 12257        if (string.IsNullOrWhiteSpace(RequiredAcknowledgmentText))
 58        {
 859            throw new InvalidOperationException("Required acknowledgment text must be configured.");
 60        }
 11461    }
 62}