From 2998f27f703282359f6389d1c2d8758fc6a14955 Mon Sep 17 00:00:00 2001 From: Richie Foreman Date: Sun, 17 Aug 2025 12:43:21 -0400 Subject: chore(compiler): Enable strict property access TS compiler flag. (#6255) Co-authored-by: Jacob Richman --- packages/core/src/code_assist/oauth2.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'packages/core/src/code_assist/oauth2.ts') diff --git a/packages/core/src/code_assist/oauth2.ts b/packages/core/src/code_assist/oauth2.ts index f9518cbe..a4dcf8a7 100644 --- a/packages/core/src/code_assist/oauth2.ts +++ b/packages/core/src/code_assist/oauth2.ts @@ -81,11 +81,11 @@ async function initOauthClient( }); if ( - process.env.GOOGLE_GENAI_USE_GCA && - process.env.GOOGLE_CLOUD_ACCESS_TOKEN + process.env['GOOGLE_GENAI_USE_GCA'] && + process.env['GOOGLE_CLOUD_ACCESS_TOKEN'] ) { client.setCredentials({ - access_token: process.env.GOOGLE_CLOUD_ACCESS_TOKEN, + access_token: process.env['GOOGLE_CLOUD_ACCESS_TOKEN'], }); await fetchAndCacheUserInfo(client); return client; @@ -248,7 +248,7 @@ async function authWithUserCode(client: OAuth2Client): Promise { async function authWithWeb(client: OAuth2Client): Promise { const port = await getAvailablePort(); // The hostname used for the HTTP server binding (e.g., '0.0.0.0' in Docker). - const host = process.env.OAUTH_CALLBACK_HOST || 'localhost'; + const host = process.env['OAUTH_CALLBACK_HOST'] || 'localhost'; // The `redirectUri` sent to Google's authorization server MUST use a loopback IP literal // (i.e., 'localhost' or '127.0.0.1'). This is a strict security policy for credentials of // type 'Desktop app' or 'Web application' (when using loopback flow) to mitigate @@ -323,7 +323,7 @@ export function getAvailablePort(): Promise { return new Promise((resolve, reject) => { let port = 0; try { - const portStr = process.env.OAUTH_CALLBACK_PORT; + const portStr = process.env['OAUTH_CALLBACK_PORT']; if (portStr) { port = parseInt(portStr, 10); if (isNaN(port) || port <= 0 || port > 65535) { @@ -353,7 +353,8 @@ export function getAvailablePort(): Promise { async function loadCachedCredentials(client: OAuth2Client): Promise { try { const keyFile = - process.env.GOOGLE_APPLICATION_CREDENTIALS || getCachedCredentialPath(); + process.env['GOOGLE_APPLICATION_CREDENTIALS'] || + getCachedCredentialPath(); const creds = await fs.readFile(keyFile, 'utf-8'); client.setCredentials(JSON.parse(creds)); -- cgit v1.2.3