Class SopsConfigurationOptions
- Namespace
- Nops.Configuration
- Assembly
- Nops.Configuration.dll
Options for SOPS configuration provider. Fluent builder pattern - all properties are optional with sensible defaults.
public class SopsConfigurationOptions
- Inheritance
-
SopsConfigurationOptions
- Inherited Members
Properties
AgeIdentities
Age private key identities (Bech32 strings or file paths).
public IReadOnlyList<string>? AgeIdentities { get; set; }
Property Value
DecryptCallback
Custom decryptor callback for advanced use cases. If set, overrides all key provider options.
public Func<byte[], string, CancellationToken, Task<IReadOnlyDictionary<string, string>>>? DecryptCallback { get; set; }
Property Value
FileKind
File kind/format detection: "yaml", "json", "dotenv", "ini", "binary". Auto-detected from file extension if null.
public string? FileKind { get; set; }
Property Value
FilePath
Path to the SOPS-encrypted file to load. Required.
public string? FilePath { get; set; }
Property Value
MasterKeys
Master key providers for cloud KMS (AWS, GCP, Azure, Vault). AgeIdentities and PgpKeys are used in addition to these.
public IReadOnlyList<IMasterKeyProvider>? MasterKeys { get; set; }
Property Value
MaxFileSize
Maximum file size to read (default: 10MB). Larger files will be rejected.
public long? MaxFileSize { get; set; }
Property Value
- long?
OnReloadError
Called when a reload triggered by WatchForChanges fails (for example the file was replaced with one the keys cannot decrypt). The previously loaded values stay in place. Use it to log.
public Action<Exception>? OnReloadError { get; set; }
Property Value
Optional
Whether the file may be missing. When true and the file does not exist, the source
contributes no values. Any other failure (wrong key, tampered file, unreadable file) still
throws, so a required secret can never silently disappear. Default: false, which throws
FileNotFoundException if the file is missing.
public bool Optional { get; set; }
Property Value
PgpKeys
PGP private keys for decryption.
public IReadOnlyList<(byte[] Key, string? Passphrase)>? PgpKeys { get; set; }
Property Value
- IReadOnlyList<(byte[] Key, string Passphrase)>
ReloadInterval
Reload interval when WatchForChanges is true. Debounces rapid file changes. Default: 250ms.
public TimeSpan? ReloadInterval { get; set; }
Property Value
UseSopsEnvironment
Also use the age identities the sops CLI would find (SOPS_AGE_KEY,
SOPS_AGE_KEY_FILE, default sops/age/keys.txt). Default true.
public bool UseSopsEnvironment { get; set; }
Property Value
WatchForChanges
Whether to watch the file for changes and reload automatically. Default: false.
public bool WatchForChanges { get; set; }