string Digest { get; }
Source
Canonical context manifest identity, excluding the local directory path.
Private bounded reader for exact, offline inspection of Docker save OCI archives.
ObservedOciImage Read(string ownedArchive, OciExpectedImage expected, CancellationToken cancellationToken = default)
Reads and verifies one exact OCI image without extraction or caller supplied security evidence.
void ValidateExpectedFiles(IReadOnlyDictionary<string, ObservedFile> observed, IReadOnlyDictionary<string, OciExpectedFile>? expected)
Validates selected paths, ancestors, type, raw hash, mode and ownership against the expected image.
Dictionary<string, string> ReadEnvironment(JsonElement c)
Reads the optional OCI environment array and rejects malformed entries.
void RemoveLower(SortedDictionary<string, ObservedFile> m, string victim, int layer, SelectionState? selectedState = null)
Removes a lower-layer path subtree for a named or opaque whiteout.
void RemovePath(SortedDictionary<string, ObservedFile> m, string p, SelectionState? selectedState = null)
Removes a path and all descendants from the merged image view.
string SafePath(string p)
Validates and canonicalizes one OCI archive path without aliasing.
Private bounded Debian archive reader. It hashes payload streams and never extracts them.
PackageResult Read(Stream deb, string expectedSha256, PackageIdentity expected, CancellationToken cancellationToken = default)
Verifies one captured package and parses control, conffile, regular, and link records.
void CompareInstalledInventory(IEnumerable<InstalledFile> baseline, IEnumerable<InstalledFile> actual, IEnumerable<string> excludes, IEnumerable<string> includes, IEnumerable<ExpectedChange> expectedChanges)
Compares every included baseline path and permits only the explicit expected change set.
Observed bounded exit without exposing raw process output as a public diagnostic.
Provides a safe process failure without preserving an unsafe nested exception.
Runs a single framework-owned argument vector with bounded output and no retry.
The host build contract for one verified context; it grants no publication or deployment authority.
IReadOnlyList<string> CreateDockerBuildArguments(string imageTag, CancellationToken cancellationToken = default)
Creates the fixed offline Docker build argument list after verifying the context.
imageTag
cancellationToken
Arguments for Docker 29; invoke with an argument-list API and no shell interpolation.
void Verify(CancellationToken cancellationToken = default)
Verifies the exact owned context immediately before the host invokes its builder.
cancellationToken
string Digest { get; }
Source
Canonical context manifest identity, excluding the local directory path.
string DirectoryPath { get; }
Source
The owned context path used only by the host builder; excluded from portable identities and evidence.
string? RepairedCliSha256 { get; }
Source
Actual repaired CLI content identity, when archive replacement was requested.
Captures supported recipe inputs and their independent host authorizations.
Task<KeycloakBuildContext> MaterializeAsync(CapturedKeycloakPlan plan, string absentContext, CancellationToken cancellationToken = default)
Materializes only verified captured bytes into an absent host-owned build context.
plan
absentContext
cancellationToken
A context identity and verification contract for the host-owned builder.
KeycloakSecurityException
Task<CapturedKeycloakPlan> CaptureAsync(KeycloakSecurityRecipe recipe, KeycloakMaterialTrustPolicy trustPolicy, KeycloakCaptureInputs inputs, string ownedDirectory, CancellationToken cancellationToken = default)
Captures approved exact inputs into a fresh caller-owned directory in one attempt.
recipe
trustPolicy
inputs
ownedDirectory
cancellationToken
A handle only after all bytes, graph identities and provenance checks pass.
KeycloakSecurityException
Task<KeycloakInspectionImage> ResolveLocalImageAsync(string hostImageReference, CancellationToken cancellationToken = default)
Resolves a host-local Docker 29 image reference to a verified immutable platform identity.
hostImageReference
cancellationToken
The actual exported and verified manifest, config, platform and ordered rootfs identities.
KeycloakSecurityException
Task<VerifiedKeycloakImageEvidence> InspectAsync(CapturedKeycloakPlan plan, KeycloakInspectionImage image, CancellationToken cancellationToken = default)
Inspects actual immutable Docker content against the captured plan and runs bound read-only probes.
plan
image
cancellationToken
Passing observed evidence only after every declared check succeeds.
KeycloakSecurityException
A safe, bounded observation of a recipe stage. It contains no paths, process output, or exception text.
Publishes structured stage events for diagnostics and bounded host progress displays.
IDisposable Subscribe(Action<KeycloakStageEvent> observer)
Subscribes to safe stage events. Observer failures are isolated from the recipe workflow.
KeycloakStageScope Begin(KeycloakStagePhase phase, string? recipeDigest = null, string? policyDigest = null, string? profile = null, string? planDigest = null, string? operationId = null, string? checkId = null)
Starts one correlated stage scope; disposing an unfinished scope emits a rejection.
Disposable stage scope that emits exactly one start and one terminal event.
void SetIdentity(string? recipeDigest, string? policyDigest, string? profile)
Sets safe content identities and a bounded profile key.
void SetContext(string? planDigest = null, string? operationId = null, string? checkId = null)
Sets optional bounded plan, operation, and check identities.
void SetCounts(int? materialCount = null, long? materialBytes = null, int? checkCount = null)
Sets bounded counters; negative values are rejected before publication.
void Complete(KeycloakEffectState effect = KeycloakEffectState.Committed)
Publishes a successful terminal event.
void Reject(KeycloakSecurityException failure)
Publishes a typed rejection using only stable diagnostic fields.
void Reject(string safeCode, KeycloakEffectState effect = KeycloakEffectState.Unknown)
Publishes a safe rejection for a host boundary that has no typed package failure.
void Dispose()
Ends an unfinished scope with a nonpassing outcome and releases its activity.
string CorrelationId { get; }
Source
Stable correlation identity shared by this stage's start and terminal events.
KeycloakStagePhase Phase { get; }
Source
Stage represented by this scope.
string? CheckId { get; }
Source
The most recently selected bounded check identity, when a stage has one.
Creates bounded, secret-safe failures at each supported public boundary.
void MarkUnknownEffect(Exception primary)
Preserves a private primary failure while recording an unconfirmed owned cleanup effect.
The marker contains no process output or host identity and is consumed only by the public diagnostic mapper.
Private, evidence-based comparison of a captured runtime baseline and final OCI observation.
Policy ReadPolicy(ObservedOciImage baselineObserved, ObservedOciImage actualObserved)
Reads and compares the captured dpkg policy bytes, preserving rule order.
Result Verify(ObservedOciImage baselineObserved, ObservedOciImage actualObserved, IReadOnlyList<DebPayloadReader.PackageResult> signedPackages, IReadOnlyList<KeycloakRemovedPackageSpec> removed, Policy policy)
Compares package status, package payload dispositions, conffiles, ownership, links, and fixed runtime profile facts.
Read-only tar transport that rejects oversized headers and payloads before TarReader sees them.
void TryDelete(string path)
Deletes an engine-owned archive staging file, tolerating expected I/O and access failures.
path
Internal visibility permits real filesystem failure tests; unexpected path or programming errors propagate.
Seekable output guard that rejects any operation which could extend the owned file past its cap.
Exact image identity, including the index and selected platform manifest.
KeycloakImageIdentity Create(string index, string platformManifest, string platform)
Creates a declaration; recipe validation checks its digest identities and platform before effects.
string? IndexMaterialId { get; init; }
Source
Material ID containing the exact upstream index JSON.
string? ArchiveMaterialId { get; init; }
Source
Material ID containing the exact selected platform archive.
string? ConfigDigest { get; init; }
Source
Exact config digest observed in the selected platform manifest.
ImmutableArray<string> DiffIds { get; init; }
Source
Ordered exact layer diff IDs observed in the selected platform image.
A safe OCI image reference and its exact content digest.
string? Id { get; init; }
Source
Stable recipe-local role identity used to select runtime or frontend OCI input.
string? Platform { get; init; }
Source
Explicit OCI platform, either linux/amd64 or linux/arm64.
string? ArchiveMaterialId { get; init; }
Source
Recipe material ID containing the exact OCI archive or manifest bytes.
string? PlatformManifestDigest { get; init; }
Source
Exact platform manifest digest selected from the index.
string? ConfigDigest { get; init; }
Source
Exact OCI config digest.
ImmutableArray<string> DiffIds { get; init; }
Source
Ordered OCI layer diff IDs.
string? IndexMaterialId { get; init; }
Source
Recipe material ID containing the exact upstream index JSON.
One explicitly authorized, bounded material input.
bool CapturedHostInput { get; init; }
Source
True when bytes are host-captured and have no downloadable HTTPS URI.
Signed repository snapshot identity and its finite package authority.
string? KeyringMaterialId { get; init; }
Source
Policy material ID containing the approved signing keyring.
ImmutableDictionary<string, string> PackageIndexMaterialIds { get; init; }
Source
Relative package-index paths mapped to exact policy material IDs.
One package in a captured runtime closure.
string? MaterialId { get; init; }
Source
Policy material ID containing the exact package bytes.
Identity of a package that must be absent from the resulting runtime; removed bytes are not captured.
Coordinates for one Maven or package artifact.
A content-addressed artifact and its intended image destination.
One exact replacement in an alignment group.
Complete, closed replacement membership; no implicit or extra members are allowed.
ArtifactReplacementGroup Create(string id, IEnumerable<ArtifactReplacement> replacements, IEnumerable<ArtifactCoordinate> requiredMembers)
Copies caller collections into immutable storage.
Versioned built-in runtime profile selection.
RuntimeProfile Create(string id, string version, string templateName, IEnumerable<string> supportedSourceProfiles)
Copies source-profile identities into immutable storage.
ImmutableArray<OciIdentity> RuntimeOciIdentities { get; init; }
Source
Exact runtime OCI identities selected by platform.
ImmutableArray<SignedRepositorySnapshot> RepositorySnapshots { get; init; }
Source
Signed repository snapshots used by this profile.
ImmutableArray<RuntimePackageSpec> RequiredPackages { get; init; }
Source
Complete installed package closure.
ImmutableArray<KeycloakRemovedPackageSpec> RemovedPackages { get; init; }
Source
Packages that must be absent from the resulting runtime.
ImmutableArray<string> ExpectedObservations { get; init; }
Source
Expected runtime user, entrypoint, certificates, and other observation IDs.
Versioned built-in embedded archive transformation selection.
EmbeddedArchiveModuleSet? ModuleSet { get; init; }
Source
Complete content-addressed source/replacement modules and image destination.
Complete source and replacement archive module material and destination.
One of the deliberately closed recipe operation kinds.
Artifact alignment replacement operation.
Runtime profile operation.
Embedded archive replacement operation.
Reviewed theme or captured-host input identified by a safe content digest.
string? LocalInputId { get; init; }
Source
Recipe material ID for the exact local or remote bytes.
string? DestinationPath { get; init; }
Source
Safe absolute image-internal destination for the reviewed theme input.
One explicitly bound local input used only during capture, never recipe identity.
Host-owned capture bindings for a reviewed recipe; local paths never enter canonical recipe JSON.
KeycloakCaptureInputs Create(string reviewedRecipeId, IEnumerable<KeycloakLocalInputBinding> localInputs)
Copies local capture bindings into immutable storage.
Reviewed upstream template baseline whose archive member and captured bytes must agree.
Immutable recipe declaration for a supported Keycloak transformation.
KeycloakSecurityRecipe Create(int schemaVersion, KeycloakImageIdentity sourceImage, IEnumerable<OciIdentity> runtimeFrontendOciIdentities, IEnumerable<KeycloakOperation> operations, KeycloakRecipeMode mode, IEnumerable<KeycloakThemeInput> themeInputs, IEnumerable<string> capturedHostInputs)
Creates a recipe while copying all enumerable inputs.
KeycloakTemplateBaseline? TemplateBaseline { get; init; }
Source
Reviewed upstream template baseline, required when a captured theme replaces FreeMarker templates.
string KeycloakVersion { get; init; }
Source
Exact supported Keycloak version, such as 26.7.2.
string EntrypointPath { get; init; }
Source
Reviewed image-internal entrypoint path; never a command string.
ImmutableArray<KeycloakMaterialReference> MaterialReferences { get; init; }
Source
Explicit content-addressed materials referenced by this recipe.
ImmutableArray<string> SourceProfiles { get; init; }
Source
Explicit source profile identities selected by the recipe.
KeycloakResourceLimits ResourceLimits { get; init; }
Source
Finite acquisition and transformation bounds.
Exact HTTPS origin authorization and material digest binding.
KeycloakMaterialTrustPolicy Create(string version, string ownerApprovalReference, IEnumerable<string> origins, IEnumerable<string> paths, IEnumerable<string> coordinates, IEnumerable<KeyValuePair<string, string>> materialDigests, IEnumerable<string> fingerprints, IEnumerable<string> algorithms, IEnumerable<string> withdrawnKeys, IEnumerable<string> historicalExactReleaseBytes)
Creates a policy with immutable copies of all collection inputs.
Explicit finite limits that participate in recipe identity.
Opaque correlation identity suitable for logs and support requests.
Safe, noninteractive typed failure. Cause text and machine paths are intentionally excluded.
KeycloakFailureCode Code { get; }
Source
Stable failure code.
KeycloakSafePhase Phase { get; }
Source
Safe phase.
string OperationId { get; }
Source
Safe operation identity.
KeycloakEffectState Effect { get; }
Source
Observed side-effect state.
KeycloakRecoveryClass Recovery { get; }
Source
Permitted recovery class.
string NextAction { get; }
Source
Safe corrective action.
KeycloakCorrelationId CorrelationId { get; }
Source
Opaque correlation value.
string DiagnosticReference { get; }
Source
Stable documentation reference for this failure code.
string ProfileKey { get; }
Source
Safe profile or operation key for boundary diagnostics.
KeycloakRetryMetadata RetryMetadata { get; }
Source
Retry guidance computed from the stable recovery and effect fields.
Whether one explicit fresh invocation may be attempted after a transient result.
KeycloakRetryMetadata For(KeycloakRecoveryClass recovery, KeycloakEffectState effect)
Computes bounded retry guidance from the exception's stable fields.
KeycloakRetryMetadata None { get; }
Source
No automatic retry metadata, as required by the recipe contract.
KeycloakRetryMetadata ExplicitTransientOnce { get; }
Source
Metadata for an eligible transient acquisition or read-only probe failure.
KeycloakRetryMetadata InspectBeforeRetry { get; }
Source
Metadata for an uncertain effect.
void TryDelete(string path)
Deletes an owned staging directory, tolerating only expected filesystem cleanup failures.
A read-only captured plan whose accepted operations own their private verified input copies.
Disposal prevents new consumers. It never deletes the caller-owned snapshot; remove it only after all operations return.
void Dispose()
Prevents new consumers while preserving accepted operations and caller-owned files.
string Digest { get; }
Source
The canonical content identity including recipe, host policy, and captured bytes.
string RecipeDigest { get; }
Source
The canonical recipe content identity.
string PolicyDigest { get; }
Source
The host policy content identity accepted during capture.
string Platform { get; }
Source
The explicit target image platform.
KeycloakRecipeMode Mode { get; }
Source
The declared inspection scope.
Exact final image identity selected by the host for inspection.
ManifestDigest
ConfigDigest
Platform
DiffIds
The supported Docker 29 immutable export and read-only runtime handoff.
Copies a verified, finite OCI graph into an owned local builder input.
One observed conformance check; no release or vulnerability policy is implied.
Id
Expected
Observed
string OperationId { get; init; }
Source
The declared operation, theme input, or fixed profile owning this observation.
string Outcome { get; }
Source
Only passing observations belong to returned evidence; failures throw a typed diagnostic.
Safe input-image identity retained with an inspection result.
Role
IndexDigest
ManifestDigest
ConfigDigest
Platform
Versioned framework operation that was evaluated.
OperationId
Family
Version
Passing observations created only by the supported exact-image inspector.
Task<string> WriteAsync(string absentFile, CancellationToken cancellationToken = default)
Writes observations once to a fresh caller-owned evidence path.
absentFile
cancellationToken
The absolute published evidence path.
string Schema { get; }
Source
Stable evidence schema; unknown versions require a coordinated upgrade.
string PlanDigest { get; }
Source
The exact captured plan content identity.
string RecipeDigest { get; }
Source
The canonical recipe accepted during capture.
string PolicyDigest { get; }
Source
The independently approved host policy accepted during capture.
ImmutableArray<KeycloakObservedImageInput> InputImages { get; }
Source
Safe source, runtime and frontend input identities evaluated by this inspection.
ImmutableArray<KeycloakObservedProfile> Profiles { get; }
Source
The evaluated closed operation profile versions.
string? TemplateBaselineSha256 { get; }
Source
The reviewed upstream template hash, when required by the recipe.
string InspectorVersion { get; }
Source
The exact framework inspector implementation profile.
string TransformerVersion { get; }
Source
The deterministic archive transformer implementation profile.
KeycloakInspectionImage Image { get; }
Source
The exact inspected image content, config, platform, and rootfs identities.
KeycloakRecipeMode Mode { get; }
Source
The scope actually evaluated by this inspection.
ImmutableArray<KeycloakObservedCheck> Checks { get; }
Source
Complete passing observations for the declared scope.
string Outcome { get; }
Source
Human-readable outcome with an explicit release boundary.
Publishes a complete owned file through a single create-if-absent filesystem operation.
Canonical schema-1 JSON serialization for recipes and trust policies.
byte[] Write(KeycloakSecurityRecipe recipe)
Serializes every recipe field, including every nested operation and material reference.
byte[] Write(KeycloakMaterialTrustPolicy policy)
Serializes the separately owned material trust policy.
KeycloakSecurityRecipe ReadRecipe(ReadOnlySpan<byte> utf8Json)
Strictly deserializes a complete recipe and all nested operations.
KeycloakMaterialTrustPolicy ReadPolicy(ReadOnlySpan<byte> utf8Json)
Strictly deserializes every trust-policy field.
KeycloakSecurityRecipe Read(ReadOnlySpan<byte> utf8Json)
Compatibility name for the strict recipe reader.
Conservatively bounds cumulative owned output writes across one public invocation.
Deleted staging bytes remain charged. Nested phases share the budget; unrelated invocations do not.
Validates closed recipe and host trust-policy declarations before effects.
KeycloakSecurityRecipe Validate(KeycloakSecurityRecipe recipe)
Validates schema, required fields, duplicate IDs, empty groups, overlap, and supported operation shapes.
KeycloakCaptureInputs Validate(KeycloakCaptureInputs inputs)
Validates host-local capture bindings separately from recipe identity.
KeycloakMaterialTrustPolicy Validate(KeycloakMaterialTrustPolicy policy)
Validates policy version, owner approval, exact origins, and material digests without network access.
KeycloakRetryMetadata RetryFor(KeycloakEffectState effect, bool transientNetworkOrReadOnlyProbe, bool verifiedCleanedStaging = false, int previousExplicitAttempts = 0)
Returns recommendation metadata only; it never performs a retry.
Canonical HTTPS URI boundary validation.
string CanonicalizeHttpsUri(string value)
Canonicalizes HTTPS DNS URIs and rejects userinfo, fragments, IP hosts, encoded separators, and dot segments.
One exact host-approved material association. URLs do not authorize one another.
Records an origin authorization for portable plan provenance.
A safe acquisition classification; no untrusted response text or URI reaches the exception.
Acquires one approved material once, with exact redirect matching and bounded hashing.
A source binding used only at capture; its local path is excluded from canonical identity.
Captured relative identity and metadata, independent of the source workspace.
Optional per-invocation resource limits shared by private infrastructure operations.
Owns entry acceptance only. Disposal never deletes committed caller-owned snapshots.
Creates and revalidates a focused content-addressed snapshot directory.
Private bounded verifier for an exact Debian signed repository snapshot.
VerificationResult VerifyRelease(Stream boundedCapturedRelease, Stream boundedKeyring, string expectedReleaseSha256, string expectedKeyringSha256, string exactSignerFingerprint, VerificationPolicy policy, IEnumerable<RequestedPackage> requestedPackages, CancellationToken cancellationToken = default)
Verifies canonical text, signer policy, and the exact signed package index records.
VerificationResult VerifyRelease(Stream boundedCapturedRelease, Stream boundedKeyring, string expectedReleaseSha256, string expectedKeyringSha256, string exactSignerFingerprint, VerificationPolicy policy, IEnumerable<RequestedPackage> requestedPackages, IReadOnlyDictionary<string, Stream>? capturedPackageIndexes, CancellationToken cancellationToken = default)
Verifies a snapshot and reads only the captured package indexes named by its signed SHA256 table.
Identifies the bounded execution stage that stopped a private process.
Bounded public phases emitted by one recipe invocation.
Outcome of a bounded stage event.
Recipe operation mode.
Stable stage at which an operation stopped.
Known effect state after a failed operation.
Recovery class exposed to noninteractive callers.
Stable failure categories; enum names are canonical serialized values.