| | | 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 | | /// A data subject's request to have their own identity erased (UC-42, GDPR Art. 17, LGPD Art. 18 |
| | | 9 | | /// VI). The subject is always the authenticated caller — there is no identifier in the path or |
| | | 10 | | /// the body — so one identity can never request another's erasure. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <remarks> |
| | | 13 | | /// <para> |
| | | 14 | | /// Exactly one of the two credentials is used, and which one is not the caller's choice: a |
| | | 15 | | /// person authenticates with their password, a Google User with a fresh Google ID token, |
| | | 16 | | /// because a Google User has no password to present. The handler picks by identity type. |
| | | 17 | | /// </para> |
| | | 18 | | /// <para> |
| | | 19 | | /// <see cref="ActingPersonId" /> and <see cref="ActingRole" /> are set by the controller from |
| | | 20 | | /// the authenticated caller and never taken from the request; both are <c>[JsonIgnore]</c>, |
| | | 21 | | /// which <c>ServerPopulatedBindingMetadataProvider</c> turns into "not bindable", so they |
| | | 22 | | /// never reach the public contract. |
| | | 23 | | /// </para> |
| | | 24 | | /// </remarks> |
| | | 25 | | public class RequestErasureCommand : BaseCommand, IActorScoped |
| | | 26 | | { |
| | | 27 | | /// <summary>The caller's current password, when the caller is a person.</summary> |
| | 87 | 28 | | public string? Password { get; set; } |
| | | 29 | | |
| | | 30 | | /// <summary>A freshly issued Google ID token, when the caller is a Google User.</summary> |
| | 40 | 31 | | public string? IdToken { get; set; } |
| | | 32 | | |
| | | 33 | | [JsonIgnore] |
| | 77 | 34 | | public Guid ActingPersonId { get; set; } |
| | | 35 | | |
| | | 36 | | [JsonIgnore] |
| | 39 | 37 | | public int ActingRole { get; set; } |
| | | 38 | | } |