save progress
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using StellaOps.Scanner.Core.Contracts;
|
||||
using StellaOps.Scanner.Core.Utility;
|
||||
using StellaOps.Scanner.Emit.Pedigree;
|
||||
|
||||
namespace StellaOps.Scanner.Emit.Composition;
|
||||
|
||||
@@ -45,6 +46,21 @@ public sealed record SbomCompositionRequest
|
||||
public ImmutableArray<SbomPolicyFinding> PolicyFindings { get; init; }
|
||||
= ImmutableArray<SbomPolicyFinding>.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pre-fetched pedigree data keyed by component PURL.
|
||||
/// This enables synchronous composition while allowing async pedigree lookups
|
||||
/// to happen before calling <see cref="CycloneDxComposer.Compose"/>.
|
||||
/// Sprint: SPRINT_20260107_005_002 Task PD-009
|
||||
/// </summary>
|
||||
public IReadOnlyDictionary<string, PedigreeData>? PedigreeDataByPurl { get; init; }
|
||||
= null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether pedigree data should be included in the SBOM.
|
||||
/// Defaults to true if pedigree data is provided.
|
||||
/// </summary>
|
||||
public bool IncludePedigree { get; init; } = true;
|
||||
|
||||
public static SbomCompositionRequest Create(
|
||||
ImageArtifactDescriptor image,
|
||||
IEnumerable<LayerComponentFragment> fragments,
|
||||
@@ -52,7 +68,9 @@ public sealed record SbomCompositionRequest
|
||||
string? generatorName = null,
|
||||
string? generatorVersion = null,
|
||||
IReadOnlyDictionary<string, string>? properties = null,
|
||||
IEnumerable<SbomPolicyFinding>? policyFindings = null)
|
||||
IEnumerable<SbomPolicyFinding>? policyFindings = null,
|
||||
IReadOnlyDictionary<string, PedigreeData>? pedigreeData = null,
|
||||
bool includePedigree = true)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(image);
|
||||
ArgumentNullException.ThrowIfNull(fragments);
|
||||
@@ -75,6 +93,8 @@ public sealed record SbomCompositionRequest
|
||||
GeneratorVersion = Normalize(generatorVersion),
|
||||
AdditionalProperties = properties,
|
||||
PolicyFindings = NormalizePolicyFindings(policyFindings),
|
||||
PedigreeDataByPurl = pedigreeData,
|
||||
IncludePedigree = includePedigree,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user