mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 02:24:09 -07:00
feat(admin): apply MCP allowlist to extensions & gemini mcp list command (#18442)
This commit is contained in:
@@ -1511,7 +1511,7 @@ describe('loadCliConfig with admin.mcp.config', () => {
|
||||
});
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
|
||||
const mergedServers = config.getMcpServers();
|
||||
const mergedServers = config.getMcpServers() ?? {};
|
||||
expect(mergedServers).toHaveProperty('serverA');
|
||||
expect(mergedServers).not.toHaveProperty('serverB');
|
||||
});
|
||||
@@ -1569,9 +1569,9 @@ describe('loadCliConfig with admin.mcp.config', () => {
|
||||
});
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
|
||||
const mergedServers = config.getMcpServers();
|
||||
const mergedServers = config.getMcpServers() ?? {};
|
||||
expect(mergedServers).not.toHaveProperty('serverC');
|
||||
expect(Object.keys(mergedServers || {})).toHaveLength(0);
|
||||
expect(Object.keys(mergedServers)).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should merge local fields and prefer admin tool filters', async () => {
|
||||
@@ -1601,7 +1601,7 @@ describe('loadCliConfig with admin.mcp.config', () => {
|
||||
});
|
||||
const config = await loadCliConfig(settings, 'test-session', argv);
|
||||
|
||||
const serverA = config.getMcpServers()?.['serverA'];
|
||||
const serverA = (config.getMcpServers() ?? {})['serverA'];
|
||||
expect(serverA).toMatchObject({
|
||||
timeout: 1234,
|
||||
includeTools: ['admin_tool'],
|
||||
|
||||
Reference in New Issue
Block a user