🗝️ refactor: loadServiceKey to Support Stringified JSON and Env Var Renaming (#8317)

* feat: Enhance loadServiceKey to support stringified JSON input

* chore: Update GOOGLE_SERVICE_KEY_FILE_PATH to GOOGLE_SERVICE_KEY_FILE for consistency
This commit is contained in:
Danny Avila 2025-07-08 21:07:33 -04:00 committed by GitHub
parent e57fc83d40
commit 7e37211458
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 112 additions and 7 deletions

View file

@ -25,7 +25,7 @@ const initializeClient = async ({ req, res, endpointOption, overrideModel, optio
/** Only attempt to load service key if GOOGLE_KEY is not provided */
try {
const serviceKeyPath =
process.env.GOOGLE_SERVICE_KEY_FILE_PATH ||
process.env.GOOGLE_SERVICE_KEY_FILE ||
path.join(__dirname, '../../../..', 'data', 'auth.json');
serviceKey = await loadServiceKey(serviceKeyPath);
if (!serviceKey) {