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