Struct ripasso::pass::PasswordEntry
source · pub struct PasswordEntry {
pub name: String,
pub updated: Option<DateTime<Local>>,
pub committed_by: Option<String>,
pub signature_status: Option<SignatureStatus>,
pub is_in_git: RepositoryStatus,
/* private fields */
}
Expand description
One password in the password store
Fields§
§name: String
Name of the entry, (from relative path to password)
updated: Option<DateTime<Local>>
if we have a git repo, then commit time
committed_by: Option<String>
if we have a git repo, then the name of the committer
signature_status: Option<SignatureStatus>
if we have a git repo, and the commit was signed
is_in_git: RepositoryStatus
describes if the file is in a repository or not
Implementations§
source§impl PasswordEntry
impl PasswordEntry
sourcepub fn new(
base: &Path,
relpath: &Path,
update_time: Result<DateTime<Local>>,
committed_by: Result<String>,
signature_status: Result<SignatureStatus>,
is_in_git: RepositoryStatus
) -> Self
pub fn new( base: &Path, relpath: &Path, update_time: Result<DateTime<Local>>, committed_by: Result<String>, signature_status: Result<SignatureStatus>, is_in_git: RepositoryStatus ) -> Self
constructs a a PasswordEntry
from the supplied parts
sourcepub fn with_new_name(old: Self, base: &Path, relpath: &Path) -> Self
pub fn with_new_name(old: Self, base: &Path, relpath: &Path) -> Self
Consumes an PasswordEntry
, and returns a new one with a new name
sourcepub fn load_from_git(
base: &Path,
path: &Path,
repo: &Repository,
store: &PasswordStore
) -> Self
pub fn load_from_git( base: &Path, path: &Path, repo: &Repository, store: &PasswordStore ) -> Self
creates a PasswordEntry
by running git blame on the specified path
sourcepub fn load_from_filesystem(base: &Path, relpath: &Path) -> Self
pub fn load_from_filesystem(base: &Path, relpath: &Path) -> Self
creates a PasswordEntry
based on data in the filesystem
sourcepub fn secret(&self, store: &PasswordStore) -> Result<String>
pub fn secret(&self, store: &PasswordStore) -> Result<String>
Decrypts and returns the full content of the PasswordEntry
Errors
Returns an Err
if the path is empty
sourcepub fn password(&self, store: &PasswordStore) -> Result<String>
pub fn password(&self, store: &PasswordStore) -> Result<String>
Decrypts and returns the first line of the PasswordEntry
Errors
Returns an Err
if the decryption fails
sourcepub fn mfa(&self, store: &PasswordStore) -> Result<String>
pub fn mfa(&self, store: &PasswordStore) -> Result<String>
decrypts and returns a TOTP code if the entry contains a otpauth:// url
Errors
Returns an Err
if the code generation fails
sourcepub fn update(&self, secret: String, store: &PasswordStore) -> Result<()>
pub fn update(&self, secret: String, store: &PasswordStore) -> Result<()>
Updates the password store entry with new content, and commits those to git if a repository is supplied.
Errors
Returns an Err
if the update fails.
sourcepub fn delete_file(&self, store: &PasswordStore) -> Result<()>
pub fn delete_file(&self, store: &PasswordStore) -> Result<()>
Removes this entry from the filesystem and commit that to git if a repository is supplied.
Errors
Returns an Err
if the remove fails.
sourcepub fn get_history(&self, store: &PasswordStore) -> Result<Vec<GitLogLine>>
pub fn get_history(&self, store: &PasswordStore) -> Result<Vec<GitLogLine>>
Returns a list of log lines for the password, one line for each commit that have changed that password in some way
Errors
Returns an Err
if any of the git operation fails.
Trait Implementations§
source§impl Clone for PasswordEntry
impl Clone for PasswordEntry
source§fn clone(&self) -> PasswordEntry
fn clone(&self) -> PasswordEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more