@digipair/skill-s3 0.136.3 → 0.136.5

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.
@@ -1,284 +1,85 @@
1
- import { C as CredentialsProviderError, y as HttpRequest, z as parseRfc3339DateTime, A as sdkStreamMixin, N as NodeHttpHandler, s as setCredentialFeature } from './index.esm3.js';
2
- import fs from 'node:fs/promises';
3
- import 'node:crypto';
4
- import 'node:path';
5
- import 'node:os';
6
- import 'node:stream';
7
- import 'node:process';
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';
5
+ import { p as parseKnownFiles } from './parseKnownFiles.esm.js';
8
6
  import 'buffer';
7
+ import 'path';
8
+ import 'os';
9
+ import 'node:fs/promises';
10
+ import 'stream';
11
+ import 'crypto';
12
+ import 'node:stream';
13
+ import 'http';
14
+ import 'https';
15
+ import 'process';
9
16
  import 'node:fs';
10
- import 'node:https';
11
- import 'node:zlib';
12
-
13
- var ECS_CONTAINER_HOST = "169.254.170.2";
14
- var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
15
- var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
16
- var checkUrl = function(url, logger) {
17
- if (url.protocol === "https:") {
18
- return;
19
- }
20
- if (url.hostname === ECS_CONTAINER_HOST || url.hostname === EKS_CONTAINER_HOST_IPv4 || url.hostname === EKS_CONTAINER_HOST_IPv6) {
21
- return;
22
- }
23
- if (url.hostname.includes("[")) {
24
- if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") {
25
- return;
26
- }
27
- } else {
28
- if (url.hostname === "localhost") {
29
- return;
30
- }
31
- var ipComponents = url.hostname.split(".");
32
- var inRange = function(component) {
33
- var num = parseInt(component, 10);
34
- return 0 <= num && num <= 255;
35
- };
36
- if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) {
37
- return;
38
- }
39
- }
40
- throw new CredentialsProviderError("URL not accepted. It must either be HTTPS or match one of the following:\n - loopback CIDR 127.0.0.0/8 or [::1/128]\n - ECS container host 169.254.170.2\n - EKS container host 169.254.170.23 or [fd00:ec2::23]", {
41
- logger: logger
42
- });
43
- };
17
+ import 'zlib';
18
+ import './getSSOTokenFromFile.esm.js';
19
+ import 'fs/promises';
44
20
 
45
- function _array_like_to_array(arr, len) {
46
- if (len == null || len > arr.length) len = arr.length;
47
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
48
- return arr2;
49
- }
50
- function _array_with_holes(arr) {
51
- if (Array.isArray(arr)) return arr;
52
- }
53
- function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
54
- try {
55
- var info = gen[key](arg);
56
- var value = info.value;
57
- } catch (error) {
58
- reject(error);
59
- return;
60
- }
61
- if (info.done) {
62
- resolve(value);
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
28
+ });
63
29
  } else {
64
- Promise.resolve(value).then(_next, _throw);
30
+ obj[key] = value;
65
31
  }
32
+ return obj;
66
33
  }
67
- function _async_to_generator$2(fn) {
68
- return function() {
69
- var self = this, args = arguments;
70
- return new Promise(function(resolve, reject) {
71
- var gen = fn.apply(self, args);
72
- function _next(value) {
73
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
74
- }
75
- function _throw(err) {
76
- asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
77
- }
78
- _next(undefined);
79
- });
80
- };
81
- }
82
- function _iterable_to_array_limit(arr, i) {
83
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
84
- if (_i == null) return;
85
- var _arr = [];
86
- var _n = true;
87
- var _d = false;
88
- var _s, _e;
89
- try {
90
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
91
- _arr.push(_s.value);
92
- if (i && _arr.length === i) break;
93
- }
94
- } catch (err) {
95
- _d = true;
96
- _e = err;
97
- } finally{
98
- try {
99
- if (!_n && _i["return"] != null) _i["return"]();
100
- } finally{
101
- if (_d) throw _e;
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
+ }));
102
42
  }
43
+ ownKeys.forEach(function(key) {
44
+ _define_property(target, key, source[key]);
45
+ });
103
46
  }
104
- return _arr;
105
- }
106
- function _non_iterable_rest() {
107
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
108
- }
109
- function _sliced_to_array(arr, i) {
110
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
47
+ return target;
111
48
  }
