mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 21:14:35 -07:00
Disallow and suppress unsafe assignment (#19736)
This commit is contained in:
committed by
GitHub
parent
b746524a1b
commit
58d637f919
@@ -31,6 +31,7 @@ export function sanitizeAdminSettings(
|
||||
|
||||
if (sanitized.mcpSetting?.mcpConfigJson) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const parsed = JSON.parse(sanitized.mcpSetting.mcpConfigJson);
|
||||
const validationResult = McpConfigDefinitionSchema.safeParse(parsed);
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ export async function getExperiments(
|
||||
const expPath = process.env['GEMINI_EXP'];
|
||||
debugLogger.debug('Reading experiments from', expPath);
|
||||
const content = await fs.promises.readFile(expPath, 'utf8');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const response: ListExperimentsResponse = JSON.parse(content);
|
||||
if (
|
||||
(response.flags && !Array.isArray(response.flags)) ||
|
||||
|
||||
@@ -125,6 +125,7 @@ export class OAuthCredentialStorage {
|
||||
throw error;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const credentials: Credentials = JSON.parse(credsJson);
|
||||
|
||||
// Save to new storage
|
||||
|
||||
@@ -695,6 +695,7 @@ async function fetchAndCacheUserInfo(client: OAuth2Client): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const userInfo = await response.json();
|
||||
await userAccountManager.cacheGoogleAccount(userInfo.email);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user