aKode fase 2b-1 (WIP): rimossi cloud-config, apps MCP ChatGPT, upload file, connectors-extension, rate limits backend; plugin remoti in corso (test non ancora compilanti)
Some checks failed
blocking-ci / Bazel (push) Has been cancelled
blocking-ci / Blob size policy (push) Has been cancelled
blocking-ci / cargo-deny (push) Has been cancelled
blocking-ci / Codespell (push) Has been cancelled
blocking-ci / repo-checks (push) Has been cancelled
blocking-ci / rust-ci (push) Has been cancelled
blocking-ci / sdk (push) Has been cancelled
blocking-ci / CI required (push) Has been cancelled
postmerge-ci / rust-ci-full (push) Has been cancelled
postmerge-ci / v8-canary (push) Has been cancelled
postmerge-ci / Postmerge CI results (push) Has been cancelled
Some checks failed
blocking-ci / Bazel (push) Has been cancelled
blocking-ci / Blob size policy (push) Has been cancelled
blocking-ci / cargo-deny (push) Has been cancelled
blocking-ci / Codespell (push) Has been cancelled
blocking-ci / repo-checks (push) Has been cancelled
blocking-ci / rust-ci (push) Has been cancelled
blocking-ci / sdk (push) Has been cancelled
blocking-ci / CI required (push) Has been cancelled
postmerge-ci / rust-ci-full (push) Has been cancelled
postmerge-ci / v8-canary (push) Has been cancelled
postmerge-ci / Postmerge CI results (push) Has been cancelled
This commit is contained in:
@@ -22,7 +22,6 @@ codex-app-server = { workspace = true }
|
||||
codex-arg0 = { workspace = true }
|
||||
codex-aws-auth = { workspace = true }
|
||||
codex-build-info = { workspace = true }
|
||||
codex-cloud-config = { workspace = true }
|
||||
codex-config = { workspace = true }
|
||||
codex-core = { workspace = true }
|
||||
codex-exec-server = { workspace = true }
|
||||
|
||||
@@ -189,7 +189,6 @@ impl ExecServerCommand {
|
||||
) -> anyhow::Result<()> {
|
||||
let strict_config = self.strict_config;
|
||||
self.validate_remote_transport()?;
|
||||
let enable_cloud_config = self.should_load_cloud_config();
|
||||
let websocket_auth = self.websocket_auth.try_into_settings()?;
|
||||
if websocket_auth.config.is_some() && (self.remote.is_some() || self.command.is_some()) {
|
||||
anyhow::bail!("WebSocket listener auth cannot be used with --remote or forward");
|
||||
@@ -231,7 +230,6 @@ impl ExecServerCommand {
|
||||
let config = load_exec_server_config(
|
||||
root_config_overrides,
|
||||
strict_config,
|
||||
enable_cloud_config,
|
||||
stdin_auth.as_ref(),
|
||||
);
|
||||
let mut parent_lifetime = if self.exit_on_stdin_close && stdin_auth.is_some() {
|
||||
@@ -356,7 +354,6 @@ impl ExecServerCommand {
|
||||
let config_result = load_exec_server_config(
|
||||
root_config_overrides,
|
||||
strict_config,
|
||||
enable_cloud_config,
|
||||
/*stdin_auth*/ None,
|
||||
)
|
||||
.await;
|
||||
@@ -398,15 +395,6 @@ impl ExecServerCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fn should_load_cloud_config(&self) -> bool {
|
||||
self.remote.is_some()
|
||||
&& self.command.is_none()
|
||||
&& !self.executor_credential_stdin
|
||||
&& !self.registration_bearer_stdin
|
||||
&& !self.aws_sigv4
|
||||
&& !self.use_agent_identity_auth
|
||||
}
|
||||
|
||||
fn validate_remote_transport(&self) -> anyhow::Result<()> {
|
||||
// Clap checks global flag conflicts separately on either side of `forward`.
|
||||
if self.registration_bearer_stdin && self.executor_credential_stdin {
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
use anyhow::Context;
|
||||
use codex_app_server::in_process::EmbeddedNetworkPolicy;
|
||||
use codex_cloud_config::chatgpt_config_bundle_loader;
|
||||
use codex_cloud_config::managed_config_bundle_loader_for_auth;
|
||||
use codex_config::LoaderOverrides;
|
||||
use codex_core::config::ConfigBuilder;
|
||||
use codex_core::config::ConfigLoadOptions;
|
||||
@@ -178,66 +176,14 @@ pub(super) fn validate_api_key_remote_host(base_url: &str) -> anyhow::Result<()>
|
||||
pub(super) async fn load_exec_server_config(
|
||||
root_config_overrides: &CliConfigOverrides,
|
||||
strict_config: bool,
|
||||
enable_cloud_config: bool,
|
||||
stdin_auth: Option<&CodexAuth>,
|
||||
) -> anyhow::Result<codex_core::config::Config> {
|
||||
let cli_kv_overrides = root_config_overrides
|
||||
.parse_overrides()
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
let bootstrap_cli_overrides = cli_kv_overrides.clone();
|
||||
let mut builder = ConfigBuilder::default()
|
||||
let builder = ConfigBuilder::default()
|
||||
.cli_overrides(cli_kv_overrides)
|
||||
.strict_config(strict_config);
|
||||
if enable_cloud_config {
|
||||
let codex_home = find_codex_home()?;
|
||||
let loader_overrides = LoaderOverrides::default();
|
||||
let network_policy = EmbeddedNetworkPolicy::load(&loader_overrides).await;
|
||||
let bootstrap_cwd = AbsolutePathBuf::current_dir()?;
|
||||
let bootstrap_config = load_config_toml_with_layer_stack(
|
||||
&codex_home,
|
||||
Some(&bootstrap_cwd),
|
||||
bootstrap_cli_overrides,
|
||||
ConfigLoadOptions {
|
||||
loader_overrides,
|
||||
strict_config,
|
||||
cloud_config_bundle: Default::default(),
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
let bootstrap_auth_config = network_policy
|
||||
.bind_bootstrap_auth(bootstrap_auth_config(&codex_home, &bootstrap_config)?);
|
||||
let cloud_config_bundle = if let Some(auth) = stdin_auth {
|
||||
anyhow::ensure!(
|
||||
bootstrap_auth_config.allows_auth(auth),
|
||||
"ChatGPT authentication is not permitted for this account"
|
||||
);
|
||||
managed_config_bundle_loader_for_auth(
|
||||
bootstrap_auth_config,
|
||||
auth,
|
||||
bootstrap_config.config_layer_stack.requirements_toml(),
|
||||
)
|
||||
.await?
|
||||
} else {
|
||||
let auth_manager = AuthManager::shared_from_auth_config_with_auth_modes(
|
||||
bootstrap_auth_config.clone(),
|
||||
/*enable_codex_api_key_env*/ true,
|
||||
REMOTE_AUTH_MODES.to_vec(),
|
||||
)
|
||||
.await?;
|
||||
chatgpt_config_bundle_loader(
|
||||
auth_manager,
|
||||
bootstrap_auth_config
|
||||
.chatgpt_base_url
|
||||
.unwrap_or_else(|| "https://chatgpt.com/backend-api/".to_string()),
|
||||
bootstrap_auth_config.codex_home,
|
||||
bootstrap_auth_config
|
||||
.auth_route_config
|
||||
.http_client_factory()
|
||||
.clone(),
|
||||
)
|
||||
};
|
||||
builder = builder.cloud_config_bundle(cloud_config_bundle);
|
||||
}
|
||||
let mut config = builder.build().await?;
|
||||
if stdin_auth.is_some() {
|
||||
config.config_layer_stack.ensure_config_server_applied()?;
|
||||
|
||||
@@ -49,7 +49,7 @@ fn exec_server_defaults_preserve_local_and_noise_modes() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn remote_forwarder_skips_cloud_config() {
|
||||
fn remote_forwarder_rejects_chatgpt_token_stdin() {
|
||||
let mut command = exec_server_from_args(&[
|
||||
"forward",
|
||||
"--connect",
|
||||
@@ -59,7 +59,6 @@ fn remote_forwarder_skips_cloud_config() {
|
||||
"--environment-id",
|
||||
"env-1",
|
||||
]);
|
||||
assert!(!command.should_load_cloud_config());
|
||||
command.chatgpt_token_stdin = true;
|
||||
assert!(command.validate_remote_transport().is_err());
|
||||
}
|
||||
@@ -98,8 +97,7 @@ fn exec_server_parses_direct_aws_options() {
|
||||
);
|
||||
assert_eq!(command.environment_id.as_deref(), Some("env-1"));
|
||||
assert_eq!(command.remote_transport, ExecServerRemoteTransport::Direct);
|
||||
assert!(!command.should_load_cloud_config());
|
||||
assert!(command.aws_sigv4);
|
||||
assert!(command.aws_sigv4);
|
||||
assert_eq!(
|
||||
(
|
||||
command.aws_profile.as_deref(),
|
||||
|
||||
Reference in New Issue
Block a user