| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | using ArturRios.Heimdall.Shared.Security; |
| | | 3 | | using ArturRios.Mediator.Command; |
| | | 4 | | |
| | | 5 | | namespace 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> |
| | | 19 | | public 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> |
| | 94 | 22 | | public string? Code { get; set; } |
| | | 23 | | |
| | | 24 | | /// <summary>One of the caller's unused recovery codes, when no code is available.</summary> |
| | 102 | 25 | | public string? RecoveryCode { get; set; } |
| | | 26 | | |
| | | 27 | | [JsonIgnore] |
| | 72 | 28 | | public Guid ActingPersonId { get; set; } |
| | | 29 | | |
| | | 30 | | [JsonIgnore] |
| | 36 | 31 | | public int ActingRole { get; set; } |
| | | 32 | | } |