UNPKG

google-auth-library

Version:

Google APIs Authentication Client Library for Node.js

49 lines (48 loc) 1.86 kB
/// <reference types="node" /> import * as stream from 'stream'; import { JWTInput } from './credentials'; import { RequestMetadataResponse } from './oauth2client'; export declare class JWTAccess { email?: string | null; key?: string | null; projectId?: string; /** * JWTAccess service account credentials. * * Create a new access token by using the credential to create a new JWT token * that's recognized as the access token. * * @param {string=} email the service account email address. * @param {string=} key the private key that will be used to sign the token. * @constructor */ constructor(email?: string | null, key?: string | null); /** * Indicates whether the credential requires scopes to be created by calling * createdScoped before use. * * @return {boolean} always false */ createScopedRequired(): boolean; /** * Get a non-expired access token, after refreshing if necessary * * @param {string} authURI the URI being authorized * @param {function} metadataCb a callback invoked with the jwt request metadata. * @returns a Promise that resolves with the request metadata response */ getRequestMetadata(authURI: string): RequestMetadataResponse; /** * Create a JWTAccess credentials instance using the given input options. * @param {object=} json The input object. */ 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. */ fromStream(inputStream: stream.Readable): Promise<void>; fromStream(inputStream: stream.Readable, callback: (err?: Error) => void): void; private fromStreamAsync(inputStream); }