| | | 1 | | using CShells.Features; |
| | | 2 | | using Elsa.SasTokens.Contracts; |
| | | 3 | | using Elsa.Platform.PackageManifest.Generator.Hints; |
| | | 4 | | using JetBrains.Annotations; |
| | | 5 | | using Microsoft.AspNetCore.DataProtection; |
| | | 6 | | using Microsoft.Extensions.DependencyInjection; |
| | | 7 | | |
| | | 8 | | namespace Elsa.SasTokens.ShellFeatures; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Adds the SAS tokens feature to the workflow runtime. |
| | | 12 | | /// </summary> |
| | | 13 | | [ManifestFeatureCategory("Security")] |
| | | 14 | | [ShellFeature( |
| | | 15 | | DisplayName = "SAS Tokens", |
| | | 16 | | Description = "Provides shared access signature token generation and validation")] |
| | | 17 | | [UsedImplicitly] |
| | | 18 | | public class SasTokensFeature : IShellFeature |
| | | 19 | | { |
| | 0 | 20 | | private Func<IServiceProvider, ITokenService> TokenService { get; set; } = sp => ActivatorUtilities.CreateInstance<D |
| | | 21 | | |
| | | 22 | | public void ConfigureServices(IServiceCollection services) |
| | | 23 | | { |
| | 0 | 24 | | var builder = services.AddDataProtection(); |
| | 0 | 25 | | builder.SetApplicationName("Elsa Workflows"); |
| | | 26 | | |
| | 0 | 27 | | services.AddScoped(TokenService); |
| | 0 | 28 | | } |
| | | 29 | | } |