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;
21mod openai_refresh_policy;
22mod openai_session_storage;
23pub mod openrouter_oauth;
24mod openrouter_token_storage;
25pub mod pkce;
26mod storage_paths;
27
28pub use auth_service::OpenAIAccountAuthService;
29pub use codex_auth_import::{
30    CodexAuthJsonRefresher, codex_auth_json_exists, codex_auth_json_path, codex_auth_json_refresher, codex_home_dir,
31    try_load_codex_chatgpt_session,
32};
33pub use config::{AuthConfig, CopilotAuthConfig, OpenAIAuthConfig, OpenAIPreferredMethod};
34pub use credentials::{
35    AuthCredentialsStoreMode, CredentialIdentity, CredentialStorage, CustomApiKeyStorage, clear_custom_api_keys,
36    load_custom_api_keys, migrate_custom_api_keys,
37};
38pub use mcp_oauth::{
39    McpOAuthConfig, McpOAuthLoginCompletion, McpOAuthPreparedLogin, McpOAuthService, McpOAuthStatus, McpOAuthToken,
40};
41pub use oauth_server::{
42    AuthCallbackOutcome, AuthCodeCallbackServer, OAuthCallbackPage, OAuthProvider, run_auth_code_callback_server,
43    start_auth_code_callback_server,
44};
45pub use openai_chatgpt_oauth::{
46    OpenAIChatGptAuthHandle, OpenAIChatGptAuthStatus, OpenAIChatGptSession, OpenAIChatGptSessionProvenance,
47    OpenAIChatGptSessionRefresher, OpenAICredentialOverview, OpenAIResolvedAuth, OpenAIResolvedAuthSource,
48    clear_openai_chatgpt_session, clear_openai_chatgpt_session_with_mode, exchange_openai_chatgpt_code_for_tokens,
49    generate_openai_oauth_state, get_openai_chatgpt_auth_status, get_openai_chatgpt_auth_status_with_mode,
50    get_openai_chatgpt_auth_url, load_openai_chatgpt_session, load_openai_chatgpt_session_with_mode,
51    parse_openai_chatgpt_manual_callback_input, refresh_openai_chatgpt_session_with_mode, resolve_openai_auth,
52    save_openai_chatgpt_session, save_openai_chatgpt_session_with_mode, summarize_openai_credentials,
53};
54pub use openrouter_oauth::{
55    AuthStatus, OpenRouterOAuthConfig, OpenRouterToken, clear_oauth_token, clear_oauth_token_with_mode,
56    exchange_code_for_token, get_auth_status, get_auth_status_with_mode, get_auth_url, load_oauth_token,
57    load_oauth_token_with_mode, save_oauth_token, save_oauth_token_with_mode,
58};
59pub use pkce::{PkceChallenge, generate_pkce_challenge};