pub struct CredentialStore;Expand description
Multi-source credential resolver.
Implementations§
Source§impl CredentialStore
impl CredentialStore
Sourcepub fn resolve(
provider: &str,
config_key: Option<&str>,
) -> Option<(String, CredentialSource)>
pub fn resolve( provider: &str, config_key: Option<&str>, ) -> Option<(String, CredentialSource)>
Resolve the best available API key for a provider.
Priority: OXIOS_
Sourcepub fn has_credential(provider: &str, config_key: Option<&str>) -> bool
pub fn has_credential(provider: &str, config_key: Option<&str>) -> bool
Check if any credential is available for a provider.
Sourcepub fn store(provider: &str, api_key: &str) -> Result<()>
pub fn store(provider: &str, api_key: &str) -> Result<()>
Store an API key to oxi’s auth store (~/.oxi/auth.json).
This is called by the onboarding wizard. If oxi CLI is also installed on this machine, it will pick up the same credential.
If the auth store contains legacy entries from oxi-cli that don’t
deserialize as TokenBundle, they are auto-migrated before saving.
Sourcepub fn provider_from_model(model_id: &str) -> Option<&str>
pub fn provider_from_model(model_id: &str) -> Option<&str>
Extract the provider name from a model ID.
“anthropic/claude-sonnet-4-20250514” → “anthropic”
Returns None if the model ID is empty or has no provider prefix.