Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use updated variable name for self-signed JWTs #1233

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

### Features

* add useJWTAccessAlways and defaultServicePath variable ([#1204](https://www.github.com/googleapis/google-auth-library-nodejs/issues/1204)) ([79e100e](https://www.github.com/googleapis/google-auth-library-nodejs/commit/79e100e9ddc64f34e34d0e91c8188f1818e33a1c))
* add useJWTAccessWithScope and defaultServicePath variable ([#1204](https://www.github.com/googleapis/google-auth-library-nodejs/issues/1204)) ([79e100e](https://www.github.com/googleapis/google-auth-library-nodejs/commit/79e100e9ddc64f34e34d0e91c8188f1818e33a1c))

## [7.2.0](https://www.github.com/googleapis/google-auth-library-nodejs/compare/v7.1.2...v7.2.0) (2021-06-30)

Expand Down
4 changes: 2 additions & 2 deletions src/auth/googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class GoogleAuth {
* @private
*/
private checkIsGCE?: boolean = undefined;
useJWTAccessAlways?: boolean;
useJWTAccessWithScope?: boolean;
defaultServicePath?: string;

// Note: this properly is only public to satisify unit tests.
Expand Down Expand Up @@ -165,7 +165,7 @@ export class GoogleAuth {
// and sign the JWT with the correct audience and scopes (if not supplied).
setGapicJWTValues(client: JWT) {
client.defaultServicePath = this.defaultServicePath;
client.useJWTAccessAlways = this.useJWTAccessAlways;
client.useJWTAccessWithScope = this.useJWTAccessWithScope;
client.defaultScopes = this.defaultScopes;
}

Expand Down
2 changes: 1 addition & 1 deletion src/auth/jwtclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class JWT extends OAuth2Client implements IdTokenProvider {
subject?: string;
gtoken?: GoogleToken;
additionalClaims?: {};
useJWTAccessAlways?: boolean;
useJWTAccessWithScope?: boolean;
defaultServicePath?: string;
private access?: JWTAccess;

Expand Down
6 changes: 3 additions & 3 deletions test/test.googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,11 @@ describe('googleauth', () => {
const result = auth.fromJSON(json);
assert.strictEqual(undefined, (result as JWT).scopes);
});
it('fromJSON should set useJWTAccessAlways with private key', () => {
auth.useJWTAccessAlways = true;
it('fromJSON should set useJWTAccessWithScope with private key', () => {
auth.useJWTAccessWithScope = true;
const json = createJwtJSON();
const result = auth.fromJSON(json);
assert.ok((result as JWT).useJWTAccessAlways);
assert.ok((result as JWT).useJWTAccessWithScope);
});

it('fromJSON should set default service path with private key', () => {
Expand Down