pub struct RegistryCredentialStore<S: SecretsStore> { /* private fields */ }Expand description
Store for Docker/OCI registry credentials.
Wraps a SecretsStore and organises data into two scopes:
registry_credentials_meta: JSON-serialisedRegistryCredentialmetadata (everything except the password).registry_credentials: The raw password/token as an encrypted secret.
Implementations§
Source§impl<S: SecretsStore> RegistryCredentialStore<S>
impl<S: SecretsStore> RegistryCredentialStore<S>
Sourcepub fn new(store: S) -> Self
pub fn new(store: S) -> Self
Create a new registry credential store backed by the provided secrets store.
Sourcepub async fn create(
&self,
registry: &str,
username: &str,
password: &str,
auth_type: RegistryAuthType,
) -> Result<RegistryCredential>
pub async fn create( &self, registry: &str, username: &str, password: &str, auth_type: RegistryAuthType, ) -> Result<RegistryCredential>
Store a new registry credential.
Generates a UUID for the credential, stores the password as an encrypted
secret in the registry_credentials scope, and the metadata as JSON in
the registry_credentials_meta scope.
§Arguments
registry- Registry hostname (e.g."docker.io")username- Username for authenticationpassword- Password or token value (stored encrypted)auth_type- Authentication method
§Errors
Returns a SecretsError if serialisation or storage fails.
Sourcepub async fn get(&self, id: &str) -> Result<Option<RegistryCredential>>
pub async fn get(&self, id: &str) -> Result<Option<RegistryCredential>>
Retrieve credential metadata (without the password).
Returns None if no credential with the given id exists.
§Errors
Returns a SecretsError on storage/decryption errors.
Sourcepub async fn get_password(&self, id: &str) -> Result<Secret>
pub async fn get_password(&self, id: &str) -> Result<Secret>
Retrieve the password/token for a registry credential.
§Errors
Returns SecretsError::NotFound if the credential does not exist.
Sourcepub async fn list(&self) -> Result<Vec<RegistryCredential>>
pub async fn list(&self) -> Result<Vec<RegistryCredential>>
List all registry credentials (metadata only, no passwords).
§Errors
Returns a SecretsError on storage/decryption errors.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for RegistryCredentialStore<S>where
S: Freeze,
impl<S> RefUnwindSafe for RegistryCredentialStore<S>where
S: RefUnwindSafe,
impl<S> Send for RegistryCredentialStore<S>
impl<S> Sync for RegistryCredentialStore<S>
impl<S> Unpin for RegistryCredentialStore<S>where
S: Unpin,
impl<S> UnsafeUnpin for RegistryCredentialStore<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for RegistryCredentialStore<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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>
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