Skip to main content

vtcode_auth/
lib.rs

1#![allow(clippy::unreachable, clippy::map_err_ignore)]
2//! Shared authentication and OAuth flows for VT Code.
3
4mod auth_service;
5mod config;
6pub mod credentials;
7pub mod mcp_oauth;
8pub mod oauth_server;
9pub mod openai_chatgpt_oauth;
10pub mod openrouter_oauth;
11pub mod pkce;
12mod storage_paths;
13
14pub use auth_service::OpenAIAccountAuthService;
15pub use config::{AuthConfig, CopilotAuthConfig, OpenAIAuthConfig, OpenAIPreferredMethod};
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 mcp_oauth::{
21    McpOAuthConfig, McpOAuthLoginCompletion, McpOAuthPreparedLogin, McpOAuthService,
22    McpOAuthStatus, McpOAuthToken,
23};
24pub use oauth_server::{
25    AuthCallbackOutcome, AuthCodeCallbackServer, OAuthCallbackPage, OAuthProvider,
26    run_auth_code_callback_server, start_auth_code_callback_server,
27};
28pub use openai_chatgpt_oauth::{
29    OpenAIChatGptAuthHandle, OpenAIChatGptAuthStatus, OpenAIChatGptSession,
30    OpenAIChatGptSessionRefresher, OpenAICredentialOverview, OpenAIResolvedAuth,
31    OpenAIResolvedAuthSource, clear_openai_chatgpt_session, clear_openai_chatgpt_session_with_mode,
32    exchange_openai_chatgpt_code_for_tokens, generate_openai_oauth_state,
33    get_openai_chatgpt_auth_status, get_openai_chatgpt_auth_status_with_mode,
34    get_openai_chatgpt_auth_url, load_openai_chatgpt_session,
35    load_openai_chatgpt_session_with_mode, parse_openai_chatgpt_manual_callback_input,
36    refresh_openai_chatgpt_session_with_mode, resolve_openai_auth, save_openai_chatgpt_session,
37    save_openai_chatgpt_session_with_mode, summarize_openai_credentials,
38};
39pub use openrouter_oauth::{
40    AuthStatus, OpenRouterOAuthConfig, OpenRouterToken, clear_oauth_token,
41    clear_oauth_token_with_mode, exchange_code_for_token, get_auth_status,
42    get_auth_status_with_mode, get_auth_url, load_oauth_token, load_oauth_token_with_mode,
43    save_oauth_token, save_oauth_token_with_mode,
44};
45pub use pkce::{PkceChallenge, generate_pkce_challenge};