< Summary - Heimdall API

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%

File(s)

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

#LineLine coverage
 1using ArturRios.Heimdall.Shared.Messages;
 2using FluentValidation;
 3
 4namespace ArturRios.Heimdall.Command.Input.Validation;
 5
 6/// <summary>UC-56 AF-56a: the request names an application, a scope and a secret of bounded length.</summary>
 7public class IssueApplicationTokenCommandValidator : AbstractValidator<IssueApplicationTokenCommand>
 8{
 9    /// <summary>A secret is 47 characters; the bound only stops hashing an arbitrarily large body.</summary>
 10    private const int MaxSecretLength = 100;
 11
 2412    public IssueApplicationTokenCommandValidator()
 13    {
 2414        RuleFor(command => command.ApplicationId)
 2415            .NotEmpty().WithMessage(ApplicationTokenMessages.ApplicationIdRequired);
 16
 2417        RuleFor(command => command.ScopeId)
 2418            .NotEmpty().WithMessage(ApplicationTokenMessages.ScopeIdRequired);
 19
 2420        RuleFor(command => command.Secret)
 2421            .NotEmpty().WithMessage(ApplicationTokenMessages.SecretRequired)
 2422            .MaximumLength(MaxSecretLength).WithMessage(ApplicationTokenMessages.SecretTooLong);
 2423    }
 24}

Methods/Properties

.ctor()