pub struct SecretsManager { /* private fields */ }Expand description
Secrets manager for YNAB API tokens
Implementations§
Source§impl SecretsManager
impl SecretsManager
Sourcepub fn new(config: SecretsConfig) -> Result<Self>
pub fn new(config: SecretsConfig) -> Result<Self>
Create a new secrets manager
Sourcepub fn load_token(&self) -> Result<YnabApiToken>
pub fn load_token(&self) -> Result<YnabApiToken>
Load the YNAB API token from the most secure available source
Sourcepub fn store_token(&self, token: &YnabApiToken) -> Result<()>
pub fn store_token(&self, token: &YnabApiToken) -> Result<()>
Store a token in the keyring
Sourcepub fn delete_token(&self) -> Result<()>
pub fn delete_token(&self) -> Result<()>
Delete the token from keyring
Sourcepub fn is_keyring_available(&self) -> bool
pub fn is_keyring_available(&self) -> bool
Check if keyring is available
Sourcepub fn get_storage_method(&self) -> StorageMethod
pub fn get_storage_method(&self) -> StorageMethod
Get the current storage method being used
Sourcepub fn setup_guidance(&self) -> Vec<String>
pub fn setup_guidance(&self) -> Vec<String>
Provide setup guidance for users
Auto Trait Implementations§
impl !RefUnwindSafe for SecretsManager
impl !UnwindSafe for SecretsManager
impl Freeze for SecretsManager
impl Send for SecretsManager
impl Sync for SecretsManager
impl Unpin for SecretsManager
impl UnsafeUnpin for SecretsManager
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