Expose auth helpers for saved account sessions

This commit is contained in:
Dhruv
2026-06-04 01:27:24 +05:30
parent d1000206e0
commit f81b5c5aef
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -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,
+1
View File
@@ -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;