UNPKG

1.34 kBTypeScriptView Raw
1import { GaxiosError } from 'gaxios';
2import { GetTokenResponse, OAuth2Client, RefreshOptions } from './oauth2client';
3export interface ComputeOptions extends RefreshOptions {
4 /**
5 * The service account email to use, or 'default'. A Compute Engine instance
6 * may have multiple service accounts.
7 */
8 serviceAccountEmail?: string;
9 /**
10 * The scopes that will be requested when acquiring service account
11 * credentials. Only applicable to modern App Engine and Cloud Function
12 * runtimes as of March 2019.
13 */
14 scopes?: string | string[];
15}
16export declare class Compute extends OAuth2Client {
17 private serviceAccountEmail;
18 scopes: string[];
19 /**
20 * Google Compute Engine service account credentials.
21 *
22 * Retrieve access token from the metadata server.
23 * See: https://developers.google.com/compute/docs/authentication
24 */
25 constructor(options?: ComputeOptions);
26 /**
27 * Refreshes the access token.
28 * @param refreshToken Unused parameter
29 */
30 protected refreshTokenNoCache(refreshToken?: string | null): Promise<GetTokenResponse>;
31 /**
32 * Fetches an ID token.
33 * @param targetAudience the audience for the fetched ID token.
34 */
35 fetchIdToken(targetAudience: string): Promise<string>;
36 protected wrapError(e: GaxiosError): void;
37}