Files
git.stella-ops.org/src/StellaOps.Scanner.Core/Security/DpopValidationResult.cs
master aef7ffb535 up
2025-10-19 10:38:55 +03:00

35 lines
1016 B
C#

using Microsoft.IdentityModel.Tokens;
namespace StellaOps.Scanner.Core.Security;
public sealed class DpopValidationResult
{
private DpopValidationResult(bool success, string? errorCode, string? errorDescription, SecurityKey? key, string? jwtId, DateTimeOffset? issuedAt)
{
IsValid = success;
ErrorCode = errorCode;
ErrorDescription = errorDescription;
PublicKey = key;
JwtId = jwtId;
IssuedAt = issuedAt;
}
public bool IsValid { get; }
public string? ErrorCode { get; }
public string? ErrorDescription { get; }
public SecurityKey? PublicKey { get; }
public string? JwtId { get; }
public DateTimeOffset? IssuedAt { get; }
public static DpopValidationResult Success(SecurityKey key, string jwtId, DateTimeOffset issuedAt)
=> new(true, null, null, key, jwtId, issuedAt);
public static DpopValidationResult Failure(string code, string description)
=> new(false, code, description, null, null, null);
}