| | | 1 | | using CShells.FastEndpoints.Features; |
| | | 2 | | using CShells.Features; |
| | | 3 | | using Elsa.Secrets.Extensions; |
| | | 4 | | using JetBrains.Annotations; |
| | | 5 | | using Microsoft.Extensions.DependencyInjection; |
| | | 6 | | |
| | | 7 | | namespace Elsa.Secrets.ShellFeatures; |
| | | 8 | | |
| | | 9 | | [ShellFeature( |
| | | 10 | | DisplayName = "Secrets", |
| | | 11 | | Description = "Provides named secret management, secret stores, and runtime secret resolution.", |
| | | 12 | | DependsOn = ["ElsaFastEndpoints"])] |
| | | 13 | | [UsedImplicitly] |
| | | 14 | | public class SecretsFeature : IFastEndpointsShellFeature |
| | | 15 | | { |
| | 0 | 16 | | public string ConfigurationSectionName { get; set; } = "Elsa:Secrets"; |
| | 0 | 17 | | public byte[]? EncryptionKey { get; set; } |
| | | 18 | | |
| | | 19 | | public void ConfigureServices(IServiceCollection services) |
| | | 20 | | { |
| | 0 | 21 | | services.AddSecretsServices(options => |
| | 0 | 22 | | { |
| | 0 | 23 | | options.ConfigurationSectionName = ConfigurationSectionName; |
| | 0 | 24 | | if (EncryptionKey != null) |
| | 0 | 25 | | options.EncryptionKey = EncryptionKey; |
| | 0 | 26 | | }); |
| | 0 | 27 | | } |
| | | 28 | | } |