@openclaw/amazon-bedrock-provider 2026.6.5 → 2026.6.6-beta.2
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/bedrock-options.js +1 -0
- package/dist/discovery.js +19 -12
- package/dist/provider-policy-api.js +1 -1
- package/dist/register.sync.runtime.js +58 -21
- package/dist/stream.runtime.js +110 -48
- package/dist/thinking-policy.js +81 -7
- package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-http/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
- package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +12 -1
- package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +12 -1
- package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +201 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +62 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +156 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +16 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +80 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +12 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +9 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +18 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +14 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +12 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +69 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-websocket/package.json +8 -8
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +99 -106
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +62 -120
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +55 -86
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +73 -104
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +102 -185
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/auth/httpAuthSchemeProvider.js +4 -5
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/endpoint/bdd.js +21 -57
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.browser.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/runtimeConfig.js +2 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +73 -41
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js +4 -5
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +20 -52
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.browser.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js +2 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +36 -59
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js +4 -5
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js +17 -45
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.browser.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js +2 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +32 -32
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js +4 -5
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js +17 -45
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.browser.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +2 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +50 -50
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js +4 -5
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js +34 -96
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.browser.js +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +3 -6
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +63 -80
- package/node_modules/@aws-sdk/nested-clients/package.json +9 -9
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
- package/node_modules/@aws-sdk/types/package.json +3 -3
- package/node_modules/@aws-sdk/util-locate-window/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +39 -22
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +39 -22
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +19 -6
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +4 -5
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/ConfiguredRetryStrategy.js +4 -5
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js +9 -5
- package/node_modules/@smithy/core/dist-types/submodules/retry/middleware-retry/configurations.d.ts +4 -1
- package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/ConfiguredRetryStrategy.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/DefaultRetryToken.d.ts +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/StandardRetryStrategy.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +14 -13
- package/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js +14 -13
- package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js +2 -2
- package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js +2 -0
- package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/httpRequest.d.ts +1 -1
- package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/node-http.d.ts +2 -0
- package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -4
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +7 -6
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2.js +2 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-https.js +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +2 -2
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/dist-types/node-https.d.ts +2 -0
- package/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@smithy/signature-v4/package.json +3 -3
- package/node_modules/@smithy/types/dist-types/retry.d.ts +25 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/npm-shrinkwrap.json +169 -152
- package/package.json +7 -7
|
@@ -33,7 +33,7 @@ const THROTTLING_ERROR_CODES = [
|
|
|
33
33
|
const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
34
34
|
const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
35
35
|
const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
36
|
-
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
|
|
36
|
+
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
|
|
37
37
|
|
|
38
38
|
const isRetryableByTrait = (error) => error?.$retryable !== undefined;
|
|
39
39
|
const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name);
|
|
@@ -184,9 +184,6 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
184
184
|
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
185
185
|
}
|
|
186
186
|
catch (refreshError) {
|
|
187
|
-
if (typeof refreshError.$backoff === "number") {
|
|
188
|
-
await cooldown(refreshError.$backoff);
|
|
189
|
-
}
|
|
190
187
|
if (!lastError.$metadata) {
|
|
191
188
|
lastError.$metadata = {};
|
|
192
189
|
}
|
|
@@ -196,8 +193,10 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
196
193
|
}
|
|
197
194
|
attempts = retryToken.getRetryCount();
|
|
198
195
|
const delay = retryToken.getRetryDelay();
|
|
199
|
-
totalRetryDelay += delay;
|
|
200
|
-
|
|
196
|
+
totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
|
|
197
|
+
if (delay > 0) {
|
|
198
|
+
await cooldown(delay);
|
|
199
|
+
}
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
}
|
|
@@ -398,6 +397,9 @@ class DefaultRetryToken {
|
|
|
398
397
|
count;
|
|
399
398
|
cost;
|
|
400
399
|
longPoll;
|
|
400
|
+
$retryLog = {
|
|
401
|
+
acquisitionDelay: 0,
|
|
402
|
+
};
|
|
401
403
|
constructor(delay, count, cost, longPoll) {
|
|
402
404
|
this.delay = delay;
|
|
403
405
|
this.count = count;
|
|
@@ -433,8 +435,8 @@ const refusal = {
|
|
|
433
435
|
};
|
|
434
436
|
let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
435
437
|
mode = exports.RETRY_MODES.STANDARD;
|
|
436
|
-
capacity = INITIAL_RETRY_TOKENS;
|
|
437
438
|
retryBackoffStrategy;
|
|
439
|
+
capacity = INITIAL_RETRY_TOKENS;
|
|
438
440
|
maxAttemptsProvider;
|
|
439
441
|
baseDelay;
|
|
440
442
|
constructor(arg1) {
|
|
@@ -470,14 +472,18 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
470
472
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
471
473
|
}
|
|
472
474
|
if (!shouldRetry) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
475
|
+
const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
476
|
+
if (longPollBackoff > 0) {
|
|
477
|
+
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
478
|
+
}
|
|
476
479
|
}
|
|
477
480
|
else {
|
|
478
481
|
const capacityCost = this.getCapacityCost(errorType);
|
|
479
482
|
this.capacity -= capacityCost;
|
|
480
|
-
|
|
483
|
+
const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
|
|
484
|
+
await new Promise((r) => setTimeout(r, retryDelay));
|
|
485
|
+
nextToken.$retryLog.acquisitionDelay = retryDelay;
|
|
486
|
+
return nextToken;
|
|
481
487
|
}
|
|
482
488
|
}
|
|
483
489
|
throw new Error("No retry token available");
|
|
@@ -559,11 +565,10 @@ class ConfiguredRetryStrategy extends StandardRetryStrategy$1 {
|
|
|
559
565
|
else {
|
|
560
566
|
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
561
567
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
return token;
|
|
568
|
+
this.retryBackoffStrategy.computeNextBackoffDelay = (completedAttempt) => {
|
|
569
|
+
const nextAttempt = completedAttempt + 1;
|
|
570
|
+
return this.computeNextBackoffDelay(nextAttempt);
|
|
571
|
+
};
|
|
567
572
|
}
|
|
568
573
|
}
|
|
569
574
|
|
|
@@ -710,17 +715,29 @@ class AdaptiveRetryStrategy extends StandardRetryStrategy {
|
|
|
710
715
|
}
|
|
711
716
|
}
|
|
712
717
|
|
|
713
|
-
const resolveRetryConfig = (input) => {
|
|
718
|
+
const resolveRetryConfig = (input, defaults) => {
|
|
714
719
|
const { retryStrategy, retryMode } = input;
|
|
715
|
-
const
|
|
720
|
+
const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
|
|
721
|
+
const maxAttemptsProvider = client.normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
|
|
716
722
|
let controller = retryStrategy
|
|
717
723
|
? Promise.resolve(retryStrategy)
|
|
718
724
|
: undefined;
|
|
719
|
-
const getDefault = async () =>
|
|
720
|
-
|
|
721
|
-
|
|
725
|
+
const getDefault = async () => {
|
|
726
|
+
const maxAttempts = await maxAttemptsProvider();
|
|
727
|
+
const adaptive = (await client.normalizeProvider(retryMode)()) === exports.RETRY_MODES.ADAPTIVE;
|
|
728
|
+
if (adaptive) {
|
|
729
|
+
return new AdaptiveRetryStrategy$1(maxAttemptsProvider, {
|
|
730
|
+
maxAttempts,
|
|
731
|
+
baseDelay: defaultBaseDelay,
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
return new StandardRetryStrategy$1({
|
|
735
|
+
maxAttempts,
|
|
736
|
+
baseDelay: defaultBaseDelay,
|
|
737
|
+
});
|
|
738
|
+
};
|
|
722
739
|
return Object.assign(input, {
|
|
723
|
-
maxAttempts,
|
|
740
|
+
maxAttempts: maxAttemptsProvider,
|
|
724
741
|
retryStrategy: () => (controller ??= getDefault()),
|
|
725
742
|
});
|
|
726
743
|
};
|
|
@@ -35,7 +35,7 @@ const THROTTLING_ERROR_CODES = [
|
|
|
35
35
|
const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
36
36
|
const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
37
37
|
const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
38
|
-
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
|
|
38
|
+
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
|
|
39
39
|
|
|
40
40
|
const isRetryableByTrait = (error) => error?.$retryable !== undefined;
|
|
41
41
|
const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name);
|
|
@@ -186,9 +186,6 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
186
186
|
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
187
187
|
}
|
|
188
188
|
catch (refreshError) {
|
|
189
|
-
if (typeof refreshError.$backoff === "number") {
|
|
190
|
-
await cooldown(refreshError.$backoff);
|
|
191
|
-
}
|
|
192
189
|
if (!lastError.$metadata) {
|
|
193
190
|
lastError.$metadata = {};
|
|
194
191
|
}
|
|
@@ -198,8 +195,10 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
198
195
|
}
|
|
199
196
|
attempts = retryToken.getRetryCount();
|
|
200
197
|
const delay = retryToken.getRetryDelay();
|
|
201
|
-
totalRetryDelay += delay;
|
|
202
|
-
|
|
198
|
+
totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
|
|
199
|
+
if (delay > 0) {
|
|
200
|
+
await cooldown(delay);
|
|
201
|
+
}
|
|
203
202
|
}
|
|
204
203
|
}
|
|
205
204
|
}
|
|
@@ -400,6 +399,9 @@ class DefaultRetryToken {
|
|
|
400
399
|
count;
|
|
401
400
|
cost;
|
|
402
401
|
longPoll;
|
|
402
|
+
$retryLog = {
|
|
403
|
+
acquisitionDelay: 0,
|
|
404
|
+
};
|
|
403
405
|
constructor(delay, count, cost, longPoll) {
|
|
404
406
|
this.delay = delay;
|
|
405
407
|
this.count = count;
|
|
@@ -435,8 +437,8 @@ const refusal = {
|
|
|
435
437
|
};
|
|
436
438
|
let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
437
439
|
mode = exports.RETRY_MODES.STANDARD;
|
|
438
|
-
capacity = INITIAL_RETRY_TOKENS;
|
|
439
440
|
retryBackoffStrategy;
|
|
441
|
+
capacity = INITIAL_RETRY_TOKENS;
|
|
440
442
|
maxAttemptsProvider;
|
|
441
443
|
baseDelay;
|
|
442
444
|
constructor(arg1) {
|
|
@@ -472,14 +474,18 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
472
474
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
473
475
|
}
|
|
474
476
|
if (!shouldRetry) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
478
|
+
if (longPollBackoff > 0) {
|
|
479
|
+
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
480
|
+
}
|
|
478
481
|
}
|
|
479
482
|
else {
|
|
480
483
|
const capacityCost = this.getCapacityCost(errorType);
|
|
481
484
|
this.capacity -= capacityCost;
|
|
482
|
-
|
|
485
|
+
const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
|
|
486
|
+
await new Promise((r) => setTimeout(r, retryDelay));
|
|
487
|
+
nextToken.$retryLog.acquisitionDelay = retryDelay;
|
|
488
|
+
return nextToken;
|
|
483
489
|
}
|
|
484
490
|
}
|
|
485
491
|
throw new Error("No retry token available");
|
|
@@ -561,11 +567,10 @@ class ConfiguredRetryStrategy extends StandardRetryStrategy$1 {
|
|
|
561
567
|
else {
|
|
562
568
|
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
563
569
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
return token;
|
|
570
|
+
this.retryBackoffStrategy.computeNextBackoffDelay = (completedAttempt) => {
|
|
571
|
+
const nextAttempt = completedAttempt + 1;
|
|
572
|
+
return this.computeNextBackoffDelay(nextAttempt);
|
|
573
|
+
};
|
|
569
574
|
}
|
|
570
575
|
}
|
|
571
576
|
|
|
@@ -737,17 +742,29 @@ const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
|
|
|
737
742
|
},
|
|
738
743
|
default: DEFAULT_MAX_ATTEMPTS,
|
|
739
744
|
};
|
|
740
|
-
const resolveRetryConfig = (input) => {
|
|
745
|
+
const resolveRetryConfig = (input, defaults) => {
|
|
741
746
|
const { retryStrategy, retryMode } = input;
|
|
742
|
-
const
|
|
747
|
+
const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
|
|
748
|
+
const maxAttemptsProvider = client.normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
|
|
743
749
|
let controller = retryStrategy
|
|
744
750
|
? Promise.resolve(retryStrategy)
|
|
745
751
|
: undefined;
|
|
746
|
-
const getDefault = async () =>
|
|
747
|
-
|
|
748
|
-
|
|
752
|
+
const getDefault = async () => {
|
|
753
|
+
const maxAttempts = await maxAttemptsProvider();
|
|
754
|
+
const adaptive = (await client.normalizeProvider(retryMode)()) === exports.RETRY_MODES.ADAPTIVE;
|
|
755
|
+
if (adaptive) {
|
|
756
|
+
return new AdaptiveRetryStrategy$1(maxAttemptsProvider, {
|
|
757
|
+
maxAttempts,
|
|
758
|
+
baseDelay: defaultBaseDelay,
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
return new StandardRetryStrategy$1({
|
|
762
|
+
maxAttempts,
|
|
763
|
+
baseDelay: defaultBaseDelay,
|
|
764
|
+
});
|
|
765
|
+
};
|
|
749
766
|
return Object.assign(input, {
|
|
750
|
-
maxAttempts,
|
|
767
|
+
maxAttempts: maxAttemptsProvider,
|
|
751
768
|
retryStrategy: () => (controller ??= getDefault()),
|
|
752
769
|
});
|
|
753
770
|
};
|
package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js
CHANGED
|
@@ -2,6 +2,7 @@ import { normalizeProvider } from "@smithy/core/client";
|
|
|
2
2
|
import { AdaptiveRetryStrategy } from "../util-retry/AdaptiveRetryStrategy";
|
|
3
3
|
import { StandardRetryStrategy } from "../util-retry/StandardRetryStrategy";
|
|
4
4
|
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, RETRY_MODES } from "../util-retry/config";
|
|
5
|
+
import { Retry } from "../util-retry/retries-2026-config";
|
|
5
6
|
export const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
|
|
6
7
|
export const CONFIG_MAX_ATTEMPTS = "max_attempts";
|
|
7
8
|
export const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
|
|
@@ -27,17 +28,29 @@ export const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
|
|
|
27
28
|
},
|
|
28
29
|
default: DEFAULT_MAX_ATTEMPTS,
|
|
29
30
|
};
|
|
30
|
-
export const resolveRetryConfig = (input) => {
|
|
31
|
+
export const resolveRetryConfig = (input, defaults) => {
|
|
31
32
|
const { retryStrategy, retryMode } = input;
|
|
32
|
-
const
|
|
33
|
+
const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
|
|
34
|
+
const maxAttemptsProvider = normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
|
|
33
35
|
let controller = retryStrategy
|
|
34
36
|
? Promise.resolve(retryStrategy)
|
|
35
37
|
: undefined;
|
|
36
|
-
const getDefault = async () =>
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const getDefault = async () => {
|
|
39
|
+
const maxAttempts = await maxAttemptsProvider();
|
|
40
|
+
const adaptive = (await normalizeProvider(retryMode)()) === RETRY_MODES.ADAPTIVE;
|
|
41
|
+
if (adaptive) {
|
|
42
|
+
return new AdaptiveRetryStrategy(maxAttemptsProvider, {
|
|
43
|
+
maxAttempts,
|
|
44
|
+
baseDelay: defaultBaseDelay,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return new StandardRetryStrategy({
|
|
48
|
+
maxAttempts,
|
|
49
|
+
baseDelay: defaultBaseDelay,
|
|
50
|
+
});
|
|
51
|
+
};
|
|
39
52
|
return Object.assign(input, {
|
|
40
|
-
maxAttempts,
|
|
53
|
+
maxAttempts: maxAttemptsProvider,
|
|
41
54
|
retryStrategy: () => (controller ??= getDefault()),
|
|
42
55
|
});
|
|
43
56
|
};
|
package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js
CHANGED
|
@@ -42,9 +42,6 @@ export function bindRetryMiddleware(isStreamingPayload) {
|
|
|
42
42
|
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
43
43
|
}
|
|
44
44
|
catch (refreshError) {
|
|
45
|
-
if (typeof refreshError.$backoff === "number") {
|
|
46
|
-
await cooldown(refreshError.$backoff);
|
|
47
|
-
}
|
|
48
45
|
if (!lastError.$metadata) {
|
|
49
46
|
lastError.$metadata = {};
|
|
50
47
|
}
|
|
@@ -54,8 +51,10 @@ export function bindRetryMiddleware(isStreamingPayload) {
|
|
|
54
51
|
}
|
|
55
52
|
attempts = retryToken.getRetryCount();
|
|
56
53
|
const delay = retryToken.getRetryDelay();
|
|
57
|
-
totalRetryDelay += delay;
|
|
58
|
-
|
|
54
|
+
totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
|
|
55
|
+
if (delay > 0) {
|
|
56
|
+
await cooldown(delay);
|
|
57
|
+
}
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
}
|
package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js
CHANGED
|
@@ -25,4 +25,4 @@ export const THROTTLING_ERROR_CODES = [
|
|
|
25
25
|
export const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
26
26
|
export const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
27
27
|
export const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
28
|
-
export const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
|
|
28
|
+
export const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
|
package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/ConfiguredRetryStrategy.js
CHANGED
|
@@ -10,10 +10,9 @@ export class ConfiguredRetryStrategy extends StandardRetryStrategy {
|
|
|
10
10
|
else {
|
|
11
11
|
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return token;
|
|
13
|
+
this.retryBackoffStrategy.computeNextBackoffDelay = (completedAttempt) => {
|
|
14
|
+
const nextAttempt = completedAttempt + 1;
|
|
15
|
+
return this.computeNextBackoffDelay(nextAttempt);
|
|
16
|
+
};
|
|
18
17
|
}
|
|
19
18
|
}
|
package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js
CHANGED
|
@@ -10,8 +10,8 @@ const refusal = {
|
|
|
10
10
|
};
|
|
11
11
|
export class StandardRetryStrategy {
|
|
12
12
|
mode = RETRY_MODES.STANDARD;
|
|
13
|
-
capacity = INITIAL_RETRY_TOKENS;
|
|
14
13
|
retryBackoffStrategy;
|
|
14
|
+
capacity = INITIAL_RETRY_TOKENS;
|
|
15
15
|
maxAttemptsProvider;
|
|
16
16
|
baseDelay;
|
|
17
17
|
constructor(arg1) {
|
|
@@ -47,14 +47,18 @@ export class StandardRetryStrategy {
|
|
|
47
47
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
48
48
|
}
|
|
49
49
|
if (!shouldRetry) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
51
|
+
if (longPollBackoff > 0) {
|
|
52
|
+
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
53
|
+
}
|
|
53
54
|
}
|
|
54
55
|
else {
|
|
55
56
|
const capacityCost = this.getCapacityCost(errorType);
|
|
56
57
|
this.capacity -= capacityCost;
|
|
57
|
-
|
|
58
|
+
const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
|
|
59
|
+
await new Promise((r) => setTimeout(r, retryDelay));
|
|
60
|
+
nextToken.$retryLog.acquisitionDelay = retryDelay;
|
|
61
|
+
return nextToken;
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
throw new Error("No retry token available");
|
package/node_modules/@smithy/core/dist-types/submodules/retry/middleware-retry/configurations.d.ts
CHANGED
|
@@ -53,7 +53,10 @@ export interface RetryResolvedConfig {
|
|
|
53
53
|
/**
|
|
54
54
|
* @internal
|
|
55
55
|
*/
|
|
56
|
-
export declare const resolveRetryConfig: <T>(input: T & PreviouslyResolved & RetryInputConfig
|
|
56
|
+
export declare const resolveRetryConfig: <T>(input: T & PreviouslyResolved & RetryInputConfig, defaults?: {
|
|
57
|
+
defaultMaxAttempts?: number;
|
|
58
|
+
defaultBaseDelay?: number;
|
|
59
|
+
}) => T & RetryResolvedConfig;
|
|
57
60
|
/**
|
|
58
61
|
* @internal
|
|
59
62
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Provider, RetryBackoffStrategy,
|
|
1
|
+
import type { Provider, RetryBackoffStrategy, RetryStrategyV2 } from "@smithy/types";
|
|
2
2
|
import { StandardRetryStrategy } from "./StandardRetryStrategy";
|
|
3
3
|
/**
|
|
4
4
|
* This extension of the StandardRetryStrategy allows customizing the
|
|
@@ -28,5 +28,4 @@ export declare class ConfiguredRetryStrategy extends StandardRetryStrategy imple
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
constructor(maxAttempts: number | Provider<number>, computeNextBackoffDelay?: number | RetryBackoffStrategy["computeNextBackoffDelay"]);
|
|
31
|
-
refreshRetryTokenForRetry(tokenToRenew: StandardRetryToken, errorInfo: RetryErrorInfo): Promise<StandardRetryToken>;
|
|
32
31
|
}
|
package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/DefaultRetryToken.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare class DefaultRetryToken implements StandardRetryToken {
|
|
|
7
7
|
private readonly count;
|
|
8
8
|
private readonly cost;
|
|
9
9
|
private readonly longPoll;
|
|
10
|
+
$retryLog: {
|
|
11
|
+
acquisitionDelay: number;
|
|
12
|
+
};
|
|
10
13
|
constructor(delay: number, count: number, cost: number | undefined, longPoll: boolean);
|
|
11
14
|
getRetryCount(): number;
|
|
12
15
|
getRetryDelay(): number;
|
package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/StandardRetryStrategy.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ export type StandardRetryStrategyOptions = {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class StandardRetryStrategy implements RetryStrategyV2 {
|
|
23
23
|
readonly mode: string;
|
|
24
|
+
protected readonly retryBackoffStrategy: StandardRetryBackoffStrategy;
|
|
24
25
|
private capacity;
|
|
25
|
-
private readonly retryBackoffStrategy;
|
|
26
26
|
private readonly maxAttemptsProvider;
|
|
27
27
|
private readonly baseDelay;
|
|
28
28
|
constructor(maxAttempts: number);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.24.
|
|
3
|
+
"version": "3.24.6",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
|
|
6
6
|
"build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline core",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"sideEffects": false,
|
|
170
170
|
"dependencies": {
|
|
171
171
|
"@aws-crypto/crc32": "5.2.0",
|
|
172
|
-
"@smithy/types": "^4.14.
|
|
172
|
+
"@smithy/types": "^4.14.3",
|
|
173
173
|
"tslib": "^2.6.2"
|
|
174
174
|
},
|
|
175
175
|
"engines": {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var node_url = require('node:url');
|
|
4
3
|
var config = require('@smithy/core/config');
|
|
5
4
|
var node_http = require('node:http');
|
|
6
5
|
var protocols = require('@smithy/core/protocols');
|
|
@@ -95,14 +94,8 @@ const requestFromEcsImds = async (timeout, options) => {
|
|
|
95
94
|
return buffer.toString();
|
|
96
95
|
};
|
|
97
96
|
const CMDS_IP = "169.254.170.2";
|
|
98
|
-
const GREENGRASS_HOSTS =
|
|
99
|
-
|
|
100
|
-
"127.0.0.1": true,
|
|
101
|
-
};
|
|
102
|
-
const GREENGRASS_PROTOCOLS = {
|
|
103
|
-
"http:": true,
|
|
104
|
-
"https:": true,
|
|
105
|
-
};
|
|
97
|
+
const GREENGRASS_HOSTS = new Set(["localhost", "127.0.0.1"]);
|
|
98
|
+
const GREENGRASS_PROTOCOLS = new Set(["http:", "https:"]);
|
|
106
99
|
const getCmdsUri = async ({ logger }) => {
|
|
107
100
|
if (process.env[ENV_CMDS_RELATIVE_URI]) {
|
|
108
101
|
return {
|
|
@@ -111,21 +104,29 @@ const getCmdsUri = async ({ logger }) => {
|
|
|
111
104
|
};
|
|
112
105
|
}
|
|
113
106
|
if (process.env[ENV_CMDS_FULL_URI]) {
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
let parsed;
|
|
108
|
+
try {
|
|
109
|
+
parsed = new URL(process.env[ENV_CMDS_FULL_URI]);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
throw new config.CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger });
|
|
113
|
+
}
|
|
114
|
+
if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) {
|
|
116
115
|
throw new config.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
117
116
|
tryNextLink: false,
|
|
118
117
|
logger,
|
|
119
118
|
});
|
|
120
119
|
}
|
|
121
|
-
if (!parsed.protocol || !(parsed.protocol
|
|
120
|
+
if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) {
|
|
122
121
|
throw new config.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
|
|
123
122
|
tryNextLink: false,
|
|
124
123
|
logger,
|
|
125
124
|
});
|
|
126
125
|
}
|
|
127
126
|
return {
|
|
128
|
-
|
|
127
|
+
protocol: parsed.protocol,
|
|
128
|
+
hostname: parsed.hostname,
|
|
129
|
+
path: parsed.pathname + parsed.search,
|
|
129
130
|
port: parsed.port ? parseInt(parsed.port, 10) : undefined,
|
|
130
131
|
};
|
|
131
132
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { parse } from "node:url";
|
|
2
1
|
import { CredentialsProviderError } from "@smithy/core/config";
|
|
3
2
|
import { fromImdsCredentials, isImdsCredentials } from "./remoteProvider/ImdsCredentials";
|
|
4
3
|
import { providerConfigFromInit } from "./remoteProvider/RemoteProviderInit";
|
|
@@ -34,14 +33,8 @@ const requestFromEcsImds = async (timeout, options) => {
|
|
|
34
33
|
return buffer.toString();
|
|
35
34
|
};
|
|
36
35
|
const CMDS_IP = "169.254.170.2";
|
|
37
|
-
const GREENGRASS_HOSTS =
|
|
38
|
-
|
|
39
|
-
"127.0.0.1": true,
|
|
40
|
-
};
|
|
41
|
-
const GREENGRASS_PROTOCOLS = {
|
|
42
|
-
"http:": true,
|
|
43
|
-
"https:": true,
|
|
44
|
-
};
|
|
36
|
+
const GREENGRASS_HOSTS = new Set(["localhost", "127.0.0.1"]);
|
|
37
|
+
const GREENGRASS_PROTOCOLS = new Set(["http:", "https:"]);
|
|
45
38
|
const getCmdsUri = async ({ logger }) => {
|
|
46
39
|
if (process.env[ENV_CMDS_RELATIVE_URI]) {
|
|
47
40
|
return {
|
|
@@ -50,21 +43,29 @@ const getCmdsUri = async ({ logger }) => {
|
|
|
50
43
|
};
|
|
51
44
|
}
|
|
52
45
|
if (process.env[ENV_CMDS_FULL_URI]) {
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
let parsed;
|
|
47
|
+
try {
|
|
48
|
+
parsed = new URL(process.env[ENV_CMDS_FULL_URI]);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
throw new CredentialsProviderError(`${process.env[ENV_CMDS_FULL_URI]} is not a valid container metadata service URL`, { tryNextLink: false, logger });
|
|
52
|
+
}
|
|
53
|
+
if (!parsed.hostname || !GREENGRASS_HOSTS.has(parsed.hostname)) {
|
|
55
54
|
throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
56
55
|
tryNextLink: false,
|
|
57
56
|
logger,
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
|
-
if (!parsed.protocol || !(parsed.protocol
|
|
59
|
+
if (!parsed.protocol || !GREENGRASS_PROTOCOLS.has(parsed.protocol)) {
|
|
61
60
|
throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
|
|
62
61
|
tryNextLink: false,
|
|
63
62
|
logger,
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
return {
|
|
67
|
-
|
|
66
|
+
protocol: parsed.protocol,
|
|
67
|
+
hostname: parsed.hostname,
|
|
68
|
+
path: parsed.pathname + parsed.search,
|
|
68
69
|
port: parsed.port ? parseInt(parsed.port, 10) : undefined,
|
|
69
70
|
};
|
|
70
71
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { request } from "node:http";
|
|
2
1
|
import { ProviderError } from "@smithy/core/config";
|
|
2
|
+
import { node_http } from "./node-http";
|
|
3
3
|
export function httpRequest(options) {
|
|
4
4
|
return new Promise((resolve, reject) => {
|
|
5
|
-
const req = request({
|
|
5
|
+
const req = node_http.request({
|
|
6
6
|
method: "GET",
|
|
7
7
|
...options,
|
|
8
8
|
hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/credential-provider-imds",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.8",
|
|
4
4
|
"description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@smithy/core": "^3.24.
|
|
31
|
-
"@smithy/types": "^4.14.
|
|
30
|
+
"@smithy/core": "^3.24.6",
|
|
31
|
+
"@smithy/types": "^4.14.3",
|
|
32
32
|
"tslib": "^2.6.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/fetch-http-handler",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.6",
|
|
4
4
|
"description": "Provides a way to make requests",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"module": "./dist-es/index.js",
|
|
28
28
|
"types": "./dist-types/index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@smithy/core": "^3.24.
|
|
31
|
-
"@smithy/types": "^4.14.
|
|
30
|
+
"@smithy/core": "^3.24.6",
|
|
31
|
+
"@smithy/types": "^4.14.3",
|
|
32
32
|
"tslib": "^2.6.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@smithy/abort-controller": "^4.2.
|
|
35
|
+
"@smithy/abort-controller": "^4.2.16",
|
|
36
36
|
"concurrently": "7.0.0",
|
|
37
37
|
"downlevel-dts": "0.10.1",
|
|
38
38
|
"premove": "4.0.0",
|