mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
f5e8eac2ae
## Summary - Move auth header construction into the `AuthProvider::add_auth_headers` contract. - Inline `CoreAuthProvider` header mutation in its provider impl and remove the shared header-map helper. - Update HTTP, websocket, file upload, sideband websocket, and test auth callsites to use the provider method. - Add direct coverage for `CoreAuthProvider` auth header mutation. ## Testing - `just fmt` - `cargo test -p codex-api` - `cargo test -p codex-core client::tests::auth_request_telemetry_context_tracks_attached_auth_and_retry_phase` - `cargo test -p codex-core` failed on unrelated/reproducible `tools::handlers::multi_agents::tests::multi_agent_v2_followup_task_interrupts_busy_child_without_losing_message` --------- Co-authored-by: Celia Chen <celia@openai.com>
11 lines
339 B
Rust
11 lines
339 B
Rust
use http::HeaderMap;
|
|
|
|
/// Adds authentication headers to API requests.
|
|
///
|
|
/// Implementations should be cheap and non-blocking; any asynchronous
|
|
/// refresh or I/O should be handled by higher layers before requests
|
|
/// reach this interface.
|
|
pub trait AuthProvider: Send + Sync {
|
|
fn add_auth_headers(&self, headers: &mut HeaderMap);
|
|
}
|