Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gtoken

Package Overview
Dependencies
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gtoken - npm Package Compare versions

Comparing version 5.3.2 to 6.0.0

6

build/src/index.d.ts

@@ -1,7 +0,1 @@

/**
* Copyright 2018 Google LLC
*
* Distributed under MIT license.
* See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
export declare type GetTokenCallback = (err: Error | null, token?: TokenData) => void;

@@ -8,0 +2,0 @@ export interface Credentials {

30

build/src/index.js
"use strict";
/**
* Copyright 2018 Google LLC
*
* Distributed under MIT license.
* See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Object.defineProperty(exports, "__esModule", { value: true });

@@ -16,3 +23,3 @@ exports.GoogleToken = void 0;

const readFile = fs.readFile
? util_1.promisify(fs.readFile)
? (0, util_1.promisify)(fs.readFile)
: async () => {

@@ -183,3 +190,3 @@ // if running in the web-browser, fs.readFile may not have been shimmed.

const url = GOOGLE_REVOKE_TOKEN_URL + this.accessToken;
await gaxios_1.request({ url });
await (0, gaxios_1.request)({ url });
this.configure({

@@ -217,2 +224,3 @@ email: this.iss,

async requestToken() {
var _a, _b;
const iat = Math.floor(new Date().getTime() / 1000);

@@ -234,3 +242,3 @@ const additionalClaims = this.additionalClaims || {};

try {
const r = await gaxios_1.request({
const r = await (0, gaxios_1.request)({
method: 'POST',

@@ -255,3 +263,5 @@ url: GOOGLE_TOKEN_URL,

this.tokenExpires = undefined;
const body = e.response && e.response.data ? e.response.data : {};
const body = e.response && ((_a = e.response) === null || _a === void 0 ? void 0 : _a.data)
? (_b = e.response) === null || _b === void 0 ? void 0 : _b.data
: {};
if (body.error) {

@@ -258,0 +268,0 @@ const desc = body.error_description

@@ -7,2 +7,13 @@ # Changelog

## [6.0.0](https://github.com/googleapis/node-gtoken/compare/v5.3.2...v6.0.0) (2022-05-10)
### ⚠ BREAKING CHANGES
* update library to use Node 12 (#428)
### Build System
* update library to use Node 12 ([#428](https://github.com/googleapis/node-gtoken/issues/428)) ([288b662](https://github.com/googleapis/node-gtoken/commit/288b662d990ce53a6824ddc67c384253487fdc04))
### [5.3.2](https://github.com/googleapis/node-gtoken/compare/v5.3.1...v5.3.2) (2022-01-28)

@@ -9,0 +20,0 @@

{
"name": "gtoken",
"version": "5.3.2",
"version": "6.0.0",
"description": "Node.js Google Authentication Service Account Tokens",

@@ -8,3 +8,3 @@ "main": "./build/src/index.js",

"engines": {
"node": ">=10"
"node": ">=12.0.0"
},

@@ -50,3 +50,3 @@ "repository": "google/node-gtoken",

"@types/jws": "^3.1.0",
"@types/mocha": "^8.0.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.0.0",

@@ -56,5 +56,5 @@ "c8": "^7.0.0",

"linkinator": "^2.0.0",
"mocha": "^8.0.0",
"mocha": "^9.2.2",
"nock": "^13.0.0",
"typescript": "^3.8.3"
"typescript": "^4.6.4"
},

@@ -61,0 +61,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc