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 6.0.1 to 6.1.0

6

build/src/index.d.ts

@@ -0,1 +1,5 @@

import { GaxiosOptions, GaxiosPromise } from 'gaxios';
export interface Transporter {
request<T>(opts: GaxiosOptions): GaxiosPromise<T>;
}
export declare type GetTokenCallback = (err: Error | null, token?: TokenData) => void;

@@ -22,2 +26,3 @@ export interface Credentials {

eagerRefreshThresholdMillis?: number;
transporter?: Transporter;
}

@@ -43,2 +48,3 @@ export interface GetTokenOptions {

eagerRefreshThresholdMillis?: number;
transporter: Transporter;
private inFlightRequest?;

@@ -45,0 +51,0 @@ /**

10

build/src/index.js

@@ -44,2 +44,5 @@ "use strict";

constructor(options) {
this.transporter = {
request: opts => (0, gaxios_1.request)(opts),
};
this.configure(options);

@@ -190,3 +193,3 @@ }

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

@@ -219,2 +222,5 @@ email: this.iss,

this.eagerRefreshThresholdMillis = options.eagerRefreshThresholdMillis;
if (options.transporter) {
this.transporter = options.transporter;
}
}

@@ -242,3 +248,3 @@ /**

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

@@ -245,0 +251,0 @@ url: GOOGLE_TOKEN_URL,

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

## [6.1.0](https://github.com/googleapis/node-gtoken/compare/v6.0.1...v6.1.0) (2022-06-28)
### Features
* allow customizing the http client ([#426](https://github.com/googleapis/node-gtoken/issues/426)) ([408ad04](https://github.com/googleapis/node-gtoken/commit/408ad048a2595313717bf427fc34aa29a6e7fb3c))
## [6.0.1](https://github.com/googleapis/node-gtoken/compare/v6.0.0...v6.0.1) (2022-06-07)

@@ -9,0 +16,0 @@

2

package.json
{
"name": "gtoken",
"version": "6.0.1",
"version": "6.1.0",
"description": "Node.js Google Authentication Service Account Tokens",

@@ -5,0 +5,0 @@ "main": "./build/src/index.js",

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