[][src]Struct sheesy_vault::Vault

pub struct Vault {
    pub name: Option<String>,
    pub kind: VaultKind,
    pub index: usize,
    pub partitions: Vec<Vault>,
    pub resolved_at: PathBuf,
    pub vault_path: Option<PathBuf>,
    pub auto_import: Option<bool>,
    pub trust_model: Option<TrustModel>,
    pub secrets: PathBuf,
    pub gpg_keys: Option<PathBuf>,
    pub recipients: PathBuf,
}

Fields

name: Option<String>kind: VaultKindindex: usizepartitions: Vec<Vault>resolved_at: PathBufvault_path: Option<PathBuf>auto_import: Option<bool>trust_model: Option<TrustModel>secrets: PathBufgpg_keys: Option<PathBuf>recipients: PathBuf

Implementations

impl Vault[src]

pub fn from_file(path: &Path) -> Result<Vec<Vault>, Error>[src]

pub fn set_resolved_at(self, vault_file: &Path) -> Result<Self, Error>[src]

pub fn validate(&self) -> Result<(), Error>[src]

pub fn to_file(&self, path: &Path, mode: WriteMode) -> Result<(), VaultError>[src]

pub fn absolute_path(&self, path: &Path) -> PathBuf[src]

pub fn secrets_path(&self) -> PathBuf[src]

pub fn url(&self) -> String[src]

pub fn print_resources(&self, w: &mut dyn Write) -> Result<(), Error>[src]

pub fn write_recipients_list(
    &self,
    recipients: &mut Vec<String>
) -> Result<PathBuf, Error>
[src]

pub fn recipients_path(&self) -> PathBuf[src]

pub fn recipients_list(&self) -> Result<Vec<String>, Error>[src]

pub fn keys_by_ids(
    &self,
    ctx: &mut Context,
    ids: &[String],
    type_of_ids_for_errors: &str,
    gpg_keys_dir: Option<&Path>,
    output: &mut dyn Write
) -> Result<Vec<Key>, Error>
[src]

pub fn recipient_keys(
    &self,
    ctx: &mut Context,
    gpg_keys_dir: Option<&Path>,
    output: &mut dyn Write
) -> Result<Vec<Key>, Error>
[src]

pub fn find_gpg_keys_dir(&self) -> Result<PathBuf, Error>[src]

TODO: change this to be similar to find_trust_model() as it's OK to let partitions override the master vault settings

pub fn gpg_keys_dir_for_auto_import(&self, partition: &Vault) -> Option<PathBuf>[src]

pub fn gpg_keys_dir(&self) -> Result<PathBuf, Error>[src]

impl Vault[src]

pub fn init(
    secrets: &Path,
    gpg_key_ids: &[String],
    gpg_keys_dir: &Path,
    recipients_file: &Path,
    vault_path: &Path,
    name: Option<String>,
    trust_model: Option<TrustModel>,
    auto_import: Option<bool>,
    output: &mut dyn Write
) -> Result<Self, Error>
[src]

impl Vault[src]

pub fn all_in_order(&self) -> Vec<&Vault>[src]

pub fn serialize(&self) -> Result<(), Error>[src]

pub fn partition_index<'a, I>(
    selector: &str,
    partitions: I,
    leader_index: Option<usize>
) -> Result<usize, Error> where
    I: IntoIterator<Item = &'a Vault>, 
[src]

pub fn remove_partition(
    &mut self,
    selector: &str,
    output: &mut dyn Write
) -> Result<(), Error>
[src]

pub fn add_partition(
    &mut self,
    path: &Path,
    name: Option<&str>,
    gpg_key_ids: &[String],
    recipients_file: Option<&Path>,
    output: &mut dyn Write
) -> Result<(), Error>
[src]

impl Vault[src]

pub fn add_recipients(
    &self,
    gpg_key_ids: &[String],
    sign: SigningMode,
    signing_key_id: Option<&str>,
    partitions: &[String],
    output: &mut dyn Write
) -> Result<(), Error>
[src]

pub fn find_trust_model(&self, partition: &Vault) -> TrustModel[src]

pub fn partitions_by_name_or_path(
    &self,
    partitions: &[String]
) -> Result<Vec<&Vault>, Error>
[src]

impl Vault[src]

pub fn init_recipients(
    &self,
    gpg_key_ids: &[String],
    output: &mut dyn Write
) -> Result<(), Error>
[src]

pub fn print_recipients(
    &self,
    output: &mut dyn Write,
    error: &mut dyn Write
) -> Result<(), Error>
[src]

impl Vault[src]

pub fn remove_recipients(
    &self,
    gpg_key_ids: &[String],
    partitions: &[String],
    output: &mut dyn Write
) -> Result<(), Error>
[src]

impl Vault[src]

pub fn import_keys(
    &self,
    gpg_ctx: &mut Context,
    gpg_keys_dir: &Path,
    gpg_key_ids: &[String],
    output: &mut dyn Write
) -> Result<Vec<String>, Error>
[src]

pub fn find_signing_key(
    &self,
    ctx: &mut Context,
    signing_key_id: Option<&str>
) -> Result<Key, Error>
[src]

pub fn read_fingerprint_file(
    &self,
    fpr: &str,
    gpg_keys_dir: &Path
) -> Result<(PathBuf, Vec<u8>), Error>
[src]

pub fn reencrypt(
    &self,
    ctx: &mut Context,
    model: &TrustModel,
    gpg_keys_dir: Option<&Path>,
    has_multiple_partitions: bool,
    output: &mut dyn Write
) -> Result<(), Error>
[src]

impl Vault[src]

pub fn edit(
    &self,
    path: &Path,
    editor: &Path,
    mode: CreateMode,
    try_encrypt: bool,
    output: &mut dyn Write
) -> Result<(), Error>
[src]

pub fn decrypt(&self, path: &Path, w: &mut dyn Write) -> Result<PathBuf, Error>[src]

pub fn remove(
    &self,
    specs: &[PathBuf],
    output: &mut dyn Write
) -> Result<(), Error>
[src]

pub fn encrypt_buffer(
    &self,
    input: &[u8],
    gpg_keys_dir: Option<&Path>,
    output: &mut dyn Write
) -> Result<Vec<u8>, Error>
[src]

pub fn partition_by_owned_path(
    &self,
    path: PathBuf
) -> Result<(&Vault, PathBuf), Error>
[src]

pub fn partition_by_owned_spec(
    &self,
    spec: VaultSpec
) -> Result<(&Vault, VaultSpec), Error>
[src]

pub fn partition_by_spec(
    &self,
    spec: &VaultSpec
) -> Result<(&Vault, VaultSpec), Error>
[src]

pub fn encrypt(
    &self,
    specs: &[VaultSpec],
    mode: WriteMode,
    dst_mode: Destination,
    output: &mut dyn Write
) -> Result<(), Error>
[src]

Trait Implementations

impl Clone for Vault[src]

impl Debug for Vault[src]

impl Default for Vault[src]

impl<'de> Deserialize<'de> for Vault[src]

impl Eq for Vault[src]

impl Hash for Vault[src]

impl PartialEq<Vault> for Vault[src]

impl Serialize for Vault[src]

impl StructuralEq for Vault[src]

impl StructuralPartialEq for Vault[src]

Auto Trait Implementations

impl RefUnwindSafe for Vault

impl Send for Vault

impl Sync for Vault

impl Unpin for Vault

impl UnwindSafe for Vault

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme
[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme
[src]

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Dst> ConvAsUtil<Dst> for T[src]

impl<T> ConvUtil for T[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<Src> TryFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 
[src]

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<Src> ValueFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 
[src]

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.