< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.UpdateScopePermissionCommand
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/UpdateScopePermissionCommand.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 45
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 7
Fully covered methods: 7
Total methods: 7
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ScopeId()100%11100%
get_Id()100%11100%
get_Name()100%11100%
get_Description()100%11100%
get_IncludeAsJwtClaim()100%11100%
get_ActingPersonId()100%11100%
get_ActingRole()100%11100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/UpdateScopePermissionCommand.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2using ArturRios.Heimdall.Shared.Security;
 3using ArturRios.Mediator.Command;
 4
 5namespace ArturRios.Heimdall.Command.Input;
 6
 7/// <summary>
 8///     Intent to change a scope permission's name, description, and JWT-claim flag (UC-33). The
 9///     permission is addressed by <see cref="Id" /> within <see cref="ScopeId" />, both assigned
 10///     from the route. PUT semantics: <see cref="Name" />, <see cref="Description" />, and
 11///     <see cref="IncludeAsJwtClaim" /> are replaced, so a caller changing only one resubmits the
 12///     current values of the others. The scope is a route qualifier, never a field to write — a
 13///     permission's scope is fixed at creation time. <see cref="ActingPersonId" />/<see cref="ActingRole" />
 14///     are set by the controller from the authenticated caller and are never bound from the body.
 15///     All four are <c>[JsonIgnore]</c>, so they are not deserialized from the body and do not
 16///     appear in the request schema.
 17/// </summary>
 18public class UpdateScopePermissionCommand : BaseCommand, IActorScoped
 19{
 20    /// <summary>Public identifier of the scope the permission belongs to (assigned from the route).</summary>
 21    [JsonIgnore]
 4322    public Guid ScopeId { get; set; }
 23
 24    /// <summary>Public identifier of the permission to update (assigned from the route).</summary>
 25    [JsonIgnore]
 4326    public Guid Id { get; set; }
 27
 28    /// <summary>New permission display name. Required, max 200 characters.</summary>
 10629    public string Name { get; set; } = string.Empty;
 30
 31    /// <summary>New permission description. Max 500 characters.</summary>
 6932    public string? Description { get; set; }
 33
 34    /// <summary>
 35    ///     New value of the flag controlling whether the permission's <see cref="Name" /> is added as
 36    ///     a claim on the JWT issued to identities acting within the owning scope.
 37    /// </summary>
 5338    public bool IncludeAsJwtClaim { get; set; }
 39
 40    [JsonIgnore]
 3041    public Guid ActingPersonId { get; set; }
 42
 43    [JsonIgnore]
 3044    public int ActingRole { get; set; }
 45}