summaryrefslogtreecommitdiff
path: root/packages/core/src/code_assist/oauth2.ts
diff options
context:
space:
mode:
authorRichie Foreman <[email protected]>2025-08-17 12:43:21 -0400
committerGitHub <[email protected]>2025-08-17 16:43:21 +0000
commit2998f27f703282359f6389d1c2d8758fc6a14955 (patch)
treea7e3ff7f969c44e61ab27240cdd615e291b6deae /packages/core/src/code_assist/oauth2.ts
parentec1fa954d18ec9abab3ce669536dd24559a499f1 (diff)
chore(compiler): Enable strict property access TS compiler flag. (#6255)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/core/src/code_assist/oauth2.ts')
-rw-r--r--packages/core/src/code_assist/oauth2.ts13
1 files changed, 7 insertions, 6 deletions
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<boolean> {
async function authWithWeb(client: OAuth2Client): Promise<OauthWebLogin> {
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<number> {
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<number> {
async function loadCachedCredentials(client: OAuth2Client): Promise<boolean> {
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));