Skip to main content

provider_credential_detail

Function provider_credential_detail 

Source
pub fn provider_credential_detail(
    provider: Provider,
) -> Option<DiscoveredProvider>
Expand description

Determine whether a single built-in provider has a usable credential right now, and the full detail of where it came from. Returns None when no credential is found.

Mirrors the resolution order of get_api_key: env var (including provider-specific alternate env vars) → OAuth session → secure storage. Local and managed-auth providers are always considered ready.

Prefer this over provider_credential_source when you need to surface which env var was read (e.g. the first-run wizard and api_key_hint).