File tree Expand file tree Collapse file tree 4 files changed +13
-9
lines changed
Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 4242 with :
4343 node-version : 20
4444 cache : pnpm
45- # Setup gcloud application default credentials. While the credentials are not actually
46- # used because Google api services are stubbed, instantiating any of the Google node
47- # clients requires the credentials file to exist and be valid.
48- - uses : " google-github-actions/auth@v2"
49- with :
50- credentials_json : " ${{ secrets.GCP_CREDENTIALS }}"
51- - uses : google-github-actions/setup-gcloud@v2
52- with :
53- version : " >= 363.0.0"
5445 - run : pnpm install --frozen-lockfile
5546 - run : pnpm run e2e
Original file line number Diff line number Diff line change 3535 "exponential-backoff" : " 3.1.1" ,
3636 "extract-zip" : " ^2.0.1" ,
3737 "gcp-metadata" : " ^6.0.0" ,
38+ "google-auth-library" : " ^9.15.0" ,
3839 "nodemailer" : " ^6.7.8" ,
3940 "reflect-metadata" : " ^0.2.2" ,
4041 "rxjs" : " 7.8.1" ,
Original file line number Diff line number Diff line change 11import { SecretManagerServiceClient } from "@google-cloud/secret-manager" ;
22import { Injectable } from "@nestjs/common" ;
33import gcpMetadata from "gcp-metadata" ;
4+ import type { JSONClient } from "google-auth-library/build/src/auth/googleauth" ;
45
56@Injectable ( )
67export class SecretsClient {
@@ -15,6 +16,14 @@ export class SecretsClient {
1516 fallback : "rest" ,
1617 protocol : "http" ,
1718 port : Number ( process . env . SECRET_MANAGER_PORT ) ,
19+ // Create a fake auth client to bypass checking for default credentials
20+ authClient : {
21+ getRequestHeaders (
22+ url ?: string
23+ ) : Promise < { [ index : string ] : string } > {
24+ return Promise . resolve ( { } ) ;
25+ } ,
26+ } as JSONClient ,
1827 } ) ;
1928 } else {
2029 this . googleSecretsClient = new SecretManagerServiceClient ( ) ;
You can’t perform that action at this time.
0 commit comments