pub trait TokenProvider: Send + Sync {
// Required methods
fn github_token(&self) -> Option<SecretString>;
fn openrouter_key(&self) -> Option<SecretString>;
}Expand description
Provides GitHub and OpenRouter credentials for API calls.
This trait abstracts credential resolution across platforms:
- CLI: Resolves from environment variables, GitHub CLI, or system keyring
- iOS: Resolves from iOS keychain via FFI
Implementations should handle credential lookup and return None if
credentials are not available.
Required Methods§
Sourcefn github_token(&self) -> Option<SecretString>
fn github_token(&self) -> Option<SecretString>
Retrieves the GitHub API token.
Returns None if no token is available from any source.
Sourcefn openrouter_key(&self) -> Option<SecretString>
fn openrouter_key(&self) -> Option<SecretString>
Retrieves the OpenRouter API key.
Returns None if no API key is available from any source.