< Summary

Information
Class: ArturRios.Output.PageTokenOptions
Assembly: ArturRios.Output
File(s): /home/runner/work/dotnet-output/dotnet-output/src/PageTokenOptions.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 35
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 4
Fully covered methods: 4
Total methods: 4
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_SigningKey()100%11100%
get_Lifetime()100%11100%
get_Scope()100%11100%
get_TimeProvider()100%11100%

File(s)

/home/runner/work/dotnet-output/dotnet-output/src/PageTokenOptions.cs

#LineLine coverage
 1namespace ArturRios.Output;
 2
 3/// <summary>
 4/// Settings for issuing and checking the signed page tokens used by token pagination. Build one instance — typically
 5/// a singleton from configuration — and pass it to every call that walks the same listing.
 6/// </summary>
 7public sealed record PageTokenOptions
 8{
 9    /// <summary>
 10    /// The minimum length, in bytes, of <see cref="SigningKey"/>.
 11    /// </summary>
 12    public const int MinimumSigningKeyLength = 32;
 13
 14    /// <summary>
 15    /// Secret HMAC-SHA256 key that signs every token, at least <see cref="MinimumSigningKeyLength"/> bytes long. A
 16    /// token signed with another key is rejected, so every instance serving the same listing must share it.
 17    /// </summary>
 53018    public required byte[] SigningKey { get; init; }
 19
 20    /// <summary>
 21    /// How long a token stays valid after it is issued, or <c>null</c> for tokens that never expire.
 22    /// </summary>
 14023    public TimeSpan? Lifetime { get; init; }
 24
 25    /// <summary>
 26    /// Optional caller-defined string that binds tokens to one listing — for example <c>"orders:customer=42"</c> — so
 27    /// a token issued under one scope is rejected under another. It is hashed into the token, never stored in it.
 28    /// </summary>
 14029    public string? Scope { get; init; }
 30
 31    /// <summary>
 32    /// Clock used to stamp tokens and check their <see cref="Lifetime"/>.
 33    /// </summary>
 20834    public TimeProvider TimeProvider { get; init; } = TimeProvider.System;
 35}