Skip to main content

vtcode_auth/
lib.rs

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