@digipair/skill-s3 0.114.3 → 0.114.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +58645 -14
- package/package.json +1 -1
- package/dist/externalDataInterceptor.esm.js +0 -19
- package/dist/getSSOTokenFromFile.esm.js +0 -169
- package/dist/index.esm10.js +0 -1603
- package/dist/index.esm11.js +0 -2635
- package/dist/index.esm2.js +0 -14
- package/dist/index.esm3.js +0 -40088
- package/dist/index.esm4.js +0 -450
- package/dist/index.esm5.js +0 -3677
- package/dist/index.esm6.js +0 -434
- package/dist/index.esm7.js +0 -705
- package/dist/index.esm8.js +0 -1690
- package/dist/index.esm9.js +0 -1519
- package/dist/loadSso.esm.js +0 -2090
- package/dist/noAuth.esm.js +0 -165
- package/dist/package.esm.js +0 -184
- package/dist/parseJsonBody.esm.js +0 -252
- package/dist/parseKnownFiles.esm.js +0 -248
package/dist/index.esm8.js
DELETED
|
@@ -1,1690 +0,0 @@
|
|
|
1
|
-
import { C as CredentialsProviderError, m as chain, s as setCredentialFeature, j as getProfileName } from './index.esm3.js';
|
|
2
|
-
import { p as parseKnownFiles } from './parseKnownFiles.esm.js';
|
|
3
|
-
import 'buffer';
|
|
4
|
-
import 'path';
|
|
5
|
-
import 'os';
|
|
6
|
-
import 'fs';
|
|
7
|
-
import 'stream';
|
|
8
|
-
import 'crypto';
|
|
9
|
-
import 'http';
|
|
10
|
-
import 'https';
|
|
11
|
-
import 'process';
|
|
12
|
-
import 'node:fs';
|
|
13
|
-
import 'async_hooks';
|
|
14
|
-
import 'zlib';
|
|
15
|
-
import 'node:stream';
|
|
16
|
-
|
|
17
|
-
function asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, key, arg) {
|
|
18
|
-
try {
|
|
19
|
-
var info = gen[key](arg);
|
|
20
|
-
var value = info.value;
|
|
21
|
-
} catch (error) {
|
|
22
|
-
reject(error);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (info.done) {
|
|
26
|
-
resolve(value);
|
|
27
|
-
} else {
|
|
28
|
-
Promise.resolve(value).then(_next, _throw);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function _async_to_generator$7(fn) {
|
|
32
|
-
return function() {
|
|
33
|
-
var self = this, args = arguments;
|
|
34
|
-
return new Promise(function(resolve, reject) {
|
|
35
|
-
var gen = fn.apply(self, args);
|
|
36
|
-
function _next(value) {
|
|
37
|
-
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "next", value);
|
|
38
|
-
}
|
|
39
|
-
function _throw(err) {
|
|
40
|
-
asyncGeneratorStep$7(gen, resolve, reject, _next, _throw, "throw", err);
|
|
41
|
-
}
|
|
42
|
-
_next(undefined);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function _ts_generator$7(thisArg, body) {
|
|
47
|
-
var f, y, t, g, _ = {
|
|
48
|
-
label: 0,
|
|
49
|
-
sent: function() {
|
|
50
|
-
if (t[0] & 1) throw t[1];
|
|
51
|
-
return t[1];
|
|
52
|
-
},
|
|
53
|
-
trys: [],
|
|
54
|
-
ops: []
|
|
55
|
-
};
|
|
56
|
-
return g = {
|
|
57
|
-
next: verb(0),
|
|
58
|
-
"throw": verb(1),
|
|
59
|
-
"return": verb(2)
|
|
60
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
61
|
-
return this;
|
|
62
|
-
}), g;
|
|
63
|
-
function verb(n) {
|
|
64
|
-
return function(v) {
|
|
65
|
-
return step([
|
|
66
|
-
n,
|
|
67
|
-
v
|
|
68
|
-
]);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function step(op) {
|
|
72
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
73
|
-
while(_)try {
|
|
74
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
75
|
-
if (y = 0, t) op = [
|
|
76
|
-
op[0] & 2,
|
|
77
|
-
t.value
|
|
78
|
-
];
|
|
79
|
-
switch(op[0]){
|
|
80
|
-
case 0:
|
|
81
|
-
case 1:
|
|
82
|
-
t = op;
|
|
83
|
-
break;
|
|
84
|
-
case 4:
|
|
85
|
-
_.label++;
|
|
86
|
-
return {
|
|
87
|
-
value: op[1],
|
|
88
|
-
done: false
|
|
89
|
-
};
|
|
90
|
-
case 5:
|
|
91
|
-
_.label++;
|
|
92
|
-
y = op[1];
|
|
93
|
-
op = [
|
|
94
|
-
0
|
|
95
|
-
];
|
|
96
|
-
continue;
|
|
97
|
-
case 7:
|
|
98
|
-
op = _.ops.pop();
|
|
99
|
-
_.trys.pop();
|
|
100
|
-
continue;
|
|
101
|
-
default:
|
|
102
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
103
|
-
_ = 0;
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
107
|
-
_.label = op[1];
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
111
|
-
_.label = t[1];
|
|
112
|
-
t = op;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
if (t && _.label < t[2]) {
|
|
116
|
-
_.label = t[2];
|
|
117
|
-
_.ops.push(op);
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
if (t[2]) _.ops.pop();
|
|
121
|
-
_.trys.pop();
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
op = body.call(thisArg, _);
|
|
125
|
-
} catch (e) {
|
|
126
|
-
op = [
|
|
127
|
-
6,
|
|
128
|
-
e
|
|
129
|
-
];
|
|
130
|
-
y = 0;
|
|
131
|
-
} finally{
|
|
132
|
-
f = t = 0;
|
|
133
|
-
}
|
|
134
|
-
if (op[0] & 5) throw op[1];
|
|
135
|
-
return {
|
|
136
|
-
value: op[0] ? op[1] : void 0,
|
|
137
|
-
done: true
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
var resolveCredentialSource = function(credentialSource, profileName, logger) {
|
|
142
|
-
var sourceProvidersMap = {
|
|
143
|
-
EcsContainer: function() {
|
|
144
|
-
var _ref = _async_to_generator$7(function(options) {
|
|
145
|
-
var fromHttp, fromContainerMetadata;
|
|
146
|
-
return _ts_generator$7(this, function(_state) {
|
|
147
|
-
switch(_state.label){
|
|
148
|
-
case 0:
|
|
149
|
-
return [
|
|
150
|
-
4,
|
|
151
|
-
import('./index.esm7.js')
|
|
152
|
-
];
|
|
153
|
-
case 1:
|
|
154
|
-
fromHttp = _state.sent().fromHttp;
|
|
155
|
-
return [
|
|
156
|
-
4,
|
|
157
|
-
import('./index.esm9.js')
|
|
158
|
-
];
|
|
159
|
-
case 2:
|
|
160
|
-
fromContainerMetadata = _state.sent().fromContainerMetadata;
|
|
161
|
-
logger === null || logger === void 0 ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
|
|
162
|
-
return [
|
|
163
|
-
2,
|
|
164
|
-
/*#__PURE__*/ _async_to_generator$7(function() {
|
|
165
|
-
return _ts_generator$7(this, function(_state) {
|
|
166
|
-
return [
|
|
167
|
-
2,
|
|
168
|
-
chain(fromHttp(options !== null && options !== void 0 ? options : {}), fromContainerMetadata(options))().then(setNamedProvider)
|
|
169
|
-
];
|
|
170
|
-
});
|
|
171
|
-
})
|
|
172
|
-
];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
return function(options) {
|
|
177
|
-
return _ref.apply(this, arguments);
|
|
178
|
-
};
|
|
179
|
-
}(),
|
|
180
|
-
Ec2InstanceMetadata: function() {
|
|
181
|
-
var _ref = _async_to_generator$7(function(options) {
|
|
182
|
-
var fromInstanceMetadata;
|
|
183
|
-
return _ts_generator$7(this, function(_state) {
|
|
184
|
-
switch(_state.label){
|
|
185
|
-
case 0:
|
|
186
|
-
logger === null || logger === void 0 ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
|
|
187
|
-
return [
|
|
188
|
-
4,
|
|
189
|
-
import('./index.esm9.js')
|
|
190
|
-
];
|
|
191
|
-
case 1:
|
|
192
|
-
fromInstanceMetadata = _state.sent().fromInstanceMetadata;
|
|
193
|
-
return [
|
|
194
|
-
2,
|
|
195
|
-
/*#__PURE__*/ _async_to_generator$7(function() {
|
|
196
|
-
return _ts_generator$7(this, function(_state) {
|
|
197
|
-
return [
|
|
198
|
-
2,
|
|
199
|
-
fromInstanceMetadata(options)().then(setNamedProvider)
|
|
200
|
-
];
|
|
201
|
-
});
|
|
202
|
-
})
|
|
203
|
-
];
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
return function(options) {
|
|
208
|
-
return _ref.apply(this, arguments);
|
|
209
|
-
};
|
|
210
|
-
}(),
|
|
211
|
-
Environment: function() {
|
|
212
|
-
var _ref = _async_to_generator$7(function(options) {
|
|
213
|
-
var fromEnv;
|
|
214
|
-
return _ts_generator$7(this, function(_state) {
|
|
215
|
-
switch(_state.label){
|
|
216
|
-
case 0:
|
|
217
|
-
logger === null || logger === void 0 ? void 0 : logger.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
|
218
|
-
return [
|
|
219
|
-
4,
|
|
220
|
-
import('./index.esm2.js')
|
|
221
|
-
];
|
|
222
|
-
case 1:
|
|
223
|
-
fromEnv = _state.sent().fromEnv;
|
|
224
|
-
return [
|
|
225
|
-
2,
|
|
226
|
-
/*#__PURE__*/ _async_to_generator$7(function() {
|
|
227
|
-
return _ts_generator$7(this, function(_state) {
|
|
228
|
-
return [
|
|
229
|
-
2,
|
|
230
|
-
fromEnv(options)().then(setNamedProvider)
|
|
231
|
-
];
|
|
232
|
-
});
|
|
233
|
-
})
|
|
234
|
-
];
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
return function(options) {
|
|
239
|
-
return _ref.apply(this, arguments);
|
|
240
|
-
};
|
|
241
|
-
}()
|
|
242
|
-
};
|
|
243
|
-
if (credentialSource in sourceProvidersMap) {
|
|
244
|
-
return sourceProvidersMap[credentialSource];
|
|
245
|
-
} else {
|
|
246
|
-
throw new CredentialsProviderError("Unsupported credential source in profile ".concat(profileName, ". Got ").concat(credentialSource, ", ") + "expected EcsContainer or Ec2InstanceMetadata or Environment.", {
|
|
247
|
-
logger: logger
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
var setNamedProvider = function(creds) {
|
|
252
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p");
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
function asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, key, arg) {
|
|
256
|
-
try {
|
|
257
|
-
var info = gen[key](arg);
|
|
258
|
-
var value = info.value;
|
|
259
|
-
} catch (error) {
|
|
260
|
-
reject(error);
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
if (info.done) {
|
|
264
|
-
resolve(value);
|
|
265
|
-
} else {
|
|
266
|
-
Promise.resolve(value).then(_next, _throw);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
function _async_to_generator$6(fn) {
|
|
270
|
-
return function() {
|
|
271
|
-
var self = this, args = arguments;
|
|
272
|
-
return new Promise(function(resolve, reject) {
|
|
273
|
-
var gen = fn.apply(self, args);
|
|
274
|
-
function _next(value) {
|
|
275
|
-
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "next", value);
|
|
276
|
-
}
|
|
277
|
-
function _throw(err) {
|
|
278
|
-
asyncGeneratorStep$6(gen, resolve, reject, _next, _throw, "throw", err);
|
|
279
|
-
}
|
|
280
|
-
_next(undefined);
|
|
281
|
-
});
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
function _define_property$3(obj, key, value) {
|
|
285
|
-
if (key in obj) {
|
|
286
|
-
Object.defineProperty(obj, key, {
|
|
287
|
-
value: value,
|
|
288
|
-
enumerable: true,
|
|
289
|
-
configurable: true,
|
|
290
|
-
writable: true
|
|
291
|
-
});
|
|
292
|
-
} else {
|
|
293
|
-
obj[key] = value;
|
|
294
|
-
}
|
|
295
|
-
return obj;
|
|
296
|
-
}
|
|
297
|
-
function _object_spread$3(target) {
|
|
298
|
-
for(var i = 1; i < arguments.length; i++){
|
|
299
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
300
|
-
var ownKeys = Object.keys(source);
|
|
301
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
302
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
303
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
304
|
-
}));
|
|
305
|
-
}
|
|
306
|
-
ownKeys.forEach(function(key) {
|
|
307
|
-
_define_property$3(target, key, source[key]);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
return target;
|
|
311
|
-
}
|
|
312
|
-
function ownKeys$2(object, enumerableOnly) {
|
|
313
|
-
var keys = Object.keys(object);
|
|
314
|
-
if (Object.getOwnPropertySymbols) {
|
|
315
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
316
|
-
keys.push.apply(keys, symbols);
|
|
317
|
-
}
|
|
318
|
-
return keys;
|
|
319
|
-
}
|
|
320
|
-
function _object_spread_props$2(target, source) {
|
|
321
|
-
source = source != null ? source : {};
|
|
322
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
323
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
324
|
-
} else {
|
|
325
|
-
ownKeys$2(Object(source)).forEach(function(key) {
|
|
326
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
return target;
|
|
330
|
-
}
|
|
331
|
-
function _type_of$3(obj) {
|
|
332
|
-
"@swc/helpers - typeof";
|
|
333
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
334
|
-
}
|
|
335
|
-
function _ts_generator$6(thisArg, body) {
|
|
336
|
-
var f, y, t, g, _ = {
|
|
337
|
-
label: 0,
|
|
338
|
-
sent: function() {
|
|
339
|
-
if (t[0] & 1) throw t[1];
|
|
340
|
-
return t[1];
|
|
341
|
-
},
|
|
342
|
-
trys: [],
|
|
343
|
-
ops: []
|
|
344
|
-
};
|
|
345
|
-
return g = {
|
|
346
|
-
next: verb(0),
|
|
347
|
-
"throw": verb(1),
|
|
348
|
-
"return": verb(2)
|
|
349
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
350
|
-
return this;
|
|
351
|
-
}), g;
|
|
352
|
-
function verb(n) {
|
|
353
|
-
return function(v) {
|
|
354
|
-
return step([
|
|
355
|
-
n,
|
|
356
|
-
v
|
|
357
|
-
]);
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
function step(op) {
|
|
361
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
362
|
-
while(_)try {
|
|
363
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
364
|
-
if (y = 0, t) op = [
|
|
365
|
-
op[0] & 2,
|
|
366
|
-
t.value
|
|
367
|
-
];
|
|
368
|
-
switch(op[0]){
|
|
369
|
-
case 0:
|
|
370
|
-
case 1:
|
|
371
|
-
t = op;
|
|
372
|
-
break;
|
|
373
|
-
case 4:
|
|
374
|
-
_.label++;
|
|
375
|
-
return {
|
|
376
|
-
value: op[1],
|
|
377
|
-
done: false
|
|
378
|
-
};
|
|
379
|
-
case 5:
|
|
380
|
-
_.label++;
|
|
381
|
-
y = op[1];
|
|
382
|
-
op = [
|
|
383
|
-
0
|
|
384
|
-
];
|
|
385
|
-
continue;
|
|
386
|
-
case 7:
|
|
387
|
-
op = _.ops.pop();
|
|
388
|
-
_.trys.pop();
|
|
389
|
-
continue;
|
|
390
|
-
default:
|
|
391
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
392
|
-
_ = 0;
|
|
393
|
-
continue;
|
|
394
|
-
}
|
|
395
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
396
|
-
_.label = op[1];
|
|
397
|
-
break;
|
|
398
|
-
}
|
|
399
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
400
|
-
_.label = t[1];
|
|
401
|
-
t = op;
|
|
402
|
-
break;
|
|
403
|
-
}
|
|
404
|
-
if (t && _.label < t[2]) {
|
|
405
|
-
_.label = t[2];
|
|
406
|
-
_.ops.push(op);
|
|
407
|
-
break;
|
|
408
|
-
}
|
|
409
|
-
if (t[2]) _.ops.pop();
|
|
410
|
-
_.trys.pop();
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
op = body.call(thisArg, _);
|
|
414
|
-
} catch (e) {
|
|
415
|
-
op = [
|
|
416
|
-
6,
|
|
417
|
-
e
|
|
418
|
-
];
|
|
419
|
-
y = 0;
|
|
420
|
-
} finally{
|
|
421
|
-
f = t = 0;
|
|
422
|
-
}
|
|
423
|
-
if (op[0] & 5) throw op[1];
|
|
424
|
-
return {
|
|
425
|
-
value: op[0] ? op[1] : void 0,
|
|
426
|
-
done: true
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
var isAssumeRoleProfile = function(arg) {
|
|
431
|
-
var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref_profile = _ref.profile, profile = _ref_profile === void 0 ? "default" : _ref_profile, logger = _ref.logger;
|
|
432
|
-
return Boolean(arg) && (typeof arg === "undefined" ? "undefined" : _type_of$3(arg)) === "object" && typeof arg.role_arn === "string" && [
|
|
433
|
-
"undefined",
|
|
434
|
-
"string"
|
|
435
|
-
].indexOf(_type_of$3(arg.role_session_name)) > -1 && [
|
|
436
|
-
"undefined",
|
|
437
|
-
"string"
|
|
438
|
-
].indexOf(_type_of$3(arg.external_id)) > -1 && [
|
|
439
|
-
"undefined",
|
|
440
|
-
"string"
|
|
441
|
-
].indexOf(_type_of$3(arg.mfa_serial)) > -1 && (isAssumeRoleWithSourceProfile(arg, {
|
|
442
|
-
profile: profile,
|
|
443
|
-
logger: logger
|
|
444
|
-
}) || isCredentialSourceProfile(arg, {
|
|
445
|
-
profile: profile,
|
|
446
|
-
logger: logger
|
|
447
|
-
}));
|
|
448
|
-
};
|
|
449
|
-
var isAssumeRoleWithSourceProfile = function(arg, param) {
|
|
450
|
-
var profile = param.profile, logger = param.logger;
|
|
451
|
-
var withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
|
|
452
|
-
if (withSourceProfile) {
|
|
453
|
-
var _logger_debug;
|
|
454
|
-
logger === null || logger === void 0 ? void 0 : (_logger_debug = logger.debug) === null || _logger_debug === void 0 ? void 0 : _logger_debug.call(logger, " ".concat(profile, " isAssumeRoleWithSourceProfile source_profile=").concat(arg.source_profile));
|
|
455
|
-
}
|
|
456
|
-
return withSourceProfile;
|
|
457
|
-
};
|
|
458
|
-
var isCredentialSourceProfile = function(arg, param) {
|
|
459
|
-
var profile = param.profile, logger = param.logger;
|
|
460
|
-
var withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
|
|
461
|
-
if (withProviderProfile) {
|
|
462
|
-
var _logger_debug;
|
|
463
|
-
logger === null || logger === void 0 ? void 0 : (_logger_debug = logger.debug) === null || _logger_debug === void 0 ? void 0 : _logger_debug.call(logger, " ".concat(profile, " isCredentialSourceProfile credential_source=").concat(arg.credential_source));
|
|
464
|
-
}
|
|
465
|
-
return withProviderProfile;
|
|
466
|
-
};
|
|
467
|
-
var resolveAssumeRoleCredentials = function() {
|
|
468
|
-
var _ref = _async_to_generator$6(function(profileName, profiles, options) {
|
|
469
|
-
var visitedProfiles, _options_logger, _options_logger1, profileData, source_profile, region, _options_parentClientConfig, getDefaultRoleAssumer, _profiles_source_profile, sourceCredsProvider, _tmp, params, mfa_serial, sourceCreds;
|
|
470
|
-
var _arguments = arguments;
|
|
471
|
-
return _ts_generator$6(this, function(_state) {
|
|
472
|
-
switch(_state.label){
|
|
473
|
-
case 0:
|
|
474
|
-
visitedProfiles = _arguments.length > 3 && _arguments[3] !== void 0 ? _arguments[3] : {};
|
|
475
|
-
(_options_logger = options.logger) === null || _options_logger === void 0 ? void 0 : _options_logger.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
|
|
476
|
-
profileData = profiles[profileName];
|
|
477
|
-
source_profile = profileData.source_profile, region = profileData.region;
|
|
478
|
-
if (!!options.roleAssumer) return [
|
|
479
|
-
3,
|
|
480
|
-
2
|
|
481
|
-
];
|
|
482
|
-
return [
|
|
483
|
-
4,
|
|
484
|
-
import('./index.esm5.js')
|
|
485
|
-
];
|
|
486
|
-
case 1:
|
|
487
|
-
getDefaultRoleAssumer = _state.sent().getDefaultRoleAssumer;
|
|
488
|
-
options.roleAssumer = getDefaultRoleAssumer(_object_spread_props$2(_object_spread$3({}, options.clientConfig), {
|
|
489
|
-
credentialProviderLogger: options.logger,
|
|
490
|
-
parentClientConfig: _object_spread_props$2(_object_spread$3({}, options === null || options === void 0 ? void 0 : options.parentClientConfig), {
|
|
491
|
-
region: region !== null && region !== void 0 ? region : options === null || options === void 0 ? void 0 : (_options_parentClientConfig = options.parentClientConfig) === null || _options_parentClientConfig === void 0 ? void 0 : _options_parentClientConfig.region
|
|
492
|
-
})
|
|
493
|
-
}), options.clientPlugins);
|
|
494
|
-
_state.label = 2;
|
|
495
|
-
case 2:
|
|
496
|
-
if (source_profile && source_profile in visitedProfiles) {
|
|
497
|
-
throw new CredentialsProviderError("Detected a cycle attempting to resolve credentials for profile" + " ".concat(getProfileName(options), ". Profiles visited: ") + Object.keys(visitedProfiles).join(", "), {
|
|
498
|
-
logger: options.logger
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
(_options_logger1 = options.logger) === null || _options_logger1 === void 0 ? void 0 : _options_logger1.debug("@aws-sdk/credential-provider-ini - finding credential resolver using ".concat(source_profile ? "source_profile=[".concat(source_profile, "]") : "profile=[".concat(profileName, "]")));
|
|
502
|
-
if (!source_profile) return [
|
|
503
|
-
3,
|
|
504
|
-
3
|
|
505
|
-
];
|
|
506
|
-
_tmp = resolveProfileData(source_profile, profiles, options, _object_spread_props$2(_object_spread$3({}, visitedProfiles), _define_property$3({}, source_profile, true)), isCredentialSourceWithoutRoleArn((_profiles_source_profile = profiles[source_profile]) !== null && _profiles_source_profile !== void 0 ? _profiles_source_profile : {}));
|
|
507
|
-
return [
|
|
508
|
-
3,
|
|
509
|
-
5
|
|
510
|
-
];
|
|
511
|
-
case 3:
|
|
512
|
-
return [
|
|
513
|
-
4,
|
|
514
|
-
resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options)
|
|
515
|
-
];
|
|
516
|
-
case 4:
|
|
517
|
-
_tmp = _state.sent()();
|
|
518
|
-
_state.label = 5;
|
|
519
|
-
case 5:
|
|
520
|
-
sourceCredsProvider = _tmp;
|
|
521
|
-
if (!isCredentialSourceWithoutRoleArn(profileData)) return [
|
|
522
|
-
3,
|
|
523
|
-
6
|
|
524
|
-
];
|
|
525
|
-
return [
|
|
526
|
-
2,
|
|
527
|
-
sourceCredsProvider.then(function(creds) {
|
|
528
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o");
|
|
529
|
-
})
|
|
530
|
-
];
|
|
531
|
-
case 6:
|
|
532
|
-
params = {
|
|
533
|
-
RoleArn: profileData.role_arn,
|
|
534
|
-
RoleSessionName: profileData.role_session_name || "aws-sdk-js-".concat(Date.now()),
|
|
535
|
-
ExternalId: profileData.external_id,
|
|
536
|
-
DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10)
|
|
537
|
-
};
|
|
538
|
-
mfa_serial = profileData.mfa_serial;
|
|
539
|
-
if (!mfa_serial) return [
|
|
540
|
-
3,
|
|
541
|
-
8
|
|
542
|
-
];
|
|
543
|
-
if (!options.mfaCodeProvider) {
|
|
544
|
-
throw new CredentialsProviderError("Profile ".concat(profileName, " requires multi-factor authentication, but no MFA code callback was provided."), {
|
|
545
|
-
logger: options.logger,
|
|
546
|
-
tryNextLink: false
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
params.SerialNumber = mfa_serial;
|
|
550
|
-
return [
|
|
551
|
-
4,
|
|
552
|
-
options.mfaCodeProvider(mfa_serial)
|
|
553
|
-
];
|
|
554
|
-
case 7:
|
|
555
|
-
params.TokenCode = _state.sent();
|
|
556
|
-
_state.label = 8;
|
|
557
|
-
case 8:
|
|
558
|
-
return [
|
|
559
|
-
4,
|
|
560
|
-
sourceCredsProvider
|
|
561
|
-
];
|
|
562
|
-
case 9:
|
|
563
|
-
sourceCreds = _state.sent();
|
|
564
|
-
return [
|
|
565
|
-
2,
|
|
566
|
-
options.roleAssumer(sourceCreds, params).then(function(creds) {
|
|
567
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o");
|
|
568
|
-
})
|
|
569
|
-
];
|
|
570
|
-
case 10:
|
|
571
|
-
return [
|
|
572
|
-
2
|
|
573
|
-
];
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
});
|
|
577
|
-
return function resolveAssumeRoleCredentials(profileName, profiles, options) {
|
|
578
|
-
return _ref.apply(this, arguments);
|
|
579
|
-
};
|
|
580
|
-
}();
|
|
581
|
-
var isCredentialSourceWithoutRoleArn = function(section) {
|
|
582
|
-
return !section.role_arn && !!section.credential_source;
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
function asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, key, arg) {
|
|
586
|
-
try {
|
|
587
|
-
var info = gen[key](arg);
|
|
588
|
-
var value = info.value;
|
|
589
|
-
} catch (error) {
|
|
590
|
-
reject(error);
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
if (info.done) {
|
|
594
|
-
resolve(value);
|
|
595
|
-
} else {
|
|
596
|
-
Promise.resolve(value).then(_next, _throw);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
function _async_to_generator$5(fn) {
|
|
600
|
-
return function() {
|
|
601
|
-
var self = this, args = arguments;
|
|
602
|
-
return new Promise(function(resolve, reject) {
|
|
603
|
-
var gen = fn.apply(self, args);
|
|
604
|
-
function _next(value) {
|
|
605
|
-
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "next", value);
|
|
606
|
-
}
|
|
607
|
-
function _throw(err) {
|
|
608
|
-
asyncGeneratorStep$5(gen, resolve, reject, _next, _throw, "throw", err);
|
|
609
|
-
}
|
|
610
|
-
_next(undefined);
|
|
611
|
-
});
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
|
-
function _define_property$2(obj, key, value) {
|
|
615
|
-
if (key in obj) {
|
|
616
|
-
Object.defineProperty(obj, key, {
|
|
617
|
-
value: value,
|
|
618
|
-
enumerable: true,
|
|
619
|
-
configurable: true,
|
|
620
|
-
writable: true
|
|
621
|
-
});
|
|
622
|
-
} else {
|
|
623
|
-
obj[key] = value;
|
|
624
|
-
}
|
|
625
|
-
return obj;
|
|
626
|
-
}
|
|
627
|
-
function _object_spread$2(target) {
|
|
628
|
-
for(var i = 1; i < arguments.length; i++){
|
|
629
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
630
|
-
var ownKeys = Object.keys(source);
|
|
631
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
632
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
633
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
634
|
-
}));
|
|
635
|
-
}
|
|
636
|
-
ownKeys.forEach(function(key) {
|
|
637
|
-
_define_property$2(target, key, source[key]);
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
return target;
|
|
641
|
-
}
|
|
642
|
-
function ownKeys$1(object, enumerableOnly) {
|
|
643
|
-
var keys = Object.keys(object);
|
|
644
|
-
if (Object.getOwnPropertySymbols) {
|
|
645
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
646
|
-
keys.push.apply(keys, symbols);
|
|
647
|
-
}
|
|
648
|
-
return keys;
|
|
649
|
-
}
|
|
650
|
-
function _object_spread_props$1(target, source) {
|
|
651
|
-
source = source != null ? source : {};
|
|
652
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
653
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
654
|
-
} else {
|
|
655
|
-
ownKeys$1(Object(source)).forEach(function(key) {
|
|
656
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
return target;
|
|
660
|
-
}
|
|
661
|
-
function _type_of$2(obj) {
|
|
662
|
-
"@swc/helpers - typeof";
|
|
663
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
664
|
-
}
|
|
665
|
-
function _ts_generator$5(thisArg, body) {
|
|
666
|
-
var f, y, t, g, _ = {
|
|
667
|
-
label: 0,
|
|
668
|
-
sent: function() {
|
|
669
|
-
if (t[0] & 1) throw t[1];
|
|
670
|
-
return t[1];
|
|
671
|
-
},
|
|
672
|
-
trys: [],
|
|
673
|
-
ops: []
|
|
674
|
-
};
|
|
675
|
-
return g = {
|
|
676
|
-
next: verb(0),
|
|
677
|
-
"throw": verb(1),
|
|
678
|
-
"return": verb(2)
|
|
679
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
680
|
-
return this;
|
|
681
|
-
}), g;
|
|
682
|
-
function verb(n) {
|
|
683
|
-
return function(v) {
|
|
684
|
-
return step([
|
|
685
|
-
n,
|
|
686
|
-
v
|
|
687
|
-
]);
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
function step(op) {
|
|
691
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
692
|
-
while(_)try {
|
|
693
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
694
|
-
if (y = 0, t) op = [
|
|
695
|
-
op[0] & 2,
|
|
696
|
-
t.value
|
|
697
|
-
];
|
|
698
|
-
switch(op[0]){
|
|
699
|
-
case 0:
|
|
700
|
-
case 1:
|
|
701
|
-
t = op;
|
|
702
|
-
break;
|
|
703
|
-
case 4:
|
|
704
|
-
_.label++;
|
|
705
|
-
return {
|
|
706
|
-
value: op[1],
|
|
707
|
-
done: false
|
|
708
|
-
};
|
|
709
|
-
case 5:
|
|
710
|
-
_.label++;
|
|
711
|
-
y = op[1];
|
|
712
|
-
op = [
|
|
713
|
-
0
|
|
714
|
-
];
|
|
715
|
-
continue;
|
|
716
|
-
case 7:
|
|
717
|
-
op = _.ops.pop();
|
|
718
|
-
_.trys.pop();
|
|
719
|
-
continue;
|
|
720
|
-
default:
|
|
721
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
722
|
-
_ = 0;
|
|
723
|
-
continue;
|
|
724
|
-
}
|
|
725
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
726
|
-
_.label = op[1];
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
730
|
-
_.label = t[1];
|
|
731
|
-
t = op;
|
|
732
|
-
break;
|
|
733
|
-
}
|
|
734
|
-
if (t && _.label < t[2]) {
|
|
735
|
-
_.label = t[2];
|
|
736
|
-
_.ops.push(op);
|
|
737
|
-
break;
|
|
738
|
-
}
|
|
739
|
-
if (t[2]) _.ops.pop();
|
|
740
|
-
_.trys.pop();
|
|
741
|
-
continue;
|
|
742
|
-
}
|
|
743
|
-
op = body.call(thisArg, _);
|
|
744
|
-
} catch (e) {
|
|
745
|
-
op = [
|
|
746
|
-
6,
|
|
747
|
-
e
|
|
748
|
-
];
|
|
749
|
-
y = 0;
|
|
750
|
-
} finally{
|
|
751
|
-
f = t = 0;
|
|
752
|
-
}
|
|
753
|
-
if (op[0] & 5) throw op[1];
|
|
754
|
-
return {
|
|
755
|
-
value: op[0] ? op[1] : void 0,
|
|
756
|
-
done: true
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
var isProcessProfile = function(arg) {
|
|
761
|
-
return Boolean(arg) && (typeof arg === "undefined" ? "undefined" : _type_of$2(arg)) === "object" && typeof arg.credential_process === "string";
|
|
762
|
-
};
|
|
763
|
-
var resolveProcessCredentials = function() {
|
|
764
|
-
var _ref = _async_to_generator$5(function(options, profile) {
|
|
765
|
-
return _ts_generator$5(this, function(_state) {
|
|
766
|
-
return [
|
|
767
|
-
2,
|
|
768
|
-
import('./index.esm6.js').then(function(param) {
|
|
769
|
-
var fromProcess = param.fromProcess;
|
|
770
|
-
return fromProcess(_object_spread_props$1(_object_spread$2({}, options), {
|
|
771
|
-
profile: profile
|
|
772
|
-
}))().then(function(creds) {
|
|
773
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v");
|
|
774
|
-
});
|
|
775
|
-
})
|
|
776
|
-
];
|
|
777
|
-
});
|
|
778
|
-
});
|
|
779
|
-
return function resolveProcessCredentials(options, profile) {
|
|
780
|
-
return _ref.apply(this, arguments);
|
|
781
|
-
};
|
|
782
|
-
}();
|
|
783
|
-
|
|
784
|
-
function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
785
|
-
try {
|
|
786
|
-
var info = gen[key](arg);
|
|
787
|
-
var value = info.value;
|
|
788
|
-
} catch (error) {
|
|
789
|
-
reject(error);
|
|
790
|
-
return;
|
|
791
|
-
}
|
|
792
|
-
if (info.done) {
|
|
793
|
-
resolve(value);
|
|
794
|
-
} else {
|
|
795
|
-
Promise.resolve(value).then(_next, _throw);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
function _async_to_generator$4(fn) {
|
|
799
|
-
return function() {
|
|
800
|
-
var self = this, args = arguments;
|
|
801
|
-
return new Promise(function(resolve, reject) {
|
|
802
|
-
var gen = fn.apply(self, args);
|
|
803
|
-
function _next(value) {
|
|
804
|
-
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "next", value);
|
|
805
|
-
}
|
|
806
|
-
function _throw(err) {
|
|
807
|
-
asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, "throw", err);
|
|
808
|
-
}
|
|
809
|
-
_next(undefined);
|
|
810
|
-
});
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
function _ts_generator$4(thisArg, body) {
|
|
814
|
-
var f, y, t, g, _ = {
|
|
815
|
-
label: 0,
|
|
816
|
-
sent: function() {
|
|
817
|
-
if (t[0] & 1) throw t[1];
|
|
818
|
-
return t[1];
|
|
819
|
-
},
|
|
820
|
-
trys: [],
|
|
821
|
-
ops: []
|
|
822
|
-
};
|
|
823
|
-
return g = {
|
|
824
|
-
next: verb(0),
|
|
825
|
-
"throw": verb(1),
|
|
826
|
-
"return": verb(2)
|
|
827
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
828
|
-
return this;
|
|
829
|
-
}), g;
|
|
830
|
-
function verb(n) {
|
|
831
|
-
return function(v) {
|
|
832
|
-
return step([
|
|
833
|
-
n,
|
|
834
|
-
v
|
|
835
|
-
]);
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
function step(op) {
|
|
839
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
840
|
-
while(_)try {
|
|
841
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
842
|
-
if (y = 0, t) op = [
|
|
843
|
-
op[0] & 2,
|
|
844
|
-
t.value
|
|
845
|
-
];
|
|
846
|
-
switch(op[0]){
|
|
847
|
-
case 0:
|
|
848
|
-
case 1:
|
|
849
|
-
t = op;
|
|
850
|
-
break;
|
|
851
|
-
case 4:
|
|
852
|
-
_.label++;
|
|
853
|
-
return {
|
|
854
|
-
value: op[1],
|
|
855
|
-
done: false
|
|
856
|
-
};
|
|
857
|
-
case 5:
|
|
858
|
-
_.label++;
|
|
859
|
-
y = op[1];
|
|
860
|
-
op = [
|
|
861
|
-
0
|
|
862
|
-
];
|
|
863
|
-
continue;
|
|
864
|
-
case 7:
|
|
865
|
-
op = _.ops.pop();
|
|
866
|
-
_.trys.pop();
|
|
867
|
-
continue;
|
|
868
|
-
default:
|
|
869
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
870
|
-
_ = 0;
|
|
871
|
-
continue;
|
|
872
|
-
}
|
|
873
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
874
|
-
_.label = op[1];
|
|
875
|
-
break;
|
|
876
|
-
}
|
|
877
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
878
|
-
_.label = t[1];
|
|
879
|
-
t = op;
|
|
880
|
-
break;
|
|
881
|
-
}
|
|
882
|
-
if (t && _.label < t[2]) {
|
|
883
|
-
_.label = t[2];
|
|
884
|
-
_.ops.push(op);
|
|
885
|
-
break;
|
|
886
|
-
}
|
|
887
|
-
if (t[2]) _.ops.pop();
|
|
888
|
-
_.trys.pop();
|
|
889
|
-
continue;
|
|
890
|
-
}
|
|
891
|
-
op = body.call(thisArg, _);
|
|
892
|
-
} catch (e) {
|
|
893
|
-
op = [
|
|
894
|
-
6,
|
|
895
|
-
e
|
|
896
|
-
];
|
|
897
|
-
y = 0;
|
|
898
|
-
} finally{
|
|
899
|
-
f = t = 0;
|
|
900
|
-
}
|
|
901
|
-
if (op[0] & 5) throw op[1];
|
|
902
|
-
return {
|
|
903
|
-
value: op[0] ? op[1] : void 0,
|
|
904
|
-
done: true
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
var resolveSsoCredentials = function() {
|
|
909
|
-
var _ref = _async_to_generator$4(function(profile, profileData) {
|
|
910
|
-
var options, fromSSO;
|
|
911
|
-
var _arguments = arguments;
|
|
912
|
-
return _ts_generator$4(this, function(_state) {
|
|
913
|
-
switch(_state.label){
|
|
914
|
-
case 0:
|
|
915
|
-
options = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
|
|
916
|
-
return [
|
|
917
|
-
4,
|
|
918
|
-
import('./index.esm10.js')
|
|
919
|
-
];
|
|
920
|
-
case 1:
|
|
921
|
-
fromSSO = _state.sent().fromSSO;
|
|
922
|
-
return [
|
|
923
|
-
2,
|
|
924
|
-
fromSSO({
|
|
925
|
-
profile: profile,
|
|
926
|
-
logger: options.logger,
|
|
927
|
-
parentClientConfig: options.parentClientConfig,
|
|
928
|
-
clientConfig: options.clientConfig
|
|
929
|
-
})().then(function(creds) {
|
|
930
|
-
if (profileData.sso_session) {
|
|
931
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r");
|
|
932
|
-
} else {
|
|
933
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t");
|
|
934
|
-
}
|
|
935
|
-
})
|
|
936
|
-
];
|
|
937
|
-
}
|
|
938
|
-
});
|
|
939
|
-
});
|
|
940
|
-
return function resolveSsoCredentials(profile, profileData) {
|
|
941
|
-
return _ref.apply(this, arguments);
|
|
942
|
-
};
|
|
943
|
-
}();
|
|
944
|
-
var isSsoProfile = function(arg) {
|
|
945
|
-
return arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
|
|
946
|
-
};
|
|
947
|
-
|
|
948
|
-
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
949
|
-
try {
|
|
950
|
-
var info = gen[key](arg);
|
|
951
|
-
var value = info.value;
|
|
952
|
-
} catch (error) {
|
|
953
|
-
reject(error);
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
if (info.done) {
|
|
957
|
-
resolve(value);
|
|
958
|
-
} else {
|
|
959
|
-
Promise.resolve(value).then(_next, _throw);
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
function _async_to_generator$3(fn) {
|
|
963
|
-
return function() {
|
|
964
|
-
var self = this, args = arguments;
|
|
965
|
-
return new Promise(function(resolve, reject) {
|
|
966
|
-
var gen = fn.apply(self, args);
|
|
967
|
-
function _next(value) {
|
|
968
|
-
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
969
|
-
}
|
|
970
|
-
function _throw(err) {
|
|
971
|
-
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
972
|
-
}
|
|
973
|
-
_next(undefined);
|
|
974
|
-
});
|
|
975
|
-
};
|
|
976
|
-
}
|
|
977
|
-
function _define_property$1(obj, key, value) {
|
|
978
|
-
if (key in obj) {
|
|
979
|
-
Object.defineProperty(obj, key, {
|
|
980
|
-
value: value,
|
|
981
|
-
enumerable: true,
|
|
982
|
-
configurable: true,
|
|
983
|
-
writable: true
|
|
984
|
-
});
|
|
985
|
-
} else {
|
|
986
|
-
obj[key] = value;
|
|
987
|
-
}
|
|
988
|
-
return obj;
|
|
989
|
-
}
|
|
990
|
-
function _object_spread$1(target) {
|
|
991
|
-
for(var i = 1; i < arguments.length; i++){
|
|
992
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
993
|
-
var ownKeys = Object.keys(source);
|
|
994
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
995
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
996
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
997
|
-
}));
|
|
998
|
-
}
|
|
999
|
-
ownKeys.forEach(function(key) {
|
|
1000
|
-
_define_property$1(target, key, source[key]);
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
return target;
|
|
1004
|
-
}
|
|
1005
|
-
function _type_of$1(obj) {
|
|
1006
|
-
"@swc/helpers - typeof";
|
|
1007
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1008
|
-
}
|
|
1009
|
-
function _ts_generator$3(thisArg, body) {
|
|
1010
|
-
var f, y, t, g, _ = {
|
|
1011
|
-
label: 0,
|
|
1012
|
-
sent: function() {
|
|
1013
|
-
if (t[0] & 1) throw t[1];
|
|
1014
|
-
return t[1];
|
|
1015
|
-
},
|
|
1016
|
-
trys: [],
|
|
1017
|
-
ops: []
|
|
1018
|
-
};
|
|
1019
|
-
return g = {
|
|
1020
|
-
next: verb(0),
|
|
1021
|
-
"throw": verb(1),
|
|
1022
|
-
"return": verb(2)
|
|
1023
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1024
|
-
return this;
|
|
1025
|
-
}), g;
|
|
1026
|
-
function verb(n) {
|
|
1027
|
-
return function(v) {
|
|
1028
|
-
return step([
|
|
1029
|
-
n,
|
|
1030
|
-
v
|
|
1031
|
-
]);
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
function step(op) {
|
|
1035
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1036
|
-
while(_)try {
|
|
1037
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1038
|
-
if (y = 0, t) op = [
|
|
1039
|
-
op[0] & 2,
|
|
1040
|
-
t.value
|
|
1041
|
-
];
|
|
1042
|
-
switch(op[0]){
|
|
1043
|
-
case 0:
|
|
1044
|
-
case 1:
|
|
1045
|
-
t = op;
|
|
1046
|
-
break;
|
|
1047
|
-
case 4:
|
|
1048
|
-
_.label++;
|
|
1049
|
-
return {
|
|
1050
|
-
value: op[1],
|
|
1051
|
-
done: false
|
|
1052
|
-
};
|
|
1053
|
-
case 5:
|
|
1054
|
-
_.label++;
|
|
1055
|
-
y = op[1];
|
|
1056
|
-
op = [
|
|
1057
|
-
0
|
|
1058
|
-
];
|
|
1059
|
-
continue;
|
|
1060
|
-
case 7:
|
|
1061
|
-
op = _.ops.pop();
|
|
1062
|
-
_.trys.pop();
|
|
1063
|
-
continue;
|
|
1064
|
-
default:
|
|
1065
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1066
|
-
_ = 0;
|
|
1067
|
-
continue;
|
|
1068
|
-
}
|
|
1069
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1070
|
-
_.label = op[1];
|
|
1071
|
-
break;
|
|
1072
|
-
}
|
|
1073
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1074
|
-
_.label = t[1];
|
|
1075
|
-
t = op;
|
|
1076
|
-
break;
|
|
1077
|
-
}
|
|
1078
|
-
if (t && _.label < t[2]) {
|
|
1079
|
-
_.label = t[2];
|
|
1080
|
-
_.ops.push(op);
|
|
1081
|
-
break;
|
|
1082
|
-
}
|
|
1083
|
-
if (t[2]) _.ops.pop();
|
|
1084
|
-
_.trys.pop();
|
|
1085
|
-
continue;
|
|
1086
|
-
}
|
|
1087
|
-
op = body.call(thisArg, _);
|
|
1088
|
-
} catch (e) {
|
|
1089
|
-
op = [
|
|
1090
|
-
6,
|
|
1091
|
-
e
|
|
1092
|
-
];
|
|
1093
|
-
y = 0;
|
|
1094
|
-
} finally{
|
|
1095
|
-
f = t = 0;
|
|
1096
|
-
}
|
|
1097
|
-
if (op[0] & 5) throw op[1];
|
|
1098
|
-
return {
|
|
1099
|
-
value: op[0] ? op[1] : void 0,
|
|
1100
|
-
done: true
|
|
1101
|
-
};
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
var isStaticCredsProfile = function(arg) {
|
|
1105
|
-
return Boolean(arg) && (typeof arg === "undefined" ? "undefined" : _type_of$1(arg)) === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && [
|
|
1106
|
-
"undefined",
|
|
1107
|
-
"string"
|
|
1108
|
-
].indexOf(_type_of$1(arg.aws_session_token)) > -1 && [
|
|
1109
|
-
"undefined",
|
|
1110
|
-
"string"
|
|
1111
|
-
].indexOf(_type_of$1(arg.aws_account_id)) > -1;
|
|
1112
|
-
};
|
|
1113
|
-
var resolveStaticCredentials = function() {
|
|
1114
|
-
var _ref = _async_to_generator$3(function(profile, options) {
|
|
1115
|
-
var _options_logger, credentials;
|
|
1116
|
-
return _ts_generator$3(this, function(_state) {
|
|
1117
|
-
options === null || options === void 0 ? void 0 : (_options_logger = options.logger) === null || _options_logger === void 0 ? void 0 : _options_logger.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
|
|
1118
|
-
credentials = _object_spread$1({
|
|
1119
|
-
accessKeyId: profile.aws_access_key_id,
|
|
1120
|
-
secretAccessKey: profile.aws_secret_access_key,
|
|
1121
|
-
sessionToken: profile.aws_session_token
|
|
1122
|
-
}, profile.aws_credential_scope && {
|
|
1123
|
-
credentialScope: profile.aws_credential_scope
|
|
1124
|
-
}, profile.aws_account_id && {
|
|
1125
|
-
accountId: profile.aws_account_id
|
|
1126
|
-
});
|
|
1127
|
-
return [
|
|
1128
|
-
2,
|
|
1129
|
-
setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n")
|
|
1130
|
-
];
|
|
1131
|
-
});
|
|
1132
|
-
});
|
|
1133
|
-
return function resolveStaticCredentials(profile, options) {
|
|
1134
|
-
return _ref.apply(this, arguments);
|
|
1135
|
-
};
|
|
1136
|
-
}();
|
|
1137
|
-
|
|
1138
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1139
|
-
try {
|
|
1140
|
-
var info = gen[key](arg);
|
|
1141
|
-
var value = info.value;
|
|
1142
|
-
} catch (error) {
|
|
1143
|
-
reject(error);
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
if (info.done) {
|
|
1147
|
-
resolve(value);
|
|
1148
|
-
} else {
|
|
1149
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
function _async_to_generator$2(fn) {
|
|
1153
|
-
return function() {
|
|
1154
|
-
var self = this, args = arguments;
|
|
1155
|
-
return new Promise(function(resolve, reject) {
|
|
1156
|
-
var gen = fn.apply(self, args);
|
|
1157
|
-
function _next(value) {
|
|
1158
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
1159
|
-
}
|
|
1160
|
-
function _throw(err) {
|
|
1161
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1162
|
-
}
|
|
1163
|
-
_next(undefined);
|
|
1164
|
-
});
|
|
1165
|
-
};
|
|
1166
|
-
}
|
|
1167
|
-
function _type_of(obj) {
|
|
1168
|
-
"@swc/helpers - typeof";
|
|
1169
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
1170
|
-
}
|
|
1171
|
-
function _ts_generator$2(thisArg, body) {
|
|
1172
|
-
var f, y, t, g, _ = {
|
|
1173
|
-
label: 0,
|
|
1174
|
-
sent: function() {
|
|
1175
|
-
if (t[0] & 1) throw t[1];
|
|
1176
|
-
return t[1];
|
|
1177
|
-
},
|
|
1178
|
-
trys: [],
|
|
1179
|
-
ops: []
|
|
1180
|
-
};
|
|
1181
|
-
return g = {
|
|
1182
|
-
next: verb(0),
|
|
1183
|
-
"throw": verb(1),
|
|
1184
|
-
"return": verb(2)
|
|
1185
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1186
|
-
return this;
|
|
1187
|
-
}), g;
|
|
1188
|
-
function verb(n) {
|
|
1189
|
-
return function(v) {
|
|
1190
|
-
return step([
|
|
1191
|
-
n,
|
|
1192
|
-
v
|
|
1193
|
-
]);
|
|
1194
|
-
};
|
|
1195
|
-
}
|
|
1196
|
-
function step(op) {
|
|
1197
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1198
|
-
while(_)try {
|
|
1199
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1200
|
-
if (y = 0, t) op = [
|
|
1201
|
-
op[0] & 2,
|
|
1202
|
-
t.value
|
|
1203
|
-
];
|
|
1204
|
-
switch(op[0]){
|
|
1205
|
-
case 0:
|
|
1206
|
-
case 1:
|
|
1207
|
-
t = op;
|
|
1208
|
-
break;
|
|
1209
|
-
case 4:
|
|
1210
|
-
_.label++;
|
|
1211
|
-
return {
|
|
1212
|
-
value: op[1],
|
|
1213
|
-
done: false
|
|
1214
|
-
};
|
|
1215
|
-
case 5:
|
|
1216
|
-
_.label++;
|
|
1217
|
-
y = op[1];
|
|
1218
|
-
op = [
|
|
1219
|
-
0
|
|
1220
|
-
];
|
|
1221
|
-
continue;
|
|
1222
|
-
case 7:
|
|
1223
|
-
op = _.ops.pop();
|
|
1224
|
-
_.trys.pop();
|
|
1225
|
-
continue;
|
|
1226
|
-
default:
|
|
1227
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1228
|
-
_ = 0;
|
|
1229
|
-
continue;
|
|
1230
|
-
}
|
|
1231
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1232
|
-
_.label = op[1];
|
|
1233
|
-
break;
|
|
1234
|
-
}
|
|
1235
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1236
|
-
_.label = t[1];
|
|
1237
|
-
t = op;
|
|
1238
|
-
break;
|
|
1239
|
-
}
|
|
1240
|
-
if (t && _.label < t[2]) {
|
|
1241
|
-
_.label = t[2];
|
|
1242
|
-
_.ops.push(op);
|
|
1243
|
-
break;
|
|
1244
|
-
}
|
|
1245
|
-
if (t[2]) _.ops.pop();
|
|
1246
|
-
_.trys.pop();
|
|
1247
|
-
continue;
|
|
1248
|
-
}
|
|
1249
|
-
op = body.call(thisArg, _);
|
|
1250
|
-
} catch (e) {
|
|
1251
|
-
op = [
|
|
1252
|
-
6,
|
|
1253
|
-
e
|
|
1254
|
-
];
|
|
1255
|
-
y = 0;
|
|
1256
|
-
} finally{
|
|
1257
|
-
f = t = 0;
|
|
1258
|
-
}
|
|
1259
|
-
if (op[0] & 5) throw op[1];
|
|
1260
|
-
return {
|
|
1261
|
-
value: op[0] ? op[1] : void 0,
|
|
1262
|
-
done: true
|
|
1263
|
-
};
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
var isWebIdentityProfile = function(arg) {
|
|
1267
|
-
return Boolean(arg) && (typeof arg === "undefined" ? "undefined" : _type_of(arg)) === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && [
|
|
1268
|
-
"undefined",
|
|
1269
|
-
"string"
|
|
1270
|
-
].indexOf(_type_of(arg.role_session_name)) > -1;
|
|
1271
|
-
};
|
|
1272
|
-
var resolveWebIdentityCredentials = function() {
|
|
1273
|
-
var _ref = _async_to_generator$2(function(profile, options) {
|
|
1274
|
-
return _ts_generator$2(this, function(_state) {
|
|
1275
|
-
return [
|
|
1276
|
-
2,
|
|
1277
|
-
import('./index.esm4.js').then(function(param) {
|
|
1278
|
-
var fromTokenFile = param.fromTokenFile;
|
|
1279
|
-
return fromTokenFile({
|
|
1280
|
-
webIdentityTokenFile: profile.web_identity_token_file,
|
|
1281
|
-
roleArn: profile.role_arn,
|
|
1282
|
-
roleSessionName: profile.role_session_name,
|
|
1283
|
-
roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity,
|
|
1284
|
-
logger: options.logger,
|
|
1285
|
-
parentClientConfig: options.parentClientConfig
|
|
1286
|
-
})().then(function(creds) {
|
|
1287
|
-
return setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q");
|
|
1288
|
-
});
|
|
1289
|
-
})
|
|
1290
|
-
];
|
|
1291
|
-
});
|
|
1292
|
-
});
|
|
1293
|
-
return function resolveWebIdentityCredentials(profile, options) {
|
|
1294
|
-
return _ref.apply(this, arguments);
|
|
1295
|
-
};
|
|
1296
|
-
}();
|
|
1297
|
-
|
|
1298
|
-
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1299
|
-
try {
|
|
1300
|
-
var info = gen[key](arg);
|
|
1301
|
-
var value = info.value;
|
|
1302
|
-
} catch (error) {
|
|
1303
|
-
reject(error);
|
|
1304
|
-
return;
|
|
1305
|
-
}
|
|
1306
|
-
if (info.done) {
|
|
1307
|
-
resolve(value);
|
|
1308
|
-
} else {
|
|
1309
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
function _async_to_generator$1(fn) {
|
|
1313
|
-
return function() {
|
|
1314
|
-
var self = this, args = arguments;
|
|
1315
|
-
return new Promise(function(resolve, reject) {
|
|
1316
|
-
var gen = fn.apply(self, args);
|
|
1317
|
-
function _next(value) {
|
|
1318
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
1319
|
-
}
|
|
1320
|
-
function _throw(err) {
|
|
1321
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1322
|
-
}
|
|
1323
|
-
_next(undefined);
|
|
1324
|
-
});
|
|
1325
|
-
};
|
|
1326
|
-
}
|
|
1327
|
-
function _ts_generator$1(thisArg, body) {
|
|
1328
|
-
var f, y, t, g, _ = {
|
|
1329
|
-
label: 0,
|
|
1330
|
-
sent: function() {
|
|
1331
|
-
if (t[0] & 1) throw t[1];
|
|
1332
|
-
return t[1];
|
|
1333
|
-
},
|
|
1334
|
-
trys: [],
|
|
1335
|
-
ops: []
|
|
1336
|
-
};
|
|
1337
|
-
return g = {
|
|
1338
|
-
next: verb(0),
|
|
1339
|
-
"throw": verb(1),
|
|
1340
|
-
"return": verb(2)
|
|
1341
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1342
|
-
return this;
|
|
1343
|
-
}), g;
|
|
1344
|
-
function verb(n) {
|
|
1345
|
-
return function(v) {
|
|
1346
|
-
return step([
|
|
1347
|
-
n,
|
|
1348
|
-
v
|
|
1349
|
-
]);
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
function step(op) {
|
|
1353
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1354
|
-
while(_)try {
|
|
1355
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1356
|
-
if (y = 0, t) op = [
|
|
1357
|
-
op[0] & 2,
|
|
1358
|
-
t.value
|
|
1359
|
-
];
|
|
1360
|
-
switch(op[0]){
|
|
1361
|
-
case 0:
|
|
1362
|
-
case 1:
|
|
1363
|
-
t = op;
|
|
1364
|
-
break;
|
|
1365
|
-
case 4:
|
|
1366
|
-
_.label++;
|
|
1367
|
-
return {
|
|
1368
|
-
value: op[1],
|
|
1369
|
-
done: false
|
|
1370
|
-
};
|
|
1371
|
-
case 5:
|
|
1372
|
-
_.label++;
|
|
1373
|
-
y = op[1];
|
|
1374
|
-
op = [
|
|
1375
|
-
0
|
|
1376
|
-
];
|
|
1377
|
-
continue;
|
|
1378
|
-
case 7:
|
|
1379
|
-
op = _.ops.pop();
|
|
1380
|
-
_.trys.pop();
|
|
1381
|
-
continue;
|
|
1382
|
-
default:
|
|
1383
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1384
|
-
_ = 0;
|
|
1385
|
-
continue;
|
|
1386
|
-
}
|
|
1387
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1388
|
-
_.label = op[1];
|
|
1389
|
-
break;
|
|
1390
|
-
}
|
|
1391
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1392
|
-
_.label = t[1];
|
|
1393
|
-
t = op;
|
|
1394
|
-
break;
|
|
1395
|
-
}
|
|
1396
|
-
if (t && _.label < t[2]) {
|
|
1397
|
-
_.label = t[2];
|
|
1398
|
-
_.ops.push(op);
|
|
1399
|
-
break;
|
|
1400
|
-
}
|
|
1401
|
-
if (t[2]) _.ops.pop();
|
|
1402
|
-
_.trys.pop();
|
|
1403
|
-
continue;
|
|
1404
|
-
}
|
|
1405
|
-
op = body.call(thisArg, _);
|
|
1406
|
-
} catch (e) {
|
|
1407
|
-
op = [
|
|
1408
|
-
6,
|
|
1409
|
-
e
|
|
1410
|
-
];
|
|
1411
|
-
y = 0;
|
|
1412
|
-
} finally{
|
|
1413
|
-
f = t = 0;
|
|
1414
|
-
}
|
|
1415
|
-
if (op[0] & 5) throw op[1];
|
|
1416
|
-
return {
|
|
1417
|
-
value: op[0] ? op[1] : void 0,
|
|
1418
|
-
done: true
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
var resolveProfileData = function() {
|
|
1423
|
-
var _ref = _async_to_generator$1(function(profileName, profiles, options) {
|
|
1424
|
-
var visitedProfiles, isAssumeRoleRecursiveCall, data;
|
|
1425
|
-
var _arguments = arguments;
|
|
1426
|
-
return _ts_generator$1(this, function(_state) {
|
|
1427
|
-
switch(_state.label){
|
|
1428
|
-
case 0:
|
|
1429
|
-
visitedProfiles = _arguments.length > 3 && _arguments[3] !== void 0 ? _arguments[3] : {}, isAssumeRoleRecursiveCall = _arguments.length > 4 && _arguments[4] !== void 0 ? _arguments[4] : false;
|
|
1430
|
-
data = profiles[profileName];
|
|
1431
|
-
if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
|
|
1432
|
-
return [
|
|
1433
|
-
2,
|
|
1434
|
-
resolveStaticCredentials(data, options)
|
|
1435
|
-
];
|
|
1436
|
-
}
|
|
1437
|
-
if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, {
|
|
1438
|
-
profile: profileName,
|
|
1439
|
-
logger: options.logger
|
|
1440
|
-
})) {
|
|
1441
|
-
return [
|
|
1442
|
-
2,
|
|
1443
|
-
resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles)
|
|
1444
|
-
];
|
|
1445
|
-
}
|
|
1446
|
-
if (isStaticCredsProfile(data)) {
|
|
1447
|
-
return [
|
|
1448
|
-
2,
|
|
1449
|
-
resolveStaticCredentials(data, options)
|
|
1450
|
-
];
|
|
1451
|
-
}
|
|
1452
|
-
if (isWebIdentityProfile(data)) {
|
|
1453
|
-
return [
|
|
1454
|
-
2,
|
|
1455
|
-
resolveWebIdentityCredentials(data, options)
|
|
1456
|
-
];
|
|
1457
|
-
}
|
|
1458
|
-
if (isProcessProfile(data)) {
|
|
1459
|
-
return [
|
|
1460
|
-
2,
|
|
1461
|
-
resolveProcessCredentials(options, profileName)
|
|
1462
|
-
];
|
|
1463
|
-
}
|
|
1464
|
-
if (!isSsoProfile(data)) return [
|
|
1465
|
-
3,
|
|
1466
|
-
2
|
|
1467
|
-
];
|
|
1468
|
-
return [
|
|
1469
|
-
4,
|
|
1470
|
-
resolveSsoCredentials(profileName, data, options)
|
|
1471
|
-
];
|
|
1472
|
-
case 1:
|
|
1473
|
-
return [
|
|
1474
|
-
2,
|
|
1475
|
-
_state.sent()
|
|
1476
|
-
];
|
|
1477
|
-
case 2:
|
|
1478
|
-
throw new CredentialsProviderError("Could not resolve credentials using profile: [".concat(profileName, "] in configuration/credentials file(s)."), {
|
|
1479
|
-
logger: options.logger
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
});
|
|
1483
|
-
});
|
|
1484
|
-
return function resolveProfileData(profileName, profiles, options) {
|
|
1485
|
-
return _ref.apply(this, arguments);
|
|
1486
|
-
};
|
|
1487
|
-
}();
|
|
1488
|
-
|
|
1489
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1490
|
-
try {
|
|
1491
|
-
var info = gen[key](arg);
|
|
1492
|
-
var value = info.value;
|
|
1493
|
-
} catch (error) {
|
|
1494
|
-
reject(error);
|
|
1495
|
-
return;
|
|
1496
|
-
}
|
|
1497
|
-
if (info.done) {
|
|
1498
|
-
resolve(value);
|
|
1499
|
-
} else {
|
|
1500
|
-
Promise.resolve(value).then(_next, _throw);
|
|
1501
|
-
}
|
|
1502
|
-
}
|
|
1503
|
-
function _async_to_generator(fn) {
|
|
1504
|
-
return function() {
|
|
1505
|
-
var self = this, args = arguments;
|
|
1506
|
-
return new Promise(function(resolve, reject) {
|
|
1507
|
-
var gen = fn.apply(self, args);
|
|
1508
|
-
function _next(value) {
|
|
1509
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1510
|
-
}
|
|
1511
|
-
function _throw(err) {
|
|
1512
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1513
|
-
}
|
|
1514
|
-
_next(undefined);
|
|
1515
|
-
});
|
|
1516
|
-
};
|
|
1517
|
-
}
|
|
1518
|
-
function _define_property(obj, key, value) {
|
|
1519
|
-
if (key in obj) {
|
|
1520
|
-
Object.defineProperty(obj, key, {
|
|
1521
|
-
value: value,
|
|
1522
|
-
enumerable: true,
|
|
1523
|
-
configurable: true,
|
|
1524
|
-
writable: true
|
|
1525
|
-
});
|
|
1526
|
-
} else {
|
|
1527
|
-
obj[key] = value;
|
|
1528
|
-
}
|
|
1529
|
-
return obj;
|
|
1530
|
-
}
|
|
1531
|
-
function _object_spread(target) {
|
|
1532
|
-
for(var i = 1; i < arguments.length; i++){
|
|
1533
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1534
|
-
var ownKeys = Object.keys(source);
|
|
1535
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1536
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1537
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1538
|
-
}));
|
|
1539
|
-
}
|
|
1540
|
-
ownKeys.forEach(function(key) {
|
|
1541
|
-
_define_property(target, key, source[key]);
|
|
1542
|
-
});
|
|
1543
|
-
}
|
|
1544
|
-
return target;
|
|
1545
|
-
}
|
|
1546
|
-
function ownKeys(object, enumerableOnly) {
|
|
1547
|
-
var keys = Object.keys(object);
|
|
1548
|
-
if (Object.getOwnPropertySymbols) {
|
|
1549
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
1550
|
-
keys.push.apply(keys, symbols);
|
|
1551
|
-
}
|
|
1552
|
-
return keys;
|
|
1553
|
-
}
|
|
1554
|
-
function _object_spread_props(target, source) {
|
|
1555
|
-
source = source != null ? source : {};
|
|
1556
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
1557
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1558
|
-
} else {
|
|
1559
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
1560
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1561
|
-
});
|
|
1562
|
-
}
|
|
1563
|
-
return target;
|
|
1564
|
-
}
|
|
1565
|
-
function _ts_generator(thisArg, body) {
|
|
1566
|
-
var f, y, t, g, _ = {
|
|
1567
|
-
label: 0,
|
|
1568
|
-
sent: function() {
|
|
1569
|
-
if (t[0] & 1) throw t[1];
|
|
1570
|
-
return t[1];
|
|
1571
|
-
},
|
|
1572
|
-
trys: [],
|
|
1573
|
-
ops: []
|
|
1574
|
-
};
|
|
1575
|
-
return g = {
|
|
1576
|
-
next: verb(0),
|
|
1577
|
-
"throw": verb(1),
|
|
1578
|
-
"return": verb(2)
|
|
1579
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1580
|
-
return this;
|
|
1581
|
-
}), g;
|
|
1582
|
-
function verb(n) {
|
|
1583
|
-
return function(v) {
|
|
1584
|
-
return step([
|
|
1585
|
-
n,
|
|
1586
|
-
v
|
|
1587
|
-
]);
|
|
1588
|
-
};
|
|
1589
|
-
}
|
|
1590
|
-
function step(op) {
|
|
1591
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1592
|
-
while(_)try {
|
|
1593
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1594
|
-
if (y = 0, t) op = [
|
|
1595
|
-
op[0] & 2,
|
|
1596
|
-
t.value
|
|
1597
|
-
];
|
|
1598
|
-
switch(op[0]){
|
|
1599
|
-
case 0:
|
|
1600
|
-
case 1:
|
|
1601
|
-
t = op;
|
|
1602
|
-
break;
|
|
1603
|
-
case 4:
|
|
1604
|
-
_.label++;
|
|
1605
|
-
return {
|
|
1606
|
-
value: op[1],
|
|
1607
|
-
done: false
|
|
1608
|
-
};
|
|
1609
|
-
case 5:
|
|
1610
|
-
_.label++;
|
|
1611
|
-
y = op[1];
|
|
1612
|
-
op = [
|
|
1613
|
-
0
|
|
1614
|
-
];
|
|
1615
|
-
continue;
|
|
1616
|
-
case 7:
|
|
1617
|
-
op = _.ops.pop();
|
|
1618
|
-
_.trys.pop();
|
|
1619
|
-
continue;
|
|
1620
|
-
default:
|
|
1621
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1622
|
-
_ = 0;
|
|
1623
|
-
continue;
|
|
1624
|
-
}
|
|
1625
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1626
|
-
_.label = op[1];
|
|
1627
|
-
break;
|
|
1628
|
-
}
|
|
1629
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1630
|
-
_.label = t[1];
|
|
1631
|
-
t = op;
|
|
1632
|
-
break;
|
|
1633
|
-
}
|
|
1634
|
-
if (t && _.label < t[2]) {
|
|
1635
|
-
_.label = t[2];
|
|
1636
|
-
_.ops.push(op);
|
|
1637
|
-
break;
|
|
1638
|
-
}
|
|
1639
|
-
if (t[2]) _.ops.pop();
|
|
1640
|
-
_.trys.pop();
|
|
1641
|
-
continue;
|
|
1642
|
-
}
|
|
1643
|
-
op = body.call(thisArg, _);
|
|
1644
|
-
} catch (e) {
|
|
1645
|
-
op = [
|
|
1646
|
-
6,
|
|
1647
|
-
e
|
|
1648
|
-
];
|
|
1649
|
-
y = 0;
|
|
1650
|
-
} finally{
|
|
1651
|
-
f = t = 0;
|
|
1652
|
-
}
|
|
1653
|
-
if (op[0] & 5) throw op[1];
|
|
1654
|
-
return {
|
|
1655
|
-
value: op[0] ? op[1] : void 0,
|
|
1656
|
-
done: true
|
|
1657
|
-
};
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
var fromIni = function() {
|
|
1661
|
-
var _init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1662
|
-
return /*#__PURE__*/ _async_to_generator(function() {
|
|
1663
|
-
var callerClientConfig, _init_logger, init, profiles, _init_profile;
|
|
1664
|
-
var _arguments = arguments;
|
|
1665
|
-
return _ts_generator(this, function(_state) {
|
|
1666
|
-
switch(_state.label){
|
|
1667
|
-
case 0:
|
|
1668
|
-
callerClientConfig = (_arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}).callerClientConfig;
|
|
1669
|
-
init = _object_spread_props(_object_spread({}, _init), {
|
|
1670
|
-
parentClientConfig: _object_spread({}, callerClientConfig, _init.parentClientConfig)
|
|
1671
|
-
});
|
|
1672
|
-
(_init_logger = init.logger) === null || _init_logger === void 0 ? void 0 : _init_logger.debug("@aws-sdk/credential-provider-ini - fromIni");
|
|
1673
|
-
return [
|
|
1674
|
-
4,
|
|
1675
|
-
parseKnownFiles(init)
|
|
1676
|
-
];
|
|
1677
|
-
case 1:
|
|
1678
|
-
profiles = _state.sent();
|
|
1679
|
-
return [
|
|
1680
|
-
2,
|
|
1681
|
-
resolveProfileData(getProfileName({
|
|
1682
|
-
profile: (_init_profile = _init.profile) !== null && _init_profile !== void 0 ? _init_profile : callerClientConfig === null || callerClientConfig === void 0 ? void 0 : callerClientConfig.profile
|
|
1683
|
-
}), profiles, init)
|
|
1684
|
-
];
|
|
1685
|
-
}
|
|
1686
|
-
});
|
|
1687
|
-
});
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
export { fromIni };
|