| | | 1 | | namespace Elsa.Secrets.Models; |
| | | 2 | | |
| | | 3 | | public class Secret |
| | | 4 | | { |
| | 285 | 5 | | public string Id { get; set; } = Guid.NewGuid().ToString("N"); |
| | 298 | 6 | | public string Name { get; set; } = default!; |
| | 214 | 7 | | public string DisplayName { get; set; } = default!; |
| | 199 | 8 | | public string? Description { get; set; } |
| | 327 | 9 | | public string TypeName { get; set; } = SecretTypeNames.Text; |
| | 338 | 10 | | public string StoreName { get; set; } = SecretStoreNames.Encrypted; |
| | 201 | 11 | | public string? Scope { get; set; } |
| | | 12 | | [System.Text.Json.Serialization.JsonConverter(typeof(CaseInsensitiveHashSetConverter))] |
| | 315 | 13 | | public HashSet<string> Tags { get; set; } = new(StringComparer.OrdinalIgnoreCase); |
| | 245 | 14 | | public SecretStatus Status { get; set; } = SecretStatus.Active; |
| | 285 | 15 | | public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow; |
| | 174 | 16 | | public DateTimeOffset? UpdatedAt { get; set; } |
| | 366 | 17 | | public IList<SecretVersion> Versions { get; set; } = []; |
| | | 18 | | |
| | 18 | 19 | | public SecretVersion? LatestActiveVersion => Versions |
| | 14 | 20 | | .Where(x => x.Status == SecretStatus.Active && !x.IsExpired()) |
| | 10 | 21 | | .OrderByDescending(x => x.Version) |
| | 18 | 22 | | .FirstOrDefault(); |
| | | 23 | | } |