Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
sdk-generator-smoke / sdk-smoke (push) Has been cancelled
SDK Publish & Sign / sdk-publish (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
30 lines
896 B
C#
30 lines
896 B
C#
using StellaOps.AirGap.Controller.Domain;
|
|
using StellaOps.AirGap.Controller.Services;
|
|
using StellaOps.AirGap.Time.Models;
|
|
|
|
namespace StellaOps.AirGap.Controller.Endpoints.Contracts;
|
|
|
|
public sealed record AirGapStatusResponse(
|
|
string TenantId,
|
|
bool Sealed,
|
|
string? PolicyHash,
|
|
TimeAnchor TimeAnchor,
|
|
StalenessEvaluation Staleness,
|
|
long DriftSeconds,
|
|
long SecondsRemaining,
|
|
DateTimeOffset LastTransitionAt,
|
|
DateTimeOffset EvaluatedAt)
|
|
{
|
|
public static AirGapStatusResponse FromStatus(AirGapStatus status) =>
|
|
new(
|
|
status.State.TenantId,
|
|
status.State.Sealed,
|
|
status.State.PolicyHash,
|
|
status.State.TimeAnchor,
|
|
status.Staleness,
|
|
status.Staleness.AgeSeconds,
|
|
status.Staleness.SecondsRemaining,
|
|
status.State.LastTransitionAt,
|
|
status.EvaluatedAt);
|
|
}
|