mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
## What changed - Add the experimental `amazonBedrockAccessKeys` app-server login flow, persist its credentials in the configured auth store, and use them for SigV4-signed Bedrock requests. - Report `bedrockAccessKeys` as a distinct auth mode and document access-key login alongside AWS profile and environment credential setup. - Clear the selected Bedrock provider, AWS settings, and Bedrock-specific model on logout while leaving external AWS credentials and `.env` untouched. - Reject managed access-key login when higher-precedence configuration would prevent its region or profile settings from taking effect. ## Testing - Cover access-key login, storage, request signing, configuration conflicts, status reporting, and logout cleanup. GitOrigin-RevId: bbf297887c6503d3651ceb2aad85c4d626e32723
22 lines
1.0 KiB
Rust
22 lines
1.0 KiB
Rust
use codex_app_server_protocol::AuthMode as ApiAuthMode;
|
|
use codex_protocol::auth::AuthMode;
|
|
|
|
/// Converts the domain auth mode owned by `codex-protocol` into the app-server wire type owned by
|
|
/// `codex-app-server-protocol`.
|
|
///
|
|
/// The types stay separate so app-server protocol ownership does not leak into domain crates.
|
|
/// Because this crate owns neither type, Rust's orphan rules require an explicit conversion
|
|
/// function instead of a `From` implementation.
|
|
pub(crate) fn auth_mode_to_api(auth_mode: AuthMode) -> ApiAuthMode {
|
|
match auth_mode {
|
|
AuthMode::ApiKey => ApiAuthMode::ApiKey,
|
|
AuthMode::Chatgpt => ApiAuthMode::Chatgpt,
|
|
AuthMode::ChatgptAuthTokens => ApiAuthMode::ChatgptAuthTokens,
|
|
AuthMode::Headers => ApiAuthMode::Headers,
|
|
AuthMode::AgentIdentity => ApiAuthMode::AgentIdentity,
|
|
AuthMode::PersonalAccessToken => ApiAuthMode::PersonalAccessToken,
|
|
AuthMode::BedrockApiKey => ApiAuthMode::BedrockApiKey,
|
|
AuthMode::BedrockAccessKeys => ApiAuthMode::BedrockAccessKeys,
|
|
}
|
|
}
|