sprints enhancements
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StellaOps.Provcache.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core entity for provcache.prov_revocations table.
|
||||
/// Tracks all revocation events for audit trail and replay.
|
||||
/// </summary>
|
||||
[Table("prov_revocations", Schema = "provcache")]
|
||||
public sealed class ProvRevocationEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Auto-incrementing sequence number for ordering.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[Column("seq_no")]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long SeqNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for this revocation event.
|
||||
/// </summary>
|
||||
[Column("revocation_id")]
|
||||
public required Guid RevocationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of revocation: 'signer', 'feed_epoch', 'policy', 'explicit'.
|
||||
/// </summary>
|
||||
[Column("revocation_type")]
|
||||
[MaxLength(32)]
|
||||
public required string RevocationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key that was revoked (signer hash, feed epoch, policy hash, or verikey).
|
||||
/// </summary>
|
||||
[Column("revoked_key")]
|
||||
[MaxLength(512)]
|
||||
public required string RevokedKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reason for revocation.
|
||||
/// </summary>
|
||||
[Column("reason")]
|
||||
[MaxLength(1024)]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of cache entries invalidated.
|
||||
/// </summary>
|
||||
[Column("entries_invalidated")]
|
||||
public int EntriesInvalidated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Source that triggered the revocation.
|
||||
/// </summary>
|
||||
[Column("source")]
|
||||
[MaxLength(128)]
|
||||
public required string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional correlation ID for tracing.
|
||||
/// </summary>
|
||||
[Column("correlation_id")]
|
||||
[MaxLength(128)]
|
||||
public string? CorrelationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when revocation occurred.
|
||||
/// </summary>
|
||||
[Column("revoked_at")]
|
||||
public DateTimeOffset RevokedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional metadata as JSON.
|
||||
/// </summary>
|
||||
[Column("metadata", TypeName = "jsonb")]
|
||||
public string? Metadata { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Types of revocation events.
|
||||
/// </summary>
|
||||
public static class RevocationTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Signer certificate revoked.
|
||||
/// </summary>
|
||||
public const string Signer = "signer";
|
||||
|
||||
/// <summary>
|
||||
/// Feed epoch advanced (older epochs revoked).
|
||||
/// </summary>
|
||||
public const string FeedEpoch = "feed_epoch";
|
||||
|
||||
/// <summary>
|
||||
/// Policy bundle updated/revoked.
|
||||
/// </summary>
|
||||
public const string Policy = "policy";
|
||||
|
||||
/// <summary>
|
||||
/// Explicit revocation of specific entry.
|
||||
/// </summary>
|
||||
public const string Explicit = "explicit";
|
||||
|
||||
/// <summary>
|
||||
/// TTL expiration (for audit completeness).
|
||||
/// </summary>
|
||||
public const string Expiration = "expiration";
|
||||
}
|
||||
Reference in New Issue
Block a user