112
- function _unsupported_iterable_to_array(o, minLen) {
113
- if (!o) return;
114
- if (typeof o === "string") return _array_like_to_array(o, minLen);
115
- var n = Object.prototype.toString.call(o).slice(8, -1);
116
- if (n === "Object" && o.constructor) n = o.constructor.name;
117
- if (n === "Map" || n === "Set") return Array.from(n);
118
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
119
- }
120
- function _ts_generator$2(thisArg, body) {
121
- var f, y, t, g, _ = {
122
- label: 0,
123
- sent: function() {
124
- if (t[0] & 1) throw t[1];
125
- return t[1];
126
- },
127
- trys: [],
128
- ops: []
129
- };
130
- return g = {
131
- next: verb(0),
132
- "throw": verb(1),
133
- "return": verb(2)
134
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
135
- return this;
136
- }), g;
137
- function verb(n) {
138
- return function(v) {
139
- return step([
140
- n,
141
- v
142
- ]);
143
- };
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."));
144
53
  }
145
- function step(op) {
146
- if (f) throw new TypeError("Generator is already executing.");
147
- while(_)try {
148
- 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;
149
- if (y = 0, t) op = [
150
- op[0] & 2,
151
- t.value
152
- ];
153
- switch(op[0]){
154
- case 0:
155
- case 1:
156
- t = op;
157
- break;
158
- case 4:
159
- _.label++;
160
- return {
161
- value: op[1],
162
- done: false
163
- };
164
- case 5:
165
- _.label++;
166
- y = op[1];
167
- op = [
168
- 0
169
- ];
170
- continue;
171
- case 7:
172
- op = _.ops.pop();
173
- _.trys.pop();
174
- continue;
175
- default:
176
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
177
- _ = 0;
178
- continue;
179
- }
180
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
181
- _.label = op[1];
182
- break;
183
- }
184
- if (op[0] === 6 && _.label < t[1]) {
185
- _.label = t[1];
186
- t = op;
187
- break;
188
- }
189
- if (t && _.label < t[2]) {
190
- _.label = t[2];
191
- _.ops.push(op);
192
- break;
193
- }
194
- if (t[2]) _.ops.pop();
195
- _.trys.pop();
196
- continue;
197
- }
198
- op = body.call(thisArg, _);
199
- } catch (e) {
200
- op = [
201
- 6,
202
- e
203
- ];
204
- y = 0;
205
- } finally{
206
- 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."));
207
62
  }
208
- if (op[0] & 5) throw op[1];
209
- return {
210
- value: op[0] ? op[1] : void 0,
211
- done: true
212
- };
213
63
  }
214
- }
215
- function createGetRequest(url) {
216
- return new HttpRequest({
217
- protocol: url.protocol,
218
- hostname: url.hostname,
219
- port: Number(url.port),
220
- path: url.pathname,
221
- query: Array.from(url.searchParams.entries()).reduce(function(acc, param) {
222
- var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
223
- acc[k] = v;
224
- return acc;
225
- }, {}),
226
- fragment: url.hash
227
- });
228
- }
229
- function getCredentials(response, logger) {
230
- return _getCredentials.apply(this, arguments);
231
- }
232
- function _getCredentials() {
233
- _getCredentials = _async_to_generator$2(function(response, logger) {
234
- var stream, str, parsed, parsedBody;
235
- return _ts_generator$2(this, function(_state) {
236
- switch(_state.label){
237
- case 0:
238
- stream = sdkStreamMixin(response.body);
239
- return [
240
- 4,
241
- stream.transformToString()
242
- ];
243
- case 1:
244
- str = _state.sent();
245
- if (response.statusCode === 200) {
246
- parsed = JSON.parse(str);
247
- if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") {
248
- throw new CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: " + "{ AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", {
249
- logger: logger
250
- });
251
- }
252
- return [
253
- 2,
254
- {
255
- accessKeyId: parsed.AccessKeyId,
256
- secretAccessKey: parsed.SecretAccessKey,
257
- sessionToken: parsed.Token,
258
- expiration: parseRfc3339DateTime(parsed.Expiration)
259
- }
260
- ];
261
- }
262
- if (response.statusCode >= 400 && response.statusCode < 500) {
263
- parsedBody = {};
264
- try {
265
- parsedBody = JSON.parse(str);
266
- } catch (e) {}
267
- throw Object.assign(new CredentialsProviderError("Server responded with status: ".concat(response.statusCode), {
268
- logger: logger
269
- }), {
270
- Code: parsedBody.Code,
271
- Message: parsedBody.Message
272
- });
273
- }
274
- throw new CredentialsProviderError("Server responded with status: ".concat(response.statusCode), {
275
- logger: logger
276
- });
277
- }
278
- });
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
279
79
  });
280
- return _getCredentials.apply(this, arguments);
281
- }
80
+ setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
81
+ return credentials;
82
+ };
282
83
 
283
84
  function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
