Skip to main content

vtcode_auth/
lib.rs

1#![allow(
2    clippy::unreachable,
3    clippy::map_err_ignore,
4    reason = "Intentional compatibility, platform, or test-only suppression."
5)]
6#![allow(
7    missing_docs,
8    dead_code,
9    unused_imports,
10    reason = "Intentional compatibility, platform, or test-only suppression."
11)]
12//! Shared authentication and OAuth flows for VT Code.
13
14mod auth_service;
15pub mod codex_auth_import;
16mod config;
17pub mod credentials;
18pub mod mcp_oauth;
19pub mod oauth_server;
20pub mod openai_chatgpt_oauth;
21pub mod openrouter_oauth;
22pub mod pkce;
23mod storage_paths;
24
25pub use auth_service::OpenAIAccountAuthService;
26pub use codex_auth_import::{
27    CodexAuthJsonRefresher, codex_auth_json_exists, codex_auth_json_path, codex_auth_json_refresher, codex_home_dir,
28    try_load_codex_chatgpt_session,
29};
30pub use config::{AuthConfig, CopilotAuthConfig, OpenAIAuthConfig, OpenAIPreferredMethod};
31pub use credentials::{
32    AuthCredentialsStoreMode, CredentialIdentity, CredentialStorage, CustomApiKeyStorage, clear_custom_api_keys,
33    load_custom_api_keys, migrate_custom_api_keys,
34};
35pub use mcp_oauth::{
36    McpOAuthConfig, McpOAuthLoginCompletion, McpOAuthPreparedLogin, McpOAuthService, McpOAuthStatus, McpOAuthToken,
37};
38pub use oauth_server::{
39    AuthCallbackOutcome, AuthCodeCallbackServer, OAuthCallbackPage, OAuthProvider, run_auth_code_callback_server,
40    start_auth_code_callback_server,
41};
42pub use openai_chatgpt_oauth::{
43    OpenAIChatGptAuthHandle, OpenAIChatGptAuthStatus, OpenAIChatGptSession, OpenAIChatGptSessionProvenance,
44    OpenAIChatGptSessionRefresher, OpenAICredentialOverview, OpenAIResolvedAuth, OpenAIResolvedAuthSource,
45    clear_openai_chatgpt_session, clear_openai_chatgpt_session_with_mode, exchange_openai_chatgpt_code_for_tokens,
46    generate_openai_oauth_state, get_openai_chatgpt_auth_status, get_openai_chatgpt_auth_status_with_mode,
47    get_openai_chatgpt_auth_url, load_openai_chatgpt_session, load_openai_chatgpt_session_with_mode,
48    parse_openai_chatgpt_manual_callback_input, refresh_openai_chatgpt_session_with_mode, resolve_openai_auth,
49    save_openai_chatgpt_session, save_openai_chatgpt_session_with_mode, summarize_openai_credentials,
50};
51pub use openrouter_oauth::{
52    AuthStatus, OpenRouterOAuthConfig, OpenRouterToken, clear_oauth_token, clear_oauth_token_with_mode,
53    exchange_code_for_token, get_auth_status, get_auth_status_with_mode, get_auth_url, load_oauth_token,
54    load_oauth_token_with_mode, save_oauth_token, save_oauth_token_with_mode,
55};
56pub use pkce::{PkceChallenge, generate_pkce_challenge};