File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/app/server/src/providers Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -471,15 +471,22 @@ export class VertexAIProvider extends BaseProvider {
471471 }
472472
473473 private getServiceAccountCredentials ( ) : any {
474- const serviceAccountKey = process . env . GOOGLE_SERVICE_ACCOUNT_KEY ;
474+ const serviceAccountKeyEncoded =
475+ process . env . GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED ;
476+ // decode from base64
477+ const serviceAccountKey = Buffer . from (
478+ serviceAccountKeyEncoded ! ,
479+ 'base64'
480+ ) . toString ( 'utf-8' ) ;
481+
475482 if ( ! serviceAccountKey ) {
476483 return null ;
477484 }
478485
479486 try {
480487 return JSON . parse ( serviceAccountKey ) ;
481488 } catch ( error ) {
482- logger . error ( 'Failed to parse GOOGLE_SERVICE_ACCOUNT_KEY ' , error ) ;
489+ logger . error ( 'Failed to parse GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED ' , error ) ;
483490 return null ;
484491 }
485492 }
You can’t perform that action at this time.
0 commit comments