New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add useJWTAccessAlways and defaultServicePath variable #1204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two places I notice where we set defaultScopes but don't set client.useJWTAccessAlways = this.useJWTAccessAlways;
:
credential.defaultScopes = this.defaultScopes; |
and
credential.defaultScopes = this.defaultScopes; |
I was also concerned by:
Where I notice you set useJWTAccessAlways
, but we miss populating defaultScopes
. Should we be setting defaultScopes
here, or I wonder did we already set it in a related code path so we don't need to? we should probably double check.
To help protect future generations from having hiccups like these, why don't we add a private helper:
setAdditionalJWTConfig
or something along those lines, which always sets all three variables?
src/auth/googleauth.ts
Outdated
@@ -583,6 +591,8 @@ export class GoogleAuth { | |||
options = options || {}; | |||
const client = new JWT(options); | |||
client.fromAPIKey(apiKey); | |||
client.defaultServicePath = this.defaultServicePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a special edge case where we don't need to set useJWTAccessAlways
, where we're providing an explicit API key to use (which I'm betting is why we don't set defaultServicePath either).
Piecemeal version of #1196