mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
feat(core): populate sandbox forbidden paths with project ignore file contents (#24038)
This commit is contained in:
@@ -274,7 +274,10 @@ describe('SandboxManager Integration', () => {
|
||||
try {
|
||||
const osManager = createSandboxManager(
|
||||
{ enabled: true },
|
||||
{ workspace: tempWorkspace, forbiddenPaths: [forbiddenDir] },
|
||||
{
|
||||
workspace: tempWorkspace,
|
||||
forbiddenPaths: async () => [forbiddenDir],
|
||||
},
|
||||
);
|
||||
const { command, args } = Platform.touch(testFile);
|
||||
|
||||
@@ -306,7 +309,10 @@ describe('SandboxManager Integration', () => {
|
||||
try {
|
||||
const osManager = createSandboxManager(
|
||||
{ enabled: true },
|
||||
{ workspace: tempWorkspace, forbiddenPaths: [forbiddenDir] },
|
||||
{
|
||||
workspace: tempWorkspace,
|
||||
forbiddenPaths: async () => [forbiddenDir],
|
||||
},
|
||||
);
|
||||
const { command, args } = Platform.cat(nestedFile);
|
||||
|
||||
@@ -335,7 +341,10 @@ describe('SandboxManager Integration', () => {
|
||||
try {
|
||||
const osManager = createSandboxManager(
|
||||
{ enabled: true },
|
||||
{ workspace: tempWorkspace, forbiddenPaths: [conflictDir] },
|
||||
{
|
||||
workspace: tempWorkspace,
|
||||
forbiddenPaths: async () => [conflictDir],
|
||||
},
|
||||
);
|
||||
const { command, args } = Platform.touch(testFile);
|
||||
|
||||
@@ -365,7 +374,10 @@ describe('SandboxManager Integration', () => {
|
||||
try {
|
||||
const osManager = createSandboxManager(
|
||||
{ enabled: true },
|
||||
{ workspace: tempWorkspace, forbiddenPaths: [nonExistentPath] },
|
||||
{
|
||||
workspace: tempWorkspace,
|
||||
forbiddenPaths: async () => [nonExistentPath],
|
||||
},
|
||||
);
|
||||
const { command, args } = Platform.echo('survived');
|
||||
const sandboxed = await osManager.prepareCommand({
|
||||
@@ -397,7 +409,10 @@ describe('SandboxManager Integration', () => {
|
||||
try {
|
||||
const osManager = createSandboxManager(
|
||||
{ enabled: true },
|
||||
{ workspace: tempWorkspace, forbiddenPaths: [nonExistentFile] },
|
||||
{
|
||||
workspace: tempWorkspace,
|
||||
forbiddenPaths: async () => [nonExistentFile],
|
||||
},
|
||||
);
|
||||
|
||||
// We use touch to attempt creation of the file
|
||||
@@ -436,7 +451,10 @@ describe('SandboxManager Integration', () => {
|
||||
try {
|
||||
const osManager = createSandboxManager(
|
||||
{ enabled: true },
|
||||
{ workspace: tempWorkspace, forbiddenPaths: [symlinkFile] },
|
||||
{
|
||||
workspace: tempWorkspace,
|
||||
forbiddenPaths: async () => [symlinkFile],
|
||||
},
|
||||
);
|
||||
|
||||
// Attempt to read the target file directly
|
||||
|
||||
Reference in New Issue
Block a user