pub struct FileAuthProvider { /* private fields */ }Expand description
File-based AuthProvider.
Concurrency: a single Mutex guards the in-memory cache. Read-heavy
workloads should consider Arc<AuthProvider> + cloning; writes are
rare (interactive login) so a coarse lock is fine.
Implementations§
Source§impl FileAuthProvider
impl FileAuthProvider
Sourcepub fn resolve_api_key(&self, provider: &str) -> Option<String>
pub fn resolve_api_key(&self, provider: &str) -> Option<String>
Resolve an API key against the in-memory boot-time cache.
Use get_api_key_sync for the
dynamic path that re-reads path from disk — that’s the one
Oxicode::create_provider consults, so it picks up writes from
external singletons (e.g. the CLI’s shared_auth_storage()).
Trait Implementations§
Source§impl AuthProvider for FileAuthProvider
impl AuthProvider for FileAuthProvider
Source§fn get_api_key_sync(&self, provider: &str) -> Result<Option<String>, SdkError>
fn get_api_key_sync(&self, provider: &str) -> Result<Option<String>, SdkError>
Sync fast-path — re-reads path from disk on every call so
external writers (e.g. the CLI’s shared_auth_storage() singleton
at oxicode-cli/src/store/auth_storage.rs:1135, which maintains its own
independent in-memory cache) are reflected without restart. This is
the credential source Oxicode::create_provider consults at build /
switch_model / refresh_credentials time; per-call file I/O is
negligible on those paths. Issue #40.