Files
codex/codex-rs/app-server-protocol/src/protocol/v2/gcp.rs
T
alexsong-oai 6fe77fc123 Add experimental GCP account setup to the app server (#57394)
## What changed

- Add `account/gcp/setup` to configure the built-in Vertex AI provider with a project, optional location (defaulting to `global`), and optional credential file. Omitting the file clears the active user override and uses Application Default Credentials.
- Validate configuration and obtain an access token before saving, return structured credential failure reasons, and reload the model catalog on the next `model/list` request.
- Share configuration previews and version-checked writes with Bedrock setup to reject conflicting settings and concurrent configuration changes.

## Testing

Add tests for credential selection and ADC fallback, catalog refresh, invalid credentials, policy and endpoint conflicts, cancellation when network permission is revoked, and configuration version conflicts.

GitOrigin-RevId: 6f411a85893f8da49581427451e0180529955b16
2026-10-27 08:06:10 +00:00

28 lines
1020 B
Rust

//! Shared setup parameters for the built-in Google Cloud Vertex AI provider.
use crate::JsonSchema;
use crate::TS;
use serde::Deserialize;
use serde::Serialize;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct GcpSetupParams {
pub project_id: String,
/// Vertex AI location. Omission or null selects `global`.
#[ts(optional = nullable)]
pub location: Option<String>,
/// Absolute path to a credential file on the app-server host.
/// Omit or pass `null` to clear the active user configuration's override and use ADC.
/// If another configuration layer would still supply a credential file, setup fails
/// without saving changes.
#[ts(optional = nullable)]
pub credential_file: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct GcpSetupResponse {}