125 lines
3.1 KiB
C#
125 lines
3.1 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace StellaOps.JobEngine.Schemas;
|
|
|
|
public sealed record ScannerReportReadyPayload
|
|
{
|
|
[JsonPropertyName("reportId")]
|
|
public string ReportId { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("scanId")]
|
|
public string? ScanId { get; init; }
|
|
|
|
[JsonPropertyName("imageDigest")]
|
|
public string? ImageDigest { get; init; }
|
|
|
|
[JsonPropertyName("generatedAt")]
|
|
public DateTimeOffset GeneratedAt { get; init; }
|
|
|
|
[JsonPropertyName("verdict")]
|
|
public string Verdict { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("summary")]
|
|
public Summary Summary { get; init; } = new();
|
|
|
|
[JsonPropertyName("delta")]
|
|
public Delta? Delta { get; init; }
|
|
|
|
[JsonPropertyName("quietedFindingCount")]
|
|
public int? QuietedFindingCount { get; init; }
|
|
|
|
[JsonPropertyName("policy")]
|
|
public PolicyRevision? Policy { get; init; }
|
|
|
|
[JsonPropertyName("links")]
|
|
public ReportLinks Links { get; init; } = new();
|
|
|
|
[JsonPropertyName("dsse")]
|
|
public DsseEnvelope? Dsse { get; init; }
|
|
|
|
[JsonPropertyName("report")]
|
|
public JsonElement Report { get; init; }
|
|
}
|
|
|
|
public sealed record Summary
|
|
{
|
|
[JsonPropertyName("total")]
|
|
public int Total { get; init; }
|
|
|
|
[JsonPropertyName("blocked")]
|
|
public int Blocked { get; init; }
|
|
|
|
[JsonPropertyName("warned")]
|
|
public int Warned { get; init; }
|
|
|
|
[JsonPropertyName("ignored")]
|
|
public int Ignored { get; init; }
|
|
|
|
[JsonPropertyName("quieted")]
|
|
public int Quieted { get; init; }
|
|
}
|
|
|
|
public sealed record Delta
|
|
{
|
|
[JsonPropertyName("newCritical")]
|
|
public int? NewCritical { get; init; }
|
|
|
|
[JsonPropertyName("newHigh")]
|
|
public int? NewHigh { get; init; }
|
|
|
|
[JsonPropertyName("kev")]
|
|
public IReadOnlyList<string>? Kev { get; init; }
|
|
}
|
|
|
|
public sealed record PolicyRevision
|
|
{
|
|
[JsonPropertyName("digest")]
|
|
public string? Digest { get; init; }
|
|
|
|
[JsonPropertyName("revisionId")]
|
|
public string? RevisionId { get; init; }
|
|
}
|
|
|
|
public sealed record ReportLinks
|
|
{
|
|
[JsonPropertyName("report.ui")]
|
|
public string? ReportUi { get; init; }
|
|
|
|
[JsonPropertyName("report.api")]
|
|
public string? ReportApi { get; init; }
|
|
|
|
[JsonPropertyName("policy.ui")]
|
|
public string? PolicyUi { get; init; }
|
|
|
|
[JsonPropertyName("policy.api")]
|
|
public string? PolicyApi { get; init; }
|
|
|
|
[JsonPropertyName("attestation.ui")]
|
|
public string? AttestationUi { get; init; }
|
|
|
|
[JsonPropertyName("attestation.api")]
|
|
public string? AttestationApi { get; init; }
|
|
}
|
|
|
|
public sealed record DsseEnvelope
|
|
{
|
|
[JsonPropertyName("payloadType")]
|
|
public string PayloadType { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("payload")]
|
|
public string Payload { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("signatures")]
|
|
public IReadOnlyList<DsseSignature> Signatures { get; init; } = Array.Empty<DsseSignature>();
|
|
}
|
|
|
|
public sealed record DsseSignature
|
|
{
|
|
[JsonPropertyName("keyid")]
|
|
public string? KeyId { get; init; }
|
|
|
|
[JsonPropertyName("sig")]
|
|
public string Sig { get; init; } = string.Empty;
|
|
}
|