Abstractions for the Altcha-based proof-of-work module: - AltchaAttribute (AllowMobileAttestationBypass param) - IHasAltchaSolution — marker interface for request POCOs carrying the widget's solution payload over HTTP/gRPC transports - IAltchaVerifier / IAltchaChallengeProvider — transport-agnostic interfaces; default gRPC implementations ship in Svrnty.CQRS.Altcha.Grpc - IMobileAttestationProvider — Phase 3 placeholder; concrete impls stamp ctx.Items["mobile_attested"] for the Altcha check to read as a bypass when AllowMobileAttestationBypass is true - AltchaChallenge / AltchaVerifyResult DTOs Lean dependencies — only references Svrnty.CQRS.Abstractions for the auth-check pipeline types. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
678 B
C#
21 lines
678 B
C#
namespace Svrnty.CQRS.Altcha.Abstractions;
|
|
|
|
/// <summary>
|
|
/// Outcome of an Altcha solution verification.
|
|
/// </summary>
|
|
public sealed class AltchaVerifyResult
|
|
{
|
|
public required bool Ok { get; init; }
|
|
|
|
/// <summary>
|
|
/// Diagnostic only — not surfaced to end users. Suggested values:
|
|
/// <c>signature-invalid</c>, <c>expired</c>, <c>pow-incorrect</c>,
|
|
/// <c>replayed</c>, <c>redis-unreachable</c>, <c>malformed</c>.
|
|
/// </summary>
|
|
public string? Reason { get; init; }
|
|
|
|
public static AltchaVerifyResult Success { get; } = new() { Ok = true };
|
|
|
|
public static AltchaVerifyResult Fail(string reason) => new() { Ok = false, Reason = reason };
|
|
}
|