Refactor code structure for improved readability and maintainability; removed redundant code blocks and optimized function calls.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StellaOps.Policy.AuthSignals;
|
||||
|
||||
public record EvidenceRef
|
||||
{
|
||||
public string Kind { get; init; } = string.Empty; // linkset|runtime|attestation|bundle
|
||||
public string Uri { get; init; } = string.Empty;
|
||||
public string Digest { get; init; } = string.Empty;
|
||||
public string? Scope { get; init; }
|
||||
}
|
||||
|
||||
public record Provenance
|
||||
{
|
||||
public string? Pipeline { get; init; }
|
||||
public IReadOnlyList<string>? Inputs { get; init; }
|
||||
public string? Signer { get; init; }
|
||||
public Transparency? Transparency { get; init; }
|
||||
}
|
||||
|
||||
public record Transparency
|
||||
{
|
||||
public string? RekorUuid { get; init; }
|
||||
public string? SkipReason { get; init; }
|
||||
}
|
||||
|
||||
public record PolicyAuthSignal
|
||||
{
|
||||
public string Id { get; init; } = string.Empty;
|
||||
public string Tenant { get; init; } = string.Empty;
|
||||
public string Subject { get; init; } = string.Empty;
|
||||
public string SignalType { get; init; } = string.Empty; // reachability|attestation|risk|vex
|
||||
public string Source { get; init; } = string.Empty;
|
||||
public double? Confidence { get; init; }
|
||||
public IReadOnlyList<EvidenceRef> Evidence { get; init; } = Array.Empty<EvidenceRef>();
|
||||
public Provenance? Provenance { get; init; }
|
||||
public DateTime Created { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageId>StellaOps.Policy.AuthSignals</PackageId>
|
||||
<Authors>StellaOps</Authors>
|
||||
<Company>StellaOps</Company>
|
||||
<Version>0.1.0-alpha</Version>
|
||||
<Description>Shared Policy/Authority/Signals contracts for advisory signals.</Description>
|
||||
<PackageOutputPath>../../../../local-nugets</PackageOutputPath>
|
||||
<IncludeSymbols>false</IncludeSymbols>
|
||||
<IncludeSource>false</IncludeSource>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user