
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
google-auth-token-generator
Advanced tools
[](https://gyazo.com/92b73b1253594a5c39761079492cb9da)
Gooogle系APIのtoken.jsonを取得するためのCLIツールです。 npx経由で実行すればインストール不要です。
に対応しています。(2021/5/3時点)
credentials.json
を取得します。npx google-auth-token-generator
を実行します。token.json
が生成されます読み込みます。googleapisも追加でインストールしましょう。
const {google} = require('googleapis');
const {oAuth2ClientGen} = require('google-auth-token-generator');
利用する際は以下のように読み込みます。 ファイル名は任意に変更できますがcredentials.jsonとtoken.jsonがデフォルトです。
const auth = oAuth2ClientGen({
library: google,
CREDENTIALS_PATH: `credentials.json`, // optional
TOKEN_PATH: 'token.json'; // optional
});
'use strict';
const {google} = require('googleapis');
const {oAuth2ClientGen} = require('google-auth-token-generator');
(async () => {
const auth = oAuth2ClientGen({library: google});
const sheets = google.sheets({version: 'v4', auth});
try {
const res = await sheets.spreadsheets.values.get({
spreadsheetId: '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms',
range: 'Class Data!A2:E',
});
const rows = res.data.values;
if (rows.length) {
console.log('Name, Major:');
// Print columns A and E, which correspond to indices 0 and 4.
rows.map((row) => {
console.log(`${row[0]}, ${row[4]}`);
});
} else {
console.log('No data found.');
}
} catch (error) {
console.log('The API returned an error: ' + error);
}
})();
credentials.json
first from the Google API site.npx google-auth-token-generator
token.json
file will be generated.FAQs
[](https://gyazo.com/92b73b1253594a5c39761079492cb9da)
The npm package google-auth-token-generator receives a total of 147 weekly downloads. As such, google-auth-token-generator popularity was classified as not popular.
We found that google-auth-token-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.