OAuthSessionConfig (src/oauth_session.rs)

codex · codex-rs/login/src/oauth_session.rs · rust · Apache-2.0
auth

Manages OAuth sessions, handling token refresh, storage, and browser authorization flows.

// Source: https://github.com/openai/codex | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
//! Owns gateway credentials, token refresh, and policy-controlled browser authorization.
//! Credential I/O runs off the async worker and writes retain the store lock through cancellation.
//! Rotated credentials survive caller cancellation and remain pending until persistence succeeds.

use std::fmt;
use std::io;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;

use crate::oauth::AuthorizationCodeGrant;
use crate::oauth::AuthorizationRequest;
use crate::oauth::ErrorBodyLimit;
use crate::oauth::OAuthClient;
use crate::oauth::OAuthError;
use crate::oauth::RefreshTokenGran

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key