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:
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace StellaOps.Scanner.EntryTrace;
|
||||
|
||||
internal static class EntryTraceCacheSerializer
|
||||
{
|
||||
public const string CurrentVersion = "entrytrace.v1";
|
||||
|
||||
public static byte[] Serialize(EntryTraceCacheEnvelope envelope)
|
||||
{
|
||||
if (envelope is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(envelope));
|
||||
}
|
||||
|
||||
return JsonSerializer.SerializeToUtf8Bytes(envelope);
|
||||
}
|
||||
|
||||
public static EntryTraceCacheEnvelope Deserialize(byte[] payload)
|
||||
{
|
||||
if (payload is null || payload.Length == 0)
|
||||
{
|
||||
throw new ArgumentException("Payload cannot be empty.", nameof(payload));
|
||||
}
|
||||
|
||||
var envelope = JsonSerializer.Deserialize<EntryTraceCacheEnvelope>(payload);
|
||||
if (envelope is null)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to deserialize entry trace cache envelope.");
|
||||
}
|
||||
|
||||
return envelope;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user