1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | import { Agent } from 'http';
|
20 | import { Credential, GoogleOAuthAccessToken } from './credential';
|
21 |
|
22 |
|
23 |
|
24 | export declare class ServiceAccountCredential implements Credential {
|
25 | private readonly httpAgent?;
|
26 | readonly implicit: boolean;
|
27 | readonly projectId: string;
|
28 | readonly privateKey: string;
|
29 | readonly clientEmail: string;
|
30 | private readonly httpClient;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | constructor(serviceAccountPathOrObject: string | object, httpAgent?: Agent | undefined, implicit?: boolean);
|
42 | getAccessToken(): Promise<GoogleOAuthAccessToken>;
|
43 | private createAuthJwt_;
|
44 | }
|
45 | /**
|
46 | * Implementation of Credential that gets access tokens from the metadata service available
|
47 | * in the Google Cloud Platform. This authenticates the process as the default service account
|
48 | * of an App Engine instance or Google Compute Engine machine.
|
49 | */
|
50 | export declare class ComputeEngineCredential implements Credential {
|
51 | private readonly httpClient;
|
52 | private readonly httpAgent?;
|
53 | private projectId?;
|
54 | constructor(httpAgent?: Agent);
|
55 | getAccessToken(): Promise<GoogleOAuthAccessToken>;
|
56 | getProjectId(): Promise<string>;
|
57 | private buildRequest;
|
58 | }
|
59 | /**
|
60 | * Implementation of Credential that gets access tokens from refresh tokens.
|
61 | */
|
62 | export declare class RefreshTokenCredential implements Credential {
|
63 | private readonly httpAgent?;
|
64 | readonly implicit: boolean;
|
65 | private readonly refreshToken;
|
66 | private readonly httpClient;
|
67 | |
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | constructor(refreshTokenPathOrObject: string | object, httpAgent?: Agent | undefined, implicit?: boolean);
|
79 | getAccessToken(): Promise<GoogleOAuthAccessToken>;
|
80 | }
|
81 | /**
|
82 | * Checks if the given credential was loaded via the application default credentials mechanism. This
|
83 | * includes all ComputeEngineCredential instances, and the ServiceAccountCredential and RefreshTokenCredential
|
84 | * instances that were loaded from well-known files or environment variables, rather than being explicitly
|
85 | * instantiated.
|
86 | *
|
87 | * @param credential - The credential instance to check.
|
88 | */
|
89 | export declare function isApplicationDefault(credential?: Credential): boolean;
|
90 | export declare function getApplicationDefault(httpAgent?: Agent): Credential;
|