Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
google-auth-token-generator
Advanced tools
Readme
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
});
また、環境変数などを利用したい場合はCREDENTIALSとTOKENのキーにセットして下さい。ファイル読み込みはしません。
const auth = oAuth2ClientGen({
library: google,
/*環境変数利用の場合*/
CREDENTIALS: process.env.GOOGLE_CREDENTIAL, //optional
TOKEN: process.env.GOOGLE_TOKEN, //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
[![Image from Gyazo](https://i.gyazo.com/92b73b1253594a5c39761079492cb9da.gif)](https://gyazo.com/92b73b1253594a5c39761079492cb9da)
The npm package google-auth-token-generator receives a total of 274 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.