pub struct Vault { /* private fields */ }Expand description
Vault rooted at a directory (typically ~/.agentid).
Implementations§
Source§impl Vault
impl Vault
Sourcepub fn default_root() -> Result<PathBuf, VaultError>
pub fn default_root() -> Result<PathBuf, VaultError>
Default vault root: $HOME/.agentid.
pub fn root(&self) -> &Path
pub fn keys_dir(&self) -> PathBuf
pub fn index_path(&self) -> PathBuf
Sourcepub fn init(&self) -> Result<(), VaultError>
pub fn init(&self) -> Result<(), VaultError>
Initialise the vault directory tree and a fresh empty index.
pub fn is_initialized(&self) -> bool
Sourcepub fn read_index(&self) -> Result<VaultIndex, VaultError>
pub fn read_index(&self) -> Result<VaultIndex, VaultError>
Read the public index. Returns VaultError::NotInitialized if the
vault has never been init’d.
Sourcepub fn list(&self) -> Result<Vec<VaultEntry>, VaultError>
pub fn list(&self) -> Result<Vec<VaultEntry>, VaultError>
Public view of all stored identities.
Sourcepub fn store(
&self,
identity: &AgentIdentity,
password: &str,
) -> Result<VaultEntry, VaultError>
pub fn store( &self, identity: &AgentIdentity, password: &str, ) -> Result<VaultEntry, VaultError>
Persist an identity under password.
Sourcepub fn load(
&self,
fingerprint: &str,
password: &str,
) -> Result<AgentIdentity, VaultError>
pub fn load( &self, fingerprint: &str, password: &str, ) -> Result<AgentIdentity, VaultError>
Decrypt and load an identity by fingerprint.
Sourcepub fn lookup_by_name_project(
&self,
name: &str,
project: &str,
) -> Result<VaultEntry, VaultError>
pub fn lookup_by_name_project( &self, name: &str, project: &str, ) -> Result<VaultEntry, VaultError>
Resolve a fingerprint by name@project. Convenience for the CLI.
pub fn remove(&self, fingerprint: &str) -> Result<(), VaultError>
Auto Trait Implementations§
impl Freeze for Vault
impl RefUnwindSafe for Vault
impl Send for Vault
impl Sync for Vault
impl Unpin for Vault
impl UnsafeUnpin for Vault
impl UnwindSafe for Vault
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request