Merge branch 'main' of https://git.stella-ops.org/stella-ops.org/git.stella-ops.org
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)}";
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ public sealed class SmartDiffSchemaValidationTests
|
||||
}
|
||||
""");
|
||||
|
||||
using StellaOps.TestKit;
|
||||
var result = schema.Evaluate(doc.RootElement, new EvaluationOptions
|
||||
{
|
||||
OutputFormat = OutputFormat.List,
|
||||
|
||||
Reference in New Issue
Block a user