UNPKG

1.35 kBJavaScriptView Raw
1"use strict";
2// Copyright 2014 Google LLC
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15Object.defineProperty(exports, "__esModule", { value: true });
16exports.IAMAuth = void 0;
17class IAMAuth {
18 /**
19 * IAM credentials.
20 *
21 * @param selector the iam authority selector
22 * @param token the token
23 * @constructor
24 */
25 constructor(selector, token) {
26 this.selector = selector;
27 this.token = token;
28 this.selector = selector;
29 this.token = token;
30 }
31 /**
32 * Acquire the HTTP headers required to make an authenticated request.
33 */
34 getRequestHeaders() {
35 return {
36 'x-goog-iam-authority-selector': this.selector,
37 'x-goog-iam-authorization-token': this.token,
38 };
39 }
40}
41exports.IAMAuth = IAMAuth;
42//# sourceMappingURL=iam.js.map
\No newline at end of file