pub struct StoreKeys { /* private fields */ }Expand description
One store’s key material: the encryption master key, cloud-home credentials,
and OAuth tokens, each stored under a store-scoped keyring account
({base}:{store_id}). The store’s signing identity is not here — it goes
through crate::identity_custody::IdentityCustody, the same way the
master key goes through crate::custody::KeyCustody.
Implementations§
Source§impl StoreKeys
impl StoreKeys
pub fn new(store_id: String) -> Self
pub fn store_id(&self) -> &str
pub fn get_encryption_key(&self) -> Result<Option<String>, KeyError>
pub fn set_encryption_key(&self, value: &str) -> Result<(), KeyError>
pub fn delete_encryption_key(&self) -> Result<(), KeyError>
pub fn get_cloud_home_credentials( &self, ) -> Result<Option<CloudHomeCredentials>, KeyError>
pub fn set_cloud_home_credentials( &self, creds: &CloudHomeCredentials, ) -> Result<(), KeyError>
pub fn set_cloud_home_oauth_tokens( &self, tokens: &OAuthTokens, ) -> Result<(), KeyError>
pub fn delete_cloud_home_credentials(&self) -> Result<(), KeyError>
Sourcepub fn get_host_secret(&self, name: &str) -> Result<Option<String>, KeyError>
pub fn get_host_secret(&self, name: &str) -> Result<Option<String>, KeyError>
A host’s own store-scoped secret — an API token, a service credential
— read from the same keyring service and access policy as coven’s own
key material. None if never set. KeyError::InvalidSecretName if
name collides with one of coven’s own reserved slot names, is
empty, or contains : (see [validate_host_secret_name]).
Sourcepub fn set_host_secret(&self, name: &str, value: &str) -> Result<(), KeyError>
pub fn set_host_secret(&self, name: &str, value: &str) -> Result<(), KeyError>
Set a host’s own store-scoped secret. Same name restrictions as
get_host_secret.
Sourcepub fn delete_host_secret(&self, name: &str) -> Result<(), KeyError>
pub fn delete_host_secret(&self, name: &str) -> Result<(), KeyError>
Remove a host secret. Ok whether or not one was set. Same name
restrictions as get_host_secret.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StoreKeys
impl RefUnwindSafe for StoreKeys
impl Send for StoreKeys
impl Sync for StoreKeys
impl Unpin for StoreKeys
impl UnsafeUnpin for StoreKeys
impl UnwindSafe for StoreKeys
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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