< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Jwt.JwtParameters
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Jwt/JwtParameters.cs
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 57
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Header()100%11100%
get_Issuer()100%11100%
get_Audiences()100%11100%
get_Subject()100%11100%
get_NotBefore()100%11100%
get_Expires()100%11100%
get_IssuedAt()100%11100%
get_Algorithm()100%11100%
get_KeyId()100%11100%
get_Type()100%11100%
get_Claims()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Jwt/JwtParameters.cs

#LineLine coverage
 1namespace Kestrun.Jwt;
 2
 3/// <summary>
 4/// Represents all parameters extracted from a JWT, including header fields, standard properties, and claims.
 5/// </summary>
 6public class JwtParameters
 7{
 8    // Header fields
 9    /// <summary>
 10    /// Gets the JWT header fields as a dictionary.
 11    /// </summary>
 4912    public IDictionary<string, object> Header { get; init; } = new Dictionary<string, object>();
 13
 14    // Standard properties
 15    /// <summary>
 16    /// Gets the issuer ("iss") claim from the JWT.
 17    /// </summary>
 1718    public string? Issuer { get; init; }
 19    /// <summary>
 20    /// Gets the audiences ("aud") claim from the JWT.
 21    /// </summary>
 2722    public IEnumerable<string> Audiences { get; init; } = [];
 23    /// <summary>
 24    /// Gets the subject ("sub") claim from the JWT.
 25    /// </summary>
 1726    public string? Subject { get; init; }
 27    /// <summary>
 28    /// Gets the "nbf" (Not Before) claim from the JWT, indicating the time before which the token is not valid.
 29    /// </summary>
 1430    public DateTime? NotBefore { get; init; }
 31    /// <summary>
 32    /// Gets the "exp" (Expiration Time) claim from the JWT, indicating the time after which the token expires.
 33    /// </summary>
 1634    public DateTime? Expires { get; init; }
 35    /// <summary>
 36    /// Gets the "iat" (Issued At) claim from the JWT, indicating when the token was issued.
 37    /// </summary>
 1238    public DateTime? IssuedAt { get; init; }
 39    /// <summary>
 40    /// Gets the algorithm ("alg") used to sign the JWT.
 41    /// </summary>
 1542    public string? Algorithm { get; init; }
 43    /// <summary>
 44    /// Gets the key ID ("kid") from the JWT header.
 45    /// </summary>
 1446    public string? KeyId { get; init; }
 47    /// <summary>
 48    /// Gets the type ("typ") of the JWT, indicating the token type.
 49    /// </summary>
 1550    public string? Type { get; init; }
 51
 52    // All payload claims
 53    /// <summary>
 54    /// Gets all claims from the JWT payload, including custom claims, as a dictionary.
 55    /// </summary>
 8656    public IDictionary<string, object> Claims { get; init; } = new Dictionary<string, object>();
 57}