pub trait SecretsReader {
// Required method
fn load_credentials(self) -> Result<CredentialsLoading, Error>;
}
Expand description
A trait to implement loading of credentials, which includes reading of secrets.
Required Methods§
Sourcefn load_credentials(self) -> Result<CredentialsLoading, Error>
fn load_credentials(self) -> Result<CredentialsLoading, Error>
Loads credentials.
Implementations on Foreign Types§
Source§impl SecretsReader for ExtendedUserMapping
impl SecretsReader for ExtendedUserMapping
Source§fn load_credentials(self) -> Result<CredentialsLoading, Error>
fn load_credentials(self) -> Result<CredentialsLoading, Error>
Loads credentials for each [UserId
] associated with a SystemUserId
.
The SystemUserId
of the mapping must be equal to the current system user calling this
function.
Relies on get_plaintext_secret_file
and get_systemd_creds_secret_file
to retrieve
the specific path to a secret file for each [UserId
] mapped to a SystemUserId
.
Returns a CredentialsLoading
, which may contain critical errors related to loading a
passphrase for each available [UserId
].
The caller is expected to handle any errors tracked in the returned object based on context.
§Errors
Returns an error if
- the
ExtendedUserMapping
provides noSystemUserId
, - no system user equal to the
SystemUserId
exists, - the
SystemUserId
is not equal to the currently calling system user, - or the systemd-creds command is not available when trying to decrypt secrets.