pub struct KeyringCredentialStore { /* private fields */ }Expand description
Production credential store backed by the OS keyring, with an
auxiliary sidecar index that answers exists() queries without
touching the keychain.
Implementations§
Source§impl KeyringCredentialStore
impl KeyringCredentialStore
pub fn new() -> Self
Sourcepub fn with_index(index_path: PathBuf) -> Self
pub fn with_index(index_path: PathBuf) -> Self
Construct with the sidecar index persisted at index_path. Pass
~/flow-studio/credential_index.json in production.
pub fn with_service(service: impl Into<String>) -> Self
Trait Implementations§
Source§impl CredentialStore for KeyringCredentialStore
impl CredentialStore for KeyringCredentialStore
Source§fn exists(&self, account: &str) -> bool
fn exists(&self, account: &str) -> bool
Answers from the sidecar index without touching the keychain. The
trait’s default would call get() which on macOS triggers a
keychain prompt per call - and the prompt fires every startup on
unsigned dev builds because “Always Allow” is tied to the binary’s
code signature, which changes on every rebuild.
fn set(&self, account: &str, secret: &str) -> Result<(), CredentialError>
fn get(&self, account: &str) -> Result<String, CredentialError>
fn delete(&self, account: &str) -> Result<(), CredentialError>
Auto Trait Implementations§
impl !Freeze for KeyringCredentialStore
impl !RefUnwindSafe for KeyringCredentialStore
impl Send for KeyringCredentialStore
impl Sync for KeyringCredentialStore
impl Unpin for KeyringCredentialStore
impl UnsafeUnpin for KeyringCredentialStore
impl UnwindSafe for KeyringCredentialStore
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