pub struct Settings {
pub default_environment: String,
pub vault_dir: String,
pub argon2_memory_kib: u32,
pub argon2_iterations: u32,
pub argon2_parallelism: u32,
pub keyfile_path: Option<String>,
pub allowed_environments: Option<Vec<String>>,
pub editor: Option<String>,
pub audit: AuditSettings,
pub secret_scanning: SecretScanningSettings,
}Expand description
Project-level configuration, loaded from .envvault.toml.
Every field has a sensible default so EnvVault works out-of-the-box without any config file at all.
Fields§
§default_environment: StringWhich environment to use when none is specified (e.g. “dev”).
vault_dir: StringDirectory (relative to project root) where vault files are stored.
argon2_memory_kib: u32Argon2 memory cost in KiB (default: 64 MB).
argon2_iterations: u32Argon2 iteration count (default: 3).
argon2_parallelism: u32Argon2 parallelism degree (default: 4).
keyfile_path: Option<String>Default keyfile path (used when --keyfile is not passed on the CLI).
allowed_environments: Option<Vec<String>>Restrict which environment names are allowed (typo protection). If set, any env name not in this list is rejected.
editor: Option<String>Preferred editor for envvault edit (overrides $VISUAL / $EDITOR).
audit: AuditSettingsAudit log settings.
secret_scanning: SecretScanningSettingsSecret scanning settings (for future use).
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn load(project_dir: &Path) -> Result<Self>
pub fn load(project_dir: &Path) -> Result<Self>
Load settings from <project_dir>/.envvault.toml.
If the file does not exist, sensible defaults are returned. If the file exists but cannot be parsed, an error is returned.
Sourcepub fn vault_path(&self, project_dir: &Path, env_name: &str) -> PathBuf
pub fn vault_path(&self, project_dir: &Path, env_name: &str) -> PathBuf
Build the full path to a vault file for a given environment.
Example: project_dir/.envvault/dev.vault
Sourcepub fn argon2_params(&self) -> Argon2Params
pub fn argon2_params(&self) -> Argon2Params
Convert the Argon2 settings into crypto-layer params.