Refactor code structure for improved readability and maintainability; optimize performance in key functions.
This commit is contained in:
@@ -16,6 +16,21 @@ public sealed class SbomSnapshot
|
||||
[JsonPropertyName("sbomDigest")]
|
||||
public string SbomDigest { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sbomVersionId")]
|
||||
public string SbomVersionId { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sbomSequence")]
|
||||
public int SbomSequence { get; init; }
|
||||
|
||||
[JsonPropertyName("sbomFormat")]
|
||||
public string SbomFormat { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sbomFormatVersion")]
|
||||
public string SbomFormatVersion { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("chainId")]
|
||||
public string ChainId { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("collectedAt")]
|
||||
public DateTimeOffset CollectedAt { get; init; } = DateTimeOffset.UnixEpoch;
|
||||
|
||||
@@ -33,6 +48,9 @@ public sealed class SbomSnapshot
|
||||
|
||||
[JsonPropertyName("baseArtifacts")]
|
||||
public IReadOnlyList<SbomBaseArtifact> BaseArtifacts { get; init; } = Array.Empty<SbomBaseArtifact>();
|
||||
|
||||
[JsonPropertyName("lineage")]
|
||||
public IReadOnlyList<SbomLineageReference> Lineage { get; init; } = Array.Empty<SbomLineageReference>();
|
||||
}
|
||||
|
||||
public sealed class SbomArtifactMetadata
|
||||
@@ -229,3 +247,24 @@ public sealed class SbomBaseArtifact
|
||||
[JsonPropertyName("source")]
|
||||
public string Source { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class SbomLineageReference
|
||||
{
|
||||
[JsonPropertyName("relationship")]
|
||||
public string Relationship { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sbomDigest")]
|
||||
public string SbomDigest { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("artifactDigest")]
|
||||
public string ArtifactDigest { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("eventOffset")]
|
||||
public long EventOffset { get; init; }
|
||||
|
||||
[JsonPropertyName("collectedAt")]
|
||||
public DateTimeOffset CollectedAt { get; init; } = DateTimeOffset.UnixEpoch;
|
||||
|
||||
[JsonPropertyName("source")]
|
||||
public string Source { get; init; } = string.Empty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user