284
85
  try {
@@ -404,70 +205,80 @@ function _ts_generator$1(thisArg, body) {
404
205
  };
405
206
  }
406
207
  }
407
- var retryWrapper = function(toRetry, maxRetries, delayMs) {
408
- return /*#__PURE__*/ _async_to_generator$1(function() {
409
- var i;
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;
410
211
  return _ts_generator$1(this, function(_state) {
411
212
  switch(_state.label){
412
213
  case 0:
413
- i = 0;
414
- _state.label = 1;
415
- case 1:
416
- if (!(i < maxRetries)) return [
214
+ profile = profiles[profileName];
215
+ if (!profiles[profileName]) return [
417
216
  3,
418
217
  7
419
218
  ];
420
- _state.label = 2;
421
- case 2:
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:
422
227
  _state.trys.push([
423
- 2,
424
- 4,
228
+ 1,
229
+ 3,
425
230
  ,
426
- 6
231
+ 4
427
232
  ]);
428
233
  return [
429
234
  4,
430
- toRetry()
235
+ execPromise(credentialProcess)
431
236
  ];
432
- case 3:
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
+ }
433
244
  return [
434
245
  2,
435
- _state.sent()
246
+ getValidatedProcessCredentials(profileName, data, profiles)
436
247
  ];
248
+ case 3:
249
+ error = _state.sent();
250
+ throw new CredentialsProviderError(error.message, {
251
+ logger: logger
252
+ });
437
253
  case 4:
438
- _state.sent();
439
- return [
440
- 4,
441
- new Promise(function(resolve) {
442
- return setTimeout(resolve, delayMs);
443
- })
444
- ];
445
- case 5:
446
- _state.sent();
447
254
  return [
448
255
  3,
449
256
  6
450
257
  ];
258
+ case 5:
259
+ throw new CredentialsProviderError("Profile ".concat(profileName, " did not contain credential_process."), {
260
+ logger: logger
261
+ });
451
262
  case 6:
452
- ++i;
453
263
  return [
454
264
  3,
455
- 1
265
+ 8
456
266
  ];
457
267
  case 7:
458
- return [
459
- 4,
460
- toRetry()
461
- ];
268
+ throw new CredentialsProviderError("Profile ".concat(profileName, " could not be found in shared credentials file."), {
269
+ logger: logger
270
+ });
462
271
  case 8:
463
272
  return [
464
- 2,
465
- _state.sent()
273
+ 2
466
274
  ];
467
275
  }
468
276
  });
469
277
  });
470
- };
278
+ return function resolveProcessCredentials(profileName, profiles, logger) {
279
+ return _ref.apply(this, arguments);
280
+ };
281
+ }();
471
282
 
472
283
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
473
284
  try {
@@ -593,144 +404,31 @@ function _ts_generator(thisArg, body) {
593
404
  };
594
405
  }
595
406
  }
