< Summary

Information
Class: Elsa.Secrets.ShellFeatures.SecretsFeature
Assembly: Elsa.Secrets
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets/ShellFeatures/SecretsFeature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 32
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ConfigurationSectionName()100%210%
get_EncryptionKey()100%210%
ConfigureServices(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Secrets/ShellFeatures/SecretsFeature.cs

#LineLine coverage
 1using CShells.FastEndpoints.Features;
 2using CShells.Features;
 3using Elsa.Secrets.Extensions;
 4using Elsa.ShellFeatures;
 5using Elsa.Platform.PackageManifest.Generator.Hints;
 6using JetBrains.Annotations;
 7using Microsoft.Extensions.DependencyInjection;
 8
 9namespace Elsa.Secrets.ShellFeatures;
 10
 11[ManifestFeatureCategory("Secrets")]
 12[ManifestFeatureCategory("Security")]
 13[ShellFeature(
 14    DisplayName = "Secrets",
 15    Description = "Provides named secret management, secret stores, and runtime secret resolution.",
 16    DependsOn = [typeof(ElsaFastEndpointsFeature)])]
 17[UsedImplicitly]
 18public class SecretsFeature : IFastEndpointsShellFeature
 19{
 020    public string ConfigurationSectionName { get; set; } = "Elsa:Secrets";
 021    public byte[]? EncryptionKey { get; set; }
 22
 23    public void ConfigureServices(IServiceCollection services)
 24    {
 025        services.AddSecretsServices(options =>
 026        {
 027            options.ConfigurationSectionName = ConfigurationSectionName;
 028            if (EncryptionKey != null)
 029                options.EncryptionKey = EncryptionKey;
 030        });
 031    }
 32}