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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps)!: upgrade node-gtoken to 7.0.0 #1590

Merged
merged 5 commits into from
Jul 12, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ecdsa-sig-formatter": "^1.0.11",
"gaxios": "^5.0.0",
"gcp-metadata": "^5.3.0",
"gtoken": "^6.1.0",
"gtoken": "^7.0.0",
"jws": "^4.0.0",
"lru-cache": "^6.0.0"
},
Expand Down
57 changes: 0 additions & 57 deletions test/test.googleauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2544,25 +2544,6 @@ describe('googleauth', () => {
scope.done();
assert.strictEqual('http://foo', (jwt as JWT).gtoken!.scope);
});
it('allows client to be instantiated from p12 key file', async () => {
const auth = new GoogleAuth({
keyFile: P12_PATH,
clientOptions: {
scopes: 'http://foo',
email: 'foo@serviceaccount.com',
subject: 'bar@subjectaccount.com',
},
});
const jwt = await auth.getClient();
const scope = createGTokenMock({access_token: 'initial-access-token'});
const headers = await jwt.getRequestHeaders();
assert.deepStrictEqual(
headers.Authorization,
'Bearer initial-access-token'
);
scope.done();
assert.strictEqual('http://foo', (jwt as JWT).gtoken!.scope);
});

// Allows a client to be instantiated from a certificate,
// See: https://github.com/googleapis/google-auth-library-nodejs/issues/808
Expand All @@ -2585,25 +2566,6 @@ describe('googleauth', () => {
scope.done();
assert.strictEqual('http://foo', (jwt as JWT).gtoken!.scope);
});
it('allows client to be instantiated from p12 key file', async () => {
const auth = new GoogleAuth({
keyFile: P12_PATH,
clientOptions: {
scopes: 'http://foo',
email: 'foo@serviceaccount.com',
subject: 'bar@subjectaccount.com',
},
});
const jwt = await auth.getClient();
const scope = createGTokenMock({access_token: 'initial-access-token'});
const headers = await jwt.getRequestHeaders();
assert.deepStrictEqual(
headers.Authorization,
'Bearer initial-access-token'
);
scope.done();
assert.strictEqual('http://foo', (jwt as JWT).gtoken!.scope);
});

// Allows a client to be instantiated from a certificate,
// See: https://github.com/googleapis/google-auth-library-nodejs/issues/808
Expand All @@ -2626,23 +2588,4 @@ describe('googleauth', () => {
scope.done();
assert.strictEqual('http://foo', (jwt as JWT).gtoken!.scope);
});
it('allows client to be instantiated from p12 key file', async () => {
const auth = new GoogleAuth({
keyFile: P12_PATH,
clientOptions: {
scopes: 'http://foo',
email: 'foo@serviceaccount.com',
subject: 'bar@subjectaccount.com',
},
});
const jwt = await auth.getClient();
const scope = createGTokenMock({access_token: 'initial-access-token'});
const headers = await jwt.getRequestHeaders();
assert.deepStrictEqual(
headers.Authorization,
'Bearer initial-access-token'
);
scope.done();
assert.strictEqual('http://foo', (jwt as JWT).gtoken!.scope);
});
});
7 changes: 0 additions & 7 deletions test/test.jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,13 +721,6 @@ describe('jwt', () => {
assert.strictEqual(private_key, PEM_CONTENTS);
});

it('getCredentials should handle a p12 keyFile', async () => {
const jwt = new JWT({keyFile: P12_PATH});
const {private_key, client_email} = await jwt.getCredentials();
assert(private_key);
assert.strictEqual(client_email, undefined);
});

it('getCredentials should handle a json keyFile', async () => {
const jwt = new JWT();
jwt.fromJSON(json);
Expand Down