Skip to main content

Module credentials

Module credentials 

Source
Expand description

CredentialProvider — the type-erased object crate::app::App stores so commands can enumerate credentials without App itself becoming generic over the downstream tool’s config type.

§Why two traits?

rtb_credentials::CredentialBearing returns Vec<(&'static str, &CredentialRef)> — borrows tied to the provider’s lifetime. That’s the right shape for implementing the trait on a typed config struct, but not for storing a type-erased Box<dyn …> on App (no lifetime to anchor the borrows to).

CredentialProvider is the storage-side dual: returns owned Vec<(String, CredentialRef)>. There is a blanket impl for every T: CredentialBearing + Send + Sync + 'static — downstream tools implement CredentialBearing once and the framework converts on demand.

Structs§

NoCredentials
Convenience: an empty provider. Used by App::for_testing and any tool that hasn’t wired a provider yet.

Traits§

CredentialProvider
Type-erased credential listing. Stored on crate::app::App as Option<Arc<dyn CredentialProvider>>.

Functions§

list_or_empty
Test-friendly handle: the wrapped provider when Some, or an empty listing when None. Used by crate::app::App::credentials.