< Summary

Information
Class: Elsa.Secrets.Endpoints.Secrets.Get.Endpoint
Assembly: Elsa.Secrets
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets/Endpoints/Secrets/Get/Endpoint.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 26
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Configure()100%210%
HandleAsync()0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets/Endpoints/Secrets/Get/Endpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Secrets.Permissions;
 3using Elsa.Secrets.Services;
 4
 5namespace Elsa.Secrets.Endpoints.Secrets.Get;
 6
 07internal class Endpoint(ISecretManager manager) : ElsaEndpointWithoutRequest<SecretModel>
 8{
 9    public override void Configure()
 10    {
 011        Get("/secrets/{name}");
 012        ConfigurePermissions(SecretsPermissions.Read);
 013    }
 14
 15    public override async Task HandleAsync(CancellationToken cancellationToken)
 16    {
 017        var secret = await manager.GetAsync(Route<string>("name")!, cancellationToken);
 018        if (secret == null)
 19        {
 020            await Send.NotFoundAsync(cancellationToken);
 021            return;
 22        }
 23
 024        await Send.OkAsync(secret.ToModel(), cancellationToken);
 025    }
 26}