< Summary

Information
Class: Elsa.Workflows.Api.ShellFeatures.WorkflowsApiFeature
Assembly: Elsa.Workflows.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/ShellFeatures/WorkflowsApiFeature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 55
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
ConfigureServices(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/ShellFeatures/WorkflowsApiFeature.cs

#LineLine coverage
 1using CShells.FastEndpoints.Features;
 2using CShells.Features;
 3using Elsa.Extensions;
 4using Elsa.SasTokens.ShellFeatures;
 5using Elsa.ShellFeatures;
 6using Elsa.Workflows.Api.Constants;
 7using Elsa.Workflows.Api.Requirements;
 8using Elsa.Workflows.Api.Security;
 9using Elsa.Workflows.Api.Serialization;
 10using Elsa.Workflows.Api.Services;
 11using Elsa.Workflows.Management.ShellFeatures;
 12using Elsa.Workflows.Runtime.ShellFeatures;
 13using Elsa.Platform.PackageManifest.Generator.Hints;
 14using JetBrains.Annotations;
 15using Microsoft.AspNetCore.Authorization;
 16using Microsoft.Extensions.DependencyInjection;
 17
 18namespace Elsa.Workflows.Api.ShellFeatures;
 19
 20/// <summary>
 21/// Adds workflows API features with FastEndpoints support.
 22/// </summary>
 23/// <remarks>
 24/// This feature implements <see cref="IFastEndpointsShellFeature"/> to indicate that this assembly
 25/// contains FastEndpoints that should be automatically discovered and registered.
 26/// </remarks>
 27[ManifestFeatureCategory("Workflows")]
 28[ManifestFeatureCategory("API")]
 29[ShellFeature(
 30    DisplayName = "Workflows API",
 31    Description = "Provides REST API endpoints for workflow management",
 32    DependsOn =
 33[
 34    typeof(ElsaFastEndpointsFeature),
 35    typeof(WorkflowInstancesFeature),
 36    typeof(WorkflowManagementFeature),
 37    typeof(WorkflowRuntimeFeature),
 38    typeof(SasTokensFeature)
 39])]
 40[UsedImplicitly]
 41public class WorkflowsApiFeature : IFastEndpointsShellFeature
 42{
 43    public void ConfigureServices(IServiceCollection services)
 44    {
 045        services.AddSerializationOptionsConfigurator<SerializationConfigurator>();
 046        services.AddScoped<IWorkflowDefinitionLinker, StaticWorkflowDefinitionLinker>();
 047        services.AddScoped<WorkflowDefinitionScriptAuthorizationService>();
 048        services.AddScoped<IAuthorizationHandler, NotReadOnlyRequirementHandler>();
 049        services.Configure<AuthorizationOptions>(options =>
 050        {
 051            options.AddPolicy(AuthorizationPolicies.NotReadOnlyPolicy, policy => policy.AddRequirements(new NotReadOnlyR
 052        });
 053        services.AddScoped<IWorkflowInstanceExportNameProvider, DefaultWorkflowInstanceExportNameProvider>();
 054    }
 55}