< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.RegenerateRecoveryCodesCommand
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/RegenerateRecoveryCodesCommand.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 32
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_Code()100%11100%
get_RecoveryCode()100%11100%
get_ActingPersonId()100%11100%
get_ActingRole()100%11100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/RegenerateRecoveryCodesCommand.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2using ArturRios.Heimdall.Shared.Security;
 3using ArturRios.Mediator.Command;
 4
 5namespace ArturRios.Heimdall.Command.Input;
 6
 7/// <summary>
 8///     Intent to invalidate the caller's current recovery codes and issue a fresh set of ten (UC-40,
 9///     FR-2F-12), requiring a valid second factor — an app/email code or one of the caller's
 10///     remaining recovery codes — verified exactly as UC-38 verifies one. Unlike
 11///     <see cref="DisableTwoFactorAuthCommand" />, no password is required — the Use Case
 12///     Specification Document's precondition for UC-40 is only that two-factor authentication is
 13///     active, and the second factor alone is what UC-38 already treats as sufficient proof of
 14///     possession. <see cref="ActingPersonId" />/<see cref="ActingRole" /> are set by the controller
 15///     from the authenticated caller and are never bound from the body — a caller can only ever
 16///     regenerate their own recovery codes. They are <c>[JsonIgnore]</c>, so they are not
 17///     deserialized from the body and do not appear in the request schema.
 18/// </summary>
 19public class RegenerateRecoveryCodesCommand : BaseCommand, IActorScoped
 20{
 21    /// <summary>The caller's current app or email code, when proving a code rather than a recovery code.</summary>
 9422    public string? Code { get; set; }
 23
 24    /// <summary>One of the caller's unused recovery codes, when no code is available.</summary>
 10225    public string? RecoveryCode { get; set; }
 26
 27    [JsonIgnore]
 7228    public Guid ActingPersonId { get; set; }
 29
 30    [JsonIgnore]
 3631    public int ActingRole { get; set; }
 32}