Skip to content

Commit

Permalink
fix: use updated variable name for self-signed JWTs (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl authored Aug 13, 2021
1 parent d77617c commit ef41fe5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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://github.com/googleapis/google-auth-library-nodejs/issues/1204)) ([79e100e](https://github.com/googleapis/google-auth-library-nodejs/commit/79e100e9ddc64f34e34d0e91c8188f1818e33a1c))
* add useJWTAccessWithScope and defaultServicePath variable ([#1204](https://github.com/googleapis/google-auth-library-nodejs/issues/1204)) ([79e100e](https://github.com/googleapis/google-auth-library-nodejs/commit/79e100e9ddc64f34e34d0e91c8188f1818e33a1c))

## [7.2.0](https://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

0 comments on commit ef41fe5

Please sign in to comment.