| | | 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 begin opting the caller into two-factor authentication (UC-36, FR-2F-01), |
| | | 9 | | /// selecting an authenticator-app method, an email method, or both. <see cref="ActingPersonId" /> |
| | | 10 | | /// /<see cref="ActingRole" /> are set by the controller from the authenticated caller and are |
| | | 11 | | /// never bound from the body — like <see cref="ResendVerificationEmailCommand" />, a caller can |
| | | 12 | | /// only ever act on their own configuration. They are <c>[JsonIgnore]</c>, so they are not |
| | | 13 | | /// deserialized from the body and do not appear in the request schema. |
| | | 14 | | /// </summary> |
| | | 15 | | public class EnableTwoFactorAuthCommand : BaseCommand, IActorScoped |
| | | 16 | | { |
| | | 17 | | /// <summary>The method(s) to configure: <c>"App"</c>, <c>"Email"</c>, or both. Required, non-empty.</summary> |
| | 335 | 18 | | public List<string> Methods { get; set; } = []; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The caller's current password (FR-2F-18). Required: adding a second factor requires proof of |
| | | 22 | | /// identity, as removing one does, and a bearer token alone is not that proof. |
| | | 23 | | /// </summary> |
| | 191 | 24 | | public string? CurrentPassword { get; set; } |
| | | 25 | | |
| | | 26 | | [JsonIgnore] |
| | 99 | 27 | | public Guid ActingPersonId { get; set; } |
| | | 28 | | |
| | | 29 | | [JsonIgnore] |
| | 51 | 30 | | public int ActingRole { get; set; } |
| | | 31 | | } |