audit work, fixed StellaOps.sln warnings/errors, fixed tests, sprints work, new advisories

This commit is contained in:
master
2026-01-07 18:49:59 +02:00
parent 04ec098046
commit 608a7f85c0
866 changed files with 56323 additions and 6231 deletions

View File

@@ -1,3 +1,4 @@
using System.Globalization;
using System.Text;
using System.Text.Json;
using Microsoft.Extensions.Logging;
@@ -15,6 +16,7 @@ public sealed class VexExportService : IVexExportService
private readonly IVexStatementRepository _statementRepository;
private readonly ILogger<VexExportService> _logger;
private readonly VexHubOptions _options;
private readonly TimeProvider _timeProvider;
private static readonly JsonSerializerOptions JsonOptions = new()
{
@@ -25,11 +27,13 @@ public sealed class VexExportService : IVexExportService
public VexExportService(
IVexStatementRepository statementRepository,
IOptions<VexHubOptions> options,
ILogger<VexExportService> logger)
ILogger<VexExportService> logger,
TimeProvider? timeProvider = null)
{
_statementRepository = statementRepository;
_options = options.Value;
_logger = logger;
_timeProvider = timeProvider ?? TimeProvider.System;
}
public async Task<Stream> ExportToOpenVexAsync(
@@ -134,7 +138,7 @@ public sealed class VexExportService : IVexExportService
string? purl = null)
{
var documentId = GenerateDocumentId(cveId, purl);
var timestamp = DateTimeOffset.UtcNow;
var timestamp = _timeProvider.GetUtcNow();
var openVexStatements = statements.Select(s => new OpenVexStatement
{
@@ -149,7 +153,7 @@ public sealed class VexExportService : IVexExportService
Statement = s.StatusNotes,
ImpactStatement = s.ImpactStatement,
ActionStatement = s.ActionStatement,
Timestamp = s.IssuedAt?.ToString("O")
Timestamp = s.IssuedAt?.ToString("O", CultureInfo.InvariantCulture)
}).ToList();
return new OpenVexDocument
@@ -162,7 +166,7 @@ public sealed class VexExportService : IVexExportService
Name = "StellaOps VexHub",
Role = "aggregator"
},
Timestamp = timestamp.ToString("O"),
Timestamp = timestamp.ToString("O", CultureInfo.InvariantCulture),
Version = 1,
Statements = openVexStatements
};