| | | 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 register a scope-specific permission (UC-31). <see cref="ScopeId" /> comes from the |
| | | 9 | | /// route; <see cref="ActingPersonId" />/<see cref="ActingRole" /> are set by the controller from |
| | | 10 | | /// the authenticated caller (for the AF-31e scope-ownership check) and are never bound from the |
| | | 11 | | /// body. They are <c>[JsonIgnore]</c>, so they are not deserialized from the body and do not |
| | | 12 | | /// appear in the request schema. The <see cref="IncludeAsJwtClaim" /> flag controls whether the |
| | | 13 | | /// permission's <see cref="Name" /> is folded into the JWT issued to identities acting within the |
| | | 14 | | /// owning scope. |
| | | 15 | | /// </summary> |
| | | 16 | | public class CreateScopePermissionCommand : BaseCommand, IActorScoped |
| | | 17 | | { |
| | | 18 | | [JsonIgnore] |
| | 69 | 19 | | public Guid ScopeId { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary>Permission display name. Required, max 200 characters.</summary> |
| | 217 | 22 | | public string Name { get; set; } = string.Empty; |
| | | 23 | | |
| | | 24 | | /// <summary>Optional description of the permission's purpose. Max 500 characters.</summary> |
| | 132 | 25 | | public string? Description { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// When <c>true</c>, this permission's <see cref="Name" /> is added as a claim on the JWT |
| | | 29 | | /// issued to identities acting within the owning scope. Defaults to <c>false</c>. |
| | | 30 | | /// </summary> |
| | 100 | 31 | | public bool IncludeAsJwtClaim { get; set; } |
| | | 32 | | |
| | | 33 | | [JsonIgnore] |
| | 59 | 34 | | public Guid ActingPersonId { get; set; } |
| | | 35 | | |
| | | 36 | | [JsonIgnore] |
| | 59 | 37 | | public int ActingRole { get; set; } |
| | | 38 | | } |