sprints work
This commit is contained in:
@@ -0,0 +1,217 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace StellaOps.Provcache.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core entity for provcache.provcache_items table.
|
||||
/// </summary>
|
||||
[Table("provcache_items", Schema = "provcache")]
|
||||
public sealed class ProvcacheItemEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Composite cache key (VeriKey).
|
||||
/// </summary>
|
||||
[Key]
|
||||
[Column("verikey")]
|
||||
[MaxLength(512)]
|
||||
public required string VeriKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Schema version of the digest format.
|
||||
/// </summary>
|
||||
[Column("digest_version")]
|
||||
[MaxLength(16)]
|
||||
public required string DigestVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Hash of sorted dispositions.
|
||||
/// </summary>
|
||||
[Column("verdict_hash")]
|
||||
[MaxLength(128)]
|
||||
public required string VerdictHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Merkle root of evidence.
|
||||
/// </summary>
|
||||
[Column("proof_root")]
|
||||
[MaxLength(128)]
|
||||
public required string ProofRoot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Replay seed as JSON (feed IDs, rule IDs, frozen epoch).
|
||||
/// </summary>
|
||||
[Column("replay_seed", TypeName = "jsonb")]
|
||||
public required string ReplaySeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Hash of the policy bundle.
|
||||
/// </summary>
|
||||
[Column("policy_hash")]
|
||||
[MaxLength(128)]
|
||||
public required string PolicyHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Hash of the signer certificate set.
|
||||
/// </summary>
|
||||
[Column("signer_set_hash")]
|
||||
[MaxLength(128)]
|
||||
public required string SignerSetHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Advisory feed epoch identifier.
|
||||
/// </summary>
|
||||
[Column("feed_epoch")]
|
||||
[MaxLength(64)]
|
||||
public required string FeedEpoch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Trust score (0-100).
|
||||
/// </summary>
|
||||
[Column("trust_score")]
|
||||
[Range(0, 100)]
|
||||
public int TrustScore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of cache hits.
|
||||
/// </summary>
|
||||
[Column("hit_count")]
|
||||
public long HitCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when entry was created.
|
||||
/// </summary>
|
||||
[Column("created_at")]
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when entry expires.
|
||||
/// </summary>
|
||||
[Column("expires_at")]
|
||||
public DateTimeOffset ExpiresAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when entry was last updated.
|
||||
/// </summary>
|
||||
[Column("updated_at")]
|
||||
public DateTimeOffset UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when entry was last accessed.
|
||||
/// </summary>
|
||||
[Column("last_accessed_at")]
|
||||
public DateTimeOffset? LastAccessedAt { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EF Core entity for provcache.prov_evidence_chunks table.
|
||||
/// </summary>
|
||||
[Table("prov_evidence_chunks", Schema = "provcache")]
|
||||
public sealed class ProvcacheEvidenceChunkEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique chunk identifier.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[Column("chunk_id")]
|
||||
public Guid ChunkId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Proof root this chunk belongs to.
|
||||
/// </summary>
|
||||
[Column("proof_root")]
|
||||
[MaxLength(128)]
|
||||
public required string ProofRoot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Index of this chunk in the Merkle tree.
|
||||
/// </summary>
|
||||
[Column("chunk_index")]
|
||||
public int ChunkIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Hash of the chunk content.
|
||||
/// </summary>
|
||||
[Column("chunk_hash")]
|
||||
[MaxLength(128)]
|
||||
public required string ChunkHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Chunk content.
|
||||
/// </summary>
|
||||
[Column("blob")]
|
||||
public required byte[] Blob { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of the blob in bytes.
|
||||
/// </summary>
|
||||
[Column("blob_size")]
|
||||
public int BlobSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MIME type of the content.
|
||||
/// </summary>
|
||||
[Column("content_type")]
|
||||
[MaxLength(128)]
|
||||
public required string ContentType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when chunk was created.
|
||||
/// </summary>
|
||||
[Column("created_at")]
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// EF Core entity for provcache.prov_revocations table.
|
||||
/// </summary>
|
||||
[Table("prov_revocations", Schema = "provcache")]
|
||||
public sealed class ProvcacheRevocationEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique revocation identifier.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[Column("revocation_id")]
|
||||
public Guid RevocationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of revocation (policy, signer, feed, pattern).
|
||||
/// </summary>
|
||||
[Column("revocation_type")]
|
||||
[MaxLength(64)]
|
||||
public required string RevocationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Target hash that was revoked.
|
||||
/// </summary>
|
||||
[Column("target_hash")]
|
||||
[MaxLength(256)]
|
||||
public required string TargetHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reason for revocation.
|
||||
/// </summary>
|
||||
[Column("reason")]
|
||||
[MaxLength(512)]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Actor who initiated the revocation.
|
||||
/// </summary>
|
||||
[Column("actor")]
|
||||
[MaxLength(256)]
|
||||
public string? Actor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of entries affected by the revocation.
|
||||
/// </summary>
|
||||
[Column("entries_affected")]
|
||||
public long EntriesAffected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UTC timestamp when revocation occurred.
|
||||
/// </summary>
|
||||
[Column("created_at")]
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user