< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.DisableTwoFactorAuthCommand
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/DisableTwoFactorAuthCommand.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
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: 5
Fully covered methods: 5
Total methods: 5
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Password()100%11100%
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/DisableTwoFactorAuthCommand.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 turn off the caller's own two-factor authentication (UC-39, FR-2F-11), requiring
 9///     both the caller's current password and a valid second factor — an app/email code or a
 10///     recovery code — exactly as hard to satisfy as a login. <see cref="ActingPersonId" />/
 11///     <see cref="ActingRole" /> are set by the controller from the authenticated caller and are
 12///     never bound from the body — like <see cref="EnableTwoFactorAuthCommand" />, a caller can only
 13///     ever disable their own configuration. They are <c>[JsonIgnore]</c>, so they are not
 14///     deserialized from the body and do not appear in the request schema.
 15/// </summary>
 16public class DisableTwoFactorAuthCommand : BaseCommand, IActorScoped
 17{
 18    /// <summary>The caller's current password (UC-11 step 3's check, reused here).</summary>
 19319    public string Password { get; set; } = string.Empty;
 20
 21    /// <summary>The caller's current app or email code, when proving a code rather than a recovery code.</summary>
 12622    public string? Code { get; set; }
 23
 24    /// <summary>One of the caller's unused recovery codes, when no code is available.</summary>
 12625    public string? RecoveryCode { get; set; }
 26
 27    [JsonIgnore]
 9228    public Guid ActingPersonId { get; set; }
 29
 30    [JsonIgnore]
 4631    public int ActingRole { get; set; }
 32}