tests fixes and sprints work
This commit is contained in:
@@ -118,12 +118,18 @@ public sealed class FacetQuotaGate : IPolicyGate
|
||||
private static FacetDriftReport? GetDriftReportFromContext(PolicyGateContext context)
|
||||
{
|
||||
// Drift report is expected to be in metadata under a well-known key
|
||||
if (context.Metadata?.TryGetValue("FacetDriftReport", out var value) == true &&
|
||||
value is string json)
|
||||
if (context.Metadata?.TryGetValue("FacetDriftReport", out var json) == true &&
|
||||
!string.IsNullOrWhiteSpace(json))
|
||||
{
|
||||
// In a real implementation, deserialize from JSON
|
||||
// For now, return null to trigger the no-seal path
|
||||
return null;
|
||||
try
|
||||
{
|
||||
return System.Text.Json.JsonSerializer.Deserialize<FacetDriftReport>(json);
|
||||
}
|
||||
catch (System.Text.Json.JsonException)
|
||||
{
|
||||
// Malformed JSON - return null to trigger no-seal path
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -109,16 +109,13 @@ public sealed class OpaGateAdapter : IPolicyGate
|
||||
{
|
||||
MergeResult = new
|
||||
{
|
||||
mergeResult.Findings,
|
||||
mergeResult.TotalFindings,
|
||||
mergeResult.CriticalCount,
|
||||
mergeResult.HighCount,
|
||||
mergeResult.MediumCount,
|
||||
mergeResult.LowCount,
|
||||
mergeResult.UnknownCount,
|
||||
mergeResult.NewFindings,
|
||||
mergeResult.RemovedFindings,
|
||||
mergeResult.UnchangedFindings
|
||||
mergeResult.Status,
|
||||
mergeResult.Confidence,
|
||||
mergeResult.HasConflicts,
|
||||
mergeResult.RequiresReplayProof,
|
||||
mergeResult.AllClaims,
|
||||
mergeResult.WinningClaim,
|
||||
mergeResult.Conflicts
|
||||
},
|
||||
Context = new
|
||||
{
|
||||
|
||||
@@ -173,7 +173,7 @@ public sealed record UnknownsGateOptions
|
||||
/// <summary>
|
||||
/// Default implementation of unknowns gate checker.
|
||||
/// </summary>
|
||||
public sealed class UnknownsGateChecker : IUnknownsGateChecker
|
||||
public class UnknownsGateChecker : IUnknownsGateChecker
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly IMemoryCache _cache;
|
||||
@@ -299,7 +299,7 @@ public sealed class UnknownsGateChecker : IUnknownsGateChecker
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<UnknownState>> GetUnknownsAsync(
|
||||
public virtual async Task<IReadOnlyList<UnknownState>> GetUnknownsAsync(
|
||||
string bomRef,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user