@cdk8s/awscdk-resolver 0.0.375 → 0.0.376
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/lib/resolve.js +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/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
|
@@ -1,453 +1,349 @@
|
|
|
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
|
-
DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig,
|
|
24
|
-
EXPIRATION_MS: () => EXPIRATION_MS,
|
|
25
|
-
HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner,
|
|
26
|
-
HttpBearerAuthSigner: () => HttpBearerAuthSigner,
|
|
27
|
-
NoAuthSigner: () => NoAuthSigner,
|
|
28
|
-
createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction,
|
|
29
|
-
createPaginator: () => createPaginator,
|
|
30
|
-
doesIdentityRequireRefresh: () => doesIdentityRequireRefresh,
|
|
31
|
-
getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin,
|
|
32
|
-
getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin,
|
|
33
|
-
getHttpSigningPlugin: () => getHttpSigningPlugin,
|
|
34
|
-
getSmithyContext: () => getSmithyContext,
|
|
35
|
-
httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions,
|
|
36
|
-
httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware,
|
|
37
|
-
httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions,
|
|
38
|
-
httpSigningMiddleware: () => httpSigningMiddleware,
|
|
39
|
-
httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions,
|
|
40
|
-
isIdentityExpired: () => isIdentityExpired,
|
|
41
|
-
memoizeIdentityProvider: () => memoizeIdentityProvider,
|
|
42
|
-
normalizeProvider: () => normalizeProvider,
|
|
43
|
-
requestBuilder: () => import_protocols.requestBuilder,
|
|
44
|
-
setFeature: () => setFeature
|
|
45
|
-
});
|
|
46
|
-
module.exports = __toCommonJS(index_exports);
|
|
1
|
+
'use strict';
|
|
47
2
|
|
|
48
|
-
|
|
49
|
-
var
|
|
50
|
-
var
|
|
3
|
+
var types = require('@smithy/types');
|
|
4
|
+
var utilMiddleware = require('@smithy/util-middleware');
|
|
5
|
+
var middlewareSerde = require('@smithy/middleware-serde');
|
|
6
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
7
|
+
var protocols = require('@smithy/core/protocols');
|
|
51
8
|
|
|
52
|
-
|
|
53
|
-
var import_util_middleware = require("@smithy/util-middleware");
|
|
9
|
+
const getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {});
|
|
54
10
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
11
|
+
const resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
|
|
12
|
+
if (!authSchemePreference || authSchemePreference.length === 0) {
|
|
13
|
+
return candidateAuthOptions;
|
|
14
|
+
}
|
|
15
|
+
const preferredAuthOptions = [];
|
|
16
|
+
for (const preferredSchemeName of authSchemePreference) {
|
|
17
|
+
for (const candidateAuthOption of candidateAuthOptions) {
|
|
18
|
+
const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
|
|
19
|
+
if (candidateAuthSchemeName === preferredSchemeName) {
|
|
20
|
+
preferredAuthOptions.push(candidateAuthOption);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
67
23
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
24
|
+
for (const candidateAuthOption of candidateAuthOptions) {
|
|
25
|
+
if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
|
|
26
|
+
preferredAuthOptions.push(candidateAuthOption);
|
|
27
|
+
}
|
|
72
28
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, "resolveAuthOptions");
|
|
29
|
+
return preferredAuthOptions;
|
|
30
|
+
};
|
|
76
31
|
|
|
77
|
-
// src/middleware-http-auth-scheme/httpAuthSchemeMiddleware.ts
|
|
78
32
|
function convertHttpAuthSchemesToMap(httpAuthSchemes) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
33
|
+
const map = new Map();
|
|
34
|
+
for (const scheme of httpAuthSchemes) {
|
|
35
|
+
map.set(scheme.schemeId, scheme);
|
|
36
|
+
}
|
|
37
|
+
return map;
|
|
84
38
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
39
|
+
const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
|
|
40
|
+
const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
|
|
41
|
+
const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
|
|
42
|
+
const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
|
|
43
|
+
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
44
|
+
const smithyContext = utilMiddleware.getSmithyContext(context);
|
|
45
|
+
const failureReasons = [];
|
|
46
|
+
for (const option of resolvedOptions) {
|
|
47
|
+
const scheme = authSchemes.get(option.schemeId);
|
|
48
|
+
if (!scheme) {
|
|
49
|
+
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
|
|
53
|
+
if (!identityProvider) {
|
|
54
|
+
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
|
|
58
|
+
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
59
|
+
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
60
|
+
smithyContext.selectedHttpAuthScheme = {
|
|
61
|
+
httpAuthOption: option,
|
|
62
|
+
identity: await identityProvider(option.identityProperties),
|
|
63
|
+
signer: scheme.signer,
|
|
64
|
+
};
|
|
65
|
+
break;
|
|
100
66
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
|
|
104
|
-
continue;
|
|
67
|
+
if (!smithyContext.selectedHttpAuthScheme) {
|
|
68
|
+
throw new Error(failureReasons.join("\n"));
|
|
105
69
|
}
|
|
106
|
-
|
|
107
|
-
option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
|
|
108
|
-
option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
|
|
109
|
-
smithyContext.selectedHttpAuthScheme = {
|
|
110
|
-
httpAuthOption: option,
|
|
111
|
-
identity: await identityProvider(option.identityProperties),
|
|
112
|
-
signer: scheme.signer
|
|
113
|
-
};
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
if (!smithyContext.selectedHttpAuthScheme) {
|
|
117
|
-
throw new Error(failureReasons.join("\n"));
|
|
118
|
-
}
|
|
119
|
-
return next(args);
|
|
120
|
-
}, "httpAuthSchemeMiddleware");
|
|
121
|
-
|
|
122
|
-
// src/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.ts
|
|
123
|
-
var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
|
124
|
-
step: "serialize",
|
|
125
|
-
tags: ["HTTP_AUTH_SCHEME"],
|
|
126
|
-
name: "httpAuthSchemeMiddleware",
|
|
127
|
-
override: true,
|
|
128
|
-
relation: "before",
|
|
129
|
-
toMiddleware: "endpointV2Middleware"
|
|
70
|
+
return next(args);
|
|
130
71
|
};
|
|
131
|
-
var getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, {
|
|
132
|
-
httpAuthSchemeParametersProvider,
|
|
133
|
-
identityProviderConfigProvider
|
|
134
|
-
}) => ({
|
|
135
|
-
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
136
|
-
clientStack.addRelativeTo(
|
|
137
|
-
httpAuthSchemeMiddleware(config, {
|
|
138
|
-
httpAuthSchemeParametersProvider,
|
|
139
|
-
identityProviderConfigProvider
|
|
140
|
-
}),
|
|
141
|
-
httpAuthSchemeEndpointRuleSetMiddlewareOptions
|
|
142
|
-
);
|
|
143
|
-
}, "applyToStack")
|
|
144
|
-
}), "getHttpAuthSchemeEndpointRuleSetPlugin");
|
|
145
72
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
relation: "before",
|
|
154
|
-
toMiddleware: import_middleware_serde.serializerMiddlewareOption.name
|
|
73
|
+
const httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
|
|
74
|
+
step: "serialize",
|
|
75
|
+
tags: ["HTTP_AUTH_SCHEME"],
|
|
76
|
+
name: "httpAuthSchemeMiddleware",
|
|
77
|
+
override: true,
|
|
78
|
+
relation: "before",
|
|
79
|
+
toMiddleware: "endpointV2Middleware",
|
|
155
80
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
identityProviderConfigProvider
|
|
165
|
-
}),
|
|
166
|
-
httpAuthSchemeMiddlewareOptions
|
|
167
|
-
);
|
|
168
|
-
}, "applyToStack")
|
|
169
|
-
}), "getHttpAuthSchemePlugin");
|
|
170
|
-
|
|
171
|
-
// src/middleware-http-signing/httpSigningMiddleware.ts
|
|
172
|
-
var import_protocol_http = require("@smithy/protocol-http");
|
|
173
|
-
|
|
174
|
-
var defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error) => {
|
|
175
|
-
throw error;
|
|
176
|
-
}, "defaultErrorHandler");
|
|
177
|
-
var defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => {
|
|
178
|
-
}, "defaultSuccessHandler");
|
|
179
|
-
var httpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context) => async (args) => {
|
|
180
|
-
if (!import_protocol_http.HttpRequest.isInstance(args.request)) {
|
|
181
|
-
return next(args);
|
|
182
|
-
}
|
|
183
|
-
const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
|
|
184
|
-
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
185
|
-
if (!scheme) {
|
|
186
|
-
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
187
|
-
}
|
|
188
|
-
const {
|
|
189
|
-
httpAuthOption: { signingProperties = {} },
|
|
190
|
-
identity,
|
|
191
|
-
signer
|
|
192
|
-
} = scheme;
|
|
193
|
-
const output = await next({
|
|
194
|
-
...args,
|
|
195
|
-
request: await signer.sign(args.request, identity, signingProperties)
|
|
196
|
-
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
197
|
-
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
198
|
-
return output;
|
|
199
|
-
}, "httpSigningMiddleware");
|
|
81
|
+
const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
82
|
+
applyToStack: (clientStack) => {
|
|
83
|
+
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
|
84
|
+
httpAuthSchemeParametersProvider,
|
|
85
|
+
identityProviderConfigProvider,
|
|
86
|
+
}), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
|
|
87
|
+
},
|
|
88
|
+
});
|
|
200
89
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
relation: "after",
|
|
209
|
-
toMiddleware: "retryMiddleware"
|
|
90
|
+
const httpAuthSchemeMiddlewareOptions = {
|
|
91
|
+
step: "serialize",
|
|
92
|
+
tags: ["HTTP_AUTH_SCHEME"],
|
|
93
|
+
name: "httpAuthSchemeMiddleware",
|
|
94
|
+
override: true,
|
|
95
|
+
relation: "before",
|
|
96
|
+
toMiddleware: middlewareSerde.serializerMiddlewareOption.name,
|
|
210
97
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (typeof input === "function") return input;
|
|
220
|
-
const promisified = Promise.resolve(input);
|
|
221
|
-
return () => promisified;
|
|
222
|
-
}, "normalizeProvider");
|
|
98
|
+
const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
|
|
99
|
+
applyToStack: (clientStack) => {
|
|
100
|
+
clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
|
|
101
|
+
httpAuthSchemeParametersProvider,
|
|
102
|
+
identityProviderConfigProvider,
|
|
103
|
+
}), httpAuthSchemeMiddlewareOptions);
|
|
104
|
+
},
|
|
105
|
+
});
|
|
223
106
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return /* @__PURE__ */ __name(async function* paginateOperation(config, input, ...additionalArguments) {
|
|
232
|
-
const _input = input;
|
|
233
|
-
let token = config.startingToken ?? _input[inputTokenName];
|
|
234
|
-
let hasNext = true;
|
|
235
|
-
let page;
|
|
236
|
-
while (hasNext) {
|
|
237
|
-
_input[inputTokenName] = token;
|
|
238
|
-
if (pageSizeTokenName) {
|
|
239
|
-
_input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
|
|
240
|
-
}
|
|
241
|
-
if (config.client instanceof ClientCtor) {
|
|
242
|
-
page = await makePagedClientRequest(
|
|
243
|
-
CommandCtor,
|
|
244
|
-
config.client,
|
|
245
|
-
input,
|
|
246
|
-
config.withCommand,
|
|
247
|
-
...additionalArguments
|
|
248
|
-
);
|
|
249
|
-
} else {
|
|
250
|
-
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
|
|
251
|
-
}
|
|
252
|
-
yield page;
|
|
253
|
-
const prevToken = token;
|
|
254
|
-
token = get(page, outputTokenName);
|
|
255
|
-
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
107
|
+
const defaultErrorHandler = (signingProperties) => (error) => {
|
|
108
|
+
throw error;
|
|
109
|
+
};
|
|
110
|
+
const defaultSuccessHandler = (httpResponse, signingProperties) => { };
|
|
111
|
+
const httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
112
|
+
if (!protocolHttp.HttpRequest.isInstance(args.request)) {
|
|
113
|
+
return next(args);
|
|
256
114
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
var get = /* @__PURE__ */ __name((fromObject, path) => {
|
|
262
|
-
let cursor = fromObject;
|
|
263
|
-
const pathComponents = path.split(".");
|
|
264
|
-
for (const step of pathComponents) {
|
|
265
|
-
if (!cursor || typeof cursor !== "object") {
|
|
266
|
-
return void 0;
|
|
115
|
+
const smithyContext = utilMiddleware.getSmithyContext(context);
|
|
116
|
+
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
117
|
+
if (!scheme) {
|
|
118
|
+
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
267
119
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
120
|
+
const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
|
|
121
|
+
const output = await next({
|
|
122
|
+
...args,
|
|
123
|
+
request: await signer.sign(args.request, identity, signingProperties),
|
|
124
|
+
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
125
|
+
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
126
|
+
return output;
|
|
127
|
+
};
|
|
272
128
|
|
|
273
|
-
|
|
274
|
-
|
|
129
|
+
const httpSigningMiddlewareOptions = {
|
|
130
|
+
step: "finalizeRequest",
|
|
131
|
+
tags: ["HTTP_SIGNING"],
|
|
132
|
+
name: "httpSigningMiddleware",
|
|
133
|
+
aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
|
|
134
|
+
override: true,
|
|
135
|
+
relation: "after",
|
|
136
|
+
toMiddleware: "retryMiddleware",
|
|
137
|
+
};
|
|
138
|
+
const getHttpSigningPlugin = (config) => ({
|
|
139
|
+
applyToStack: (clientStack) => {
|
|
140
|
+
clientStack.addRelativeTo(httpSigningMiddleware(), httpSigningMiddlewareOptions);
|
|
141
|
+
},
|
|
142
|
+
});
|
|
275
143
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
144
|
+
const normalizeProvider = (input) => {
|
|
145
|
+
if (typeof input === "function")
|
|
146
|
+
return input;
|
|
147
|
+
const promisified = Promise.resolve(input);
|
|
148
|
+
return () => promisified;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => {
|
|
152
|
+
let command = new CommandCtor(input);
|
|
153
|
+
command = withCommand(command) ?? command;
|
|
154
|
+
return await client.send(command, ...args);
|
|
155
|
+
};
|
|
156
|
+
function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) {
|
|
157
|
+
return async function* paginateOperation(config, input, ...additionalArguments) {
|
|
158
|
+
const _input = input;
|
|
159
|
+
let token = config.startingToken ?? _input[inputTokenName];
|
|
160
|
+
let hasNext = true;
|
|
161
|
+
let page;
|
|
162
|
+
while (hasNext) {
|
|
163
|
+
_input[inputTokenName] = token;
|
|
164
|
+
if (pageSizeTokenName) {
|
|
165
|
+
_input[pageSizeTokenName] = _input[pageSizeTokenName] ?? config.pageSize;
|
|
166
|
+
}
|
|
167
|
+
if (config.client instanceof ClientCtor) {
|
|
168
|
+
page = await makePagedClientRequest(CommandCtor, config.client, input, config.withCommand, ...additionalArguments);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`);
|
|
172
|
+
}
|
|
173
|
+
yield page;
|
|
174
|
+
const prevToken = token;
|
|
175
|
+
token = get(page, outputTokenName);
|
|
176
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
177
|
+
}
|
|
178
|
+
return undefined;
|
|
281
179
|
};
|
|
282
|
-
} else if (!context.__smithy_context.features) {
|
|
283
|
-
context.__smithy_context.features = {};
|
|
284
|
-
}
|
|
285
|
-
context.__smithy_context.features[feature] = value;
|
|
286
180
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
*/
|
|
296
|
-
constructor(config) {
|
|
297
|
-
this.authSchemes = /* @__PURE__ */ new Map();
|
|
298
|
-
for (const [key, value] of Object.entries(config)) {
|
|
299
|
-
if (value !== void 0) {
|
|
300
|
-
this.authSchemes.set(key, value);
|
|
301
|
-
}
|
|
181
|
+
const get = (fromObject, path) => {
|
|
182
|
+
let cursor = fromObject;
|
|
183
|
+
const pathComponents = path.split(".");
|
|
184
|
+
for (const step of pathComponents) {
|
|
185
|
+
if (!cursor || typeof cursor !== "object") {
|
|
186
|
+
return undefined;
|
|
187
|
+
}
|
|
188
|
+
cursor = cursor[step];
|
|
302
189
|
}
|
|
303
|
-
|
|
304
|
-
static {
|
|
305
|
-
__name(this, "DefaultIdentityProviderConfig");
|
|
306
|
-
}
|
|
307
|
-
getIdentityProvider(schemeId) {
|
|
308
|
-
return this.authSchemes.get(schemeId);
|
|
309
|
-
}
|
|
190
|
+
return cursor;
|
|
310
191
|
};
|
|
311
192
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
__name(this, "HttpApiKeyAuthSigner");
|
|
318
|
-
}
|
|
319
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
320
|
-
if (!signingProperties) {
|
|
321
|
-
throw new Error(
|
|
322
|
-
"request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"
|
|
323
|
-
);
|
|
193
|
+
function setFeature(context, feature, value) {
|
|
194
|
+
if (!context.__smithy_context) {
|
|
195
|
+
context.__smithy_context = {
|
|
196
|
+
features: {},
|
|
197
|
+
};
|
|
324
198
|
}
|
|
325
|
-
if (!
|
|
326
|
-
|
|
199
|
+
else if (!context.__smithy_context.features) {
|
|
200
|
+
context.__smithy_context.features = {};
|
|
327
201
|
}
|
|
328
|
-
|
|
329
|
-
|
|
202
|
+
context.__smithy_context.features[feature] = value;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
class DefaultIdentityProviderConfig {
|
|
206
|
+
authSchemes = new Map();
|
|
207
|
+
constructor(config) {
|
|
208
|
+
for (const [key, value] of Object.entries(config)) {
|
|
209
|
+
if (value !== undefined) {
|
|
210
|
+
this.authSchemes.set(key, value);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
330
213
|
}
|
|
331
|
-
|
|
332
|
-
|
|
214
|
+
getIdentityProvider(schemeId) {
|
|
215
|
+
return this.authSchemes.get(schemeId);
|
|
333
216
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
class HttpApiKeyAuthSigner {
|
|
220
|
+
async sign(httpRequest, identity, signingProperties) {
|
|
221
|
+
if (!signingProperties) {
|
|
222
|
+
throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");
|
|
223
|
+
}
|
|
224
|
+
if (!signingProperties.name) {
|
|
225
|
+
throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
|
|
226
|
+
}
|
|
227
|
+
if (!signingProperties.in) {
|
|
228
|
+
throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
|
|
229
|
+
}
|
|
230
|
+
if (!identity.apiKey) {
|
|
231
|
+
throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
|
|
232
|
+
}
|
|
233
|
+
const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest);
|
|
234
|
+
if (signingProperties.in === types.HttpApiKeyAuthLocation.QUERY) {
|
|
235
|
+
clonedRequest.query[signingProperties.name] = identity.apiKey;
|
|
236
|
+
}
|
|
237
|
+
else if (signingProperties.in === types.HttpApiKeyAuthLocation.HEADER) {
|
|
238
|
+
clonedRequest.headers[signingProperties.name] = signingProperties.scheme
|
|
239
|
+
? `${signingProperties.scheme} ${identity.apiKey}`
|
|
240
|
+
: identity.apiKey;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " +
|
|
244
|
+
"but found: `" +
|
|
245
|
+
signingProperties.in +
|
|
246
|
+
"`");
|
|
247
|
+
}
|
|
248
|
+
return clonedRequest;
|
|
343
249
|
}
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
};
|
|
250
|
+
}
|
|
347
251
|
|
|
348
|
-
|
|
252
|
+
class HttpBearerAuthSigner {
|
|
253
|
+
async sign(httpRequest, identity, signingProperties) {
|
|
254
|
+
const clonedRequest = protocolHttp.HttpRequest.clone(httpRequest);
|
|
255
|
+
if (!identity.token) {
|
|
256
|
+
throw new Error("request could not be signed with `token` since the `token` is not defined");
|
|
257
|
+
}
|
|
258
|
+
clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
|
|
259
|
+
return clonedRequest;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
349
262
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
355
|
-
const clonedRequest = import_protocol_http.HttpRequest.clone(httpRequest);
|
|
356
|
-
if (!identity.token) {
|
|
357
|
-
throw new Error("request could not be signed with `token` since the `token` is not defined");
|
|
263
|
+
class NoAuthSigner {
|
|
264
|
+
async sign(httpRequest, identity, signingProperties) {
|
|
265
|
+
return httpRequest;
|
|
358
266
|
}
|
|
359
|
-
|
|
360
|
-
return clonedRequest;
|
|
361
|
-
}
|
|
362
|
-
};
|
|
267
|
+
}
|
|
363
268
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
static {
|
|
367
|
-
__name(this, "NoAuthSigner");
|
|
368
|
-
}
|
|
369
|
-
async sign(httpRequest, identity, signingProperties) {
|
|
370
|
-
return httpRequest;
|
|
371
|
-
}
|
|
269
|
+
const createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired(identity) {
|
|
270
|
+
return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
|
|
372
271
|
};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
var memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
|
|
380
|
-
if (provider === void 0) {
|
|
381
|
-
return void 0;
|
|
382
|
-
}
|
|
383
|
-
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
|
|
384
|
-
let resolved;
|
|
385
|
-
let pending;
|
|
386
|
-
let hasResult;
|
|
387
|
-
let isConstant = false;
|
|
388
|
-
const coalesceProvider = /* @__PURE__ */ __name(async (options) => {
|
|
389
|
-
if (!pending) {
|
|
390
|
-
pending = normalizedProvider(options);
|
|
272
|
+
const EXPIRATION_MS = 300_000;
|
|
273
|
+
const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
|
|
274
|
+
const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
|
|
275
|
+
const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
276
|
+
if (provider === undefined) {
|
|
277
|
+
return undefined;
|
|
391
278
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
279
|
+
const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
|
|
280
|
+
let resolved;
|
|
281
|
+
let pending;
|
|
282
|
+
let hasResult;
|
|
283
|
+
let isConstant = false;
|
|
284
|
+
const coalesceProvider = async (options) => {
|
|
285
|
+
if (!pending) {
|
|
286
|
+
pending = normalizedProvider(options);
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
resolved = await pending;
|
|
290
|
+
hasResult = true;
|
|
291
|
+
isConstant = false;
|
|
292
|
+
}
|
|
293
|
+
finally {
|
|
294
|
+
pending = undefined;
|
|
295
|
+
}
|
|
296
|
+
return resolved;
|
|
297
|
+
};
|
|
298
|
+
if (isExpired === undefined) {
|
|
299
|
+
return async (options) => {
|
|
300
|
+
if (!hasResult || options?.forceRefresh) {
|
|
301
|
+
resolved = await coalesceProvider(options);
|
|
302
|
+
}
|
|
303
|
+
return resolved;
|
|
304
|
+
};
|
|
398
305
|
}
|
|
399
|
-
return resolved;
|
|
400
|
-
}, "coalesceProvider");
|
|
401
|
-
if (isExpired === void 0) {
|
|
402
306
|
return async (options) => {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
307
|
+
if (!hasResult || options?.forceRefresh) {
|
|
308
|
+
resolved = await coalesceProvider(options);
|
|
309
|
+
}
|
|
310
|
+
if (isConstant) {
|
|
311
|
+
return resolved;
|
|
312
|
+
}
|
|
313
|
+
if (!requiresRefresh(resolved)) {
|
|
314
|
+
isConstant = true;
|
|
315
|
+
return resolved;
|
|
316
|
+
}
|
|
317
|
+
if (isExpired(resolved)) {
|
|
318
|
+
await coalesceProvider(options);
|
|
319
|
+
return resolved;
|
|
320
|
+
}
|
|
321
|
+
return resolved;
|
|
407
322
|
};
|
|
408
|
-
|
|
409
|
-
return async (options) => {
|
|
410
|
-
if (!hasResult || options?.forceRefresh) {
|
|
411
|
-
resolved = await coalesceProvider(options);
|
|
412
|
-
}
|
|
413
|
-
if (isConstant) {
|
|
414
|
-
return resolved;
|
|
415
|
-
}
|
|
416
|
-
if (!requiresRefresh(resolved)) {
|
|
417
|
-
isConstant = true;
|
|
418
|
-
return resolved;
|
|
419
|
-
}
|
|
420
|
-
if (isExpired(resolved)) {
|
|
421
|
-
await coalesceProvider(options);
|
|
422
|
-
return resolved;
|
|
423
|
-
}
|
|
424
|
-
return resolved;
|
|
425
|
-
};
|
|
426
|
-
}, "memoizeIdentityProvider");
|
|
427
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
323
|
+
};
|
|
428
324
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
httpAuthSchemeMiddleware,
|
|
433
|
-
httpAuthSchemeEndpointRuleSetMiddlewareOptions,
|
|
434
|
-
getHttpAuthSchemeEndpointRuleSetPlugin,
|
|
435
|
-
httpAuthSchemeMiddlewareOptions,
|
|
436
|
-
getHttpAuthSchemePlugin,
|
|
437
|
-
httpSigningMiddleware,
|
|
438
|
-
httpSigningMiddlewareOptions,
|
|
439
|
-
getHttpSigningPlugin,
|
|
440
|
-
normalizeProvider,
|
|
441
|
-
requestBuilder,
|
|
442
|
-
setFeature,
|
|
443
|
-
DefaultIdentityProviderConfig,
|
|
444
|
-
HttpApiKeyAuthSigner,
|
|
445
|
-
HttpBearerAuthSigner,
|
|
446
|
-
NoAuthSigner,
|
|
447
|
-
createIsIdentityExpiredFunction,
|
|
448
|
-
EXPIRATION_MS,
|
|
449
|
-
isIdentityExpired,
|
|
450
|
-
doesIdentityRequireRefresh,
|
|
451
|
-
memoizeIdentityProvider
|
|
325
|
+
Object.defineProperty(exports, "requestBuilder", {
|
|
326
|
+
enumerable: true,
|
|
327
|
+
get: function () { return protocols.requestBuilder; }
|
|
452
328
|
});
|
|
453
|
-
|
|
329
|
+
exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;
|
|
330
|
+
exports.EXPIRATION_MS = EXPIRATION_MS;
|
|
331
|
+
exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;
|
|
332
|
+
exports.HttpBearerAuthSigner = HttpBearerAuthSigner;
|
|
333
|
+
exports.NoAuthSigner = NoAuthSigner;
|
|
334
|
+
exports.createIsIdentityExpiredFunction = createIsIdentityExpiredFunction;
|
|
335
|
+
exports.createPaginator = createPaginator;
|
|
336
|
+
exports.doesIdentityRequireRefresh = doesIdentityRequireRefresh;
|
|
337
|
+
exports.getHttpAuthSchemeEndpointRuleSetPlugin = getHttpAuthSchemeEndpointRuleSetPlugin;
|
|
338
|
+
exports.getHttpAuthSchemePlugin = getHttpAuthSchemePlugin;
|
|
339
|
+
exports.getHttpSigningPlugin = getHttpSigningPlugin;
|
|
340
|
+
exports.getSmithyContext = getSmithyContext;
|
|
341
|
+
exports.httpAuthSchemeEndpointRuleSetMiddlewareOptions = httpAuthSchemeEndpointRuleSetMiddlewareOptions;
|
|
342
|
+
exports.httpAuthSchemeMiddleware = httpAuthSchemeMiddleware;
|
|
343
|
+
exports.httpAuthSchemeMiddlewareOptions = httpAuthSchemeMiddlewareOptions;
|
|
344
|
+
exports.httpSigningMiddleware = httpSigningMiddleware;
|
|
345
|
+
exports.httpSigningMiddlewareOptions = httpSigningMiddlewareOptions;
|
|
346
|
+
exports.isIdentityExpired = isIdentityExpired;
|
|
347
|
+
exports.memoizeIdentityProvider = memoizeIdentityProvider;
|
|
348
|
+
exports.normalizeProvider = normalizeProvider;
|
|
349
|
+
exports.setFeature = setFeature;
|