#[non_exhaustive]pub enum EnvVarMode {
Passthrough,
Strict {
allowed: BTreeSet<Arc<str>>,
},
Mock,
}Expand description
How get_env calls treat the process
environment.
Default is EnvVarMode::Strict with an empty allowlist — get_env is
off until the operator opts in. See 70-security.md § 3.3.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Passthrough
Pass the full process environment to the evaluator. The CLI prints a startup warning before this mode goes live.
Strict
Only the names in allowed are visible. Any other get_env(...)
returns the supplied default or "".
Fields
§
allowed: BTreeSet<Arc<str>>Allowed env var names. The set is a BTreeSet for deterministic
ordering (and dedup) per 13-evaluator.md § 2.
Mock
get_env always returns the supplied default (or ""). Useful for
hermetic tests.
Implementations§
Trait Implementations§
Source§impl Clone for EnvVarMode
impl Clone for EnvVarMode
Source§fn clone(&self) -> EnvVarMode
fn clone(&self) -> EnvVarMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnvVarMode
impl Debug for EnvVarMode
Source§impl Default for EnvVarMode
impl Default for EnvVarMode
Source§impl<'de> Deserialize<'de> for EnvVarMode
impl<'de> Deserialize<'de> for EnvVarMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Hash for EnvVarMode
impl Hash for EnvVarMode
Source§impl PartialEq for EnvVarMode
impl PartialEq for EnvVarMode
Source§fn eq(&self, other: &EnvVarMode) -> bool
fn eq(&self, other: &EnvVarMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EnvVarMode
impl Serialize for EnvVarMode
impl Eq for EnvVarMode
impl StructuralPartialEq for EnvVarMode
Auto Trait Implementations§
impl Freeze for EnvVarMode
impl RefUnwindSafe for EnvVarMode
impl Send for EnvVarMode
impl Sync for EnvVarMode
impl Unpin for EnvVarMode
impl UnsafeUnpin for EnvVarMode
impl UnwindSafe for EnvVarMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.