pub struct CredentialStore { /* private fields */ }Expand description
Credential store for all configured routes.
Implementations§
Source§impl CredentialStore
impl CredentialStore
Sourcepub fn load(
routes: &[RouteConfig],
tls_connector: &TlsConnector,
) -> Result<Self>
pub fn load( routes: &[RouteConfig], tls_connector: &TlsConnector, ) -> Result<Self>
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 (e.g.
unset env var) are skipped with a warning — this allows profiles to
declare optional credentials without failing when they are unavailable.
OAuth2 routes perform an initial token exchange at startup. If the exchange fails, the route is skipped (graceful degradation).
The tls_connector is required for OAuth2 token exchange HTTPS calls.
Returns an error only for hard failures (keystore access errors, config parse errors, non-UTF-8 values).
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 loaded_prefixes(&self) -> HashSet<String>
pub fn loaded_prefixes(&self) -> HashSet<String>
Returns the set of route prefixes that have loaded credentials (both static keystore and OAuth2 routes).