| | | 1 | | namespace Elsa.Secrets.Models; |
| | | 2 | | |
| | | 3 | | public class SecretModel |
| | | 4 | | { |
| | | 5 | | public string Id { get; set; } = default!; |
| | | 6 | | public string Name { get; set; } = default!; |
| | | 7 | | public string DisplayName { get; set; } = default!; |
| | | 8 | | public string? Description { get; set; } |
| | | 9 | | public string TypeName { get; set; } = default!; |
| | | 10 | | public string StoreName { get; set; } = default!; |
| | | 11 | | public string? Scope { get; set; } |
| | | 12 | | public ICollection<string> Tags { get; set; } = []; |
| | | 13 | | public SecretStatus Status { get; set; } |
| | | 14 | | public int? CurrentVersion { get; set; } |
| | | 15 | | public DateTimeOffset CreatedAt { get; set; } |
| | | 16 | | public DateTimeOffset? UpdatedAt { get; set; } |
| | | 17 | | public DateTimeOffset? ExpiresAt { get; set; } |
| | | 18 | | } |
| | | 19 | | |
| | | 20 | | public class CreateSecretRequest |
| | | 21 | | { |
| | | 22 | | public string Name { get; set; } = default!; |
| | | 23 | | public string? DisplayName { get; set; } |
| | | 24 | | public string? Description { get; set; } |
| | | 25 | | public string TypeName { get; set; } = SecretTypeNames.Text; |
| | | 26 | | public string StoreName { get; set; } = SecretStoreNames.Encrypted; |
| | | 27 | | public string? Scope { get; set; } |
| | | 28 | | public ICollection<string> Tags { get; set; } = []; |
| | | 29 | | public string? Value { get; set; } |
| | | 30 | | public string? ConfigurationKey { get; set; } |
| | | 31 | | public DateTimeOffset? ExpiresAt { get; set; } |
| | | 32 | | public IDictionary<string, string> Metadata { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgn |
| | | 33 | | } |
| | | 34 | | |
| | | 35 | | public class RotateSecretRequest |
| | | 36 | | { |
| | | 37 | | public string? Value { get; set; } |
| | | 38 | | public string? ConfigurationKey { get; set; } |
| | | 39 | | public DateTimeOffset? ExpiresAt { get; set; } |
| | | 40 | | public IDictionary<string, string> Metadata { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgn |
| | | 41 | | } |
| | | 42 | | |
| | | 43 | | public class ListSecretsRequest |
| | | 44 | | { |
| | | 45 | | public string? Search { get; set; } |
| | | 46 | | public string? TypeName { get; set; } |
| | | 47 | | public ICollection<string> TypeNames { get; set; } = []; |
| | | 48 | | public string? StoreName { get; set; } |
| | | 49 | | public ICollection<string> StoreNames { get; set; } = []; |
| | | 50 | | public string? Scope { get; set; } |
| | | 51 | | public SecretStatus? Status { get; set; } |
| | | 52 | | public int? Page { get; set; } |
| | | 53 | | public int? PageSize { get; set; } |
| | | 54 | | } |
| | | 55 | | |
| | | 56 | | public class ListSecretsResponse |
| | | 57 | | { |
| | 0 | 58 | | public ICollection<SecretModel> Items { get; set; } = []; |
| | 0 | 59 | | public long TotalCount { get; set; } |
| | | 60 | | } |
| | | 61 | | |
| | | 62 | | public class ListSecretsResult |
| | | 63 | | { |
| | | 64 | | public IReadOnlyCollection<Secret> Items { get; set; } = []; |
| | | 65 | | public long TotalCount { get; set; } |
| | | 66 | | } |
| | | 67 | | |
| | | 68 | | public class SecretDescriptorsResponse |
| | | 69 | | { |
| | | 70 | | public ICollection<SecretTypeDescriptor> Types { get; set; } = []; |
| | | 71 | | public ICollection<SecretStoreDescriptor> Stores { get; set; } = []; |
| | | 72 | | } |
| | | 73 | | |
| | | 74 | | public class SecretPickerRequest |
| | | 75 | | { |
| | | 76 | | public string? Search { get; set; } |
| | | 77 | | public ICollection<string> TypeNames { get; set; } = []; |
| | | 78 | | public ICollection<string> StoreNames { get; set; } = []; |
| | | 79 | | public string? Scope { get; set; } |
| | | 80 | | public bool ActiveOnly { get; set; } = true; |
| | | 81 | | } |
| | | 82 | | |
| | | 83 | | public class SecretPickerResponse |
| | | 84 | | { |
| | | 85 | | public ICollection<SecretModel> Items { get; set; } = []; |
| | | 86 | | public bool CanCreateInline { get; set; } = true; |
| | | 87 | | } |
| | | 88 | | |
| | | 89 | | public class SecretTestResponse |
| | | 90 | | { |
| | | 91 | | public bool Succeeded { get; set; } |
| | | 92 | | public string? Error { get; set; } |
| | | 93 | | } |