skill-tree 0.3.0 → 0.3.1

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.
Files changed (90) hide show
  1. package/package.json +1 -1
  2. package/dist/bowser-XBWM4HVL.mjs +0 -2821
  3. package/dist/chunk-3MV4GQ3N.mjs +0 -19
  4. package/dist/chunk-3SRB47JW.mjs +0 -8344
  5. package/dist/chunk-43YOKLZP.mjs +0 -6081
  6. package/dist/chunk-4AGZU52D.mjs +0 -7918
  7. package/dist/chunk-4HXHCEFH.mjs +0 -9157
  8. package/dist/chunk-4OC5QFIF.mjs +0 -11267
  9. package/dist/chunk-4TFMKAVC.mjs +0 -1225
  10. package/dist/chunk-55SMGVTP.mjs +0 -7126
  11. package/dist/chunk-6AZMD3Q3.mjs +0 -1243
  12. package/dist/chunk-6FX4IK4Z.mjs +0 -5368
  13. package/dist/chunk-6UPDN5QM.mjs +0 -163
  14. package/dist/chunk-7EGDKOHV.mjs +0 -9439
  15. package/dist/chunk-7IHYDFWW.mjs +0 -163
  16. package/dist/chunk-7LMOQW5H.mjs +0 -4893
  17. package/dist/chunk-7QIQJVNP.mjs +0 -14206
  18. package/dist/chunk-7VB4ZRZO.mjs +0 -7127
  19. package/dist/chunk-A3SILZYX.mjs +0 -8360
  20. package/dist/chunk-BPVRW25O.mjs +0 -6089
  21. package/dist/chunk-CI4476KM.mjs +0 -6607
  22. package/dist/chunk-DDXYQ74I.mjs +0 -13969
  23. package/dist/chunk-DQOFJXBX.mjs +0 -6595
  24. package/dist/chunk-E2CVK23F.mjs +0 -8751
  25. package/dist/chunk-F3YEUQAP.mjs +0 -654
  26. package/dist/chunk-FKJJ4RJG.mjs +0 -13874
  27. package/dist/chunk-GBIK7WMX.mjs +0 -9293
  28. package/dist/chunk-GFK5SZRJ.mjs +0 -580
  29. package/dist/chunk-II7DECZQ.mjs +0 -9111
  30. package/dist/chunk-INKVOZXK.mjs +0 -15898
  31. package/dist/chunk-J2JM7HAK.mjs +0 -8787
  32. package/dist/chunk-K6NRCSAZ.mjs +0 -4355
  33. package/dist/chunk-M4RPUUZT.mjs +0 -3156
  34. package/dist/chunk-MR4TVINH.mjs +0 -1234
  35. package/dist/chunk-OOECXYLU.mjs +0 -1379
  36. package/dist/chunk-OYHYXKXO.mjs +0 -7297
  37. package/dist/chunk-P5GJJ4JB.mjs +0 -9237
  38. package/dist/chunk-PDPN7FW7.mjs +0 -1045
  39. package/dist/chunk-PJJJQXJL.mjs +0 -1174
  40. package/dist/chunk-PK3BAIFW.mjs +0 -9294
  41. package/dist/chunk-QNK3WYNA.mjs +0 -8971
  42. package/dist/chunk-T4PVQW5O.mjs +0 -124
  43. package/dist/chunk-TENXZJB3.mjs +0 -349
  44. package/dist/chunk-TEUB6DZR.mjs +0 -6453
  45. package/dist/chunk-TWPEHDW4.mjs +0 -1067
  46. package/dist/chunk-VHFTX33A.mjs +0 -6724
  47. package/dist/chunk-VNZSS2WY.mjs +0 -1057
  48. package/dist/chunk-WJP5XYS7.mjs +0 -2102
  49. package/dist/chunk-WX6N7KNO.mjs +0 -1239
  50. package/dist/chunk-Y54UK2J3.mjs +0 -13071
  51. package/dist/chunk-YDNGMDXC.mjs +0 -9294
  52. package/dist/chunk-YJ6NZQLT.mjs +0 -9237
  53. package/dist/chunk-YWRKGXK4.mjs +0 -9300
  54. package/dist/chunk-ZI4AIAWQ.mjs +0 -46
  55. package/dist/chunk-ZQVS7MQK.mjs +0 -6081
  56. package/dist/dist-es-27NPMXP7.mjs +0 -22
  57. package/dist/dist-es-2JG6ZWFR.mjs +0 -69
  58. package/dist/dist-es-5QD5QJS2.mjs +0 -495
  59. package/dist/dist-es-5ZD454R2.mjs +0 -317
  60. package/dist/dist-es-DYHMPEKZ.mjs +0 -170
  61. package/dist/dist-es-FIVW7BUZ.mjs +0 -317
  62. package/dist/dist-es-HRBPKDMR.mjs +0 -935
  63. package/dist/dist-es-L5AMJHSY.mjs +0 -935
  64. package/dist/dist-es-LHPJ63IO.mjs +0 -4437
  65. package/dist/dist-es-OK2J7EV3.mjs +0 -378
  66. package/dist/dist-es-XFAHNA2L.mjs +0 -69
  67. package/dist/dist-es-XPNJAJI7.mjs +0 -4437
  68. package/dist/dist-es-Y4JPNLF3.mjs +0 -6077
  69. package/dist/dist-es-ZGPJUGVW.mjs +0 -87
  70. package/dist/dist-es-ZYHLY2E6.mjs +0 -487
  71. package/dist/event-streams-6MFHPNRF.mjs +0 -42
  72. package/dist/lib-B245IUXF.mjs +0 -778
  73. package/dist/loadSso-CAWKILED.mjs +0 -579
  74. package/dist/loadSso-OYKG6ZRE.mjs +0 -579
  75. package/dist/signin-KUENA7ZD.mjs +0 -743
  76. package/dist/signin-LMFNL434.mjs +0 -665
  77. package/dist/sqlite-5LHEQTBD.mjs +0 -7
  78. package/dist/sqlite-BZK5GF76.mjs +0 -7
  79. package/dist/sqlite-MG45OOTV.mjs +0 -6
  80. package/dist/sqlite-OLU72GHB.mjs +0 -6
  81. package/dist/sqlite-RR2SJ3SR.mjs +0 -7
  82. package/dist/sqlite-XJRPMNAJ.mjs +0 -6
  83. package/dist/sqlite-ZKQKQKPT.mjs +0 -7
  84. package/dist/sso-oidc-3VGFPMFD.mjs +0 -832
  85. package/dist/sso-oidc-NNH6SQIH.mjs +0 -832
  86. package/dist/sts-EF755UBF.mjs +0 -6290
  87. package/dist/sts-QGXULWRT.mjs +0 -6290
  88. package/dist/sync-4DCV43GA.mjs +0 -15
  89. package/dist/sync-BSWMMDA6.mjs +0 -14
  90. package/dist/sync-WHIIDHML.mjs +0 -14
