Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit a511e56

Browse files
renovate-botd-goog
andauthored
chore(deps): update dependency gts to v6 (#1886)
* chore(deps): update dependency gts to v6 * style: lint fix * chore: update config * chore: lint * chore: clean-up * style: lint * chore: clean-up internal --------- Co-authored-by: Daniel Bankhead <danielbankhead@google.com>
1 parent f23e807 commit a511e56

70 files changed

Lines changed: 970 additions & 1017 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

browser-test/test.crypto.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import * as base64js from 'base64-js';
16-
import {assert} from 'chai';
16+
import {strict as assert} from 'assert';
1717
import {createCrypto, fromArrayBufferToHex} from '../src/crypto/crypto';
1818
import {BrowserCrypto} from '../src/crypto/browser/crypto';
1919
import {privateKey, publicKey} from './fixtures/keys';
@@ -112,8 +112,8 @@ describe('Browser crypto tests', () => {
112112
'f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8';
113113
const expectedHash = new Uint8Array(
114114
(expectedHexHash.match(/.{1,2}/g) as string[]).map(byte =>
115-
parseInt(byte, 16)
116-
)
115+
parseInt(byte, 16),
116+
),
117117
);
118118

119119
const calculatedHash = await crypto.signWithHmacSha256(key, message);
@@ -129,8 +129,8 @@ describe('Browser crypto tests', () => {
129129
'f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8';
130130
const expectedHash = new Uint8Array(
131131
(expectedHexHash.match(/.{1,2}/g) as string[]).map(byte =>
132-
parseInt(byte, 16)
133-
)
132+
parseInt(byte, 16),
133+
),
134134
);
135135

136136
const calculatedHash = await crypto.signWithHmacSha256(key, message);

browser-test/test.oauth2.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import * as base64js from 'base64-js';
16-
import {assert} from 'chai';
16+
import {strict as assert} from 'assert';
1717
import * as sinon from 'sinon';
1818
import {privateKey, publicKey} from './fixtures/keys';
1919
import {it, describe, beforeEach} from 'mocha';
@@ -89,8 +89,8 @@ describe('Browser OAuth2 tests', () => {
8989
client.transporter.request = stub;
9090
const response = await client.getToken('code here');
9191
const tokens = response.tokens;
92-
assert.isAbove(tokens!.expiry_date!, now + 10 * 1000);
93-
assert.isBelow(tokens!.expiry_date!, now + 15 * 1000);
92+
assert(tokens!.expiry_date! > now + 10 * 1000);
93+
assert(tokens!.expiry_date! < now + 15 * 1000);
9494
});
9595

9696
it('getFederatedSignonCerts talks to correct endpoint', async () => {
@@ -135,7 +135,7 @@ describe('Browser OAuth2 tests', () => {
135135
assert.strictEqual(params.get('code_challenge'), codes.codeChallenge);
136136
assert.strictEqual(
137137
params.get('code_challenge_method'),
138-
CodeChallengeMethod.S256
138+
CodeChallengeMethod.S256,
139139
);
140140
});
141141

@@ -167,25 +167,23 @@ describe('Browser OAuth2 tests', () => {
167167
name: 'RSASSA-PKCS1-v1_5',
168168
hash: {name: 'SHA-256'},
169169
};
170-
// eslint-disable-next-line no-undef
171170
const cryptoKey = await window.crypto.subtle.importKey(
172171
'jwk',
173172
privateKey,
174173
algo,
175174
true,
176-
['sign']
175+
['sign'],
177176
);
178-
// eslint-disable-next-line no-undef
179177
const signature = await window.crypto.subtle.sign(
180178
algo,
181179
cryptoKey,
182-
new TextEncoder().encode(data)
180+
new TextEncoder().encode(data),
183181
);
184182
data += '.' + base64js.fromByteArray(new Uint8Array(signature));
185183
const login = await client.verifySignedJwtWithCertsAsync(
186184
data,
187185
{keyid: publicKey},
188-
'testaudience'
186+
'testaudience',
189187
);
190188
assert.strictEqual(login.getUserId(), '123456789');
191189
});

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,17 @@
2626
},
2727
"devDependencies": {
2828
"@types/base64-js": "^1.2.5",
29-
"@types/chai": "^4.1.7",
3029
"@types/jws": "^3.1.0",
31-
"@types/mocha": "^9.0.0",
30+
"@types/mocha": "^10.0.10",
3231
"@types/mv": "^2.1.0",
3332
"@types/ncp": "^2.0.1",
3433
"@types/node": "^22.0.0",
3534
"@types/sinon": "^17.0.0",
3635
"assert-rejects": "^1.0.0",
3736
"c8": "^10.0.0",
38-
"chai": "^4.2.0",
3937
"codecov": "^3.0.2",
40-
"gts": "^5.0.0",
41-
"is-docker": "^2.0.0",
38+
"gts": "^6.0.0",
39+
"is-docker": "^3.0.0",
4240
"jsdoc": "^4.0.0",
4341
"jsdoc-fresh": "^3.0.0",
4442
"jsdoc-region-tag": "^3.0.0",
@@ -48,16 +46,16 @@
4846
"karma-firefox-launcher": "^2.0.0",
4947
"karma-mocha": "^2.0.0",
5048
"karma-sourcemap-loader": "^0.4.0",
51-
"karma-webpack": "5.0.0",
49+
"karma-webpack": "^5.0.1",
5250
"keypair": "^1.0.4",
5351
"linkinator": "^6.1.2",
54-
"mocha": "^9.2.2",
52+
"mocha": "^11.1.0",
5553
"mv": "^2.1.1",
5654
"ncp": "^2.0.0",
5755
"nock": "^14.0.1",
5856
"null-loader": "^4.0.0",
5957
"puppeteer": "^24.0.0",
60-
"sinon": "^18.0.0",
58+
"sinon": "^18.0.1",
6159
"ts-loader": "^8.0.0",
6260
"typescript": "^5.1.6",
6361
"webpack": "^5.21.2",

samples/authenticateAPIKey.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function main() {
4343

4444
console.log(`Text: ${text}`);
4545
console.log(
46-
`Sentiment: ${response.documentSentiment.score}, ${response.documentSentiment.magnitude}`
46+
`Sentiment: ${response.documentSentiment.score}, ${response.documentSentiment.magnitude}`,
4747
);
4848
console.log('Successfully authenticated using the API key');
4949
}

samples/idtokens-iap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
function main(
2222
url = 'https://some.iap.url',
23-
targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'
23+
targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com',
2424
) {
2525
// [START iap_make_request]
2626
/**

samples/idtokens-serverless.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
function main(
2222
url = 'https://service-1234-uc.a.run.app',
23-
targetAudience = null
23+
targetAudience = null,
2424
) {
2525
if (!targetAudience) {
2626
// Use the target service's hostname as the target audience for requests.

samples/jwt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const fs = require('fs');
2929

3030
async function main(
3131
// Full path to the service account credential
32-
keyFile = process.env.GOOGLE_APPLICATION_CREDENTIALS
32+
keyFile = process.env.GOOGLE_APPLICATION_CREDENTIALS,
3333
) {
3434
const keys = JSON.parse(fs.readFileSync(keyFile, 'utf8'));
3535
const client = new JWT({

samples/keyfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const {GoogleAuth} = require('google-auth-library');
2424
*/
2525
async function main(
2626
// Full path to the service account credential
27-
keyFile = process.env.GOOGLE_APPLICATION_CREDENTIALS
27+
keyFile = process.env.GOOGLE_APPLICATION_CREDENTIALS,
2828
) {
2929
const auth = new GoogleAuth({
3030
keyFile: keyFile,

samples/oauth2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function main() {
4040
// After acquiring an access_token, you may want to check on the audience, expiration,
4141
// or original scopes requested. You can do that with the `getTokenInfo` method.
4242
const tokenInfo = await oAuth2Client.getTokenInfo(
43-
oAuth2Client.credentials.access_token
43+
oAuth2Client.credentials.access_token,
4444
);
4545
console.log(tokenInfo);
4646
}

samples/scripts/downscoping-with-cab-setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function generateRandomString(length) {
5757
const allowedChars = 'abcdefghijklmnopqrstuvwxyz0123456789';
5858
for (let i = 0; i < length; i++) {
5959
chars.push(
60-
allowedChars.charAt(Math.floor(Math.random() * allowedChars.length))
60+
allowedChars.charAt(Math.floor(Math.random() * allowedChars.length)),
6161
);
6262
}
6363
return chars.join('');

0 commit comments

Comments
 (0)