mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
12aaeb7bf8
## Why `account/read` currently reports only `type: "amazonBedrock"`, so clients cannot distinguish a Codex-managed Bedrock API key from credentials supplied by AWS. The app UI needs that distinction to render the appropriate account state without duplicating provider-auth logic. Credential-source selection belongs to the Bedrock model provider because it already owns the precedence between managed Bedrock auth and the external AWS credential path. This builds on #27443 and #27689. ## What changed - Added `AmazonBedrockCredentialSource` with `codexManaged` and `awsManaged` values. - Included the selected credential source in `ProviderAccount::AmazonBedrock` and the app-server `Account` response. - Made `AmazonBedrockModelProvider::account_state()` classify the source from its managed-auth state. - Regenerated the app-server JSON and TypeScript schemas. - Updated app-server account documentation and downstream TUI matches. `codexManaged` means the provider found a managed Bedrock API key. `awsManaged` identifies the provider's external AWS credential path; it does not assert that the AWS credential chain has been validated. ## Testing - Added model-provider coverage for Codex-managed precedence and AWS-managed fallback. - Added app-server protocol serialization coverage for both wire values. - Added app-server integration coverage for both `account/read` responses. - `just test -p codex-protocol -p codex-model-provider -p codex-app-server-protocol` (497 tests passed). After rebasing onto #27711, the `codex-app-server` test target compiled past the image-generation `PathUri` migration. Local linking was then interrupted by disk exhaustion (`No space left on device`).
117 lines
2.4 KiB
JSON
Generated
117 lines
2.4 KiB
JSON
Generated
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"Account": {
|
|
"oneOf": [
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": [
|
|
"apiKey"
|
|
],
|
|
"title": "ApiKeyAccountType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "ApiKeyAccount",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"planType": {
|
|
"$ref": "#/definitions/PlanType"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"chatgpt"
|
|
],
|
|
"title": "ChatgptAccountType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"email",
|
|
"planType",
|
|
"type"
|
|
],
|
|
"title": "ChatgptAccount",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"properties": {
|
|
"credentialSource": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/definitions/AmazonBedrockCredentialSource"
|
|
}
|
|
],
|
|
"default": "awsManaged"
|
|
},
|
|
"type": {
|
|
"enum": [
|
|
"amazonBedrock"
|
|
],
|
|
"title": "AmazonBedrockAccountType",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"type"
|
|
],
|
|
"title": "AmazonBedrockAccount",
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"AmazonBedrockCredentialSource": {
|
|
"enum": [
|
|
"codexManaged",
|
|
"awsManaged"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"PlanType": {
|
|
"enum": [
|
|
"free",
|
|
"go",
|
|
"plus",
|
|
"pro",
|
|
"prolite",
|
|
"team",
|
|
"self_serve_business_usage_based",
|
|
"business",
|
|
"enterprise_cbp_usage_based",
|
|
"enterprise",
|
|
"edu",
|
|
"unknown"
|
|
],
|
|
"type": "string"
|
|
}
|
|
},
|
|
"properties": {
|
|
"account": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/Account"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"requiresOpenaiAuth": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"requiresOpenaiAuth"
|
|
],
|
|
"title": "GetAccountResponse",
|
|
"type": "object"
|
|
} |