Skip to main content

Settings

Struct Settings 

Source
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: String

Which environment to use when none is specified (e.g. “dev”).

§vault_dir: String

Directory (relative to project root) where vault files are stored.

§argon2_memory_kib: u32

Argon2 memory cost in KiB (default: 64 MB).

§argon2_iterations: u32

Argon2 iteration count (default: 3).

§argon2_parallelism: u32

Argon2 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: AuditSettings

Audit log settings.

§secret_scanning: SecretScanningSettings

Secret scanning settings (for future use).

Implementations§

Source§

impl Settings

Source

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.

Source

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

Source

pub fn argon2_params(&self) -> Argon2Params

Convert the Argon2 settings into crypto-layer params.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Settings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Settings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,