Skip to content

Commit 38431fd

Browse files
galdawavegemini-cli-robot
authored andcommitted
Enable network access in sandbox configuration (#24055)
# Conflicts: # packages/cli/src/config/sandboxConfig.test.ts
1 parent fdf3019 commit 38431fd

2 files changed

Lines changed: 35 additions & 16 deletions

File tree

packages/cli/src/config/sandboxConfig.test.ts

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('loadSandboxConfig', () => {
9393
expect(config).toEqual({
9494
enabled: true,
9595
allowedPaths: [],
96-
networkAccess: false,
96+
networkAccess: true,
9797
command: 'docker',
9898
image: 'default/image',
9999
});
@@ -122,7 +122,7 @@ describe('loadSandboxConfig', () => {
122122
expect(config).toEqual({
123123
enabled: true,
124124
allowedPaths: [],
125-
networkAccess: false,
125+
networkAccess: true,
126126
command: 'lxc',
127127
image: 'default/image',
128128
});
@@ -148,7 +148,7 @@ describe('loadSandboxConfig', () => {
148148
expect(config).toEqual({
149149
enabled: true,
150150
allowedPaths: [],
151-
networkAccess: false,
151+
networkAccess: true,
152152
command: 'sandbox-exec',
153153
image: 'default/image',
154154
});
@@ -161,7 +161,7 @@ describe('loadSandboxConfig', () => {
161161
expect(config).toEqual({
162162
enabled: true,
163163
allowedPaths: [],
164-
networkAccess: false,
164+
networkAccess: true,
165165
command: 'sandbox-exec',
166166
image: 'default/image',
167167
});
@@ -174,7 +174,7 @@ describe('loadSandboxConfig', () => {
174174
expect(config).toEqual({
175175
enabled: true,
176176
allowedPaths: [],
177-
networkAccess: false,
177+
networkAccess: true,
178178
command: 'docker',
179179
image: 'default/image',
180180
});
@@ -187,7 +187,7 @@ describe('loadSandboxConfig', () => {
187187
expect(config).toEqual({
188188
enabled: true,
189189
allowedPaths: [],
190-
networkAccess: false,
190+
networkAccess: true,
191191
command: 'podman',
192192
image: 'default/image',
193193
});
@@ -210,7 +210,7 @@ describe('loadSandboxConfig', () => {
210210
expect(config).toEqual({
211211
enabled: true,
212212
allowedPaths: [],
213-
networkAccess: false,
213+
networkAccess: true,
214214
command: 'podman',
215215
image: 'default/image',
216216
});
@@ -244,7 +244,7 @@ describe('loadSandboxConfig', () => {
244244
expect(config).toEqual({
245245
enabled: true,
246246
allowedPaths: [],
247-
networkAccess: false,
247+
networkAccess: true,
248248
command: 'docker',
249249
image: 'env/image',
250250
});
@@ -257,7 +257,7 @@ describe('loadSandboxConfig', () => {
257257
expect(config).toEqual({
258258
enabled: true,
259259
allowedPaths: [],
260-
networkAccess: false,
260+
networkAccess: true,
261261
command: 'docker',
262262
image: 'default/image',
263263
});
@@ -285,7 +285,7 @@ describe('loadSandboxConfig', () => {
285285
expect(config).toEqual({
286286
enabled: true,
287287
allowedPaths: [],
288-
networkAccess: false,
288+
networkAccess: true,
289289
command: 'docker',
290290
image: 'default/image',
291291
});
@@ -338,6 +338,11 @@ describe('loadSandboxConfig', () => {
338338
sandbox: {
339339
enabled: true,
340340
command: 'podman',
341+
<<<<<<< HEAD
342+
=======
343+
allowedPaths: [],
344+
networkAccess: true,
345+
>>>>>>> 765fb6701 (Enable network access in sandbox configuration (#24055))
341346
},
342347
},
343348
},
@@ -353,6 +358,11 @@ describe('loadSandboxConfig', () => {
353358
sandbox: {
354359
enabled: true,
355360
image: 'custom/image',
361+
<<<<<<< HEAD
362+
=======
363+
allowedPaths: [],
364+
networkAccess: true,
365+
>>>>>>> 765fb6701 (Enable network access in sandbox configuration (#24055))
356366
},
357367
},
358368
},
@@ -367,6 +377,11 @@ describe('loadSandboxConfig', () => {
367377
tools: {
368378
sandbox: {
369379
enabled: false,
380+
<<<<<<< HEAD
381+
=======
382+
allowedPaths: [],
383+
networkAccess: true,
384+
>>>>>>> 765fb6701 (Enable network access in sandbox configuration (#24055))
370385
},
371386
},
372387
},
@@ -382,6 +397,10 @@ describe('loadSandboxConfig', () => {
382397
sandbox: {
383398
enabled: true,
384399
allowedPaths: ['/settings-path'],
400+
<<<<<<< HEAD
401+
=======
402+
networkAccess: true,
403+
>>>>>>> 765fb6701 (Enable network access in sandbox configuration (#24055))
385404
},
386405
},
387406
},
@@ -403,7 +422,7 @@ describe('loadSandboxConfig', () => {
403422
expect(config).toEqual({
404423
enabled: true,
405424
allowedPaths: [],
406-
networkAccess: false,
425+
networkAccess: true,
407426
command: 'runsc',
408427
image: 'default/image',
409428
});
@@ -418,7 +437,7 @@ describe('loadSandboxConfig', () => {
418437
expect(config).toEqual({
419438
enabled: true,
420439
allowedPaths: [],
421-
networkAccess: false,
440+
networkAccess: true,
422441
command: 'runsc',
423442
image: 'default/image',
424443
});
@@ -435,7 +454,7 @@ describe('loadSandboxConfig', () => {
435454
expect(config).toEqual({
436455
enabled: true,
437456
allowedPaths: [],
438-
networkAccess: false,
457+
networkAccess: true,
439458
command: 'runsc',
440459
image: 'default/image',
441460
});
@@ -453,7 +472,7 @@ describe('loadSandboxConfig', () => {
453472
expect(config).toEqual({
454473
enabled: true,
455474
allowedPaths: [],
456-
networkAccess: false,
475+
networkAccess: true,
457476
command: 'runsc',
458477
image: 'default/image',
459478
});

packages/cli/src/config/sandboxConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export async function loadSandboxConfig(
123123

124124
let sandboxValue: boolean | string | null | undefined;
125125
let allowedPaths: string[] = [];
126-
let networkAccess = false;
126+
let networkAccess = true;
127127
let customImage: string | undefined;
128128

129129
if (
@@ -134,7 +134,7 @@ export async function loadSandboxConfig(
134134
const config = sandboxOption;
135135
sandboxValue = config.enabled ? (config.command ?? true) : false;
136136
allowedPaths = config.allowedPaths ?? [];
137-
networkAccess = config.networkAccess ?? false;
137+
networkAccess = config.networkAccess ?? true;
138138
customImage = config.image;
139139
} else if (typeof sandboxOption !== 'object' || sandboxOption === null) {
140140
sandboxValue = sandboxOption;

0 commit comments

Comments
 (0)