pub struct Keyring { /* private fields */ }Expand description
Interface to a pluggable keyring backend
Implementations§
Source§impl Keyring
impl Keyring
Sourcepub const SUPPORTED_BACKENDS: &'static [&'static str]
pub const SUPPORTED_BACKENDS: &'static [&'static str]
List of supported credential store backends
Sourcepub const DEFAULT_BACKEND: &'static str
pub const DEFAULT_BACKEND: &'static str
The default backend when no configuration option is set
Sourcepub fn describe_backend(backend: &str) -> &'static str
pub fn describe_backend(backend: &str) -> &'static str
Returns a human-readable description of a keyring backend.
Sourcepub fn new(backend: &str) -> Result<Self>
pub fn new(backend: &str) -> Result<Self>
Instantiate a new keyring.
The argument should be an element of Self::SUPPORTED_BACKENDS.
Sourcepub fn from_config(config: &Config) -> Result<Self>
pub fn from_config(config: &Config) -> Result<Self>
Instantiate a new keyring using the backend specified in a configuration file.
Sourcepub fn get_auth_token_entry(&self, registry_url: &RegistryUrl) -> Result<Entry>
pub fn get_auth_token_entry(&self, registry_url: &RegistryUrl) -> Result<Entry>
Gets the auth token entry for the given registry and key name.
Sourcepub fn get_auth_token(
&self,
registry_url: &RegistryUrl,
) -> Result<Option<Secret<String>>>
pub fn get_auth_token( &self, registry_url: &RegistryUrl, ) -> Result<Option<Secret<String>>>
Gets the auth token
Sourcepub fn delete_auth_token(&self, registry_url: &RegistryUrl) -> Result<()>
pub fn delete_auth_token(&self, registry_url: &RegistryUrl) -> Result<()>
Deletes the auth token
Sourcepub fn set_auth_token(
&self,
registry_url: &RegistryUrl,
token: &str,
) -> Result<()>
pub fn set_auth_token( &self, registry_url: &RegistryUrl, token: &str, ) -> Result<()>
Sets the auth token
Sourcepub fn get_signing_key_entry(
&self,
registry_url: Option<&str>,
keys: &IndexSet<String>,
home_url: Option<&str>,
) -> Result<Entry>
pub fn get_signing_key_entry( &self, registry_url: Option<&str>, keys: &IndexSet<String>, home_url: Option<&str>, ) -> Result<Entry>
Gets the signing key entry for the given registry and key name.
Sourcepub fn get_signing_key(
&self,
registry_url: Option<&str>,
keys: &IndexSet<String>,
home_url: Option<&str>,
) -> Result<PrivateKey>
pub fn get_signing_key( &self, registry_url: Option<&str>, keys: &IndexSet<String>, home_url: Option<&str>, ) -> Result<PrivateKey>
Gets the signing key for the given registry registry_label and key name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keyring
impl !RefUnwindSafe for Keyring
impl Send for Keyring
impl Sync for Keyring
impl Unpin for Keyring
impl !UnwindSafe for Keyring
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more