Skip to main content

vtcode_config/auth/
mod.rs

1//! Authentication utilities for VT Code.
2//!
3//! This module provides:
4//! - Generic credential storage with OS keyring and file backends
5//! - OAuth PKCE support for OpenRouter and other providers
6//!
7//! ## Credential Storage
8//!
9//! Credentials are stored using OS-specific secure storage (keyring) by default,
10//! with fallback to AES-256-GCM encrypted files if the keyring is unavailable.
11
12pub mod credentials;
13pub mod openrouter_oauth;
14pub mod pkce;
15
16pub use credentials::{
17    AuthCredentialsStoreMode, CredentialStorage, CustomApiKeyStorage, clear_custom_api_keys,
18    load_custom_api_keys, migrate_custom_api_keys_to_keyring,
19};
20pub use openrouter_oauth::{
21    AuthStatus, OpenRouterOAuthConfig, OpenRouterToken, clear_oauth_token, exchange_code_for_token,
22    get_auth_status, get_auth_url, load_oauth_token, load_oauth_token_with_mode, save_oauth_token,
23    save_oauth_token_with_mode,
24};
25pub use pkce::{PkceChallenge, generate_pkce_challenge};