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

google-auth-library

Package Overview
Dependencies
Maintainers
7
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-auth-library - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

build/src/auth/computeclient.js

@@ -162,3 +162,3 @@ "use strict";

*/
Compute._GOOGLE_OAUTH2_TOKEN_URL = 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token';
Compute._GOOGLE_OAUTH2_TOKEN_URL = 'http://metadata.google.internal/computeMetadata/v1beta1/instance/service-accounts/default/token';
return Compute;

@@ -165,0 +165,0 @@ }(oauth2client_1.OAuth2Client));

@@ -60,3 +60,3 @@ /// <reference types="node" />

* Obtains the default service-level credentials for the application.
* @param {function=} callback Optional callback.
* @param callback Optional callback.
* @returns Promise that resolves with the ADCResponse (if no callback was

@@ -90,3 +90,3 @@ * passed).

* Attempts to load default credentials from a file at the given path..
* @param {string=} filePath The path to the file to read.
* @param filePath The path to the file to read.
* @returns Promise that resolves with the OAuth2Client

@@ -98,3 +98,3 @@ * @api private

* Create a credentials instance using the given input options.
* @param {object=} json The input object.
* @param json The input object.
* @returns JWT or UserRefresh Client with data

@@ -105,4 +105,4 @@ */

* Create a credentials instance using the given input stream.
* @param {object=} inputStream The input stream.
* @param {function=} callback Optional callback.
* @param inputStream The input stream.
* @param callback Optional callback.
*/

@@ -116,3 +116,4 @@ fromStream(inputStream: stream.Readable): Promise<JWT | UserRefreshClient>;

* Create a credentials instance using the given API key string.
* @param {string} - The API key string
* @param apiKey The API key string
* @param options An optional options object.
* @returns A JWT loaded from the key

@@ -132,8 +133,2 @@ */

/**
* Gets the value of the environment variable with the given name. Allows
* mocking.
* @api private
*/
_getEnv(name: string): string | undefined;
/**
* Gets the current operating system platform. Allows mocking.

@@ -140,0 +135,0 @@ * @api private

@@ -308,3 +308,3 @@ "use strict";

return __generator(this, function (_a) {
credentialsPath = this._getEnv('GOOGLE_APPLICATION_CREDENTIALS');
credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'];
if (!credentialsPath || credentialsPath.length === 0) {

@@ -335,6 +335,6 @@ return [2 /*return*/, null];

