Disallow and suppress unsafe assignment (#19736)

This commit is contained in:
Christian Gunderman
2026-02-20 22:28:55 +00:00
committed by GitHub
parent b746524a1b
commit 58d637f919
71 changed files with 149 additions and 22 deletions
@@ -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
+1
View File
@@ -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) {