2.9 KiB
2.9 KiB
AirGap Time Anchor Scaffold (prep for AIRGAP-TIME-57-001)
Scope for prep
- Provide a deterministic parsing surface for signed time tokens (Roughtime, RFC3161) so staleness calculations and telemetry wiring can start without full crypto yet.
What landed (2025-11-20)
- New project:
src/AirGap/StellaOps.AirGap.Time/StellaOps.AirGap.Time.csproj(net10.0), BCL-only. - Model:
TimeAnchorcanonical record (anchor time, source, format, signature fingerprint placeholder, token digest). - Parser:
TimeTokenParserwith deterministic SHA-256 digest derivation and structured success/failure reasons. - Result envelope:
TimeAnchorValidationResultandTimeTokenFormatenum. - Tests:
tests/AirGap/StellaOps.AirGap.Time.Testscover empty-token failure and digest production for Roughtime tokens.
Updates (2025-11-20)
- Added staleness calculator (
StalenessCalculator) and budgets/evaluation models to derive warning/breach states deterministically. - Added
TimeAnchorLoaderto ingest hex-encoded tokens from fixtures; sample tokens placed undersrc/AirGap/StellaOps.AirGap.Time/fixtures/. - Added
TimeStatusService+InMemoryTimeAnchorStorefor per-tenant anchor/budget status + staleness; tests inTimeStatusServiceTests. - Added verification pipeline (
TimeVerificationService) with stub Roughtime/RFC3161 verifiers requiring trust roots; loader now verifies using trust roots. - Added API surface
/api/v1/time/status(plus POST/api/v1/time/anchor) viaTimeStatusControllerand web host wiring. - Added sealed startup hook (
StartupValidationExtensions) to block app start when anchor missing/stale; uses budgets and returns structured reasons. - Upgraded Roughtime verifier to real Ed25519 signature check + RFC3161 verifier using SignedCms; failures now return
roughtime-*/rfc3161-*reasons. - Added config binding (
AirGap:*) for tenant and staleness budgets; startup validation pulls from config. - Added config sample at
docs/airgap/time-config-sample.jsonfor sealed-mode deployments. - Documented endpoints and payloads at
docs/airgap/time-api.md. - Health check:
/healthz/readyreports degraded/healthy based on staleness; consumers should scrape for sealed-mode readiness.
Next implementation hooks
- Plug real Roughtime and RFC3161 decoders, verifying against trust roots supplied via sealed-mode config.
- Persist
TimeAnchorrows under controller/importer once schema is final; emit telemetry counters/alerts. - Replace placeholder signature fingerprint with actual signer fingerprint post-verification.
Determinism/air-gap posture
- Parser avoids wall-clock; anchor time derived deterministically from token digest until real parser is wired.
- No network calls; uses cached NuGet (
local-nugets/) for tests.
How to consume
DOTNET_NOLOGO=1 dotnet test tests/AirGap/StellaOps.AirGap.Time.Tests/StellaOps.AirGap.Time.Tests.csproj --no-build
Owners
- AirGap Time Guild (per sprint 0510).