Harden remote API security boundaries
This commit is contained in:
@@ -421,7 +421,7 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
|
||||
});
|
||||
selectedTarget = result.path;
|
||||
} else if (shouldCreateSelection) {
|
||||
await opencodeClient.createDirectory(target, { allowOutsideWorkspace: true });
|
||||
await opencodeClient.createDirectory(target);
|
||||
}
|
||||
const added = addProject(selectedTarget);
|
||||
if (!added) {
|
||||
|
||||
@@ -664,7 +664,7 @@ export const DirectoryTree: React.FC<DirectoryTreeProps> = ({
|
||||
const fullPath = `${creatingInPath}/${dirName}`;
|
||||
|
||||
try {
|
||||
await opencodeClient.createDirectory(fullPath, { allowOutsideWorkspace: true });
|
||||
await opencodeClient.createDirectory(fullPath);
|
||||
|
||||
const children = await loadDirectory(creatingInPath);
|
||||
const updateItems = (items: DirectoryItem[]): DirectoryItem[] => {
|
||||
|
||||
@@ -620,6 +620,9 @@ export const ProjectNotesTodoPanel: React.FC<ProjectNotesTodoPanelProps> = ({
|
||||
path: result.path,
|
||||
allowOutsideWorkspace: 'true',
|
||||
});
|
||||
if (result.outsideFileGrant) {
|
||||
params.set('outsideFileGrant', result.outsideFileGrant);
|
||||
}
|
||||
const response = await runtimeFetch(`/api/fs/read?${params.toString()}`, { cache: 'no-store' });
|
||||
if (!response.ok) {
|
||||
toast.error(t('rightSidebar.contextNotesTodo.toast.readPlanFileFailed'));
|
||||
|
||||
Reference in New Issue
Block a user