mirror of
https://github.com/openai/codex.git
synced 2026-11-04 00:24:43 +00:00
Use ApiPathString in app-server filesystem permission paths (#28367)
## Why Clients running an app-server on one OS and an exec-server on another OS need to be able to pass sandbox config to app-server that refers to resources on the executor's foreign OS. ## What `AbsolutePathBuf` can't represent these paths and we don't want users to be exposed to `PathUri` yet, so this moves the public app-server API to be expressed in terms of `ApiPathString`. Stacked on #28165. - change app-server v2 filesystem permission paths, including legacy read/write roots, to `ApiPathString` - localize API paths through `PathUri` when converting into the current native core permission types - make path-bearing permission conversions fallible and surface localization failures instead of silently treating malformed grants as ordinary denials - propagate conversion failures through app-server and TUI approval handling - regenerate the app-server JSON and TypeScript schemas - leave migration TODOs on native-path conversions so they can be removed once core permission paths use `PathUri`
This commit is contained in:
1 parent
d959664420
commit
ecfe174d5f
34 files changed
+546
-233
No files matched your search
@@ -89,6 +89,8 @@ fn app_server_exec_approval_request_preserves_permissions_context() {
|
||||
.expect("absolute read path");
|
||||
let write_path = AbsolutePathBuf::try_from(PathBuf::from(test_path_display("/tmp/write")))
|
||||
.expect("absolute write path");
|
||||
let read_api_path = ApiPathString::from_abs_path(&read_path);
|
||||
let write_api_path = ApiPathString::from_abs_path(&write_path);
|
||||
let request = exec_approval_request_from_params(
|
||||
AppServerCommandExecutionRequestApprovalParams {
|
||||
thread_id: "thread-1".to_string(),
|
||||
@@ -109,8 +111,8 @@ fn app_server_exec_approval_request_preserves_permissions_context() {
|
||||
enabled: Some(true),
|
||||
}),
|
||||
file_system: Some(AppServerAdditionalFileSystemPermissions {
|
||||
read: Some(vec![read_path.clone()]),
|
||||
write: Some(vec![write_path.clone()]),
|
||||
read: Some(vec![read_api_path.clone()]),
|
||||
write: Some(vec![write_api_path.clone()]),
|
||||
glob_scan_max_depth: None,
|
||||
entries: None,
|
||||
}),
|
||||
@@ -136,8 +138,8 @@ fn app_server_exec_approval_request_preserves_permissions_context() {
|
||||
enabled: Some(true),
|
||||
}),
|
||||
file_system: Some(AppServerAdditionalFileSystemPermissions {
|
||||
read: Some(vec![read_path]),
|
||||
write: Some(vec![write_path]),
|
||||
read: Some(vec![read_api_path]),
|
||||
write: Some(vec![write_api_path]),
|
||||
glob_scan_max_depth: None,
|
||||
entries: None,
|
||||
}),
|
||||
@@ -274,6 +276,8 @@ fn app_server_request_permissions_preserves_file_system_permissions() {
|
||||
.expect("absolute read path");
|
||||
let write_path = AbsolutePathBuf::try_from(PathBuf::from(test_path_display("/tmp/write")))
|
||||
.expect("absolute write path");
|
||||
let read_api_path = ApiPathString::from_abs_path(&read_path);
|
||||
let write_api_path = ApiPathString::from_abs_path(&write_path);
|
||||
let cwd =
|
||||
AbsolutePathBuf::try_from(PathBuf::from(test_path_display("/tmp"))).expect("absolute cwd");
|
||||
|
||||
@@ -290,13 +294,14 @@ fn app_server_request_permissions_preserves_file_system_permissions() {
|
||||
enabled: Some(true),
|
||||
}),
|
||||
file_system: Some(AppServerAdditionalFileSystemPermissions {
|
||||
read: Some(vec![read_path.clone()]),
|
||||
write: Some(vec![write_path.clone()]),
|
||||
read: Some(vec![read_api_path]),
|
||||
write: Some(vec![write_api_path]),
|
||||
glob_scan_max_depth: None,
|
||||
entries: None,
|
||||
}),
|
||||
},
|
||||
});
|
||||
})
|
||||
.expect("API paths should convert to native paths");
|
||||
|
||||
assert_eq!(
|
||||
request.permissions,
|
||||
|
||||
Reference in new issue
Block a user