// Windows
location = this._getEnv('APPDATA');
location = process.env['APPDATA'];
}
else {
home = this._getEnv('HOME');
home = process.env['HOME'];
if (home) {

@@ -366,3 +366,3 @@ location = this._pathJoin(home, '.config');

* Attempts to load default credentials from a file at the given path..
* @param {string=} filePath The path to the file to read.
* @param filePath The path to the file to read.
* @returns Promise that resolves with the OAuth2Client

@@ -407,3 +407,3 @@ * @api private

* Create a credentials instance using the given input options.
* @param {object=} json The input object.
* @param json The input object.
* @returns JWT or UserRefresh Client with data

@@ -470,3 +470,4 @@ */

* Create a credentials instance using the given API key string.
* @param {string} - The API key string
* @param apiKey The API key string
* @param options An optional options object.
* @returns A JWT loaded from the key

@@ -501,10 +502,2 @@ */

/**
* Gets the value of the environment variable with the given name. Allows
* mocking.
* @api private
*/
GoogleAuth.prototype._getEnv = function (name) {
return process.env[name];
};
/**
* Gets the current operating system platform. Allows mocking.

@@ -583,4 +576,3 @@ * @api private

GoogleAuth.prototype.getProductionProjectId = function () {
return this._getEnv('GCLOUD_PROJECT') ||
this._getEnv('GOOGLE_CLOUD_PROJECT');
return process.env['GCLOUD_PROJECT'] || process.env['GOOGLE_CLOUD_PROJECT'];
};

@@ -587,0 +579,0 @@ /**

@@ -26,4 +26,4 @@ /**

*
* @param {string=} selector the iam authority selector
* @param {string=} token the token
* @param selector the iam authority selector
* @param token the token
* @constructor

@@ -36,3 +36,3 @@ */

*
* @return {boolean} always false
* @return always false
*/

@@ -43,4 +43,4 @@ createScopedRequired(): boolean;

*
* @param {string} unused_uri is required of the credentials interface
* @param {function} metadataFn a callback invoked with object
* @param unused_uri is required of the credentials interface
* @param metadataFn a callback invoked with object
* containing request metadata.

@@ -47,0 +47,0 @@ */

@@ -22,4 +22,4 @@ "use strict";

*
* @param {string=} selector the iam authority selector
* @param {string=} token the token
* @param selector the iam authority selector
* @param token the token
* @constructor

@@ -37,3 +37,3 @@ */

*
* @return {boolean} always false
* @return always false
*/

@@ -47,4 +47,4 @@ IAMAuth.prototype.createScopedRequired = function () {

*
* @param {string} unused_uri is required of the credentials interface
* @param {function} metadataFn a callback invoked with object
* @param unused_uri is required of the credentials interface
* @param metadataFn a callback invoked with object
* containing request metadata.

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

@@ -16,5 +16,4 @@ /// <reference types="node" />

*
* @param {string=} email the service account email address.
* @param {string=} key the private key that will be used to sign the token.
* @constructor
* @param email the service account email address.
* @param key the private key that will be used to sign the token.
*/

@@ -26,3 +25,3 @@ constructor(email?: string | null, key?: string | null);

*
* @return {boolean} always false
* @return always false
*/

@@ -43,3 +42,3 @@ createScopedRequired(): boolean;

* Create a JWTAccess credentials instance using the given input options.
* @param {object=} json The input object.
* @param json The input object.
*/

@@ -49,4 +48,4 @@ fromJSON(json: JWTInput): void;

* Create a JWTAccess credentials instance using the given input stream.
* @param {object=} inputStream The input stream.
* @param {function=} callback Optional callback.
* @param inputStream The input stream.
* @param callback Optional callback.
*/

@@ -53,0 +52,0 @@ fromStream(inputStream: stream.Readable): Promise<void>;

@@ -27,5 +27,4 @@ "use strict";

*
* @param {string=} email the service account email address.
* @param {string=} key the private key that will be used to sign the token.
* @constructor
* @param email the service account email address.
* @param key the private key that will be used to sign the token.
*/

@@ -41,3 +40,3 @@ function JWTAccess(email, key) {

*
* @return {boolean} always false
* @return always false
*/

@@ -85,3 +84,3 @@ JWTAccess.prototype.createScopedRequired = function () {

* Create a JWTAccess credentials instance using the given input options.
* @param {object=} json The input object.
* @param json The input object.
*/

@@ -88,0 +87,0 @@ JWTAccess.prototype.fromJSON = function (json) {

@@ -44,8 +44,7 @@ /// <reference types="node" />

*
* @param {string=} email service account email address.
* @param {string=} keyFile path to private key file.
* @param {string=} key value of key
* @param {(string|array)=} scopes list of requested scopes or a single scope.
* @param {string=} subject impersonated account's email address.
* @constructor
* @param email service account email address.
* @param keyFile path to private key file.
* @param key value of key
* @param scopes list of requested scopes or a single scope.
* @param subject impersonated account's email address.
*/

@@ -56,4 +55,4 @@ constructor(options: JWTOptions);

* Creates a copy of the credential with the specified scopes.
* @param {(string|array)=} scopes List of requested scopes or a single scope.
* @return {object} The cloned instance.
* @param scopes List of requested scopes or a single scope.
* @return The cloned instance.
*/

@@ -64,3 +63,3 @@ createScoped(scopes?: string | string[]): JWT;

*
* @param optUri the URI being authorized.
* @param url the URI being authorized.
*/

@@ -71,3 +70,3 @@ protected getRequestMetadataAsync(url?: string | null): Promise<RequestMetadataResponse>;

* createdScoped before use.
* @return {boolean} false if createScoped does not need to be called.
* @return false if createScoped does not need to be called.
*/

@@ -77,3 +76,3 @@ createScopedRequired(): boolean;

* Get the initial access token using gToken.
* @param {function=} callback Optional callback.
* @param callback Optional callback.
* @returns Promise that resolves with credentials

@@ -92,3 +91,3 @@ */

* Create a JWT credentials instance using the given input options.
* @param {object=} json The input object.
* @param json The input object.
*/

@@ -98,4 +97,4 @@ fromJSON(json: JWTInput): void;

* Create a JWT credentials instance using the given input stream.
* @param {object=} inputStream The input stream.
* @param {function=} callback Optional callback.
* @param inputStream The input stream.
* @param callback Optional callback.
*/

@@ -107,5 +106,5 @@ fromStream(inputStream: stream.Readable): Promise<void>;

* Creates a JWT credentials instance using an API Key for authentication.
* @param {string} apiKey - the API Key in string form.
* @param apiKey The API Key in string form.
*/
fromAPIKey(apiKey: string): void;
}

@@ -86,4 +86,4 @@ "use strict";

* Creates a copy of the credential with the specified scopes.
* @param {(string|array)=} scopes List of requested scopes or a single scope.
* @return {object} The cloned instance.
* @param scopes List of requested scopes or a single scope.
* @return The cloned instance.
*/

@@ -103,3 +103,3 @@ JWT.prototype.createScoped = function (scopes) {

*
* @param optUri the URI being authorized.
* @param url the URI being authorized.
*/

@@ -135,3 +135,3 @@ JWT.prototype.getRequestMetadataAsync = function (url) {

* createdScoped before use.
* @return {boolean} false if createScoped does not need to be called.
* @return false if createScoped does not need to be called.
*/

@@ -214,3 +214,3 @@ JWT.prototype.createScopedRequired = function () {

* Create a JWT credentials instance using the given input options.
* @param {object=} json The input object.
* @param json The input object.
*/

@@ -265,3 +265,3 @@ JWT.prototype.fromJSON = function (json) {

* Creates a JWT credentials instance using an API Key for authentication.
* @param {string} apiKey - the API Key in string form.
* @param apiKey The API Key in string form.
*/

@@ -268,0 +268,0 @@ JWT.prototype.fromAPIKey = function (apiKey) {

@@ -32,3 +32,3 @@ /**

*
* @return {string} The user ID
* @return The user ID
*/

@@ -40,3 +40,3 @@ getUserId(): string | null;

*
* @return {Object} The envelope and payload
* @return The envelope and payload
*/

@@ -43,0 +43,0 @@ getAttributes(): {

@@ -39,3 +39,3 @@ "use strict";

*
* @return {string} The user ID
* @return The user ID
*/

@@ -53,3 +53,3 @@ LoginTicket.prototype.getUserId = function () {

*
* @return {Object} The envelope and payload
* @return The envelope and payload
*/

@@ -56,0 +56,0 @@ LoginTicket.prototype.getAttributes = function () {

@@ -209,6 +209,7 @@ /// <reference types="node" />

*
* @param {string=} clientId The authentication client ID.
* @param {string=} clientSecret The authentication client secret.
* @param {string=} redirectUri The URI to redirect to after completing the auth request.
* @param {Object=} opts optional options for overriding the given parameters.
* @param clientId The authentication client ID.
* @param clientSecret The authentication client secret.
* @param redirectUri The URI to redirect to after completing the auth
* request.
* @param opts optional options for overriding the given parameters.
* @constructor

@@ -248,4 +249,4 @@ */

* Generates URL for consent page landing.
* @param {object=} opts Options.
* @return {string} URL to consent page.
* @param opts Options.
* @return URL to consent page.
*/

@@ -264,4 +265,4 @@ generateAuthUrl(opts?: GenerateAuthUrlOpts): string;

* Gets the access token for the given code.
* @param {string} code The authorization code.
* @param {function=} callback Optional callback fn.
* @param code The authorization code.
* @param callback Optional callback fn.
*/

@@ -275,4 +276,3 @@ getToken(code: string): Promise<GetTokenResponse>;

* Refreshes the access token.
* @param {string} refresh_token Existing refresh token.
* @param {function=} callback Optional callback.
* @param refresh_token Existing refresh token.
* @private

@@ -285,3 +285,3 @@ */

* @deprecated use getRequestMetadata instead.
* @param {function} callback callback
* @param callback callback
*/

@@ -294,3 +294,3 @@ refreshAccessToken(): Promise<RefreshAccessTokenResponse>;

*
* @param {function} callback Callback to call with the access token
* @param callback Callback to call with the access token
*/

@@ -312,4 +312,4 @@ getAccessToken(): Promise<GetAccessTokenResponse>;

*
* @param {string} optUri the Uri being authorized
* @param {function} metadataCb the func described above
* @param url the Uri being authorized
* @param callback the func described above
*/

@@ -321,4 +321,4 @@ getRequestMetadata(url?: string | null): Promise<RequestMetadataResponse>;

* Revokes the access given to token.
* @param {string} token The existing token to be revoked.
* @param {function=} callback Optional callback fn.
* @param token The existing token to be revoked.
* @param callback Optional callback fn.
*/

@@ -329,3 +329,3 @@ revokeToken(token: string): AxiosPromise<RevokeCredentialsResult>;

* Revokes access token and clears the credentials object
* @param {Function=} callback callback
* @param callback callback
*/

@@ -339,5 +339,5 @@ revokeCredentials(): AxiosPromise<RevokeCredentialsResult>;

* asks for a new access token and replays the unsuccessful request.
* @param {object} opts Request options.
* @param {function} callback callback.
* @return {Request} Request object
* @param opts Request options.
* @param callback callback.
* @return Request object
*/

@@ -349,4 +349,4 @@ request<T>(opts: AxiosRequestConfig): AxiosPromise<T>;

* Verify id token is token by checking the certs and audience
* @param {VerifyIdTokenOptions} Object that contains all options.
* @param {function=} callback Callback supplying GoogleLogin if successful
* @param options that contains all options.
* @param callback Callback supplying GoogleLogin if successful
*/

@@ -360,3 +360,3 @@ verifyIdToken(options: VerifyIdTokenOptions): Promise<LoginTicket | null>;

* are PEM encoded certificates.
* @param {function=} callback Callback supplying the certificates
* @param callback Callback supplying the certificates
*/

@@ -369,8 +369,8 @@ getFederatedSignonCerts(): Promise<FederatedSignonCertsResponse>;

* and is from the correct audience.
* @param {string} jwt The jwt to verify (The ID Token in this case).
* @param {array} certs The array of certs to test the jwt against.
* @param {(string|Array.<string>)} requiredAudience The audience to test the jwt against.
* @param {array} issuers The allowed issuers of the jwt (Optional).
* @param {string} maxExpiry The max expiry the certificate can be (Optional).
* @return {LoginTicket} Returns a LoginTicket on verification.
* @param jwt The jwt to verify (The ID Token in this case).
* @param certs The array of certs to test the jwt against.
* @param requiredAudience The audience to test the jwt against.
* @param issuers The allowed issuers of the jwt (Optional).
* @param maxExpiry The max expiry the certificate can be (Optional).
* @return Returns a LoginTicket on verification.
*/

@@ -380,4 +380,4 @@ verifySignedJwtWithCerts(jwt: string, certs: {}, requiredAudience: string | string[], issuers?: string[], maxExpiry?: number): LoginTicket;

* This is a utils method to decode a base64 string
* @param {string} b64String The string to base64 decode
* @return {string} The decoded string
* @param b64String The string to base64 decode
* @return The decoded string
*/

@@ -384,0 +384,0 @@ decodeBase64(b64String: string): string;

@@ -101,4 +101,4 @@ "use strict";

* Generates URL for consent page landing.
* @param {object=} opts Options.
* @return {string} URL to consent page.
* @param opts Options.
* @return URL to consent page.
*/

@@ -190,4 +190,3 @@ OAuth2Client.prototype.generateAuthUrl = function (opts) {

* Refreshes the access token.
* @param {string} refresh_token Existing refresh token.
* @param {function=} callback Optional callback.
* @param refresh_token Existing refresh token.
* @private

@@ -540,8 +539,8 @@ */

* and is from the correct audience.
* @param {string} jwt The jwt to verify (The ID Token in this case).
* @param {array} certs The array of certs to test the jwt against.
* @param {(string|Array.<string>)} requiredAudience The audience to test the jwt against.
* @param {array} issuers The allowed issuers of the jwt (Optional).
* @param {string} maxExpiry The max expiry the certificate can be (Optional).
* @return {LoginTicket} Returns a LoginTicket on verification.
* @param jwt The jwt to verify (The ID Token in this case).
* @param certs The array of certs to test the jwt against.
* @param requiredAudience The audience to test the jwt against.
* @param issuers The allowed issuers of the jwt (Optional).
* @param maxExpiry The max expiry the certificate can be (Optional).
* @return Returns a LoginTicket on verification.
*/

@@ -640,4 +639,4 @@ OAuth2Client.prototype.verifySignedJwtWithCerts = function (jwt, certs, requiredAudience, issuers, maxExpiry) {

* This is a utils method to decode a base64 string
* @param {string} b64String The string to base64 decode
* @return {string} The decoded string
* @param b64String The string to base64 decode
* @return The decoded string
*/

@@ -644,0 +643,0 @@ OAuth2Client.prototype.decodeBase64 = function (b64String) {

@@ -30,6 +30,5 @@ /// <reference types="node" />

*
* @param {string} clientId The authentication client ID.
* @param {string} clientSecret The authentication client secret.
* @param {string} refreshToken The authentication refresh token.
* @constructor
* @param clientId The authentication client ID.
* @param clientSecret The authentication client secret.
* @param refreshToken The authentication refresh token.
*/

@@ -41,5 +40,4 @@ constructor(clientId?: string, clientSecret?: string, refreshToken?: string);

* Refreshes the access token.
* @param {object=} ignored
* @param {function=} callback Optional callback.
* @private
* @param refreshToken An ignored refreshToken..
* @param callback Optional callback.
*/

@@ -50,3 +48,3 @@ protected refreshToken(refreshToken?: string | null): Promise<GetTokenResponse>;

* options.
* @param {object=} json The input object.
* @param json The input object.
*/

@@ -57,4 +55,4 @@ fromJSON(json: JWTInput): void;

* stream.
* @param {object=} inputStream The input stream.
* @param {function=} callback Optional callback.
* @param inputStream The input stream.
* @param callback Optional callback.
*/

@@ -61,0 +59,0 @@ fromStream(inputStream: stream.Readable): Promise<void>;

@@ -86,5 +86,4 @@ "use strict";

* Refreshes the access token.
* @param {object=} ignored
* @param {function=} callback Optional callback.
* @private
* @param refreshToken An ignored refreshToken..
* @param callback Optional callback.
*/

@@ -101,3 +100,3 @@ UserRefreshClient.prototype.refreshToken = function (refreshToken) {

* options.
* @param {object=} json The input object.
* @param json The input object.
*/

@@ -104,0 +103,0 @@ UserRefreshClient.prototype.fromJSON = function (json) {

{
"name": "google-auth-library",
"version": "1.2.0",
"version": "1.2.1",
"author": "Google Inc.",

@@ -5,0 +5,0 @@ "description": "Google APIs Authentication Client Library for Node.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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