string? ProjectId { get; set; }
Source
Gets or sets the Google Cloud project id used for short secret ids.
Classifies Google Secret Manager configuration resolution outcomes.
Describes a value-safe Google Secret Manager transfer diagnostic.
string ToDisplayString()
Source
Renders the diagnostic for terminal output without secret payloads.
A display-safe diagnostic string.
Describes a value-safe Google Secret Manager probe result.
StatusThe probe status.ResourceNameThe requested resource name.HasEnabledVersionsWhether an existing secret has at least one enabled version.DiagnosticA display-safe diagnostic for failed probes.AppSurfaceGoogleSecretProbeResult Ready(string resourceName, bool hasEnabledVersions = false)
Source
Creates a successful probe result.
resourceNameThe requested resource name.hasEnabledVersionsWhether an existing secret has enabled versions.The successful probe result.
AppSurfaceGoogleSecretProbeResult Failed(GoogleSecretManagerTransferStatus status, string resourceName, AppSurfaceGoogleSecretTransferDiagnostic diagnostic)
Source
Creates a failed probe result.
statusThe failure status.resourceNameThe requested resource name.diagnosticThe display-safe diagnostic.The failed probe result.
Describes a value-safe Google Secret Manager write result.
StatusThe write status.ResourceNameThe requested secret parent resource name.WrittenVersionResourceNameThe written version resource name, when Google returned one.DiagnosticA display-safe diagnostic for failed writes.AppSurfaceGoogleSecretWriteResult Written(string resourceName, string? writtenVersionResourceName)
Source
Creates a successful write result.
resourceNameThe secret parent resource name.writtenVersionResourceNameThe written version resource name.The successful write result.
AppSurfaceGoogleSecretWriteResult Failed(GoogleSecretManagerTransferStatus status, string resourceName, AppSurfaceGoogleSecretTransferDiagnostic diagnostic)
Source
Creates a failed write result.
statusThe failure status.resourceNameThe requested secret parent resource name.diagnosticThe display-safe diagnostic.The failed write result.
Describes a value-safe Google Secret Manager payload access result.
StatusThe access status.ResourceNameThe requested version resource name.PayloadThe payload when access succeeded.DiagnosticA display-safe diagnostic for failed access.AppSurfaceGoogleSecretAccessResult Accessed(string resourceName, AppSurfaceGoogleSecretPayload payload)
Source
Creates a successful access result.
resourceNameThe requested version resource name.payloadThe accessed payload.The successful access result.
AppSurfaceGoogleSecretAccessResult Failed(GoogleSecretManagerTransferStatus status, string resourceName, AppSurfaceGoogleSecretTransferDiagnostic diagnostic)
Source
Creates a failed access result.
statusThe failure status.resourceNameThe requested version resource name.diagnosticThe display-safe diagnostic.The failed access result.
Probes and writes Google Secret Manager resources for explicit AppSurface secret transfer workflows.
This seam is intentionally separate from IAppSurfaceGoogleSecretManagerClient, which remains the read-only runtime configuration provider client. Implementations must keep diagnostics value-safe and must not create, disable, destroy, rotate, or provision secrets. Version 1 transfer workflows can write an existing Google secret; version 2 workflows use this client only to probe and read a pinned Google version before guarded local materialization.
AppSurfaceGoogleSecretProbeResult ProbeSecret(string secretResourceName, TimeSpan timeout)
Source
Probes one existing Google Secret Manager secret parent.
secretResourceNameThe full projects/.../secrets/... resource name.timeoutThe bounded probe timeout.The probe result.
AppSurfaceGoogleSecretProbeResult ProbeSecretVersion(string versionResourceName, TimeSpan timeout)
Source
Probes one existing Google Secret Manager secret version.
versionResourceNameThe full projects/.../secrets/.../versions/... resource name.timeoutThe bounded probe timeout.The probe result, whose resource name is the canonical provider response identity.
AppSurfaceGoogleSecretAccessResult AccessSecretVersion(string versionResourceName, TimeSpan timeout)
Source
Accesses one Google Secret Manager version payload for an apply operation.
versionResourceNameThe full version resource name.timeoutThe bounded access timeout.The version payload.
AppSurfaceGoogleSecretWriteResult AddSecretVersion(string secretResourceName, string value, TimeSpan timeout)
Source
Adds a new enabled version to an existing Google Secret Manager secret.
secretResourceNameThe full secret parent resource name.valueThe UTF-8 text secret value.timeoutThe bounded write timeout.The write result.
Default transfer client backed by Google Cloud Secret Manager.
GoogleSecretManagerTransferClientAdapter FromCredentialFile(string credentialFilePath)
Source
Creates a transfer client that uses one explicit service-account credential file.
credentialFilePathAbsolute path to the Google credential file.A client isolated from ambient Application Default Credentials.
Use this factory for operator-owned transfer profiles only. The caller owns file validation and must never include the path or file contents in diagnostics. Runtime configuration continues to use its existing credential flow.
Classifies Google Secret Manager transfer operations without exposing payload bytes.
Carries one Google Secret Manager version payload.
DataThe raw payload bytes.ResolvedResourceNameThe resolved Secret Manager version resource name, if available.Record equality compares Data by array reference, not by content, because byte[] does not override equality. Compare payload contents explicitly when byte identity matters.
Default IAppSurfaceGoogleSecretManagerClient backed by Google Cloud Secret Manager.
The default constructor creates the Google client lazily so applications that register the provider but do not resolve Google-backed keys avoid opening Secret Manager transport during service registration.
Configures the AppSurface Google Secret Manager provider.
Keys are claimed explicitly by MapSecret or by an opt-in convention resolver. Claimed keys fail closed by default when Google Secret Manager cannot safely return the value. Environment variables still remain the top AppSurface emergency override because DefaultConfigManager checks them before normal providers.
AppSurfaceGoogleSecretManagerOptions AllowLatest()
Source
Allows use of the mutable latest Secret Manager version alias.
The same options instance.
AppSurfaceGoogleSecretManagerOptions MapSecret(string logicalKey, string secretIdOrResourceName, string? version = null)
Source
Maps an AppSurface logical configuration key to a Google Secret Manager secret id or full version resource name.
logicalKeyThe logical AppSurface configuration key, for example Stripe:ApiKey.secretIdOrResourceNameA short secret id or full projects/.../secrets/.../versions/... name.versionThe version or alias for short secret ids. Overrides DefaultVersion.The same options instance.
AppSurfaceGoogleSecretManagerOptions EnableConventionResolver(string logicalKeyPrefix, string secretIdPrefix = "", string? version = null)
Source
Enables a scoped convention resolver for logical keys under logicalKeyPrefix.
logicalKeyPrefixThe required logical-key prefix that the convention may claim.secretIdPrefixAn optional prefix prepended to normalized secret ids.versionThe version or alias used by claimed convention keys.The same options instance.
string? ProjectId { get; set; }
Source
Gets or sets the Google Cloud project id used for short secret ids.
string? DefaultVersion { get; set; }
Source
Gets or sets the default secret version used by mappings that do not specify one.
Keep this unset for production unless every mapping supplies its own version or alias. Set AllowLatestVersion before using latest; mutable latest is an explicit opt-in, not the silent production default.
bool AllowLatestVersion { get; set; }
Source
Gets or sets a value indicating whether the mutable latest version alias is allowed.
bool FailClosedOnProviderFailure { get; set; }
Source
Gets or sets a value indicating whether claimed-key failures should stop lower-priority providers.
TimeSpan LookupTimeout { get; set; }
Source
Gets or sets the bounded timeout for one Secret Manager lookup.
TimeSpan? CacheTtl { get; set; }
Source
Gets or sets the optional in-memory cache duration for successful secret values.
Leave unset for strict read-through behavior. When enabled, rotation is visible after this duration or after the app rebuilds the provider. The provider does not run background refresh.
IReadOnlyList<AppSurfaceGoogleSecretMapping> Mappings { get; }
Source
Gets explicit logical-key to Secret Manager mappings.
IReadOnlyList<AppSurfaceGoogleSecretConvention> Conventions { get; }
Source
Gets opt-in convention resolvers.
Provides service collection helpers for AppSurface Google Secret Manager.
IServiceCollection ConfigureAppSurfaceGoogleSecretManager(this IServiceCollection services, Action<AppSurfaceGoogleSecretManagerOptions> configure)
Source
Configures Google Secret Manager options.
servicesThe service collection to configure.configureThe options callback.The original service collection.
IServiceCollection UseAppSurfaceGoogleSecretManagerClient<TClient>(this IServiceCollection services)
Source
Replaces the Google Secret Manager client seam.
TClientThe client implementation type.servicesThe service collection to configure.The original service collection.
IServiceCollection UseAppSurfaceGoogleSecretManagerClient(this IServiceCollection services, IAppSurfaceGoogleSecretManagerClient client)
Source
Replaces the Google Secret Manager client seam with a specific instance.
servicesThe service collection to configure.clientThe client instance.The original service collection.
IServiceCollection UseAppSurfaceGoogleSecretTransferClient<TClient>(this IServiceCollection services)
Source
Replaces the Google Secret Manager transfer client seam.
TClientThe transfer client implementation type.servicesThe service collection to configure.The original service collection.
IServiceCollection UseAppSurfaceGoogleSecretTransferClient(this IServiceCollection services, IAppSurfaceGoogleSecretTransferClient client)
Source
Replaces the Google Secret Manager transfer client seam with a specific instance.
servicesThe service collection to configure.clientThe transfer client instance.The original service collection.
Describes a typed Google Secret Manager configuration resolution.
TThe requested configuration type.GoogleSecretManagerConfigResolution<T> Unclaimed()
Source
Creates an unclaimed resolution.
An unclaimed resolution.
GoogleSecretManagerConfigResolution<T> Found(T? value, string source)
Source
Creates a found resolution.
valueThe converted value.sourceThe source name.A found resolution.
GoogleSecretManagerConfigResolution<T> Failed(GoogleSecretManagerResultStatus status, ConfigProviderTerminalDiagnostic diagnostic, string source)
Source
Creates a failed claimed-key resolution.
statusThe failed status.diagnosticThe display-safe diagnostic.sourceThe source name.A failed resolution.
GoogleSecretManagerResultStatus Status { get; }
Source
Gets the resolution status.
T? Value { get; }
Source
Gets the converted value when Status is GoogleSecretManagerResultStatus.Found.
ConfigProviderTerminalDiagnostic? Diagnostic { get; }
Source
Gets the display-safe terminal diagnostic when resolution failed for a claimed key.
string? Source { get; }
Source
Gets the provider source name.
Validates AppSurfaceGoogleSecretManagerOptions before provider lookup.
Reads Secret Manager version payloads for the AppSurface Google Secret Manager provider.
AppSurfaceGoogleSecretPayload AccessSecretVersion(string resourceName, TimeSpan timeout)
Source
Accesses one Secret Manager version.
resourceNameThe full Secret Manager version resource name.timeoutThe bounded lookup timeout.The secret version payload.
AppSurface configuration provider that resolves claimed keys from Google Secret Manager.
The provider sits above LocalSecrets and file configuration but below environment variables. Only explicitly mapped or convention-claimed keys are owned by this provider; unclaimed keys fall through. Claimed-key failures are terminal when fail-closed behavior is enabled.
GoogleSecretManagerConfigResolution<T> ResolveValue<T>(string environment, string key)
Source
Resolves a value and returns the structured provider status before config-provider adaptation.
TThe requested configuration value type.environmentThe AppSurface environment being resolved.keyThe logical AppSurface configuration key.The typed Google Secret Manager resolution.
Describes a scoped convention resolver for Google Secret Manager mappings.
LogicalKeyPrefixThe logical-key prefix this convention may claim.SecretIdPrefixThe optional prefix prepended to normalized secret ids.VersionThe optional version or alias used by this convention.Registers the AppSurface Google Secret Manager configuration provider.
Maps one AppSurface logical configuration key to a Google Secret Manager secret.
LogicalKeyThe logical AppSurface configuration key.SecretIdOrResourceNameA short secret id or full Secret Manager version resource name.VersionThe optional version or alias for short secret ids.