mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
Extract shared network policy types from the proxy crate (#63986)
## Why The protocol and feature configuration crates depend on the network proxy crate for data types. Give them a smaller dependency that contains the shared definitions. ## What changed Move environment network policies, domain and Unix socket permissions, policy decisions and their sources, and credential provider definitions into `codex-network-policy-types`. Use the new crate directly from `codex-protocol` and `codex-features`. Re-export the moved types from `codex-network-proxy` and keep environment policy conversion and application, along with credential provider validation, in the proxy crate. GitOrigin-RevId: 8af684da746830bce45ac00135aed8052dba3824
This commit is contained in:
@@ -15,6 +15,7 @@ use codex_config::ConfigLayerStack;
|
||||
use codex_config::merge_toml_values;
|
||||
use codex_core::config::edit::ConfigEdit;
|
||||
use codex_network_proxy::CredentialProviderConfig;
|
||||
use codex_network_proxy::validate_credential_provider;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::BTreeSet;
|
||||
use toml::Value as TomlValue;
|
||||
@@ -215,7 +216,7 @@ impl CredentialProviderEdits {
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
if old.validate(id).is_ok() {
|
||||
if validate_credential_provider(id, &old).is_ok() {
|
||||
to_validate.insert(id.clone(), current.clone());
|
||||
}
|
||||
}
|
||||
@@ -255,7 +256,7 @@ impl CredentialProviderEdits {
|
||||
}
|
||||
for (id, definition) in to_validate {
|
||||
let provider: CredentialProviderConfig = definition.try_into()?;
|
||||
provider.validate(&id)?;
|
||||
validate_credential_provider(&id, &provider)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user