Add Authority Advisory AI and API Lifecycle Configuration
- Introduced AuthorityAdvisoryAiOptions and related classes for managing advisory AI configurations, including remote inference options and tenant-specific settings. - Added AuthorityApiLifecycleOptions to control API lifecycle settings, including legacy OAuth endpoint configurations. - Implemented validation and normalization methods for both advisory AI and API lifecycle options to ensure proper configuration. - Created AuthorityNotificationsOptions and its related classes for managing notification settings, including ack tokens, webhooks, and escalation options. - Developed IssuerDirectoryClient and related models for interacting with the issuer directory service, including caching mechanisms and HTTP client configurations. - Added support for dependency injection through ServiceCollectionExtensions for the Issuer Directory Client. - Updated project file to include necessary package references for the new Issuer Directory Client library.
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0-rc.2.25502.107" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.0-rc.2.25502.107" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.0-rc.2.25502.107" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StellaOps.Excititor.Core\StellaOps.Excititor.Core.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0-rc.2.25502.107" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.0-rc.2.25502.107" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.0-rc.2.25502.107" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StellaOps.Excititor.Core\StellaOps.Excititor.Core.csproj" />
|
||||
<ProjectReference Include="..\..\..\__Libraries\StellaOps.Cryptography\StellaOps.Cryptography.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -184,43 +184,74 @@ public sealed record VexClaimDocument
|
||||
public VexSignatureMetadata? Signature { get; }
|
||||
}
|
||||
|
||||
public sealed record VexSignatureMetadata
|
||||
{
|
||||
public VexSignatureMetadata(
|
||||
string type,
|
||||
string? subject = null,
|
||||
string? issuer = null,
|
||||
string? keyId = null,
|
||||
DateTimeOffset? verifiedAt = null,
|
||||
string? transparencyLogReference = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(type))
|
||||
{
|
||||
throw new ArgumentException("Signature type must be provided.", nameof(type));
|
||||
}
|
||||
|
||||
Type = type.Trim();
|
||||
Subject = string.IsNullOrWhiteSpace(subject) ? null : subject.Trim();
|
||||
Issuer = string.IsNullOrWhiteSpace(issuer) ? null : issuer.Trim();
|
||||
KeyId = string.IsNullOrWhiteSpace(keyId) ? null : keyId.Trim();
|
||||
VerifiedAt = verifiedAt;
|
||||
TransparencyLogReference = string.IsNullOrWhiteSpace(transparencyLogReference)
|
||||
? null
|
||||
: transparencyLogReference.Trim();
|
||||
}
|
||||
|
||||
public string Type { get; }
|
||||
|
||||
public string? Subject { get; }
|
||||
|
||||
public string? Issuer { get; }
|
||||
|
||||
public string? KeyId { get; }
|
||||
|
||||
public DateTimeOffset? VerifiedAt { get; }
|
||||
|
||||
public string? TransparencyLogReference { get; }
|
||||
}
|
||||
public sealed record VexSignatureMetadata
|
||||
{
|
||||
public VexSignatureMetadata(
|
||||
string type,
|
||||
string? subject = null,
|
||||
string? issuer = null,
|
||||
string? keyId = null,
|
||||
DateTimeOffset? verifiedAt = null,
|
||||
string? transparencyLogReference = null,
|
||||
VexSignatureTrustMetadata? trust = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(type))
|
||||
{
|
||||
throw new ArgumentException("Signature type must be provided.", nameof(type));
|
||||
}
|
||||
|
||||
Type = type.Trim();
|
||||
Subject = string.IsNullOrWhiteSpace(subject) ? null : subject.Trim();
|
||||
Issuer = string.IsNullOrWhiteSpace(issuer) ? null : issuer.Trim();
|
||||
KeyId = string.IsNullOrWhiteSpace(keyId) ? null : keyId.Trim();
|
||||
VerifiedAt = verifiedAt;
|
||||
TransparencyLogReference = string.IsNullOrWhiteSpace(transparencyLogReference)
|
||||
? null
|
||||
: transparencyLogReference.Trim();
|
||||
Trust = trust;
|
||||
}
|
||||
|
||||
public string Type { get; }
|
||||
|
||||
public string? Subject { get; }
|
||||
|
||||
public string? Issuer { get; }
|
||||
|
||||
public string? KeyId { get; }
|
||||
|
||||
public DateTimeOffset? VerifiedAt { get; }
|
||||
|
||||
public string? TransparencyLogReference { get; }
|
||||
|
||||
public VexSignatureTrustMetadata? Trust { get; }
|
||||
}
|
||||
|
||||
public sealed record VexSignatureTrustMetadata
|
||||
{
|
||||
public VexSignatureTrustMetadata(
|
||||
decimal effectiveWeight,
|
||||
string tenantId,
|
||||
string issuerId,
|
||||
bool tenantOverrideApplied,
|
||||
DateTimeOffset retrievedAtUtc)
|
||||
{
|
||||
EffectiveWeight = effectiveWeight;
|
||||
TenantId = string.IsNullOrWhiteSpace(tenantId) ? "@unknown" : tenantId.Trim();
|
||||
IssuerId = string.IsNullOrWhiteSpace(issuerId) ? "unknown" : issuerId.Trim();
|
||||
TenantOverrideApplied = tenantOverrideApplied;
|
||||
RetrievedAtUtc = retrievedAtUtc.ToUniversalTime();
|
||||
}
|
||||
|
||||
public decimal EffectiveWeight { get; }
|
||||
|
||||
public string TenantId { get; }
|
||||
|
||||
public string IssuerId { get; }
|
||||
|
||||
public bool TenantOverrideApplied { get; }
|
||||
|
||||
public DateTimeOffset RetrievedAtUtc { get; }
|
||||
}
|
||||
|
||||
public sealed record VexConfidence
|
||||
{
|
||||
|
||||
@@ -783,43 +783,76 @@ internal sealed class VexSignatureMetadataDocument
|
||||
public string? Issuer { get; set; }
|
||||
= null;
|
||||
|
||||
public string? KeyId { get; set; }
|
||||
= null;
|
||||
|
||||
public DateTime? VerifiedAt { get; set; }
|
||||
= null;
|
||||
|
||||
public string? TransparencyLogReference { get; set; }
|
||||
= null;
|
||||
|
||||
public static VexSignatureMetadataDocument? FromDomain(VexSignatureMetadata? signature)
|
||||
=> signature is null
|
||||
? null
|
||||
: new VexSignatureMetadataDocument
|
||||
{
|
||||
Type = signature.Type,
|
||||
Subject = signature.Subject,
|
||||
Issuer = signature.Issuer,
|
||||
KeyId = signature.KeyId,
|
||||
VerifiedAt = signature.VerifiedAt?.UtcDateTime,
|
||||
TransparencyLogReference = signature.TransparencyLogReference,
|
||||
};
|
||||
|
||||
public VexSignatureMetadata ToDomain()
|
||||
{
|
||||
var verifiedAt = VerifiedAt.HasValue
|
||||
? new DateTimeOffset(DateTime.SpecifyKind(VerifiedAt.Value, DateTimeKind.Utc))
|
||||
: (DateTimeOffset?)null;
|
||||
|
||||
return new VexSignatureMetadata(
|
||||
Type,
|
||||
Subject,
|
||||
Issuer,
|
||||
KeyId,
|
||||
verifiedAt,
|
||||
TransparencyLogReference);
|
||||
}
|
||||
}
|
||||
public string? KeyId { get; set; }
|
||||
= null;
|
||||
|
||||
public DateTime? VerifiedAt { get; set; }
|
||||
= null;
|
||||
|
||||
public string? TransparencyLogReference { get; set; }
|
||||
= null;
|
||||
|
||||
public decimal? TrustWeight { get; set; }
|
||||
= null;
|
||||
|
||||
public string? TrustTenantId { get; set; }
|
||||
= null;
|
||||
|
||||
public string? TrustIssuerId { get; set; }
|
||||
= null;
|
||||
|
||||
public bool? TrustTenantOverrideApplied { get; set; }
|
||||
= null;
|
||||
|
||||
public DateTime? TrustRetrievedAtUtc { get; set; }
|
||||
= null;
|
||||
|
||||
public static VexSignatureMetadataDocument? FromDomain(VexSignatureMetadata? signature)
|
||||
=> signature is null
|
||||
? null
|
||||
: new VexSignatureMetadataDocument
|
||||
{
|
||||
Type = signature.Type,
|
||||
Subject = signature.Subject,
|
||||
Issuer = signature.Issuer,
|
||||
KeyId = signature.KeyId,
|
||||
VerifiedAt = signature.VerifiedAt?.UtcDateTime,
|
||||
TransparencyLogReference = signature.TransparencyLogReference,
|
||||
TrustWeight = signature.Trust?.EffectiveWeight,
|
||||
TrustTenantId = signature.Trust?.TenantId,
|
||||
TrustIssuerId = signature.Trust?.IssuerId,
|
||||
TrustTenantOverrideApplied = signature.Trust?.TenantOverrideApplied,
|
||||
TrustRetrievedAtUtc = signature.Trust?.RetrievedAtUtc.UtcDateTime
|
||||
};
|
||||
|
||||
public VexSignatureMetadata ToDomain()
|
||||
{
|
||||
var verifiedAt = VerifiedAt.HasValue
|
||||
? new DateTimeOffset(DateTime.SpecifyKind(VerifiedAt.Value, DateTimeKind.Utc))
|
||||
: (DateTimeOffset?)null;
|
||||
|
||||
VexSignatureTrustMetadata? trust = null;
|
||||
if (TrustWeight is not null && TrustRetrievedAtUtc is not null)
|
||||
{
|
||||
var retrievedOffset = new DateTimeOffset(DateTime.SpecifyKind(TrustRetrievedAtUtc.Value, DateTimeKind.Utc));
|
||||
trust = new VexSignatureTrustMetadata(
|
||||
TrustWeight.Value,
|
||||
TrustTenantId ?? "@unknown",
|
||||
TrustIssuerId ?? "unknown",
|
||||
TrustTenantOverrideApplied ?? false,
|
||||
retrievedOffset);
|
||||
}
|
||||
|
||||
return new VexSignatureMetadata(
|
||||
Type,
|
||||
Subject,
|
||||
Issuer,
|
||||
KeyId,
|
||||
verifiedAt,
|
||||
TransparencyLogReference,
|
||||
trust);
|
||||
}
|
||||
}
|
||||
|
||||
[BsonIgnoreExtraElements]
|
||||
internal sealed class VexClaimDocumentRecord
|
||||
|
||||
Reference in New Issue
Block a user