Harden remote API security boundaries

This commit is contained in:
Bohdan Triapitsyn
2026-06-12 18:24:07 +03:00
parent c281937406
commit 106b31a407
52 changed files with 1582 additions and 579 deletions
@@ -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'));