feat: Add in-memory implementations for issuer audit, key, repository, and trust management
Some checks failed
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
Some checks failed
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
- Introduced InMemoryIssuerAuditSink to retain audit entries for testing. - Implemented InMemoryIssuerKeyRepository for deterministic key storage. - Created InMemoryIssuerRepository to manage issuer records in memory. - Added InMemoryIssuerTrustRepository for managing issuer trust overrides. - Each repository utilizes concurrent collections for thread-safe operations. - Enhanced deprecation tracking with a comprehensive YAML schema for API governance.
This commit is contained in:
@@ -44,7 +44,9 @@ public sealed class ReachabilityGraphBuilder
|
||||
string? display = null,
|
||||
string? sourceFile = null,
|
||||
int? sourceLine = null,
|
||||
IReadOnlyDictionary<string, string>? attributes = null)
|
||||
IReadOnlyDictionary<string, string>? attributes = null,
|
||||
string? purl = null,
|
||||
string? symbolDigest = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(symbolId))
|
||||
{
|
||||
@@ -59,7 +61,9 @@ public sealed class ReachabilityGraphBuilder
|
||||
display?.Trim(),
|
||||
sourceFile?.Trim(),
|
||||
sourceLine,
|
||||
attributes?.ToImmutableSortedDictionary(StringComparer.Ordinal) ?? ImmutableSortedDictionary<string, string>.Empty);
|
||||
attributes?.ToImmutableSortedDictionary(StringComparer.Ordinal) ?? ImmutableSortedDictionary<string, string>.Empty,
|
||||
purl?.Trim(),
|
||||
symbolDigest?.Trim());
|
||||
|
||||
_richNodes[id] = node;
|
||||
nodes.Add(id);
|
||||
@@ -93,6 +97,9 @@ public sealed class ReachabilityGraphBuilder
|
||||
/// <param name="origin">Origin: static or runtime.</param>
|
||||
/// <param name="provenance">Provenance hint: jvm-bytecode, il, ts-ast, ssa, ebpf, etw, jfr, hook.</param>
|
||||
/// <param name="evidence">Evidence locator (e.g., "file:path:line").</param>
|
||||
/// <param name="purl">PURL of the component that defines the callee.</param>
|
||||
/// <param name="symbolDigest">Stable hash of the normalized callee signature.</param>
|
||||
/// <param name="candidates">Ranked candidate purls when resolution is ambiguous.</param>
|
||||
public ReachabilityGraphBuilder AddEdge(
|
||||
string from,
|
||||
string to,
|
||||
@@ -100,7 +107,10 @@ public sealed class ReachabilityGraphBuilder
|
||||
EdgeConfidence confidence,
|
||||
string origin = "static",
|
||||
string? provenance = null,
|
||||
string? evidence = null)
|
||||
string? evidence = null,
|
||||
string? purl = null,
|
||||
string? symbolDigest = null,
|
||||
IReadOnlyList<(string Purl, string? SymbolDigest, double? Score)>? candidates = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(from) || string.IsNullOrWhiteSpace(to))
|
||||
{
|
||||
@@ -118,7 +128,10 @@ public sealed class ReachabilityGraphBuilder
|
||||
confidence,
|
||||
origin?.Trim() ?? "static",
|
||||
provenance?.Trim(),
|
||||
evidence?.Trim());
|
||||
evidence?.Trim(),
|
||||
purl?.Trim(),
|
||||
symbolDigest?.Trim(),
|
||||
candidates);
|
||||
|
||||
_richEdges.Add(richEdge);
|
||||
nodes.Add(fromId);
|
||||
@@ -172,7 +185,9 @@ public sealed class ReachabilityGraphBuilder
|
||||
rich.Kind,
|
||||
rich.Display,
|
||||
source,
|
||||
rich.Attributes.Count > 0 ? rich.Attributes : null));
|
||||
rich.Attributes.Count > 0 ? rich.Attributes : null,
|
||||
rich.Purl,
|
||||
rich.SymbolDigest));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -199,12 +214,17 @@ public sealed class ReachabilityGraphBuilder
|
||||
rich.Provenance,
|
||||
rich.Evidence);
|
||||
|
||||
var candidates = rich.Candidates?.Select(c => new ReachabilityEdgeCandidate(c.Purl, c.SymbolDigest, c.Score)).ToList();
|
||||
|
||||
edgeList.Add(new ReachabilityUnionEdge(
|
||||
rich.From,
|
||||
rich.To,
|
||||
rich.EdgeType,
|
||||
ConfidenceToString(rich.Confidence),
|
||||
source));
|
||||
source,
|
||||
rich.Purl,
|
||||
rich.SymbolDigest,
|
||||
candidates));
|
||||
}
|
||||
|
||||
// Add any legacy edges not already covered
|
||||
@@ -315,7 +335,9 @@ public sealed class ReachabilityGraphBuilder
|
||||
string? Display,
|
||||
string? SourceFile,
|
||||
int? SourceLine,
|
||||
ImmutableSortedDictionary<string, string> Attributes);
|
||||
ImmutableSortedDictionary<string, string> Attributes,
|
||||
string? Purl = null,
|
||||
string? SymbolDigest = null);
|
||||
|
||||
private sealed record RichEdge(
|
||||
string From,
|
||||
@@ -324,7 +346,10 @@ public sealed class ReachabilityGraphBuilder
|
||||
EdgeConfidence Confidence,
|
||||
string Origin,
|
||||
string? Provenance,
|
||||
string? Evidence);
|
||||
string? Evidence,
|
||||
string? Purl = null,
|
||||
string? SymbolDigest = null,
|
||||
IReadOnlyList<(string Purl, string? SymbolDigest, double? Score)>? Candidates = null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user