Skip to content

Commit 206b6fb

Browse files
authored
Merge branch 'main' into owl-bot-update-lock-d920257482ca1cd72978f29f7d28765a9f8c758c21ee0708234db5cf4c5016c2
2 parents b6dbeef + ca8c1f0 commit 206b6fb

File tree

9 files changed

+36
-18
lines changed

9 files changed

+36
-18
lines changed

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
[1]: https://www.npmjs.com/package/google-auth-library?activeTab=versions
66

7+
## [9.11.0](https://github.com/googleapis/google-auth-library-nodejs/compare/v9.10.0...v9.11.0) (2024-06-01)
8+
9+
10+
### Features
11+
12+
* Adding support of client authentication method. ([#1814](https://github.com/googleapis/google-auth-library-nodejs/issues/1814)) ([4a14e8c](https://github.com/googleapis/google-auth-library-nodejs/commit/4a14e8c3bdcfa9d8531a231b00b946728530ce12))
13+
714
## [9.10.0](https://github.com/googleapis/google-auth-library-nodejs/compare/v9.9.0...v9.10.0) (2024-05-10)
815

916

Diff for: browser-test/test.oauth2.ts

-3
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,8 @@ describe('Browser OAuth2 tests', () => {
160160
'}';
161161
const envelope = JSON.stringify({kid: 'keyid', alg: 'RS256'});
162162
let data =
163-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
164163
base64js.fromByteArray(new TextEncoder().encode(envelope)) +
165164
'.' +
166-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
167165
base64js.fromByteArray(new TextEncoder().encode(idToken));
168166
const algo = {
169167
name: 'RSASSA-PKCS1-v1_5',
@@ -181,7 +179,6 @@ describe('Browser OAuth2 tests', () => {
181179
const signature = await window.crypto.subtle.sign(
182180
algo,
183181
cryptoKey,
184-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
185182
new TextEncoder().encode(data)
186183
);
187184
data += '.' + base64js.fromByteArray(new Uint8Array(signature));

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "google-auth-library",
3-
"version": "9.10.0",
3+
"version": "9.11.0",
44
"author": "Google Inc.",
55
"description": "Google APIs Authentication Client Library for Node.js",
66
"engines": {

Diff for: samples/oauth2-codeVerifier.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ const open = require('open');
2020
const destroyer = require('server-destroy');
2121

2222
// Download your OAuth2 configuration from the Google Developer Console.
23-
const keys = require('./oauth2.keys.json');
23+
/**
24+
* @example
25+
* require('./oauth2.keys.json');
26+
*/
27+
const keys = {};
2428

2529
/**
2630
* Start by acquiring a pre-authenticated oAuth2 client.

Diff for: samples/oauth2.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ const open = require('open');
2020
const destroyer = require('server-destroy');
2121

2222
// Download your OAuth2 configuration from the Google
23-
const keys = require('./oauth2.keys.json');
23+
/**
24+
* @example
25+
* require('./oauth2.keys.json');
26+
*/
27+
const keys = {};
2428

2529
/**
2630
* Start by acquiring a pre-authenticated oAuth2 client.

Diff for: samples/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@google-cloud/storage": "^7.0.0",
1717
"@googleapis/iam": "^18.0.0",
18-
"google-auth-library": "^9.10.0",
18+
"google-auth-library": "^9.11.0",
1919
"node-fetch": "^2.3.0",
2020
"open": "^9.0.0",
2121
"server-destroy": "^1.0.1"

Diff for: samples/puppeteer/oauth2-test.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018, Google, LLC
1+
// Copyright 2018 Google LLC
22
// Licensed under the Apache License, Version 2.0 (the "License");
33
// you may not use this file except in compliance with the License.
44
// You may obtain a copy of the License at
@@ -22,7 +22,11 @@ const puppeteer = require('puppeteer');
2222
const url = require('url');
2323
const http = require('http');
2424

25-
const keys = require('../oauth2.keys.json');
25+
/**
26+
* @example
27+
* require('../oauth2.keys.json');
28+
*/
29+
const keys = {};
2630

2731
/**
2832
* Keep a config.keys.json with a username and password
@@ -31,8 +35,11 @@ const keys = require('../oauth2.keys.json');
3135
* "username": "your-user-name@gmail.com",
3236
* "password": "your-password"
3337
* }
38+
*
39+
* @example
40+
* require('../config.keys.json');
3441
*/
35-
const config = require('../config.keys.json');
42+
const config = {};
3643

3744
async function main() {
3845
const oAuth2Client = await getAuthenticatedClient();

Diff for: samples/verifyIdToken.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ const open = require('open');
2020
const destroyer = require('server-destroy');
2121

2222
// Download your OAuth2 configuration from the Google
23-
const keys = require('./oauth2.keys.json');
23+
/**
24+
* @example
25+
* require('./oauth2.keys.json');
26+
*/
27+
const keys = {};
2428

2529
/**
2630
* Start by acquiring a pre-authenticated oAuth2 client.

Diff for: src/crypto/browser/crypto.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export class BrowserCrypto implements Crypto {
3939

4040
// To calculate SHA256 digest using SubtleCrypto, we first
4141
// need to convert an input string to an ArrayBuffer:
42-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
4342
const inputBuffer = new TextEncoder().encode(str);
4443

4544
// Result is ArrayBuffer as well.
@@ -74,7 +73,7 @@ export class BrowserCrypto implements Crypto {
7473
name: 'RSASSA-PKCS1-v1_5',
7574
hash: {name: 'SHA-256'},
7675
};
77-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
76+
7877
const dataArray = new TextEncoder().encode(data);
7978
const signatureArray = base64js.toByteArray(
8079
BrowserCrypto.padBase64(signature)
@@ -103,7 +102,7 @@ export class BrowserCrypto implements Crypto {
103102
name: 'RSASSA-PKCS1-v1_5',
104103
hash: {name: 'SHA-256'},
105104
};
106-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
105+
107106
const dataArray = new TextEncoder().encode(data);
108107
const cryptoKey = await window.crypto.subtle.importKey(
109108
'jwk',
@@ -121,13 +120,11 @@ export class BrowserCrypto implements Crypto {
121120

122121
decodeBase64StringUtf8(base64: string): string {
123122
const uint8array = base64js.toByteArray(BrowserCrypto.padBase64(base64));
124-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
125123
const result = new TextDecoder().decode(uint8array);
126124
return result;
127125
}
128126

129127
encodeBase64StringUtf8(text: string): string {
130-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
131128
const uint8array = new TextEncoder().encode(text);
132129
const result = base64js.fromByteArray(uint8array);
133130
return result;
@@ -145,7 +142,6 @@ export class BrowserCrypto implements Crypto {
145142

146143
// To calculate SHA256 digest using SubtleCrypto, we first
147144
// need to convert an input string to an ArrayBuffer:
148-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
149145
const inputBuffer = new TextEncoder().encode(str);
150146

151147
// Result is ArrayBuffer as well.
@@ -175,7 +171,6 @@ export class BrowserCrypto implements Crypto {
175171
? key
176172
: String.fromCharCode(...new Uint16Array(key));
177173

178-
// eslint-disable-next-line node/no-unsupported-features/node-builtins
179174
const enc = new TextEncoder();
180175
const cryptoKey = await window.crypto.subtle.importKey(
181176
'raw',

0 commit comments

Comments
 (0)