mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
[codex] Rename host-provided auth
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user