src/auth/iam.ts
Properties |
Methods |
constructor(selector: string, token: string)
|
|
Defined in src/auth/iam.ts:20
|
|
IAM credentials. |
| Public selector |
Type : string
|
|
Defined in src/auth/iam.ts:28
|
|
the iam authority selector
|
| Public token |
Type : string
|
|
Defined in src/auth/iam.ts:28
|
|
the token
|
| getRequestHeaders |
getRequestHeaders()
|
|
Defined in src/auth/iam.ts:36
|
|
Acquire the HTTP headers required to make an authenticated request. |
export interface RequestMetadata {
'x-goog-iam-authority-selector': string;
'x-goog-iam-authorization-token': string;
}
export class IAMAuth {
/**
* IAM credentials.
*
* @param selector the iam authority selector
* @param token the token
* @constructor
*/
constructor(public selector: string, public token: string) {
this.selector = selector;
this.token = token;
}
/**
* Acquire the HTTP headers required to make an authenticated request.
*/
getRequestHeaders() {
return {
'x-goog-iam-authority-selector': this.selector,
'x-goog-iam-authorization-token': this.token,
};
}
}