[codex] Rename host-provided auth

This commit is contained in:
Liang-Ting Jiang
2026-06-27 03:49:09 +00:00
parent 832b93e4f8
commit d485192b3e
28 changed files with 106 additions and 100 deletions
+10 -6
View File
@@ -15,10 +15,12 @@ pub enum AuthMode {
#[serde(rename = "chatgptAuthTokens")]
#[strum(serialize = "chatgptAuthTokens")]
ChatgptAuthTokens,
/// Codex backend request headers supplied by the process embedding Codex.
#[serde(rename = "hostProvided")]
#[strum(serialize = "hostProvided")]
HostProvided,
/// Backend auth supplied programmatically by the caller.
///
/// Request headers are kept in memory and are not persisted or refreshed by Codex.
#[serde(rename = "callerProvided")]
#[strum(serialize = "callerProvided")]
CallerProvided,
/// Programmatic Codex auth backed by a registered Agent Identity.
#[serde(rename = "agentIdentity")]
#[strum(serialize = "agentIdentity")]
@@ -38,7 +40,9 @@ impl AuthMode {
pub fn has_chatgpt_account(self) -> bool {
match self {
Self::Chatgpt | Self::ChatgptAuthTokens | Self::PersonalAccessToken => true,
Self::ApiKey | Self::HostProvided | Self::AgentIdentity | Self::BedrockApiKey => false,
Self::ApiKey | Self::CallerProvided | Self::AgentIdentity | Self::BedrockApiKey => {
false
}
}
}
@@ -47,7 +51,7 @@ impl AuthMode {
match self {
Self::Chatgpt
| Self::ChatgptAuthTokens
| Self::HostProvided
| Self::CallerProvided
| Self::AgentIdentity
| Self::PersonalAccessToken => true,
Self::ApiKey | Self::BedrockApiKey => false,