mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Support Amazon Bedrock login in the app server (#33170)
## What changed - Handle experimental `account/login/start` requests with `type: "amazonBedrock"`. - Validate the API key and Mantle region, persist the managed credential, select the `amazon-bedrock` model provider, and emit the standard login and account-update notifications. - Reload configuration for account and authentication status reads so the newly selected provider is visible immediately, with the startup configuration as a fallback. - Extend the app-server test client with an Amazon Bedrock login mode that redacts API keys from request logs. ## Testing - Add app-server coverage for successful login, credential and provider persistence, notifications, refreshed account state, invalid inputs, conflicting configuration, forced ChatGPT login, external authentication, and configuration reload failure. GitOrigin-RevId: bf3ae98375caee41e78d2cdc677127138184c17a
This commit is contained in:
1 parent
a2fb3f048d
commit
518085387b
11 files changed
+816
-22
No files matched your search
@@ -39,8 +39,13 @@ pub(super) fn region_from_config(aws: &ModelProviderAwsAuthInfo) -> Option<Strin
|
||||
.map(str::to_string)
|
||||
}
|
||||
|
||||
/// Returns whether Amazon Bedrock Mantle is available in `region`.
|
||||
pub fn is_supported_amazon_bedrock_region(region: &str) -> bool {
|
||||
BEDROCK_MANTLE_SUPPORTED_REGIONS.contains(®ion)
|
||||
}
|
||||
|
||||
pub(super) fn base_url(region: &str) -> Result<String> {
|
||||
if BEDROCK_MANTLE_SUPPORTED_REGIONS.contains(®ion) {
|
||||
if is_supported_amazon_bedrock_region(region) {
|
||||
Ok(format!("https://bedrock-mantle.{region}.api.aws/openai/v1"))
|
||||
} else {
|
||||
Err(CodexErr::Fatal(format!(
|
||||
|
||||
@@ -31,6 +31,7 @@ use crate::provider::ProviderCapabilities;
|
||||
use auth::resolve_provider_auth;
|
||||
pub(crate) use catalog::static_model_catalog;
|
||||
use catalog::with_default_only_service_tier;
|
||||
pub use mantle::is_supported_amazon_bedrock_region;
|
||||
use mantle::runtime_base_url;
|
||||
|
||||
/// Runtime provider for Amazon Bedrock's OpenAI-compatible Mantle endpoint.
|
||||
|
||||
Reference in new issue
Block a user