596
- var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
597
- var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2";
598
- var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
599
- var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE";
600
- var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
601
- var fromHttp = function() {
602
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
603
- var _options_logger, _options_logger_constructor, _options_logger1, _options_logger2;
604
- (_options_logger = options.logger) === null || _options_logger === void 0 ? void 0 : _options_logger.debug("@aws-sdk/credential-provider-http - fromHttp");
605
- var host;
606
- var _options_awsContainerCredentialsRelativeUri;
607
- var relative = (_options_awsContainerCredentialsRelativeUri = options.awsContainerCredentialsRelativeUri) !== null && _options_awsContainerCredentialsRelativeUri !== void 0 ? _options_awsContainerCredentialsRelativeUri : process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
608
- var _options_awsContainerCredentialsFullUri;
609
- var full = (_options_awsContainerCredentialsFullUri = options.awsContainerCredentialsFullUri) !== null && _options_awsContainerCredentialsFullUri !== void 0 ? _options_awsContainerCredentialsFullUri : process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
610
- var _options_awsContainerAuthorizationToken;
611
- var token = (_options_awsContainerAuthorizationToken = options.awsContainerAuthorizationToken) !== null && _options_awsContainerAuthorizationToken !== void 0 ? _options_awsContainerAuthorizationToken : process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
612
- var _options_awsContainerAuthorizationTokenFile;
613
- var tokenFile = (_options_awsContainerAuthorizationTokenFile = options.awsContainerAuthorizationTokenFile) !== null && _options_awsContainerAuthorizationTokenFile !== void 0 ? _options_awsContainerAuthorizationTokenFile : process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
614
- var warn = ((_options_logger1 = options.logger) === null || _options_logger1 === void 0 ? void 0 : (_options_logger_constructor = _options_logger1.constructor) === null || _options_logger_constructor === void 0 ? void 0 : _options_logger_constructor.name) === "NoOpLogger" || !((_options_logger2 = options.logger) === null || _options_logger2 === void 0 ? void 0 : _options_logger2.warn) ? console.warn : options.logger.warn.bind(options.logger);
615
- if (relative && full) {
616
- warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
617
- warn("awsContainerCredentialsFullUri will take precedence.");
618
- }
619
- if (token && tokenFile) {
620
- warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
621
- warn("awsContainerAuthorizationToken will take precedence.");
622
- }
623
- if (full) {
624
- host = full;
625
- } else if (relative) {
626
- host = "".concat(DEFAULT_LINK_LOCAL_HOST).concat(relative);
627
- } else {
628
- throw new CredentialsProviderError("No HTTP credential provider host provided.\nSet AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.", {
629
- logger: options.logger
630
- });
631
- }
632
- var url = new URL(host);
633
- checkUrl(url, options.logger);
634
- var _options_timeout;
635
- var requestHandler = NodeHttpHandler.create({
636
- connectionTimeout: (_options_timeout = options.timeout) !== null && _options_timeout !== void 0 ? _options_timeout : 1000
637
- });
638
- var _options_timeout1;
639
- var requestTimeout = (_options_timeout1 = options.timeout) !== null && _options_timeout1 !== void 0 ? _options_timeout1 : 1000;
640
- var _options_maxRetries, _options_timeout2;
641
- var provider = retryWrapper(/*#__PURE__*/ _async_to_generator(function() {
642
- var request, _, result, e;
643
- return _ts_generator(this, function(_state) {
644
- switch(_state.label){
645
- case 0:
646
- request = createGetRequest(url);
647
- if (!token) return [
648
- 3,
649
- 1
650
- ];
651
- request.headers.Authorization = token;
652
- return [
653
- 3,
654
- 3
655
- ];
656
- case 1:
657
- if (!tokenFile) return [
658
- 3,
659
- 3
660
- ];
661
- _ = request.headers;
662
- return [
663
- 4,
664
- fs.readFile(tokenFile)
665
- ];
666
- case 2:
667
- _.Authorization = _state.sent().toString();
668
- _state.label = 3;
669
- case 3:
670
- _state.trys.push([
671
- 3,
672
- 5,
673
- ,
674
- 6
675
- ]);
676
- return [
677
- 4,
678
- requestHandler.handle(request, {
679
- requestTimeout: requestTimeout
680
- })
681
- ];
682
- case 4:
683
- result = _state.sent();
684
- return [
685
- 2,
686
- getCredentials(result.response).then(function(creds) {
687
- return setCredentialFeature(creds, "CREDENTIALS_HTTP", "z");
688
- })
689
- ];
690
- case 5:
691
- e = _state.sent();
692
- throw new CredentialsProviderError(String(e), {
693
- logger: options.logger
694
- });
695
- case 6:
696
- return [
697
- 2
698
- ];
699
- }
700
- });
701
- }), (_options_maxRetries = options.maxRetries) !== null && _options_maxRetries !== void 0 ? _options_maxRetries : 3, (_options_timeout2 = options.timeout) !== null && _options_timeout2 !== void 0 ? _options_timeout2 : 1000);
407
+ var fromProcess = function() {
408
+ var init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
702
409
  return /*#__PURE__*/ _async_to_generator(function() {
703
- var _requestHandler_destroy;
410
+ var callerClientConfig, _init_logger, profiles, _init_profile;
411
+ var _arguments = arguments;
704
412
  return _ts_generator(this, function(_state) {
705
413
  switch(_state.label){
706
414
  case 0:
707
- _state.trys.push([
708
- 0,
709
- ,
710
- 2,
711
- 3
712
- ]);
415
+ callerClientConfig = (_arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}).callerClientConfig;
416
+ (_init_logger = init.logger) === null || _init_logger === void 0 ? void 0 : _init_logger.debug("@aws-sdk/credential-provider-process - fromProcess");
713
417
  return [
714
418
  4,
715
- provider()
419
+ parseKnownFiles(init)
716
420
  ];
717
421
  case 1:
422
+ profiles = _state.sent();
718
423
  return [
719
424
  2,
720
- _state.sent()
721
- ];
722
- case 2:
723
- (_requestHandler_destroy = requestHandler.destroy) === null || _requestHandler_destroy === void 0 ? void 0 : _requestHandler_destroy.call(requestHandler);
724
- return [
725
- 7
726
- ];
727
- case 3:
728
- return [
729
- 2
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)
730
428
  ];
731
429
  }
732
430
  });
733
431
  });
734
432
  };
735
433
 
736
- export { fromHttp };
434
+ export { fromProcess };