Skip to main content

codex_login/auth/
auth_headers.rs

1use std::fmt;
2
3use http::HeaderMap;
4
5/// Request headers returned by an external auth provider.
6///
7/// The provider owns credential validation, rotation, and persistence. Codex
8/// keeps the resolved headers in memory and attaches them to backend requests.
9#[derive(Clone, PartialEq, Eq)]
10pub struct AuthHeaders {
11    headers: HeaderMap,
12}
13
14impl AuthHeaders {
15    pub fn new(headers: HeaderMap) -> Self {
16        Self { headers }
17    }
18
19    pub fn headers(&self) -> &HeaderMap {
20        &self.headers
21    }
22}
23
24impl fmt::Debug for AuthHeaders {
25    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26        f.debug_struct("AuthHeaders")
27            .field("headers", &"<redacted>")
28            .finish()
29    }
30}