pub struct EnvValue(/* private fields */);Expand description
One environment variable’s value, on its way to a sheep.
A newtype for one reason, the same one DogSectionToml exists for: an
env value is the single most secret-dense thing a client can send this
daemon (a database URL, an API token, a signing key), and a derived
Debug on Request would print it in the clear the moment anything
logs a request. Every other secret-bearing field on this wire is already
protected by its inner type (AppConfig’s own manual Debug prints
env: <N vars>), and a bare String here would have been the first
field in the enum without that protection.
One direction only. Nothing ever sends one back: Request::SheepConfig
answers with the env keys and no values at all.
Self::as_str is the only way out, for the reason
DogSectionToml gives: a Deref<Target = str> would hand the type
ToString too, and .to_string() would return the value in the clear,
defeating the redacted Debug below.
#[serde(transparent)] makes the wire representation identical to a
bare String, so this newtype changes nothing about
crate::protocol::PROTOCOL_VERSION or the pinned snapshot fixtures.
Implementations§
Trait Implementations§
Source§impl Debug for EnvValue
Debug prints a length and never the value (IR-41); see the type doc for
why. Exact-string-tested below (env_value_debug_does_not_leak) so a
future #[derive(Debug)] fails that test instead of silently reopening
the leak.
impl Debug for EnvValue
Debug prints a length and never the value (IR-41); see the type doc for
why. Exact-string-tested below (env_value_debug_does_not_leak) so a
future #[derive(Debug)] fails that test instead of silently reopening
the leak.
Source§impl<'de> Deserialize<'de> for EnvValue
impl<'de> Deserialize<'de> for EnvValue
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>,
impl Eq for EnvValue
impl StructuralPartialEq for EnvValue
Auto Trait Implementations§
impl Freeze for EnvValue
impl RefUnwindSafe for EnvValue
impl Send for EnvValue
impl Sync for EnvValue
impl Unpin for EnvValue
impl UnsafeUnpin for EnvValue
impl UnwindSafe for EnvValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.