string Authority { get; }
Source
Gets the local Keycloak realm authority.
Captures safe readiness evidence for the AppSurface Keycloak local proof.
AuthorityThe verified Keycloak realm authority.ClientIdThe verified public client id.RealmThe verified realm id.Secret-safe app configuration produced by the AppSurface Keycloak proof package.
The projection only contains OIDC authority, client id, callback paths, and the public-client secret policy. It never contains admin credentials, seeded user passwords, realm JSON, tokens, raw claims, or client secrets.
IResourceBuilder<ProjectResource> ApplyTo(IResourceBuilder<ProjectResource> project)
Source
Applies the allowlisted environment variables to an Aspire project resource.
projectThe project resource builder.The same project resource builder for chaining.
string Authority { get; }
Source
Gets the local Keycloak realm authority.
string ClientId { get; }
Source
Gets the local public client id.
string CallbackPath { get; }
Source
Gets the OIDC callback path.
string SignedOutCallbackPath { get; }
Source
Gets the OIDC signed-out callback path.
bool RequireClientSecret { get; }
Source
Gets a value indicating whether the paired proof app should require a client secret.
IReadOnlyDictionary<string, string> EnvironmentVariables { get; }
Source
Gets the allowlisted environment variables used by the proof web app.
Defines the nonsecret environment contract for the package-owned realm-ready executable.
Identifies one registered finite consumer project in an AppSurface local Keycloak seed chain.
string Name { get; }
Source
Gets the caller-supplied stage name.
IResourceBuilder<ProjectResource> Resource { get; }
Source
Gets the consumer-owned finite project resource.
Applications may make their own resources wait for this completion handle, but the normal next seed should be registered through AppSurfaceKeycloakResource.WithLocalSeed with AppSurfaceKeycloakLocalSeedOptions.After so the package can validate the linear chain.
Wraps the official Aspire Keycloak resource with AppSurface local proof metadata.
AppSurfaceKeycloakRealmReady RealmReady()
Source
Gets the lazily registered finite resource that proves the local Keycloak realm baseline is ready.
A cached completion-bearing resource that consumers can use as the first dependency for local seed projects.
AppSurfaceKeycloakExceptionThe wrapper was not created by AddAppSurfaceKeycloak(...) or the package-owned worker cannot be resolved.The returned resource waits for the official Keycloak resource to become healthy, then performs the package's bounded metadata, generated-realm, and public authorization-challenge checks in a separate finite process. It performs no Keycloak administration and receives no credentials. Calling this method repeatedly for the same wrapper returns the same resource and never adds a second gate to the AppHost graph.
AppSurfaceKeycloakLocalSeed WithLocalSeed(string name, Func<AppSurfaceKeycloakLocalSeedContext, IResourceBuilder<ProjectResource>> factory, Action<AppSurfaceKeycloakLocalSeedOptions>? configure = null)
Source
Registers one finite, consumer-owned project that seeds local Keycloak-adjacent state after baseline realm readiness.
nameA unique lower-case local seed stage name.factoryCreates exactly one finite Aspire ProjectResource using the supplied safe context.configureOptional local-only ordering, environment-policy, and typed-secret configuration.The registered local seed handle, including its consumer-owned project resource.
AppSurfaceKeycloakExceptionLocal policy, ordering, factory, or secret-binding validation fails.Registration is permitted only while the AppHost executes Run in Development, Test, or Testing by default. The first seed waits for RealmReady. Each later seed must nominate the immediately previous handle via AppSurfaceKeycloakLocalSeedOptions.After; this intentionally creates one linear, observable completion chain. The package never starts a callback runner or performs Keycloak administration. The factory owns the actual client, mutation, retry, idempotence, and finite exit code.
IResourceBuilder<KeycloakResource> Resource { get; }
Source
Gets the underlying Aspire Keycloak resource builder for normal Aspire APIs such as WithReference and WaitFor.
AppSurfaceKeycloakConfigurationProjection Configuration { get; }
Source
Gets the secret-safe web configuration projection.
AppSurfaceKeycloakReadinessProbe Readiness { get; }
Source
Gets the readiness probe.
string RealmImportFile { get; }
Source
Gets the generated realm import file path.
AppSurfaceKeycloakThemeRegistration? Theme { get; }
Source
Gets secret-safe evidence for the optional local login theme.
Runs the package-owned finite readiness verification process.
Reconstructs validated probe inputs from the explicit nonsecret executable environment contract.
Default local-only values used by the AppSurface Keycloak AppHost proof package.
These defaults intentionally mirror the AppSurface OIDC package callback paths without taking a runtime dependency on that package. Drift is covered by tests so the AppHost proof package does not become part of web auth registration.
string Authority(string realm = Realm, int port = KeycloakPort)
Source
Builds the default authority URL for a local realm and port.
realmThe Keycloak realm name.portThe local Keycloak host port.The local HTTPS authority URL.
string SeededUserEmail(string username)
Source
Builds the default verified email address for a locally seeded Keycloak proof user.
usernameThe seeded user's configured username.The local-only email address for the user.
Configures the deterministic local Keycloak realm and public client used for AppSurface OIDC proof AppHosts.
void Validate()
Source
Validates all local Keycloak proof options and populates default redirect URIs when needed.
AppSurfaceKeycloakConfigurationProjection CreateConfigurationProjection()
Source
Builds the secret-safe configuration projection for the paired web proof.
An immutable projection containing only allowlisted OIDC configuration.
string Realm { get; set; }
Source
Gets or sets the local Keycloak realm name.
string ClientId { get; set; }
Source
Gets or sets the local public OIDC client id.
string ClientDisplayName { get; set; }
Source
Gets or sets the local display name imported for the OIDC client.
string CallbackPath { get; set; }
Source
Gets or sets the OIDC callback path used by the web proof.
string SignedOutCallbackPath { get; set; }
Source
Gets or sets the OIDC signed-out callback path used by the web proof.
int KeycloakPort { get; set; }
Source
Gets or sets the fixed local Keycloak host port.
int WebProofPort { get; set; }
Source
Gets or sets the fixed local web proof port used to build redirect URIs.
bool UsePersistentDataVolume { get; set; }
Source
Gets or sets a value indicating whether Keycloak data should persist in a container volume.
Disposable data is the default so realm import is deterministic. Persistent data keeps admin credentials and imported realm state until the volume is deleted.
string RealmImportDirectory { get; set; }
Source
Gets or sets the directory that receives generated Keycloak realm import JSON.
AppSurfaceKeycloakThemeOptions? LoginTheme { get; set; }
Source
Gets or sets the optional application-owned login theme used by the local Keycloak AppHost proof.
When absent, Keycloak's existing behavior and the package's original five-minute proof remain unchanged. When present, the package validates and read-only mounts the theme only for local AppHost use; it does not publish an image or mutate a production realm.
IList<Uri> RedirectUris { get; }
Source
Gets mutable redirect URIs imported into the public OIDC client.
IList<Uri> PostLogoutRedirectUris { get; }
Source
Gets mutable post-logout redirect URIs imported into the public OIDC client.
IList<AppSurfaceKeycloakUserOptions> SeededUsers { get; }
Source
Gets mutable local-only users imported into the proof realm.
Represents the secret-safe tuple that binds a packaged Keycloak login theme to the images and manifests it was verified against.
AppSurfaceKeycloakThemeReleaseEvidence Create(AppSurfaceKeycloakThemeBuildContract buildContract, string finalImage)
Source
Creates release evidence from a verified build contract and the digest-pinned image that packages its theme.
buildContractThe validated build contract that produced the image context.finalImageThe immutable image reference that contains the packaged theme.A portable evidence tuple without source paths, realm imports, credentials, or property values.
void Verify(AppSurfaceKeycloakThemeBuildContract buildContract, string finalImage)
Source
Verifies that this evidence still represents the supplied build contract and final image reference.
buildContractThe current validated build contract.finalImageThe expected digest-pinned final image reference.AppSurfaceKeycloakExceptionThe evidence and supplied immutable inputs do not match.string Write(string outputFile)
Source
Atomically writes this release tuple to an application-owned evidence file.
outputFileAn absent, application-owned JSON evidence file path.The absolute evidence file path.
AppSurfaceKeycloakExceptionThe output path is invalid or cannot be safely materialized.Action<string>? BeforeMoveForTesting { get; set; }
Source
Gets or sets a test-only action invoked after temporary evidence is written and immediately before its atomic move into place.
The action is stored in AsyncLocal<Action<string>> so parallel test flows remain isolated. Tests must reset this property to null after use.
string Schema { get; }
Source
Gets the versioned evidence schema name.
string ThemeName { get; }
Source
Gets the registered Keycloak login theme name.
string SourceManifestDigest { get; }
Source
Gets the complete validated source-manifest digest.
string PackagedManifestDigest { get; }
Source
Gets the immutable image-context manifest digest.
string BuildContractDigest { get; }
Source
Gets the digest of the generated build contract.
string KeycloakBaseImage { get; }
Source
Gets the digest-pinned Keycloak base-image reference.
string FinalImage { get; }
Source
Gets the digest-pinned image that contains the packaged theme.
string Platform { get; }
Source
Gets the verified container platform.
string? TemplateBaselineDigest { get; }
Source
Gets the optional reviewed FreeMarker baseline digest.
Exposes secret-safe evidence for a validated Keycloak login theme registration.
NameThe validated Keycloak theme name.BaseImageThe canonical immutable Keycloak base-image reference.PlatformThe exact-image evidence platform.ManifestDigestThe deterministic source-manifest digest.TemplateBaselineDigestThe optional reviewed upstream template-baseline digest.Holds validated theme-registration state, including the resolved source directory and development-only paths that are excluded from immutable image evidence.
SourceDirectoryThe resolved application-owned theme source directory.ManifestThe deterministic manifest of the complete validated source tree.BaseImageThe immutable Keycloak base image used for the local proof.TemplateBaselineDigestThe optional reviewed upstream template-baseline digest.DevelopmentOnlyResourcePathsSource-relative paths excluded from packaged image evidence.RegistrationThe secret-safe public registration evidence.Resolves the framework-dependent executable payload for a package or project-reference AppHost.
Holds one resolved command invocation without exposing the local payload path as a public API.
Holds the safe, immutable inputs needed to materialize the package-owned realm-ready executable.
Resolves safe local paths for generated Keycloak realm import artifacts.
string GetDefaultImportDirectory()
Source
Gets the default realm import directory without creating it.
The default directory beneath the application base directory.
string ResolveImportDirectory(string rootDirectory, string resourceName)
Source
Resolves a resource-specific realm import directory without creating it.
rootDirectoryRoot directory that owns generated realm imports.resourceNameResource name used as one safe path segment.The resolved import directory.
string GetRealmImportFilePath(string realmImportDirectory, string realm)
Source
Resolves the generated realm import file beneath an import directory.
realmImportDirectoryDirectory that contains realm imports.realmRealm id used in the generated file name.The safe realm import file path.
Represents deterministic, secret-safe evidence for a Keycloak login theme source tree.
The manifest contains normalized relative paths, byte lengths, and content digests. It intentionally omits source machine paths and file contents so it can be retained as safe build evidence.
AppSurfaceKeycloakThemeManifest Create(string themeName, string sourceDirectory)
Source
Creates a deterministic manifest for a resolved Keycloak theme source directory.
themeNameValidated Keycloak theme name.sourceDirectoryAbsolute source directory containing the theme's login directory.A deterministic manifest with ordinally sorted entries.
Represents one normalized, content-addressed file in a Keycloak login theme manifest.
RelativePathThe slash-separated path relative to the theme root.LengthThe exact file length in bytes.Sha256The lowercase hexadecimal SHA-256 digest of the file content.Provides early local fixed-port diagnostics before Aspire starts containers or projects.
void ThrowIfOccupied(int port, string optionName)
Source
Throws a safe diagnostic when a configured fixed port is already occupied.
portThe local TCP port to check.optionNameThe option name that supplied the fixed port.bool IsAvailable(int port)
Source
Returns whether a local TCP port can be bound at preflight time.
portThe local TCP port to check.true when the port can be bound; otherwise false.
Configures an application-owned Keycloak login theme for a local AppHost proof.
This configuration affects only the AppHost resource. It does not build, publish, deploy, or administer a production Keycloak image or realm. The source directory must contain a Keycloak theme root with login/theme.properties.
AppSurfaceKeycloakThemeOptions Login(string name, string sourceDirectory, AppSurfaceKeycloakImageReference baseImage)
Source
Creates an assets-only or inherited-template login-theme configuration.
nameThe lower-case Keycloak login theme name.sourceDirectoryThe directory containing the login theme subtree.baseImageThe immutable Keycloak image whose theme behavior is being verified.A configurable login-theme instance.
void Validate()
Source
Validates the theme source and declared resource/property requirements using the AppHost process base directory.
string Name { get; set; }
Source
Gets or sets the lower-case Keycloak login theme name.
string SourceDirectory { get; set; }
Source
Gets or sets the directory containing the theme's login subtree.
Relative paths are resolved once against the AppHost process base directory before validation and mounting. The resolved path is never exposed through the safe resource registration.
AppSurfaceKeycloakImageReference BaseImage { get; set; }
Source
Gets or sets the immutable Keycloak base image used by local theme proof.
string Platform { get; set; }
Source
Gets or sets the platform for exact-image evidence.
Version one supports linux/amd64 exact runtime proof. Other platforms can use deterministic source validation, but must not claim the exact-image release proof.
string? TemplateBaselineDirectory { get; set; }
Source
Gets or sets the directory holding the reviewed upstream FreeMarker baseline for copied template overrides.
A source tree containing .ftl files must declare this directory. It contains only the expected slash-relative upstream template files and its digest is emitted as evidence beside the pinned image identity.
IList<string> RequiredThemeProperties { get; }
Source
Gets property names that must occur in login/theme.properties without retaining their values in evidence.
IList<string> RequiredResourcePaths { get; }
Source
Gets source-relative resources that must exist in the deterministic manifest.
IList<string> DevelopmentOnlyResourcePaths { get; }
Source
Gets source-relative resources used only by the development bind mount.
This declaration is validated but does not make an asset eligible for a future packaged-image proof.
Supplies a local seed factory with the safe Keycloak metadata and resource name it may bind to its own project.
This context never carries Keycloak administrator credentials, client secrets, tokens, claims, external subjects, seeded-user passwords, provider responses, or consumer state. Bind a required consumer credential through AppSurfaceKeycloakLocalSeedOptions.WithRequiredSecretParameter instead.
string ResourceName { get; }
Source
Gets the exact required name for the consumer project resource.
string Authority { get; }
Source
Gets the safe local realm authority.
string RealmName { get; }
Source
Gets the safe local realm name.
string PublicClientId { get; }
Source
Gets the safe public OIDC client identifier.
Creates and verifies a deterministic, immutable-image-ready Keycloak login-theme build context.
This contract materializes a validated source snapshot, a Containerfile, and secret-safe manifest metadata. The application or its CI system owns the actual image build, registry push, deployment, and production realm update.
AppSurfaceKeycloakThemeBuildContract Create(AppSurfaceKeycloakThemeOptions theme)
Source
Creates a deterministic build contract from a configured login theme.
themeThe application-owned login theme configuration.A build contract that owns only the materialized local snapshot.
string Write(string buildContextDirectory)
Source
Writes an immutable-image-ready snapshot to a new directory.
buildContextDirectoryA currently absent output directory owned by the caller.The absolute build context directory.
AppSurfaceKeycloakExceptionThe output would overwrite an existing context or fails verification.void VerifyPackagedTheme(string packagedThemeDirectory)
Source
Verifies that a materialized or extracted image theme directory exactly matches this contract's manifest.
packagedThemeDirectoryThe directory corresponding to /opt/keycloak/themes/{name}.AppSurfaceKeycloakExceptionThe packaged content does not match PackagedManifest.string CreateContainerfile()
Source
Creates the deterministic Containerfile content for the materialized snapshot.
The image build instructions without machine-local source paths.
AppSurfaceKeycloakThemeRegistration Registration { get; }
Source
Gets secret-safe evidence for the registered login theme.
AppSurfaceKeycloakThemeManifest Manifest { get; }
Source
Gets the deterministic source manifest used by this build contract.
AppSurfaceKeycloakThemeManifest PackagedManifest { get; }
Source
Gets the deterministic manifest for the immutable image context after development-only resources are excluded.
Manifest retains the complete validated local source manifest. Use this property to prove the packaged image content that Write(string) materializes and VerifyPackagedTheme(string) validates.
string Digest { get; }
Source
Gets the deterministic digest that binds the registration, source manifest, packaged manifest, and inputs used to derive the Containerfile.
Describes a deterministic local-only user imported into the AppSurface Keycloak proof realm.
void Validate()
Source
Validates the seeded user's username, subject, password, display name, and claim entries.
AppSurfaceKeycloakExceptionA seeded user option is invalid.string Username { get; }
Source
Gets the local Keycloak username.
string Password { get; }
Source
Gets the temporary local-only password used by Keycloak realm import.
This value is intentionally never included in runtime app configuration projection.
string Subject { get; }
Source
Gets the stable OIDC subject value.
string DisplayName { get; }
Source
Gets the local display name used by the proof UI.
IDictionary<string, string> Claims { get; }
Source
Gets local-only user attributes that should be imported and optionally mapped to claims.
Stable diagnostic codes emitted by the AppSurface Keycloak AppHost proof package.
Generates deterministic Keycloak realm import JSON for the AppSurface local proof.
string Generate(AppSurfaceKeycloakOptions options)
Source
Generates deterministic realm import JSON from validated options.
optionsThe Keycloak proof options.A JSON document suitable for Keycloak startup realm import.
string WriteRealmImport(AppSurfaceKeycloakOptions options)
Source
Writes deterministic realm import JSON into the configured import directory.
optionsThe Keycloak proof options.The written realm import file path.
Action<string>? BeforeMoveForTesting { get; set; }
Source
Gets or sets a test-only action invoked after temporary realm evidence is written and immediately before its atomic replacement.
The action is stored in AsyncLocal<Action<string>> so parallel test flows remain isolated. Tests must reset this property to null after use.
Adds AppSurface local Keycloak proof resources to Aspire AppHosts.
AppSurfaceKeycloakResource AddAppSurfaceKeycloak(this IDistributedApplicationBuilder builder, string name = AppSurfaceKeycloakDefaults.ResourceName, Action<AppSurfaceKeycloakOptions>? configure = null)
Source
Adds an official Aspire Keycloak resource configured with deterministic AppSurface local OIDC proof defaults.
builderThe distributed application builder.nameThe Aspire resource name.configureOptional callback that customizes local proof options.An AppSurface wrapper exposing the underlying Keycloak resource, secret-safe config projection, and readiness probe.
AppSurfaceKeycloakResource AddAppSurfaceKeycloak(this IDistributedApplicationBuilder builder, string name, IResourceBuilder<ParameterResource> adminUsername, IResourceBuilder<ParameterResource> adminPassword, Action<AppSurfaceKeycloakOptions>? configure = null)
Source
Adds an official Aspire Keycloak resource configured with deterministic AppSurface local OIDC proof defaults and explicit typed administrator parameters for finite consumer-owned local seed projects.
builderThe distributed application builder.nameThe Aspire resource name.adminUsernameThe typed administrator username parameter supplied to the Keycloak container.adminPasswordThe typed secret administrator password parameter supplied to the Keycloak container.configureOptional callback that customizes local proof options.An AppSurface wrapper exposing the underlying Keycloak resource, secret-safe config projection, and readiness probe.
Use this overload only when a consumer-owned local seed must authenticate to the Keycloak Admin API. AppSurface does not read either parameter value. A seed receives the password only through AppSurfaceKeycloakLocalSeedOptions.WithRequiredSecretParameter and owns all administration work.
Represents the finite AppHost resource that proves an AppSurface local Keycloak realm is ready for dependent work.
The package owns only this baseline proof. Provider administration, client creation, broker policy, credentials, mutations, retries, and convergence remain the responsibility of the consumer-owned finite project that waits for Resource to complete.
IResourceBuilder<ExecutableResource> Resource { get; }
Source
Gets the completion-bearing Aspire executable resource.
Depend on this resource through Aspire's WaitForCompletion relationship. A dependent project starts only after the realm-ready process exits successfully.
Performs bounded, multi-signal readiness checks for the AppSurface local Keycloak proof.
Task<AppSurfaceKeycloakReadinessResult> CheckOnceAsync(CancellationToken cancellationToken = default)
Source
Checks metadata, generated realm evidence, and authorization challenge evidence once.
cancellationTokenCancellation token for HTTP work.A successful readiness result.
Configures the explicit local-only policy, predecessor, and typed secret bindings for one consumer seed project.
AppSurfaceKeycloakLocalSeedOptions After(AppSurfaceKeycloakLocalSeed predecessor)
Source
Requires this seed to follow the immediately preceding local seed returned by the same Keycloak wrapper.
predecessorThe immediately prior returned seed handle.This options instance for fluent configuration.
AppSurfaceKeycloakLocalSeedOptions WithRequiredSecretParameter(string environmentVariableName, IResourceBuilder<ParameterResource> parameter)
Source
Binds one required Aspire secret parameter only to this seed's consumer project.
environmentVariableNameThe consumer-owned environment variable name.parameterA typed Aspire parameter resource whose ParameterResource.Secret flag is true.This options instance for fluent configuration.
AppSurface validates parameter identity and secret metadata only; it never reads, logs, writes, serializes, or otherwise resolves the parameter value. The parameter may not be reused by a second seed in the same wrapper.
IList<string> AllowedEnvironmentNames { get; }
Source
Gets local environment names in which seed registration is allowed, compared case-insensitively.
The default is Development, Test, and Testing. Publish and every execution operation other than Aspire Run are always denied, even when this list contains a deployment-like environment.
Stores a declared typed secret binding until the parent resource validates and applies it to the consumer project.
Represents an immutable container image reference used to prove a Keycloak login theme.
Theme verification is meaningful only when it is associated with a concrete Keycloak image. This type requires a registry, tag, and SHA-256 digest so a moving tag cannot silently change the template baseline beneath a theme.
AppSurfaceKeycloakImageReference Parse(string value)
Source
Parses a fully-qualified immutable container image reference.
valueA reference in registry/repository:tag@sha256:<64 lowercase hex characters> form.The parsed image reference.
AppSurfaceKeycloakExceptionThe image reference is incomplete or non-deterministic.string Registry { get; }
Source
Gets the container registry, including an optional port.
string Image { get; }
Source
Gets the slash-separated repository name without the registry.
string Tag { get; }
Source
Gets the immutable-reference tag retained for human-readable evidence.
string Sha256 { get; }
Source
Gets the lowercase hexadecimal SHA-256 image digest without the sha256: prefix.
string Value { get; }
Source
Gets the canonical registry, image, tag, and digest reference.
Validates local seed registration before a consumer project can be launched.
Represents a safe AppSurface Keycloak proof diagnostic with a stable code.
string Code { get; }
Source
Gets the stable AppSurface Keycloak diagnostic code.
Hosts the package's finite realm-ready executable mode.