@@ -1,378 +0,0 @@
1
- import {
2
- CredentialsProviderError,
3
- ProviderError,
4
- loadConfig,
5
- parseUrl
6
- } from "./chunk-WJP5XYS7.mjs";
7
- import "./chunk-VNZSS2WY.mjs";
8
- import {
9
- __publicField
10
- } from "./chunk-3MV4GQ3N.mjs";
11
-
12
- // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js
13
- var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string";
14
- var fromImdsCredentials = (creds) => ({
15
- accessKeyId: creds.AccessKeyId,
16
- secretAccessKey: creds.SecretAccessKey,
17
- sessionToken: creds.Token,
18
- expiration: new Date(creds.Expiration),
19
- ...creds.AccountId && { accountId: creds.AccountId }
20
- });
21
-
22
- // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js
23
- var DEFAULT_TIMEOUT = 1e3;
24
- var DEFAULT_MAX_RETRIES = 0;
25
- var providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout });
26
-
27
- // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js
28
- import node_http from "http";
29
-
30
- // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
31
- function httpRequest(options) {
32
- return new Promise((resolve, reject) => {
33
- const req = node_http.request({
34
- method: "GET",
35
- ...options,
36
- hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1")
37
- });
38
- req.on("error", (err) => {
39
- reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err));
40
- req.destroy();
41
- });
42
- req.on("timeout", () => {
43
- reject(new ProviderError("TimeoutError from instance metadata service"));
44
- req.destroy();
45
- });
46
- req.on("response", (res) => {
47
- const { statusCode = 400 } = res;
48
- if (statusCode < 200 || 300 <= statusCode) {
49
- reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode }));
50
- req.destroy();
51
- }
52
- const chunks = [];
53
- res.on("data", (chunk) => {
54
- chunks.push(chunk);
55
- });
56
- res.on("end", () => {
57
- resolve(Buffer.concat(chunks));
58
- req.destroy();
59
- });
60
- });
61
- req.end();
62
- });
63
- }
64
-
65
- // node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js
66
- var retry = (toRetry, maxRetries) => {
67
- let promise = toRetry();
68
- for (let i = 0; i < maxRetries; i++) {
69
- promise = promise.catch(toRetry);
70
- }
71
- return promise;
72
- };
73
-
74
- // node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js
75
- var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
76
- var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
77
- var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
78
- var fromContainerMetadata = (init = {}) => {
79
- const { timeout, maxRetries } = providerConfigFromInit(init);
80
- return () => retry(async () => {
81
- const requestOptions = await getCmdsUri({ logger: init.logger });
82
- const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
83
- if (!isImdsCredentials(credsResponse)) {
84
- throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
85
- logger: init.logger
86
- });
87
- }
88
- return fromImdsCredentials(credsResponse);
89
- }, maxRetries);
90
- };
91
- var requestFromEcsImds = async (timeout, options) => {
92
- if (process.env[ENV_CMDS_AUTH_TOKEN]) {
93
- options.headers = {
94
- ...options.headers,
95
- Authorization: process.env[ENV_CMDS_AUTH_TOKEN]
96
- };
97
- }
98
- const buffer = await httpRequest({
99
- ...options,
100
- timeout
101
- });
102
- return buffer.toString();
103
- };
104
- var CMDS_IP = "169.254.170.2";
105
- var GREENGRASS_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]);
106
- var GREENGRASS_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]);
107
- var getCmdsUri = async ({ logger }) => {
108
- if (process.env[ENV_CMDS_RELATIVE_URI]) {
109
- return {
110
- hostname: CMDS_IP,
111
- path: process.env[ENV_CMDS_RELATIVE_URI]
112
- };
113
- }
114
- if (process.env[ENV_CMDS_FULL_URI]) {
115
- let parsed;
116
- try {
117
- parsed = new URL(process.env[ENV_CMDS_FULL_URI]);
118
- } catch {
119
- throw new CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger });
120
- }
121
- if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) {
122
- throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
123
- tryNextLink: false,
124
- logger
125
- });
126
- }
127
- if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) {
128
- throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
129
- tryNextLink: false,
130
- logger
131
- });
132
- }
133
- return {
134
- protocol: parsed.protocol,
135
- hostname: parsed.hostname,
136
- path: parsed.pathname + parsed.search,
137
- port: parsed.port ? parseInt(parsed.port, 10) : void 0
138
- };
139
- }
140
- throw new CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, {
141
- tryNextLink: false,
142
- logger
143
- });
144
- };
145
-
146
- // node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js
147
- var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends CredentialsProviderError {
148
- constructor(message, tryNextLink = true) {
149
- super(message, tryNextLink);
150
- __publicField(this, "tryNextLink");
151
- __publicField(this, "name", "InstanceMetadataV1FallbackError");
152
- this.tryNextLink = tryNextLink;
153
- Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
154
- }
155
- };
156
-
157
- // node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js
158
- var Endpoint;
159
- (function(Endpoint2) {
160
- Endpoint2["IPv4"] = "http://169.254.169.254";
161
- Endpoint2["IPv6"] = "http://[fd00:ec2::254]";
162
- })(Endpoint || (Endpoint = {}));
163
-
164
- // node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js
165
- var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
166
- var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
167
- var ENDPOINT_CONFIG_OPTIONS = {
168
- environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],
169
- configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],
170
- default: void 0
171
- };
172
-
173
- // node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js
174
- var EndpointMode;
175
- (function(EndpointMode2) {
176
- EndpointMode2["IPv4"] = "IPv4";
177
- EndpointMode2["IPv6"] = "IPv6";
178
- })(EndpointMode || (EndpointMode = {}));
179
-
180
- // node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js
181
- var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
182
- var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
183
- var ENDPOINT_MODE_CONFIG_OPTIONS = {
184
- environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],
185
- configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],
186
- default: EndpointMode.IPv4
187
- };
188
-
189
- // node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js
190
- var getInstanceMetadataEndpoint = async () => parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig());
191
- var getFromEndpointConfig = async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)();
192
- var getFromEndpointModeConfig = async () => {
193
- const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
194
- switch (endpointMode) {
195
- case EndpointMode.IPv4:
196
- return Endpoint.IPv4;
197
- case EndpointMode.IPv6:
198
- return Endpoint.IPv6;
199
- default:
200
- throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`);
201
- }
202
- };
203
-
204
- // node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js
205
- var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
206
- var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
207
- var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
208
- var getExtendedInstanceMetadataCredentials = (credentials, logger) => {
209
- const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
210
- const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
211
- logger.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
212
- For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
213
- const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
214
- return {
215
- ...credentials,
216
- ...originalExpiration ? { originalExpiration } : {},
217
- expiration: newExpiration
218
- };
219
- };
220
-
221
- // node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js
222
- var staticStabilityProvider = (provider, options = {}) => {
223
- const logger = options?.logger || console;
224
- let pastCredentials;
225
- return async () => {
226
- let credentials;
227
- try {
228
- credentials = await provider();
229
- if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
230
- credentials = getExtendedInstanceMetadataCredentials(credentials, logger);
231
- }
232
- } catch (e) {
233
- if (pastCredentials) {
234
- logger.warn("Credential renew failed: ", e);
235
- credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);
236
- } else {
237
- throw e;
238
- }
239
- }
240
- pastCredentials = credentials;
241
- return credentials;
242
- };
243
- };
244
-
245
- // node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js
246
- var IMDS_PATH = "/latest/meta-data/iam/security-credentials/";
247
- var IMDS_TOKEN_PATH = "/latest/api/token";
248
- var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED";
249
- var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled";
250
- var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
251
- var fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });
252
- var getInstanceMetadataProvider = (init = {}) => {
253
- let disableFetchToken = false;
254
- const { logger, profile } = init;
255
- const { timeout, maxRetries } = providerConfigFromInit(init);
256
- const getCredentials = async (maxRetries2, options) => {
257
- const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
258
- if (isImdsV1Fallback) {
259
- let fallbackBlockedFromProfile = false;
260
- let fallbackBlockedFromProcessEnv = false;
261
- const configValue = await loadConfig({
262
- environmentVariableSelector: (env) => {
263
- const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
264
- fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
265
- if (envValue === void 0) {
266
- throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });
267
- }
268
- return fallbackBlockedFromProcessEnv;
269
- },
270
- configFileSelector: (profile2) => {
271
- const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
272
- fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
273
- return fallbackBlockedFromProfile;
274
- },
275
- default: false
276
- }, {
277
- profile
278
- })();
279
- if (init.ec2MetadataV1Disabled || configValue) {
280
- const causes = [];
281
- if (init.ec2MetadataV1Disabled)
282
- causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
283
- if (fallbackBlockedFromProfile)
284
- causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
285
- if (fallbackBlockedFromProcessEnv)
286
- causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
287
- throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`);
288
- }
289
- }
290
- const imdsProfile = (await retry(async () => {
291
- let profile2;
292
- try {
293
- profile2 = await getProfile(options);
294
- } catch (err) {
295
- if (err.statusCode === 401) {
296
- disableFetchToken = false;
297
- }
298
- throw err;
299
- }
300
- return profile2;
301
- }, maxRetries2)).trim();
302
- return retry(async () => {
303
- let creds;
304
- try {
305
- creds = await getCredentialsFromProfile(imdsProfile, options, init);
306
- } catch (err) {
307
- if (err.statusCode === 401) {
308
- disableFetchToken = false;
309
- }
310
- throw err;
311
- }
312
- return creds;
313
- }, maxRetries2);
314
- };
315
- return async () => {
316
- const endpoint = await getInstanceMetadataEndpoint();
317
- if (disableFetchToken) {
318
- logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
319
- return getCredentials(maxRetries, { ...endpoint, timeout });
320
- } else {
321
- let token;
322
- try {
323
- token = (await getMetadataToken({ ...endpoint, timeout })).toString();
324
- } catch (error) {
325
- if (error?.statusCode === 400) {
326
- throw Object.assign(error, {
327
- message: "EC2 Metadata token request returned error"
328
- });
329
- } else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) {
330
- disableFetchToken = true;
331
- }
332
- logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
333
- return getCredentials(maxRetries, { ...endpoint, timeout });
334
- }
335
- return getCredentials(maxRetries, {
336
- ...endpoint,
337
- headers: {
338
- [X_AWS_EC2_METADATA_TOKEN]: token
339
- },
340
- timeout
341
- });
342
- }
343
- };
344
- };
345
- var getMetadataToken = async (options) => httpRequest({
346
- ...options,
347
- path: IMDS_TOKEN_PATH,
348
- method: "PUT",
349
- headers: {
350
- "x-aws-ec2-metadata-token-ttl-seconds": "21600"
351
- }
352
- });
353
- var getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();
354
- var getCredentialsFromProfile = async (profile, options, init) => {
355
- const credentialsResponse = JSON.parse((await httpRequest({
356
- ...options,
357
- path: IMDS_PATH + profile
358
- })).toString());
359
- if (!isImdsCredentials(credentialsResponse)) {
360
- throw new CredentialsProviderError("Invalid response received from instance metadata service.", {
361
- logger: init.logger
362
- });
363
- }
364
- return fromImdsCredentials(credentialsResponse);
365
- };
366
- export {
367
- DEFAULT_MAX_RETRIES,
368
- DEFAULT_TIMEOUT,
369
- ENV_CMDS_AUTH_TOKEN,
370
- ENV_CMDS_FULL_URI,
371
- ENV_CMDS_RELATIVE_URI,
372
- Endpoint,
373
- fromContainerMetadata,
374
- fromInstanceMetadata,
375
- getInstanceMetadataEndpoint,
376
- httpRequest,
377
- providerConfigFromInit
378
- };
@@ -1,69 +0,0 @@
1
- import {
2
- setCredentialFeature
3
- } from "./chunk-M4RPUUZT.mjs";
4
- import {
5
- CredentialsProviderError,
6
- externalDataInterceptor
7
- } from "./chunk-WJP5XYS7.mjs";
8
- import "./chunk-VNZSS2WY.mjs";
9
- import "./chunk-3MV4GQ3N.mjs";
10
-
11
- // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
12
- import { readFileSync } from "fs";
13
-
14
- // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
15
- var fromWebToken = (init) => async (awsIdentityProperties) => {
16
- init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
17
- const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
18
- let { roleAssumerWithWebIdentity } = init;
19
- if (!roleAssumerWithWebIdentity) {
20
- const { getDefaultRoleAssumerWithWebIdentity } = await import("./sts-QGXULWRT.mjs");
21
- roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity({
22
- ...init.clientConfig,
23
- credentialProviderLogger: init.logger,
24
- parentClientConfig: {
25
- ...awsIdentityProperties?.callerClientConfig,
26
- ...init.parentClientConfig
27
- }
28
- }, init.clientPlugins);
29
- }
30
- return roleAssumerWithWebIdentity({
31
- RoleArn: roleArn,
32
- RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`,
33
- WebIdentityToken: webIdentityToken,
34
- ProviderId: providerId,
35
- PolicyArns: policyArns,
36
- Policy: policy,
37
- DurationSeconds: durationSeconds
38
- });
39
- };
40
-
41
- // node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
42
- var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE";
43
- var ENV_ROLE_ARN = "AWS_ROLE_ARN";
44
- var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME";
45
- var fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
46
- init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
47
- const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE];
48
- const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN];
49
- const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME];
50
- if (!webIdentityTokenFile || !roleArn) {
51
- throw new CredentialsProviderError("Web identity configuration not specified", {
52
- logger: init.logger
53
- });
54
- }
55
- const credentials = await fromWebToken({
56
- ...init,
57
- webIdentityToken: externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? readFileSync(webIdentityTokenFile, { encoding: "ascii" }),
58
- roleArn,
59
- roleSessionName
60
- })(awsIdentityProperties);
61
- if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) {
62
- setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h");
63
- }
64
- return credentials;
65
- };
66
- export {
67
- fromTokenFile,
68
- fromWebToken
69
- };