mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Use PathUri in filesystem permission paths for exec-server (#28165)
## Why Progress towards letting app-server and exec-server run on different platforms, specifically for sandbox configuration. ## What - Make the filesystem path containment hierarchy generic, defaulting to `AbsolutePathBuf` for now. - Have clients specify `AbsolutePathBuf` or `PathUri` directly where needed. - Use `PathUri` throughout exec-server filesystem protocol and trait boundaries. - Implement `From` for conversion to path URIs and `TryFrom` for fallible conversion to absolute paths through the generic type hierarchy.
This commit is contained in:
1 parent
428cd44154
commit
46f17930b6
17 files changed
+320
-97
No files matched your search
@@ -97,7 +97,7 @@ impl ApplyPatchRuntime {
|
||||
let permissions =
|
||||
effective_permission_profile(attempt.permissions, req.additional_permissions.as_ref());
|
||||
Some(FileSystemSandboxContext {
|
||||
permissions,
|
||||
permissions: permissions.into(),
|
||||
cwd: Some(attempt.sandbox_cwd.clone()),
|
||||
windows_sandbox_level: attempt.windows_sandbox_level,
|
||||
windows_sandbox_private_desktop: attempt.windows_sandbox_private_desktop,
|
||||
|
||||
@@ -233,7 +233,12 @@ async fn file_system_sandbox_context_uses_active_attempt() {
|
||||
);
|
||||
let expected_permissions =
|
||||
PermissionProfile::from_runtime_permissions(&file_system_policy, network_policy);
|
||||
assert_eq!(sandbox.permissions, expected_permissions);
|
||||
let native_permissions: PermissionProfile = sandbox
|
||||
.permissions
|
||||
.clone()
|
||||
.try_into()
|
||||
.expect("native sandbox permissions");
|
||||
assert_eq!(native_permissions, expected_permissions);
|
||||
assert_eq!(
|
||||
sandbox.cwd,
|
||||
Some(codex_utils_path_uri::PathUri::from_abs_path(&path))
|
||||
|
||||
Reference in new issue
Block a user