| | | 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 | | /// Re-applies erasure to identities that came back in a database restore (NFR-25). |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// <para> |
| | | 12 | | /// <b>Why this has to exist at all.</b> An erasure that the next restore silently undoes is |
| | | 13 | | /// not an erasure. Backups are full copies and are never edited — editing one destroys the |
| | | 14 | | /// integrity that is its purpose — so a restore reinstates whatever the database held when |
| | | 15 | | /// the backup was taken, erased people included. |
| | | 16 | | /// </para> |
| | | 17 | | /// <para> |
| | | 18 | | /// <b>Why the scheduled pass is not enough on its own.</b> Where the backup was taken |
| | | 19 | | /// <em>after</em> the subject asked, the restored row still carries its deletion and |
| | | 20 | | /// deadline, and NFR-20's pass completes the erasure again by itself. Where the backup |
| | | 21 | | /// predates the request, the row comes back with no trace of it ever having been made, and |
| | | 22 | | /// nothing inside the database knows to act. This is the only case that needs a list from |
| | | 23 | | /// outside, and it is the case this command exists for. |
| | | 24 | | /// </para> |
| | | 25 | | /// </remarks> |
| | | 26 | | public class ReapplyErasuresCommand : BaseCommand, IActorScoped |
| | | 27 | | { |
| | | 28 | | /// <summary> |
| | | 29 | | /// Public identifiers of the identities to erase, taken from the erasure ledger the restore |
| | | 30 | | /// runbook keeps outside the database. |
| | | 31 | | /// </summary> |
| | 30 | 32 | | public IEnumerable<Guid> SubjectIds { get; set; } = []; |
| | | 33 | | |
| | | 34 | | [JsonIgnore] |
| | 1 | 35 | | public Guid ActingPersonId { get; set; } |
| | | 36 | | |
| | | 37 | | [JsonIgnore] |
| | 10 | 38 | | public int ActingRole { get; set; } |
| | | 39 | | } |