Skip to content

Commit b1d4bb7

Browse files
galdawavegemini-cli-robot
authored andcommitted
Enable network access in sandbox configuration (#24055)
1 parent c1af5ab commit b1d4bb7

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

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

Lines changed: 18 additions & 18 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
});
@@ -339,7 +339,7 @@ describe('loadSandboxConfig', () => {
339339
enabled: true,
340340
command: 'podman',
341341
allowedPaths: [],
342-
networkAccess: false,
342+
networkAccess: true,
343343
},
344344
},
345345
},
@@ -356,7 +356,7 @@ describe('loadSandboxConfig', () => {
356356
enabled: true,
357357
image: 'custom/image',
358358
allowedPaths: [],
359-
networkAccess: false,
359+
networkAccess: true,
360360
},
361361
},
362362
},
@@ -372,7 +372,7 @@ describe('loadSandboxConfig', () => {
372372
sandbox: {
373373
enabled: false,
374374
allowedPaths: [],
375-
networkAccess: false,
375+
networkAccess: true,
376376
},
377377
},
378378
},
@@ -388,7 +388,7 @@ describe('loadSandboxConfig', () => {
388388
sandbox: {
389389
enabled: true,
390390
allowedPaths: ['/settings-path'],
391-
networkAccess: false,
391+
networkAccess: true,
392392
},
393393
},
394394
},
@@ -410,7 +410,7 @@ describe('loadSandboxConfig', () => {
410410
expect(config).toEqual({
411411
enabled: true,
412412
allowedPaths: [],
413-
networkAccess: false,
413+
networkAccess: true,
414414
command: 'runsc',
415415
image: 'default/image',
416416
});
@@ -425,7 +425,7 @@ describe('loadSandboxConfig', () => {
425425
expect(config).toEqual({
426426
enabled: true,
427427
allowedPaths: [],
428-
networkAccess: false,
428+
networkAccess: true,
429429
command: 'runsc',
430430
image: 'default/image',
431431
});
@@ -442,7 +442,7 @@ describe('loadSandboxConfig', () => {
442442
expect(config).toEqual({
443443
enabled: true,
444444
allowedPaths: [],
445-
networkAccess: false,
445+
networkAccess: true,
446446
command: 'runsc',
447447
image: 'default/image',
448448
});
@@ -460,7 +460,7 @@ describe('loadSandboxConfig', () => {
460460
expect(config).toEqual({
461461
enabled: true,
462462
allowedPaths: [],
463-
networkAccess: false,
463+
networkAccess: true,
464464
command: 'runsc',
465465
image: 'default/image',
466466
});

packages/cli/src/config/sandboxConfig.ts

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

132132
let sandboxValue: boolean | string | null | undefined;
133133
let allowedPaths: string[] = [];
134-
let networkAccess = false;
134+
let networkAccess = true;
135135
let customImage: string | undefined;
136136

137137
if (
@@ -142,7 +142,7 @@ export async function loadSandboxConfig(
142142
const config = sandboxOption;
143143
sandboxValue = config.enabled ? (config.command ?? true) : false;
144144
allowedPaths = config.allowedPaths ?? [];
145-
networkAccess = config.networkAccess ?? false;
145+
networkAccess = config.networkAccess ?? true;
146146
customImage = config.image;
147147
} else if (typeof sandboxOption !== 'object' || sandboxOption === null) {
148148
sandboxValue = sandboxOption;

0 commit comments

Comments
 (0)