Skip to content

Commit 169f259

Browse files
committed
chore: Fix lint issues
1 parent 0d0bc2a commit 169f259

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

browser-test/test.oauth2.ts

Lines changed: 0 additions & 3 deletions
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));

samples/oauth2-codeVerifier.js

Lines changed: 5 additions & 1 deletion
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.

samples/oauth2.js

Lines changed: 5 additions & 1 deletion
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.

samples/puppeteer/oauth2-test.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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();

samples/verifyIdToken.js

Lines changed: 5 additions & 1 deletion
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.

src/crypto/browser/crypto.ts

Lines changed: 2 additions & 7 deletions
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)