This commit is contained in:
StellaOps Bot
2025-12-26 21:43:56 +02:00
354 changed files with 354 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ public sealed class DsseEnvelopeSerializerTests
"payload hash must reflect the raw payload bytes");
using var document = JsonDocument.Parse(result.CompactJson!);
using StellaOps.TestKit;
var keyIds = document.RootElement
.GetProperty("signatures")
.EnumerateArray()

View File

@@ -149,6 +149,7 @@ public sealed class EnvelopeSignatureServiceTests
{
var jwk = $"{{\"crv\":\"Ed25519\",\"kty\":\"OKP\",\"x\":\"{ToBase64Url(publicKey)}\"}}";
using var sha = SHA256.Create();
using StellaOps.TestKit;
var digest = sha.ComputeHash(Encoding.UTF8.GetBytes(jwk));
return $"sha256:{ToBase64Url(digest)}";
}

View File

@@ -114,6 +114,7 @@ public sealed class DsseEnvelopeSerializerTests
Assert.NotNull(result.ExpandedJson);
using var expanded = JsonDocument.Parse(result.ExpandedJson!);
using StellaOps.TestKit;
var detached = expanded.RootElement.GetProperty("detachedPayload");
Assert.Equal(reference.Uri, detached.GetProperty("uri").GetString());

View File

@@ -256,6 +256,7 @@ public sealed class AttestorSigningServiceTests : IDisposable
using var metrics = new AttestorMetrics();
using var registry = new AttestorSigningKeyRegistry(options, TimeProvider.System, NullLogger<AttestorSigningKeyRegistry>.Instance);
using StellaOps.TestKit;
var auditSink = new InMemoryAttestorAuditSink();
var service = new AttestorSigningService(
registry,

View File

@@ -277,6 +277,7 @@ public sealed class AttestorSubmissionServiceTests
var logger = new NullLogger<AttestorSubmissionService>();
using var metrics = new AttestorMetrics();
using StellaOps.TestKit;
var service = new AttestorSubmissionService(
validator,
repository,

View File

@@ -700,6 +700,7 @@ public sealed class AttestorVerificationServiceTests
private static byte[] ComputeMerkleNode(byte[] left, byte[] right)
{
using var sha = SHA256.Create();
using StellaOps.TestKit;
var buffer = new byte[1 + left.Length + right.Length];
buffer[0] = 0x01;
Buffer.BlockCopy(left, 0, buffer, 1, left.Length);

View File

@@ -24,6 +24,7 @@ public sealed class BulkVerificationWorkerTests
var jobStore = new InMemoryBulkVerificationJobStore();
var verificationService = new StubVerificationService();
using var metrics = new AttestorMetrics();
using StellaOps.TestKit;
var options = Options.Create(new AttestorOptions
{
BulkVerification = new AttestorOptions.BulkVerificationOptions

View File

@@ -86,6 +86,7 @@ public sealed class CachedAttestorVerificationServiceTests
var options = Options.Create(new AttestorOptions());
using var memoryCache = new MemoryCache(new MemoryCacheOptions());
using var metrics = new AttestorMetrics();
using StellaOps.TestKit;
var cache = new InMemoryAttestorVerificationCache(memoryCache, options, new NullLogger<InMemoryAttestorVerificationCache>());
var inner = new StubVerificationService();
var service = new CachedAttestorVerificationService(

View File

@@ -136,6 +136,7 @@ public sealed class HttpTransparencyWitnessClientTests
using var metrics = new AttestorMetrics();
using var activitySource = new AttestorActivitySource();
using StellaOps.TestKit;
var options = Options.Create(new AttestorOptions
{
TransparencyWitness = new AttestorOptions.TransparencyWitnessOptions

View File

@@ -309,6 +309,7 @@ public sealed class RekorInclusionVerificationIntegrationTests
private static byte[] ComputeInteriorHash(byte[] left, byte[] right)
{
using var sha256 = System.Security.Cryptography.SHA256.Create();
using StellaOps.TestKit;
var combined = new byte[1 + left.Length + right.Length];
combined[0] = 0x01; // Interior node prefix
left.CopyTo(combined, 1);

View File

@@ -328,6 +328,7 @@ public class SigstoreBundleVerifierTests
DateTimeOffset.UtcNow.AddDays(-1),
DateTimeOffset.UtcNow.AddYears(1));
using StellaOps.TestKit;
return cert.Export(System.Security.Cryptography.X509Certificates.X509ContentType.Cert);
}
}

View File

@@ -406,6 +406,7 @@ public class BundleWorkflowIntegrationTests
}
using var sha256 = System.Security.Cryptography.SHA256.Create();
using StellaOps.TestKit;
var combined = string.Join("|", attestations.Select(a => a.EntryId));
var hash = sha256.ComputeHash(System.Text.Encoding.UTF8.GetBytes(combined));
return Convert.ToHexString(hash).ToLowerInvariant();

View File

@@ -350,6 +350,7 @@ public class FileSystemRootStoreTests : IDisposable
private static X509Certificate2 CreateTestCertificate(string subject)
{
using var rsa = RSA.Create(2048);
using StellaOps.TestKit;
var request = new CertificateRequest(
subject,
rsa,

View File

@@ -349,6 +349,7 @@ public class OfflineCertChainValidatorTests
private static X509Certificate2 CreateFutureCertificate(string subject)
{
using var rsa = RSA.Create(2048);
using StellaOps.TestKit;
var request = new CertificateRequest(
subject,
rsa,

View File

@@ -54,6 +54,7 @@ public sealed class JsonCanonicalizerTests
var output = _canonicalizer.Canonicalize(input);
using var document = JsonDocument.Parse(output);
using StellaOps.TestKit;
Assert.Equal(text, document.RootElement.GetProperty("text").GetString());
}

View File

@@ -92,6 +92,7 @@ public sealed class SmartDiffSchemaValidationTests
}
""");
using StellaOps.TestKit;
var result = schema.Evaluate(doc.RootElement, new EvaluationOptions
{
OutputFormat = OutputFormat.List,