Skip to main content

SecretField

Trait SecretField 

pub trait SecretField {
    // Required methods
    fn mask(&mut self);
    fn restore_from(&mut self, current: &Self);
    fn encrypt_in_place(
        &mut self,
        store: &SecretStore,
        field: &str,
    ) -> Result<()>;
    fn decrypt_in_place(
        &mut self,
        store: &SecretStore,
        field: &str,
    ) -> Result<()>;
    fn is_set(&self) -> bool;
}

Required Methods§

Source

fn mask(&mut self)

Replace each non-empty inner string with MASKED_SECRET.

Source

fn restore_from(&mut self, current: &Self)

Restore inner strings that currently equal MASKED_SECRET from the matching position in current. The dashboard write path relies on this so re-posting an already-displayed masked value doesn’t overwrite the real secret in config.

Source

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Encrypt every non-empty, not-already-encrypted inner string.

Source

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source

fn is_set(&self) -> bool

Whether the field carries at least one non-empty inner string. Reported back through SecretFieldInfo::is_set.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SecretField for HashMap<String, String>

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Source§

impl SecretField for Option<HashMap<String, String>>

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Source§

impl SecretField for Option<PathBuf>

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Source§

impl SecretField for Option<String>

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Source§

impl SecretField for PathBuf

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Source§

impl SecretField for String

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Source§

impl SecretField for Vec<String>

Source§

fn mask(&mut self)

Source§

fn restore_from(&mut self, current: &Self)

Source§

fn encrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn decrypt_in_place(&mut self, store: &SecretStore, field: &str) -> Result<()>

Source§

fn is_set(&self) -> bool

Implementors§