Files
Kigi-CLI/crates/codegen/kigi-shell/src/auth/mod.rs
T
雷电芽衣 2ca1f3baa7 feat(shell): custom providers declared in config.toml join the model catalog
[platforms.<name>] with base_url and api (openai or anthropic) declares a provider.
Its key lives in auth.json under the name or in the table; /models is fetched per
provider, entries are keyed <name>/<model>, and the key is stamped in memory only.
2026-09-29 14:50:24 -04:00

40 lines
1.3 KiB
Rust

pub(crate) mod attribution;
mod config;
pub(crate) mod credential_authority;
pub mod credential_provider;
pub(crate) mod device;
pub mod device_code;
pub mod error;
mod flow;
pub(crate) mod github_copilot;
pub(crate) mod kimi_oauth;
pub(crate) mod manager;
mod model;
pub(crate) mod oauth_device;
pub(crate) mod oauth_pkce;
pub(crate) mod oauth_registry;
pub(crate) mod recovery;
pub(crate) mod refresh;
mod storage;
pub(crate) mod token_type;
pub use config::{KIMI_CODE_OAUTH_SCOPE, KimiCodeConfig};
pub(crate) use flow::try_ensure_session_noninteractive;
pub use flow::{
AuthChannels, AuthUrlInfo, AuthUrlMode, LogoutResult, ensure_authenticated,
ensure_authenticated_or_noninteractive, perform_logout, run_auth_flow,
run_auth_flow_with_stderr_bridge, run_cli_login, run_cli_logout, run_oauth_provider_flow,
try_ensure_fresh_auth,
};
mod meta;
pub use device::device_headers;
pub use error::{AuthError, RefreshTokenError, RefreshTokenFailedReason};
pub use manager::{AuthManager, shared_api_key_provider};
pub use meta::AuthMeta;
pub use model::{AuthMode, KimiAuth, lookup_auth};
pub(crate) use model::{TOKEN_TTL, is_expired, token_suffix};
pub(crate) use storage::store_scoped_api_key;
pub use storage::{
clear_api_key, read_api_key, read_auth_json, read_platform_api_key, read_token_by_scope,
store_api_key, store_platform_api_key,
};