mirror of
https://github.com/openai/codex.git
synced 2026-10-26 18:38:47 +00:00
fix(core): enforce managed plaintext injection policy
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
committed by
Winston Howes
co-authored by
Codex noreply@openai.com
parent
336612bc25
commit
c03bca9a33
@@ -30,6 +30,7 @@ pub struct NetworkProxyConstraints {
|
||||
pub allow_upstream_proxy: Option<bool>,
|
||||
pub dangerously_allow_non_loopback_proxy: Option<bool>,
|
||||
pub dangerously_allow_all_unix_sockets: Option<bool>,
|
||||
pub dangerously_allow_plaintext_credential_injection: Option<bool>,
|
||||
pub allowed_domains: Option<Vec<String>>,
|
||||
pub allowlist_expansion_enabled: Option<bool>,
|
||||
pub denied_domains: Option<Vec<String>>,
|
||||
@@ -198,6 +199,27 @@ pub fn validate_policy_against_constraints(
|
||||
},
|
||||
)?;
|
||||
|
||||
if let Some(allow_plaintext_credential_injection) =
|
||||
constraints.dangerously_allow_plaintext_credential_injection
|
||||
{
|
||||
validate(
|
||||
config
|
||||
.network
|
||||
.dangerously_allow_plaintext_credential_injection,
|
||||
move |candidate| {
|
||||
if *candidate && !allow_plaintext_credential_injection {
|
||||
Err(invalid_value(
|
||||
"network.dangerously_allow_plaintext_credential_injection",
|
||||
"true",
|
||||
"false (disabled by managed config)",
|
||||
))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
},
|
||||
)?;
|
||||
}
|
||||
|
||||
let allow_all_unix_sockets = constraints
|
||||
.dangerously_allow_all_unix_sockets
|
||||
.unwrap_or(constraints.allow_unix_sockets.is_none());
|
||||
|
||||
Reference in New Issue
Block a user