google-auth-library
Advanced tools
Comparing version
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
import { Credentials } from './credentials'; | ||
import { Headers } from './oauth2client'; | ||
import { GetAccessTokenResponse, Headers } from './oauth2client'; | ||
import { OriginalAndCamel } from '../util'; | ||
@@ -99,6 +99,3 @@ /** | ||
*/ | ||
getAccessToken(): Promise<{ | ||
token?: string | null; | ||
res?: GaxiosResponse | null; | ||
}>; | ||
getAccessToken(): Promise<GetAccessTokenResponse>; | ||
/** | ||
@@ -105,0 +102,0 @@ * The main authentication interface. It takes an optional url which when |
@@ -92,5 +92,4 @@ import { BaseExternalAccountClient, BaseExternalAccountClientOptions } from './baseexternalclient'; | ||
private getAwsSecurityCredentials; | ||
private shouldUseMetadataServer; | ||
private get regionFromEnv(); | ||
private get securityCredentialsFromEnv(); | ||
} |
@@ -98,3 +98,3 @@ "use strict"; | ||
// Removing this check may break them. | ||
if (this.shouldUseMetadataServer() && this.imdsV2SessionTokenUrl) { | ||
if (!this.regionFromEnv && this.imdsV2SessionTokenUrl) { | ||
metadataHeaders['x-aws-ec2-metadata-token'] = | ||
@@ -110,2 +110,6 @@ await this.getImdsV2SessionToken(); | ||
} | ||
if (this.imdsV2SessionTokenUrl) { | ||
metadataHeaders['x-aws-ec2-metadata-token'] = | ||
await this.getImdsV2SessionToken(); | ||
} | ||
// Since the role on a VM can change, we don't need to cache it. | ||
@@ -238,7 +242,2 @@ const roleName = await this.getAwsRoleName(metadataHeaders); | ||
} | ||
shouldUseMetadataServer() { | ||
// The metadata server must be used when either the AWS region or AWS security | ||
// credentials cannot be retrieved through their defined environment variables. | ||
return !this.regionFromEnv || !this.securityCredentialsFromEnv; | ||
} | ||
get regionFromEnv() { | ||
@@ -245,0 +244,0 @@ // The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION. |
@@ -464,3 +464,3 @@ /// <reference types="node" /> | ||
getRequestHeaders(url?: string): Promise<Headers>; | ||
protected getRequestMetadataAsync(url?: string | null): Promise<RequestMetadataResponse>; | ||
protected getRequestMetadataAsync(url?: string | URL | null): Promise<RequestMetadataResponse>; | ||
/** | ||
@@ -467,0 +467,0 @@ * Generates an URL to revoke the given token. |
@@ -22,4 +22,5 @@ import { GoogleAuth } from './auth/googleauth'; | ||
export { PluggableAuthClient, PluggableAuthClientOptions, } from './auth/pluggable-auth-client'; | ||
export { PassThroughClient } from './auth/passthrough'; | ||
export { DefaultTransporter } from './transporters'; | ||
declare const auth: GoogleAuth<import("./auth/googleauth").JSONClient>; | ||
export { auth, GoogleAuth }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GoogleAuth = exports.auth = exports.DefaultTransporter = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gcpMetadata = void 0; | ||
exports.GoogleAuth = exports.auth = exports.DefaultTransporter = exports.PassThroughClient = exports.PluggableAuthClient = exports.DownscopedClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.IdentityPoolClient = exports.AwsClient = exports.UserRefreshClient = exports.LoginTicket = exports.OAuth2Client = exports.CodeChallengeMethod = exports.Impersonated = exports.JWT = exports.JWTAccess = exports.IdTokenClient = exports.IAMAuth = exports.GCPEnv = exports.Compute = exports.DEFAULT_UNIVERSE = exports.AuthClient = exports.gcpMetadata = void 0; | ||
// Copyright 2017 Google LLC | ||
@@ -56,2 +56,4 @@ // | ||
Object.defineProperty(exports, "PluggableAuthClient", { enumerable: true, get: function () { return pluggable_auth_client_1.PluggableAuthClient; } }); | ||
var passthrough_1 = require("./auth/passthrough"); | ||
Object.defineProperty(exports, "PassThroughClient", { enumerable: true, get: function () { return passthrough_1.PassThroughClient; } }); | ||
var transporters_1 = require("./transporters"); | ||
@@ -58,0 +60,0 @@ Object.defineProperty(exports, "DefaultTransporter", { enumerable: true, get: function () { return transporters_1.DefaultTransporter; } }); |
{ | ||
"name": "google-auth-library", | ||
"version": "9.6.3", | ||
"version": "9.7.0", | ||
"author": "Google Inc.", | ||
@@ -5,0 +5,0 @@ "description": "Google APIs Authentication Client Library for Node.js", |
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
553606
0.73%72
2.86%9232
1.07%