pub struct CredentialStore { /* private fields */ }Expand description
Credential store for all configured routes.
Implementations§
Source§impl CredentialStore
impl CredentialStore
Sourcepub fn load_with_diagnostics(
routes: &[RouteConfig],
tls_connector: &TlsConnector,
) -> Result<CredentialLoadOutcome>
pub fn load_with_diagnostics( routes: &[RouteConfig], tls_connector: &TlsConnector, ) -> Result<CredentialLoadOutcome>
Load credentials for all configured routes from the system keystore.
Routes without a credential_key or oauth2 block are skipped (no
credential injection). Routes whose credential is not found remain
configured but unavailable at request time, so managed-credential
requests fail closed instead of silently accepting agent-supplied
upstream credentials.
OAuth2 routes perform an initial token exchange at startup. If the exchange fails, the route remains configured but unavailable until token acquisition succeeds.
The tls_connector is required for OAuth2 token exchange HTTPS calls.
Returns an error only for hard failures (config parse errors,
non-UTF-8 values). Missing credentials are logged, recorded in
diagnostics, and the route is skipped.
Sourcepub fn load(
routes: &[RouteConfig],
tls_connector: &TlsConnector,
) -> Result<CredentialStore>
👎Deprecated since 0.64.0: Use load_with_diagnostics instead. Will be removed in 1.0.0.
pub fn load( routes: &[RouteConfig], tls_connector: &TlsConnector, ) -> Result<CredentialStore>
Use load_with_diagnostics instead. Will be removed in 1.0.0.
Deprecated wrapper around Self::load_with_diagnostics.
Sourcepub fn get(&self, prefix: &str) -> Option<&LoadedCredential>
pub fn get(&self, prefix: &str) -> Option<&LoadedCredential>
Get a static credential for a route prefix, if configured.
Sourcepub fn get_oauth2(&self, prefix: &str) -> Option<&OAuth2Route>
pub fn get_oauth2(&self, prefix: &str) -> Option<&OAuth2Route>
Get an OAuth2 route (token cache + upstream) for a route prefix, if configured.
Sourcepub fn get_aws(&self, prefix: &str) -> Option<&()>
pub fn get_aws(&self, prefix: &str) -> Option<&()>
Returns Some(()) if an AWS SigV4 route is configured for the given
prefix, None otherwise. The Option<&()> return mirrors get_oauth2
so call sites can use .is_some() uniformly. The value will become
Option<&AwsRoute> when SigV4 signing is implemented.
Sourcepub fn loaded_prefixes(&self) -> HashSet<String>
pub fn loaded_prefixes(&self) -> HashSet<String>
Returns the set of route prefixes that have loaded credentials (static keystore, OAuth2, and AWS routes).