48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using StellaOps.AuditPack.Models;
|
|
using StellaOps.AuditPack.Services;
|
|
|
|
namespace StellaOps.AuditPack.Tests;
|
|
|
|
public sealed partial class AuditReplayE2ETests
|
|
{
|
|
private static AuditBundleWriteRequest CreateWriteRequest(
|
|
string bundlePath,
|
|
string scanId,
|
|
string imageRef,
|
|
string imageDigest,
|
|
string decision)
|
|
{
|
|
return new AuditBundleWriteRequest
|
|
{
|
|
OutputPath = bundlePath,
|
|
ScanId = scanId,
|
|
ImageRef = imageRef,
|
|
ImageDigest = imageDigest,
|
|
Decision = decision,
|
|
Sbom = CreateCycloneDxSbom(imageRef),
|
|
FeedsSnapshot = CreateFeedsSnapshot(),
|
|
PolicyBundle = CreatePolicyBundle(),
|
|
Verdict = CreateVerdict(decision, scanId),
|
|
VexStatements = CreateVexStatements(),
|
|
Sign = false,
|
|
TimeAnchor = new TimeAnchorInput
|
|
{
|
|
Timestamp = FixedUtcNow,
|
|
Source = "local-test"
|
|
}
|
|
};
|
|
}
|
|
|
|
private static AuditBundleReadRequest CreateReadRequest(string bundlePath)
|
|
{
|
|
return new AuditBundleReadRequest
|
|
{
|
|
BundlePath = bundlePath,
|
|
VerifySignature = false,
|
|
VerifyMerkleRoot = true,
|
|
VerifyInputDigests = true,
|
|
LoadReplayInputs = true
|
|
};
|
|
}
|
|
}
|