mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Expose auth helpers for saved account sessions
This commit is contained in:
@@ -198,7 +198,7 @@ impl From<RefreshTokenError> for std::io::Error {
|
||||
}
|
||||
|
||||
impl CodexAuth {
|
||||
async fn from_auth_dot_json(
|
||||
pub async fn from_auth_dot_json(
|
||||
codex_home: &Path,
|
||||
auth_dot_json: AuthDotJson,
|
||||
auth_credentials_store_mode: AuthCredentialsStoreMode,
|
||||
@@ -607,6 +607,10 @@ pub fn load_auth_dot_json(
|
||||
storage.load()
|
||||
}
|
||||
|
||||
pub async fn revoke_auth_dot_json(auth: &AuthDotJson) -> std::io::Result<()> {
|
||||
revoke_auth_tokens(Some(auth)).await
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct AuthConfig {
|
||||
pub codex_home: PathBuf,
|
||||
|
||||
@@ -44,6 +44,7 @@ pub use auth::logout;
|
||||
pub use auth::logout_with_revoke;
|
||||
pub use auth::read_codex_access_token_from_env;
|
||||
pub use auth::read_openai_api_key_from_env;
|
||||
pub use auth::revoke_auth_dot_json;
|
||||
pub use auth::save_auth;
|
||||
pub use auth_env_telemetry::AuthEnvTelemetry;
|
||||
pub use auth_env_telemetry::collect_auth_env_telemetry;
|
||||
|
||||
Reference in New Issue
Block a user