@jjrawlins/cdk-iam-policy-builder-helper 0.0.43 → 0.0.44
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/.jsii +2 -2
- package/cdk-iam-policy-builder-helper/go.mod +2 -2
- package/cdk-iam-policy-builder-helper/jsii/jsii.go +2 -2
- package/cdk-iam-policy-builder-helper/version +1 -1
- package/node_modules/@smithy/abort-controller/dist-cjs/index.js +28 -80
- package/node_modules/@smithy/abort-controller/dist-es/AbortController.js +1 -3
- package/node_modules/@smithy/abort-controller/dist-es/AbortSignal.js +2 -2
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/dist-cjs/index.js +158 -215
- package/node_modules/@smithy/config-resolver/package.json +5 -5
- package/node_modules/@smithy/core/dist-cjs/index.js +308 -412
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +957 -969
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +198 -249
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +793 -895
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +617 -811
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +584 -680
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +4 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +18 -18
- package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +9 -7
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +3 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +3 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +16 -8
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +6 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +14 -14
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -0
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +1 -1
- package/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js +4 -2
- package/node_modules/@smithy/core/package.json +11 -11
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +340 -412
- package/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js +2 -1
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +190 -238
- package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -0
- package/node_modules/@smithy/fetch-http-handler/package.json +6 -6
- package/node_modules/@smithy/hash-node/dist-cjs/index.js +38 -63
- package/node_modules/@smithy/hash-node/dist-es/index.js +3 -0
- package/node_modules/@smithy/hash-node/package.json +4 -4
- package/node_modules/@smithy/invalid-dependency/dist-cjs/index.js +7 -38
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/is-array-buffer/dist-cjs/index.js +4 -30
- package/node_modules/@smithy/is-array-buffer/package.json +1 -1
- package/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +39 -64
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +1 -1
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +219 -277
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/dist-cjs/index.js +327 -380
- package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.browser.js +1 -1
- package/node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js +2 -2
- package/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js +1 -0
- package/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js +5 -1
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/dist-cjs/index.js +89 -118
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/dist-cjs/index.js +274 -297
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/dist-cjs/index.js +51 -98
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +663 -771
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +5 -3
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +1 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +4 -2
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +3 -1
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js +1 -4
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +3 -1
- package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +1 -1
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/dist-cjs/index.js +105 -158
- package/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js +1 -1
- package/node_modules/@smithy/property-provider/dist-es/ProviderError.js +2 -1
- package/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js +1 -1
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/dist-cjs/index.js +154 -246
- package/node_modules/@smithy/protocol-http/dist-es/Field.js +3 -0
- package/node_modules/@smithy/protocol-http/dist-es/Fields.js +2 -1
- package/node_modules/@smithy/protocol-http/dist-es/httpRequest.js +11 -0
- package/node_modules/@smithy/protocol-http/dist-es/httpResponse.js +4 -0
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/dist-cjs/index.js +21 -47
- package/node_modules/@smithy/querystring-builder/package.json +3 -3
- package/node_modules/@smithy/querystring-parser/dist-cjs/index.js +22 -48
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +70 -103
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js +171 -210
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/slurpFile.js +1 -1
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +525 -648
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +2 -1
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +1 -1
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +6 -0
- package/node_modules/@smithy/signature-v4/package.json +8 -8
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +554 -747
- package/node_modules/@smithy/smithy-client/dist-es/client.js +4 -1
- package/node_modules/@smithy/smithy-client/dist-es/command.js +17 -18
- package/node_modules/@smithy/smithy-client/dist-es/exceptions.js +4 -0
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-cjs/index.js +80 -133
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/dist-cjs/index.js +20 -46
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-base64/dist-cjs/index.js +16 -24
- package/node_modules/@smithy/util-base64/package.json +3 -3
- package/node_modules/@smithy/util-body-length-browser/dist-cjs/index.js +26 -50
- package/node_modules/@smithy/util-body-length-browser/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +27 -50
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-buffer-from/dist-cjs/index.js +17 -44
- package/node_modules/@smithy/util-buffer-from/package.json +2 -2
- package/node_modules/@smithy/util-config-provider/dist-cjs/index.js +26 -56
- package/node_modules/@smithy/util-config-provider/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/index.js +9 -22
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +4 -5
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.native.js +2 -2
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +65 -110
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +445 -526
- package/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js +3 -2
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js +29 -58
- package/node_modules/@smithy/util-hex-encoding/package.json +1 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/index.js +11 -40
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +260 -340
- package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +4 -1
- package/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js +1 -0
- package/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js +17 -8
- package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +5 -3
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js +3 -2
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js +7 -3
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js +2 -3
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +1 -1
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +2 -3
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.js +4 -8
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +83 -93
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +3 -7
- package/node_modules/@smithy/util-stream/dist-es/ByteArrayCollector.js +3 -2
- package/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js +5 -0
- package/node_modules/@smithy/util-stream/dist-es/headStream.js +3 -6
- package/node_modules/@smithy/util-stream/package.json +8 -8
- package/node_modules/@smithy/util-uri-escape/dist-cjs/index.js +6 -40
- package/node_modules/@smithy/util-uri-escape/package.json +1 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/index.js +27 -60
- package/node_modules/@smithy/util-utf8/package.json +2 -2
- package/node_modules/@smithy/util-waiter/dist-cjs/index.js +152 -189
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/node_modules/@smithy/uuid/dist-cjs/index.js +33 -42
- package/node_modules/@smithy/uuid/package.json +1 -1
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -7
- package/node_modules/get-intrinsic/index.js +13 -8
- package/node_modules/get-intrinsic/package.json +4 -7
- package/package.json +3 -3
- package/node_modules/@smithy/abort-controller/dist-cjs/AbortController.js +0 -1
- package/node_modules/@smithy/abort-controller/dist-cjs/AbortSignal.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/NodeUseFipsEndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/index.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveCustomEndpointsConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/resolveEndpointsConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/config.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/getRealRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/index.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/isFipsRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariant.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/EndpointVariantTag.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/PartitionHash.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/RegionHash.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getHostnameFromVariants.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getRegionInfo.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedHostname.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedPartition.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/getResolvedSigningRegion.js +0 -1
- package/node_modules/@smithy/config-resolver/dist-cjs/regionInfo/index.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/Endpoint.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointConfigOptions.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointMode.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/config/EndpointModeConfigOptions.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/error/InstanceMetadataV1FallbackError.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromContainerMetadata.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/fromInstanceMetadata.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/ImdsCredentials.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/RemoteProviderInit.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/httpRequest.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/index.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/remoteProvider/retry.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getExtendedInstanceMetadataCredentials.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/getInstanceMetadataEndpoint.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/utils/staticStabilityProvider.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/create-request.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/fetch-http-handler.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/request-timeout.js +0 -1
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/stream-collector.js +0 -1
- package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidFunction.js +0 -1
- package/node_modules/@smithy/invalid-dependency/dist-cjs/invalidProvider.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/serdePlugin.js +0 -1
- package/node_modules/@smithy/middleware-serde/dist-cjs/serializerMiddleware.js +0 -1
- package/node_modules/@smithy/middleware-stack/dist-cjs/MiddlewareStack.js +0 -1
- package/node_modules/@smithy/middleware-stack/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/configLoader.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromEnv.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromSharedConfigFiles.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/fromStatic.js +0 -1
- package/node_modules/@smithy/node-config-provider/dist-cjs/getSelectorName.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/get-transformed-headers.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-manager.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-connection-pool.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/node-http2-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/readable.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/server.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-connection-timeout.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-keep-alive.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/set-socket-timeout.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/collector.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/index.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/stream-collector/readable.mock.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/timing.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/write-request-body.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/CredentialsProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/ProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/TokenProviderError.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/chain.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/fromStatic.js +0 -1
- package/node_modules/@smithy/property-provider/dist-cjs/memoize.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/Field.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/Fields.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/httpExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/extensions/index.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpHandler.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpRequest.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/httpResponse.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/isValidHostname.js +0 -1
- package/node_modules/@smithy/protocol-http/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/service-error-classification/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/externalDataInterceptor.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getConfigFilepath.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getCredentialsFilepath.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getProfileName.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSsoSessionData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSharedConfigFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/loadSsoSessionData.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/mergeConfigFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseIni.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/parseKnownFiles.js +0 -1
- package/node_modules/@smithy/shared-ini-file-loader/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/HeaderFormatter.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/SignatureV4Base.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/credentialDerivation.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalHeaders.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getCanonicalQuery.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/getPayloadHash.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/headerUtil.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/moveHeadersToQuery.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/prepareRequest.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/signature-v4a-container.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/suite.fixture.js +0 -1
- package/node_modules/@smithy/signature-v4/dist-cjs/utilDate.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/abort-handler.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/abort.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpApiKeyAuth.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthScheme.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpAuthSchemeProvider.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/HttpSigner.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/IdentityProviderConfig.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/auth.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/auth/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/blob/blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/checksum.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/client.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/command.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/config.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/manager.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/connection/pool.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/crypto.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/downlevel-ts3.4/transform/type-transform.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/encode.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoint.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/RuleSetObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/endpoints/shared.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/eventStream.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/checksum.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/defaultClientConfiguration.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/defaultExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/extensions/retry.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/externals-check/browser-externals-check.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/feature-ids.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/http/httpHandlerInitialization.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/http.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/apiKeyIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/awsCredentialIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/identity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/index.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/identity/tokenIdentity.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/logger.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/middleware.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/pagination.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/profile.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/response.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/retry.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/schema.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/sentinels.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/schema/traits.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/serde.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/shapes.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/signature.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/stream.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-common-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/streaming-payload/streaming-blob-payload-output-types.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transfer.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/client-method-transforms.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/client-payload-blob-type-narrow.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/exact.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/mutable.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/no-undefined.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/transform/type-transform.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/uri.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/util.js +0 -1
- package/node_modules/@smithy/types/dist-cjs/waiter.js +0 -1
- package/node_modules/@smithy/util-body-length-browser/dist-cjs/calculateBodyLength.js +0 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/calculateBodyLength.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/booleanSelector.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/numberSelector.js +0 -1
- package/node_modules/@smithy/util-config-provider/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/cache/EndpointCache.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/debugId.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/debug/toDebugString.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/getEndpointUrlConfig.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/booleanEquals.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttr.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/getAttrPathList.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isIpAddress.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isSet.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/isValidHostLabel.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/not.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/parseURL.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/stringEquals.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/substring.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/lib/uriEncode.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/resolveEndpoint.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointError.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/RuleSetObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/index.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/types/shared.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/callFunction.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/customEndpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/endpointFunctions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateCondition.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateConditions.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateEndpointRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateErrorRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateExpression.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateRules.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTemplate.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/evaluateTreeRule.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointHeaders.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperties.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointProperty.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getEndpointUrl.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/getReferenceValue.js +0 -1
- package/node_modules/@smithy/util-endpoints/dist-cjs/utils/index.js +0 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/getSmithyContext.js +0 -1
- package/node_modules/@smithy/util-middleware/dist-cjs/normalizeProvider.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/DefaultRateLimiter.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/config.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/constants.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryBackoffStrategy.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/defaultRetryToken.js +0 -1
- package/node_modules/@smithy/util-retry/dist-cjs/types.js +0 -1
- package/node_modules/@smithy/util-stream/dist-cjs/blob/Uint8ArrayBlobAdapter.js +0 -1
- package/node_modules/@smithy/util-stream/dist-cjs/blob/transforms.js +0 -1
- package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri-path.js +0 -1
- package/node_modules/@smithy/util-uri-escape/dist-cjs/escape-uri.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.browser.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/fromUtf8.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUint8Array.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.browser.js +0 -1
- package/node_modules/@smithy/util-utf8/dist-cjs/toUtf8.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/createWaiter.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/poller.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/index.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/sleep.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/utils/validate.js +0 -1
- package/node_modules/@smithy/util-waiter/dist-cjs/waiter.js +0 -1
- package/node_modules/@smithy/uuid/dist-cjs/randomUUID.browser.js +0 -1
- package/node_modules/@smithy/uuid/dist-cjs/v4.js +0 -1
- package/node_modules/async-function/.eslintrc +0 -16
- package/node_modules/async-function/.github/FUNDING.yml +0 -12
- package/node_modules/async-function/.nycrc +0 -9
- package/node_modules/async-function/CHANGELOG.md +0 -16
- package/node_modules/async-function/LICENSE +0 -21
- package/node_modules/async-function/README.md +0 -51
- package/node_modules/async-function/index.d.mts +0 -3
- package/node_modules/async-function/index.d.ts +0 -13
- package/node_modules/async-function/index.js +0 -8
- package/node_modules/async-function/index.mjs +0 -4
- package/node_modules/async-function/legacy.js +0 -18
- package/node_modules/async-function/package.json +0 -86
- package/node_modules/async-function/require.mjs +0 -5
- package/node_modules/async-function/test/index.js +0 -40
- package/node_modules/async-function/tsconfig.json +0 -9
- package/node_modules/async-generator-function/.eslintrc +0 -26
- package/node_modules/async-generator-function/.github/FUNDING.yml +0 -12
- package/node_modules/async-generator-function/.nycrc +0 -9
- package/node_modules/async-generator-function/CHANGELOG.md +0 -15
- package/node_modules/async-generator-function/LICENSE +0 -21
- package/node_modules/async-generator-function/README.md +0 -52
- package/node_modules/async-generator-function/index.d.mts +0 -3
- package/node_modules/async-generator-function/index.d.ts +0 -22
- package/node_modules/async-generator-function/index.js +0 -8
- package/node_modules/async-generator-function/index.mjs +0 -4
- package/node_modules/async-generator-function/legacy.js +0 -18
- package/node_modules/async-generator-function/package.json +0 -87
- package/node_modules/async-generator-function/require.mjs +0 -5
- package/node_modules/async-generator-function/test/index.js +0 -40
- package/node_modules/async-generator-function/tsconfig.json +0 -9
- package/node_modules/generator-function/.eslintrc +0 -16
- package/node_modules/generator-function/.github/FUNDING.yml +0 -12
- package/node_modules/generator-function/.nycrc +0 -9
- package/node_modules/generator-function/CHANGELOG.md +0 -21
- package/node_modules/generator-function/LICENSE.md +0 -7
- package/node_modules/generator-function/README.md +0 -51
- package/node_modules/generator-function/index.d.mts +0 -3
- package/node_modules/generator-function/index.d.ts +0 -3
- package/node_modules/generator-function/index.js +0 -8
- package/node_modules/generator-function/index.mjs +0 -4
- package/node_modules/generator-function/legacy.js +0 -18
- package/node_modules/generator-function/package.json +0 -88
- package/node_modules/generator-function/require.mjs +0 -5
- package/node_modules/generator-function/test/index.js +0 -42
- package/node_modules/generator-function/tsconfig.json +0 -9
|
@@ -1,444 +1,372 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES,
|
|
24
|
-
DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
|
|
25
|
-
ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN,
|
|
26
|
-
ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI,
|
|
27
|
-
ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI,
|
|
28
|
-
Endpoint: () => Endpoint,
|
|
29
|
-
fromContainerMetadata: () => fromContainerMetadata,
|
|
30
|
-
fromInstanceMetadata: () => fromInstanceMetadata,
|
|
31
|
-
getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint,
|
|
32
|
-
httpRequest: () => httpRequest,
|
|
33
|
-
providerConfigFromInit: () => providerConfigFromInit
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
|
|
37
|
-
// src/fromContainerMetadata.ts
|
|
1
|
+
'use strict';
|
|
38
2
|
|
|
39
|
-
var
|
|
3
|
+
var propertyProvider = require('@smithy/property-provider');
|
|
4
|
+
var url = require('url');
|
|
5
|
+
var buffer = require('buffer');
|
|
6
|
+
var http = require('http');
|
|
7
|
+
var nodeConfigProvider = require('@smithy/node-config-provider');
|
|
8
|
+
var urlParser = require('@smithy/url-parser');
|
|
40
9
|
|
|
41
|
-
// src/remoteProvider/httpRequest.ts
|
|
42
|
-
var import_property_provider = require("@smithy/property-provider");
|
|
43
|
-
var import_buffer = require("buffer");
|
|
44
|
-
var import_http = require("http");
|
|
45
10
|
function httpRequest(options) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
req.destroy();
|
|
77
|
-
});
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const req = http.request({
|
|
13
|
+
method: "GET",
|
|
14
|
+
...options,
|
|
15
|
+
hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1"),
|
|
16
|
+
});
|
|
17
|
+
req.on("error", (err) => {
|
|
18
|
+
reject(Object.assign(new propertyProvider.ProviderError("Unable to connect to instance metadata service"), err));
|
|
19
|
+
req.destroy();
|
|
20
|
+
});
|
|
21
|
+
req.on("timeout", () => {
|
|
22
|
+
reject(new propertyProvider.ProviderError("TimeoutError from instance metadata service"));
|
|
23
|
+
req.destroy();
|
|
24
|
+
});
|
|
25
|
+
req.on("response", (res) => {
|
|
26
|
+
const { statusCode = 400 } = res;
|
|
27
|
+
if (statusCode < 200 || 300 <= statusCode) {
|
|
28
|
+
reject(Object.assign(new propertyProvider.ProviderError("Error response received from instance metadata service"), { statusCode }));
|
|
29
|
+
req.destroy();
|
|
30
|
+
}
|
|
31
|
+
const chunks = [];
|
|
32
|
+
res.on("data", (chunk) => {
|
|
33
|
+
chunks.push(chunk);
|
|
34
|
+
});
|
|
35
|
+
res.on("end", () => {
|
|
36
|
+
resolve(buffer.Buffer.concat(chunks));
|
|
37
|
+
req.destroy();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
req.end();
|
|
78
41
|
});
|
|
79
|
-
req.end();
|
|
80
|
-
});
|
|
81
42
|
}
|
|
82
|
-
__name(httpRequest, "httpRequest");
|
|
83
43
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var providerConfigFromInit = /* @__PURE__ */ __name(({
|
|
98
|
-
maxRetries = DEFAULT_MAX_RETRIES,
|
|
99
|
-
timeout = DEFAULT_TIMEOUT
|
|
100
|
-
}) => ({ maxRetries, timeout }), "providerConfigFromInit");
|
|
44
|
+
const isImdsCredentials = (arg) => Boolean(arg) &&
|
|
45
|
+
typeof arg === "object" &&
|
|
46
|
+
typeof arg.AccessKeyId === "string" &&
|
|
47
|
+
typeof arg.SecretAccessKey === "string" &&
|
|
48
|
+
typeof arg.Token === "string" &&
|
|
49
|
+
typeof arg.Expiration === "string";
|
|
50
|
+
const fromImdsCredentials = (creds) => ({
|
|
51
|
+
accessKeyId: creds.AccessKeyId,
|
|
52
|
+
secretAccessKey: creds.SecretAccessKey,
|
|
53
|
+
sessionToken: creds.Token,
|
|
54
|
+
expiration: new Date(creds.Expiration),
|
|
55
|
+
...(creds.AccountId && { accountId: creds.AccountId }),
|
|
56
|
+
});
|
|
101
57
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
for (let i = 0; i < maxRetries; i++) {
|
|
106
|
-
promise = promise.catch(toRetry);
|
|
107
|
-
}
|
|
108
|
-
return promise;
|
|
109
|
-
}, "retry");
|
|
58
|
+
const DEFAULT_TIMEOUT = 1000;
|
|
59
|
+
const DEFAULT_MAX_RETRIES = 0;
|
|
60
|
+
const providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT, }) => ({ maxRetries, timeout });
|
|
110
61
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var fromContainerMetadata = /* @__PURE__ */ __name((init = {}) => {
|
|
116
|
-
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
117
|
-
return () => retry(async () => {
|
|
118
|
-
const requestOptions = await getCmdsUri({ logger: init.logger });
|
|
119
|
-
const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
|
|
120
|
-
if (!isImdsCredentials(credsResponse)) {
|
|
121
|
-
throw new import_property_provider.CredentialsProviderError("Invalid response received from instance metadata service.", {
|
|
122
|
-
logger: init.logger
|
|
123
|
-
});
|
|
62
|
+
const retry = (toRetry, maxRetries) => {
|
|
63
|
+
let promise = toRetry();
|
|
64
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
65
|
+
promise = promise.catch(toRetry);
|
|
124
66
|
}
|
|
125
|
-
return
|
|
126
|
-
}, maxRetries);
|
|
127
|
-
}, "fromContainerMetadata");
|
|
128
|
-
var requestFromEcsImds = /* @__PURE__ */ __name(async (timeout, options) => {
|
|
129
|
-
if (process.env[ENV_CMDS_AUTH_TOKEN]) {
|
|
130
|
-
options.headers = {
|
|
131
|
-
...options.headers,
|
|
132
|
-
Authorization: process.env[ENV_CMDS_AUTH_TOKEN]
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
const buffer = await httpRequest({
|
|
136
|
-
...options,
|
|
137
|
-
timeout
|
|
138
|
-
});
|
|
139
|
-
return buffer.toString();
|
|
140
|
-
}, "requestFromEcsImds");
|
|
141
|
-
var CMDS_IP = "169.254.170.2";
|
|
142
|
-
var GREENGRASS_HOSTS = {
|
|
143
|
-
localhost: true,
|
|
144
|
-
"127.0.0.1": true
|
|
67
|
+
return promise;
|
|
145
68
|
};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
69
|
+
|
|
70
|
+
const ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI";
|
|
71
|
+
const ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
|
|
72
|
+
const ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN";
|
|
73
|
+
const fromContainerMetadata = (init = {}) => {
|
|
74
|
+
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
75
|
+
return () => retry(async () => {
|
|
76
|
+
const requestOptions = await getCmdsUri({ logger: init.logger });
|
|
77
|
+
const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions));
|
|
78
|
+
if (!isImdsCredentials(credsResponse)) {
|
|
79
|
+
throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", {
|
|
80
|
+
logger: init.logger,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return fromImdsCredentials(credsResponse);
|
|
84
|
+
}, maxRetries);
|
|
149
85
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
if (process.env[ENV_CMDS_FULL_URI]) {
|
|
158
|
-
const parsed = (0, import_url.parse)(process.env[ENV_CMDS_FULL_URI]);
|
|
159
|
-
if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
|
|
160
|
-
throw new import_property_provider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
161
|
-
tryNextLink: false,
|
|
162
|
-
logger
|
|
163
|
-
});
|
|
86
|
+
const requestFromEcsImds = async (timeout, options) => {
|
|
87
|
+
if (process.env[ENV_CMDS_AUTH_TOKEN]) {
|
|
88
|
+
options.headers = {
|
|
89
|
+
...options.headers,
|
|
90
|
+
Authorization: process.env[ENV_CMDS_AUTH_TOKEN],
|
|
91
|
+
};
|
|
164
92
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
93
|
+
const buffer = await httpRequest({
|
|
94
|
+
...options,
|
|
95
|
+
timeout,
|
|
96
|
+
});
|
|
97
|
+
return buffer.toString();
|
|
98
|
+
};
|
|
99
|
+
const CMDS_IP = "169.254.170.2";
|
|
100
|
+
const GREENGRASS_HOSTS = {
|
|
101
|
+
localhost: true,
|
|
102
|
+
"127.0.0.1": true,
|
|
103
|
+
};
|
|
104
|
+
const GREENGRASS_PROTOCOLS = {
|
|
105
|
+
"http:": true,
|
|
106
|
+
"https:": true,
|
|
107
|
+
};
|
|
108
|
+
const getCmdsUri = async ({ logger }) => {
|
|
109
|
+
if (process.env[ENV_CMDS_RELATIVE_URI]) {
|
|
110
|
+
return {
|
|
111
|
+
hostname: CMDS_IP,
|
|
112
|
+
path: process.env[ENV_CMDS_RELATIVE_URI],
|
|
113
|
+
};
|
|
170
114
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
115
|
+
if (process.env[ENV_CMDS_FULL_URI]) {
|
|
116
|
+
const parsed = url.parse(process.env[ENV_CMDS_FULL_URI]);
|
|
117
|
+
if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
|
|
118
|
+
throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
119
|
+
tryNextLink: false,
|
|
120
|
+
logger,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
|
|
124
|
+
throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
|
|
125
|
+
tryNextLink: false,
|
|
126
|
+
logger,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
...parsed,
|
|
131
|
+
port: parsed.port ? parseInt(parsed.port, 10) : undefined,
|
|
132
|
+
};
|
|
181
133
|
}
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// src/error/InstanceMetadataV1FallbackError.ts
|
|
190
|
-
|
|
191
|
-
var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends import_property_provider.CredentialsProviderError {
|
|
192
|
-
constructor(message, tryNextLink = true) {
|
|
193
|
-
super(message, tryNextLink);
|
|
194
|
-
this.tryNextLink = tryNextLink;
|
|
195
|
-
this.name = "InstanceMetadataV1FallbackError";
|
|
196
|
-
Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
|
|
197
|
-
}
|
|
198
|
-
static {
|
|
199
|
-
__name(this, "InstanceMetadataV1FallbackError");
|
|
200
|
-
}
|
|
134
|
+
throw new propertyProvider.CredentialsProviderError("The container metadata credential provider cannot be used unless" +
|
|
135
|
+
` the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment` +
|
|
136
|
+
" variable is set", {
|
|
137
|
+
tryNextLink: false,
|
|
138
|
+
logger,
|
|
139
|
+
});
|
|
201
140
|
};
|
|
202
141
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
142
|
+
class InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError {
|
|
143
|
+
tryNextLink;
|
|
144
|
+
name = "InstanceMetadataV1FallbackError";
|
|
145
|
+
constructor(message, tryNextLink = true) {
|
|
146
|
+
super(message, tryNextLink);
|
|
147
|
+
this.tryNextLink = tryNextLink;
|
|
148
|
+
Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
206
151
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
})(Endpoint || {});
|
|
152
|
+
exports.Endpoint = void 0;
|
|
153
|
+
(function (Endpoint) {
|
|
154
|
+
Endpoint["IPv4"] = "http://169.254.169.254";
|
|
155
|
+
Endpoint["IPv6"] = "http://[fd00:ec2::254]";
|
|
156
|
+
})(exports.Endpoint || (exports.Endpoint = {}));
|
|
213
157
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
default: void 0
|
|
158
|
+
const ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT";
|
|
159
|
+
const CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint";
|
|
160
|
+
const ENDPOINT_CONFIG_OPTIONS = {
|
|
161
|
+
environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME],
|
|
162
|
+
configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME],
|
|
163
|
+
default: undefined,
|
|
221
164
|
};
|
|
222
165
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
})(EndpointMode || {});
|
|
166
|
+
var EndpointMode;
|
|
167
|
+
(function (EndpointMode) {
|
|
168
|
+
EndpointMode["IPv4"] = "IPv4";
|
|
169
|
+
EndpointMode["IPv6"] = "IPv6";
|
|
170
|
+
})(EndpointMode || (EndpointMode = {}));
|
|
229
171
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
default: "IPv4" /* IPv4 */
|
|
172
|
+
const ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE";
|
|
173
|
+
const CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode";
|
|
174
|
+
const ENDPOINT_MODE_CONFIG_OPTIONS = {
|
|
175
|
+
environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME],
|
|
176
|
+
configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME],
|
|
177
|
+
default: EndpointMode.IPv4,
|
|
237
178
|
};
|
|
238
179
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`);
|
|
251
|
-
}
|
|
252
|
-
}, "getFromEndpointModeConfig");
|
|
253
|
-
|
|
254
|
-
// src/utils/getExtendedInstanceMetadataCredentials.ts
|
|
255
|
-
var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
|
|
256
|
-
var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
|
|
257
|
-
var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
|
|
258
|
-
var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger) => {
|
|
259
|
-
const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
|
|
260
|
-
const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
|
|
261
|
-
logger.warn(
|
|
262
|
-
`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
|
|
263
|
-
For more information, please visit: ` + STATIC_STABILITY_DOC_URL
|
|
264
|
-
);
|
|
265
|
-
const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
|
|
266
|
-
return {
|
|
267
|
-
...credentials,
|
|
268
|
-
...originalExpiration ? { originalExpiration } : {},
|
|
269
|
-
expiration: newExpiration
|
|
270
|
-
};
|
|
271
|
-
}, "getExtendedInstanceMetadataCredentials");
|
|
272
|
-
|
|
273
|
-
// src/utils/staticStabilityProvider.ts
|
|
274
|
-
var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => {
|
|
275
|
-
const logger = options?.logger || console;
|
|
276
|
-
let pastCredentials;
|
|
277
|
-
return async () => {
|
|
278
|
-
let credentials;
|
|
279
|
-
try {
|
|
280
|
-
credentials = await provider();
|
|
281
|
-
if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
|
|
282
|
-
credentials = getExtendedInstanceMetadataCredentials(credentials, logger);
|
|
283
|
-
}
|
|
284
|
-
} catch (e) {
|
|
285
|
-
if (pastCredentials) {
|
|
286
|
-
logger.warn("Credential renew failed: ", e);
|
|
287
|
-
credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);
|
|
288
|
-
} else {
|
|
289
|
-
throw e;
|
|
290
|
-
}
|
|
180
|
+
const getInstanceMetadataEndpoint = async () => urlParser.parseUrl((await getFromEndpointConfig()) || (await getFromEndpointModeConfig()));
|
|
181
|
+
const getFromEndpointConfig = async () => nodeConfigProvider.loadConfig(ENDPOINT_CONFIG_OPTIONS)();
|
|
182
|
+
const getFromEndpointModeConfig = async () => {
|
|
183
|
+
const endpointMode = await nodeConfigProvider.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
|
|
184
|
+
switch (endpointMode) {
|
|
185
|
+
case EndpointMode.IPv4:
|
|
186
|
+
return exports.Endpoint.IPv4;
|
|
187
|
+
case EndpointMode.IPv6:
|
|
188
|
+
return exports.Endpoint.IPv6;
|
|
189
|
+
default:
|
|
190
|
+
throw new Error(`Unsupported endpoint mode: ${endpointMode}.` + ` Select from ${Object.values(EndpointMode)}`);
|
|
291
191
|
}
|
|
292
|
-
|
|
293
|
-
return credentials;
|
|
294
|
-
};
|
|
295
|
-
}, "staticStabilityProvider");
|
|
192
|
+
};
|
|
296
193
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
194
|
+
const STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
|
|
195
|
+
const STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
|
|
196
|
+
const STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
|
|
197
|
+
const getExtendedInstanceMetadataCredentials = (credentials, logger) => {
|
|
198
|
+
const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS +
|
|
199
|
+
Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
|
|
200
|
+
const newExpiration = new Date(Date.now() + refreshInterval * 1000);
|
|
201
|
+
logger.warn("Attempting credential expiration extension due to a credential service availability issue. A refresh of these " +
|
|
202
|
+
`credentials will be attempted after ${new Date(newExpiration)}.\nFor more information, please visit: ` +
|
|
203
|
+
STATIC_STABILITY_DOC_URL);
|
|
204
|
+
const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
|
|
205
|
+
return {
|
|
206
|
+
...credentials,
|
|
207
|
+
...(originalExpiration ? { originalExpiration } : {}),
|
|
208
|
+
expiration: newExpiration,
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const staticStabilityProvider = (provider, options = {}) => {
|
|
213
|
+
const logger = options?.logger || console;
|
|
214
|
+
let pastCredentials;
|
|
215
|
+
return async () => {
|
|
216
|
+
let credentials;
|
|
217
|
+
try {
|
|
218
|
+
credentials = await provider();
|
|
219
|
+
if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
|
|
220
|
+
credentials = getExtendedInstanceMetadataCredentials(credentials, logger);
|
|
323
221
|
}
|
|
324
|
-
return fallbackBlockedFromProcessEnv;
|
|
325
|
-
}, "environmentVariableSelector"),
|
|
326
|
-
configFileSelector: /* @__PURE__ */ __name((profile2) => {
|
|
327
|
-
const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
|
|
328
|
-
fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
|
|
329
|
-
return fallbackBlockedFromProfile;
|
|
330
|
-
}, "configFileSelector"),
|
|
331
|
-
default: false
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
profile
|
|
335
222
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
throw new InstanceMetadataV1FallbackError(
|
|
345
|
-
`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(
|
|
346
|
-
", "
|
|
347
|
-
)}].`
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
const imdsProfile = (await retry(async () => {
|
|
352
|
-
let profile2;
|
|
353
|
-
try {
|
|
354
|
-
profile2 = await getProfile(options);
|
|
355
|
-
} catch (err) {
|
|
356
|
-
if (err.statusCode === 401) {
|
|
357
|
-
disableFetchToken = false;
|
|
223
|
+
catch (e) {
|
|
224
|
+
if (pastCredentials) {
|
|
225
|
+
logger.warn("Credential renew failed: ", e);
|
|
226
|
+
credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
throw e;
|
|
230
|
+
}
|
|
358
231
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
232
|
+
pastCredentials = credentials;
|
|
233
|
+
return credentials;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const IMDS_PATH = "/latest/meta-data/iam/security-credentials/";
|
|
238
|
+
const IMDS_TOKEN_PATH = "/latest/api/token";
|
|
239
|
+
const AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED";
|
|
240
|
+
const PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled";
|
|
241
|
+
const X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
|
|
242
|
+
const fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger });
|
|
243
|
+
const getInstanceMetadataProvider = (init = {}) => {
|
|
244
|
+
let disableFetchToken = false;
|
|
245
|
+
const { logger, profile } = init;
|
|
246
|
+
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
247
|
+
const getCredentials = async (maxRetries, options) => {
|
|
248
|
+
const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
|
|
249
|
+
if (isImdsV1Fallback) {
|
|
250
|
+
let fallbackBlockedFromProfile = false;
|
|
251
|
+
let fallbackBlockedFromProcessEnv = false;
|
|
252
|
+
const configValue = await nodeConfigProvider.loadConfig({
|
|
253
|
+
environmentVariableSelector: (env) => {
|
|
254
|
+
const envValue = env[AWS_EC2_METADATA_V1_DISABLED];
|
|
255
|
+
fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false";
|
|
256
|
+
if (envValue === undefined) {
|
|
257
|
+
throw new propertyProvider.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger });
|
|
258
|
+
}
|
|
259
|
+
return fallbackBlockedFromProcessEnv;
|
|
260
|
+
},
|
|
261
|
+
configFileSelector: (profile) => {
|
|
262
|
+
const profileValue = profile[PROFILE_AWS_EC2_METADATA_V1_DISABLED];
|
|
263
|
+
fallbackBlockedFromProfile = !!profileValue && profileValue !== "false";
|
|
264
|
+
return fallbackBlockedFromProfile;
|
|
265
|
+
},
|
|
266
|
+
default: false,
|
|
267
|
+
}, {
|
|
268
|
+
profile,
|
|
269
|
+
})();
|
|
270
|
+
if (init.ec2MetadataV1Disabled || configValue) {
|
|
271
|
+
const causes = [];
|
|
272
|
+
if (init.ec2MetadataV1Disabled)
|
|
273
|
+
causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");
|
|
274
|
+
if (fallbackBlockedFromProfile)
|
|
275
|
+
causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`);
|
|
276
|
+
if (fallbackBlockedFromProcessEnv)
|
|
277
|
+
causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`);
|
|
278
|
+
throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`);
|
|
279
|
+
}
|
|
370
280
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
281
|
+
const imdsProfile = (await retry(async () => {
|
|
282
|
+
let profile;
|
|
283
|
+
try {
|
|
284
|
+
profile = await getProfile(options);
|
|
285
|
+
}
|
|
286
|
+
catch (err) {
|
|
287
|
+
if (err.statusCode === 401) {
|
|
288
|
+
disableFetchToken = false;
|
|
289
|
+
}
|
|
290
|
+
throw err;
|
|
291
|
+
}
|
|
292
|
+
return profile;
|
|
293
|
+
}, maxRetries)).trim();
|
|
294
|
+
return retry(async () => {
|
|
295
|
+
let creds;
|
|
296
|
+
try {
|
|
297
|
+
creds = await getCredentialsFromProfile(imdsProfile, options, init);
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
if (err.statusCode === 401) {
|
|
301
|
+
disableFetchToken = false;
|
|
302
|
+
}
|
|
303
|
+
throw err;
|
|
304
|
+
}
|
|
305
|
+
return creds;
|
|
306
|
+
}, maxRetries);
|
|
307
|
+
};
|
|
308
|
+
return async () => {
|
|
309
|
+
const endpoint = await getInstanceMetadataEndpoint();
|
|
310
|
+
if (disableFetchToken) {
|
|
311
|
+
logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
|
|
312
|
+
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
392
313
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return fromImdsCredentials(credentialsResponse);
|
|
428
|
-
}, "getCredentialsFromProfile");
|
|
429
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
430
|
-
|
|
431
|
-
0 && (module.exports = {
|
|
432
|
-
httpRequest,
|
|
433
|
-
getInstanceMetadataEndpoint,
|
|
434
|
-
Endpoint,
|
|
435
|
-
ENV_CMDS_FULL_URI,
|
|
436
|
-
ENV_CMDS_RELATIVE_URI,
|
|
437
|
-
ENV_CMDS_AUTH_TOKEN,
|
|
438
|
-
fromContainerMetadata,
|
|
439
|
-
fromInstanceMetadata,
|
|
440
|
-
DEFAULT_TIMEOUT,
|
|
441
|
-
DEFAULT_MAX_RETRIES,
|
|
442
|
-
providerConfigFromInit
|
|
314
|
+
else {
|
|
315
|
+
let token;
|
|
316
|
+
try {
|
|
317
|
+
token = (await getMetadataToken({ ...endpoint, timeout })).toString();
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
if (error?.statusCode === 400) {
|
|
321
|
+
throw Object.assign(error, {
|
|
322
|
+
message: "EC2 Metadata token request returned error",
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
else if (error.message === "TimeoutError" || [403, 404, 405].includes(error.statusCode)) {
|
|
326
|
+
disableFetchToken = true;
|
|
327
|
+
}
|
|
328
|
+
logger?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
|
|
329
|
+
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
330
|
+
}
|
|
331
|
+
return getCredentials(maxRetries, {
|
|
332
|
+
...endpoint,
|
|
333
|
+
headers: {
|
|
334
|
+
[X_AWS_EC2_METADATA_TOKEN]: token,
|
|
335
|
+
},
|
|
336
|
+
timeout,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
const getMetadataToken = async (options) => httpRequest({
|
|
342
|
+
...options,
|
|
343
|
+
path: IMDS_TOKEN_PATH,
|
|
344
|
+
method: "PUT",
|
|
345
|
+
headers: {
|
|
346
|
+
"x-aws-ec2-metadata-token-ttl-seconds": "21600",
|
|
347
|
+
},
|
|
443
348
|
});
|
|
349
|
+
const getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString();
|
|
350
|
+
const getCredentialsFromProfile = async (profile, options, init) => {
|
|
351
|
+
const credentialsResponse = JSON.parse((await httpRequest({
|
|
352
|
+
...options,
|
|
353
|
+
path: IMDS_PATH + profile,
|
|
354
|
+
})).toString());
|
|
355
|
+
if (!isImdsCredentials(credentialsResponse)) {
|
|
356
|
+
throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", {
|
|
357
|
+
logger: init.logger,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
return fromImdsCredentials(credentialsResponse);
|
|
361
|
+
};
|
|
444
362
|
|
|
363
|
+
exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES;
|
|
364
|
+
exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
|
|
365
|
+
exports.ENV_CMDS_AUTH_TOKEN = ENV_CMDS_AUTH_TOKEN;
|
|
366
|
+
exports.ENV_CMDS_FULL_URI = ENV_CMDS_FULL_URI;
|
|
367
|
+
exports.ENV_CMDS_RELATIVE_URI = ENV_CMDS_RELATIVE_URI;
|
|
368
|
+
exports.fromContainerMetadata = fromContainerMetadata;
|
|
369
|
+
exports.fromInstanceMetadata = fromInstanceMetadata;
|
|
370
|
+
exports.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint;
|
|
371
|
+
exports.httpRequest = httpRequest;
|
|
372
|
+
exports.providerConfigFromInit = providerConfigFromInit;
|