mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
feat: introduce EffectivePermissions
This commit is contained in:
@@ -1677,11 +1677,14 @@ impl CodexMessageProcessor {
|
||||
}
|
||||
|
||||
let cwd = params.cwd.unwrap_or_else(|| self.config.cwd.clone());
|
||||
let env = create_env(&self.config.shell_environment_policy, None);
|
||||
let env = create_env(
|
||||
&self.config.effective_permissions.shell_environment_policy,
|
||||
None,
|
||||
);
|
||||
let timeout_ms = params
|
||||
.timeout_ms
|
||||
.and_then(|timeout_ms| u64::try_from(timeout_ms).ok());
|
||||
let started_network_proxy = match self.config.network.as_ref() {
|
||||
let started_network_proxy = match self.config.effective_permissions.network.as_ref() {
|
||||
Some(spec) => match spec.start_proxy().await {
|
||||
Ok(started) => Some(started),
|
||||
Err(err) => {
|
||||
@@ -1713,7 +1716,12 @@ impl CodexMessageProcessor {
|
||||
|
||||
let requested_policy = params.sandbox_policy.map(|policy| policy.to_core());
|
||||
let effective_policy = match requested_policy {
|
||||
Some(policy) => match self.config.sandbox_policy.can_set(&policy) {
|
||||
Some(policy) => match self
|
||||
.config
|
||||
.effective_permissions
|
||||
.sandbox_policy
|
||||
.can_set(&policy)
|
||||
{
|
||||
Ok(()) => policy,
|
||||
Err(err) => {
|
||||
let error = JSONRPCErrorError {
|
||||
@@ -1725,7 +1733,12 @@ impl CodexMessageProcessor {
|
||||
return;
|
||||
}
|
||||
},
|
||||
None => self.config.sandbox_policy.get().clone(),
|
||||
None => self
|
||||
.config
|
||||
.effective_permissions
|
||||
.sandbox_policy
|
||||
.get()
|
||||
.clone(),
|
||||
};
|
||||
|
||||
let codex_linux_sandbox_exe = self.config.codex_linux_sandbox_exe.clone();
|
||||
|
||||
Reference in New Issue
Block a user