@aws-sdk/client-s3 3.622.0 → 3.624.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/auth/httpAuthSchemeProvider.js +126 -0
- package/dist-cjs/index.js +67 -13
- package/dist-cjs/runtimeConfig.shared.js +15 -0
- package/dist-es/S3Client.js +15 -6
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +122 -0
- package/dist-es/runtimeConfig.shared.js +15 -0
- package/dist-es/runtimeExtensions.js +3 -0
- package/dist-types/S3Client.d.ts +15 -14
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +69 -0
- package/dist-types/extensionConfiguration.d.ts +2 -1
- package/dist-types/runtimeConfig.browser.d.ts +6 -4
- package/dist-types/runtimeConfig.d.ts +4 -2
- package/dist-types/runtimeConfig.native.d.ts +6 -4
- package/dist-types/runtimeConfig.shared.d.ts +2 -0
- package/dist-types/ts3.4/S3Client.d.ts +13 -15
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +46 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +6 -6
- package/dist-types/ts3.4/runtimeConfig.d.ts +4 -4
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +6 -6
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
- package/package.json +9 -9
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveHttpAuthSchemeConfig = exports.defaultS3HttpAuthSchemeProvider = exports.defaultS3HttpAuthSchemeParametersProvider = void 0;
|
|
4
|
+
const core_1 = require("@aws-sdk/core");
|
|
5
|
+
const signature_v4_multi_region_1 = require("@aws-sdk/signature-v4-multi-region");
|
|
6
|
+
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
7
|
+
const util_middleware_1 = require("@smithy/util-middleware");
|
|
8
|
+
const endpointResolver_1 = require("../endpoint/endpointResolver");
|
|
9
|
+
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
10
|
+
if (!input) {
|
|
11
|
+
throw new Error(`Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\``);
|
|
12
|
+
}
|
|
13
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
14
|
+
const instructionsFn = (0, util_middleware_1.getSmithyContext)(context)?.commandInstance?.constructor
|
|
15
|
+
?.getEndpointParameterInstructions;
|
|
16
|
+
if (!instructionsFn) {
|
|
17
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on \`${context.commandName}\``);
|
|
18
|
+
}
|
|
19
|
+
const endpointParameters = await (0, middleware_endpoint_1.resolveParams)(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
20
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
21
|
+
};
|
|
22
|
+
const _defaultS3HttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
23
|
+
return {
|
|
24
|
+
operation: (0, util_middleware_1.getSmithyContext)(context).operation,
|
|
25
|
+
region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
|
|
26
|
+
(() => {
|
|
27
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
28
|
+
})(),
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultS3HttpAuthSchemeParametersProvider);
|
|
32
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
33
|
+
return {
|
|
34
|
+
schemeId: "aws.auth#sigv4",
|
|
35
|
+
signingProperties: {
|
|
36
|
+
name: "s3",
|
|
37
|
+
region: authParameters.region,
|
|
38
|
+
},
|
|
39
|
+
propertiesExtractor: (config, context) => ({
|
|
40
|
+
signingProperties: {
|
|
41
|
+
config,
|
|
42
|
+
context,
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
48
|
+
return {
|
|
49
|
+
schemeId: "aws.auth#sigv4a",
|
|
50
|
+
signingProperties: {
|
|
51
|
+
name: "s3",
|
|
52
|
+
region: authParameters.region,
|
|
53
|
+
},
|
|
54
|
+
propertiesExtractor: (config, context) => ({
|
|
55
|
+
signingProperties: {
|
|
56
|
+
config,
|
|
57
|
+
context,
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
63
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
64
|
+
const endpoint = defaultEndpointResolver(authParameters);
|
|
65
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
66
|
+
if (!authSchemes) {
|
|
67
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
68
|
+
}
|
|
69
|
+
const options = [];
|
|
70
|
+
for (const scheme of authSchemes) {
|
|
71
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
72
|
+
const name = resolvedName.toLowerCase();
|
|
73
|
+
if (resolvedName !== name) {
|
|
74
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${resolvedName}\` to \`${name}\``);
|
|
75
|
+
}
|
|
76
|
+
let schemeId;
|
|
77
|
+
if (name === "sigv4a") {
|
|
78
|
+
schemeId = "aws.auth#sigv4a";
|
|
79
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
80
|
+
const name = s.name.toLowerCase();
|
|
81
|
+
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
82
|
+
});
|
|
83
|
+
if (!signature_v4_multi_region_1.signatureV4CrtContainer.CrtSignerV4 && sigv4Present) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else if (name.startsWith("sigv4")) {
|
|
88
|
+
schemeId = "aws.auth#sigv4";
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${name}\``);
|
|
92
|
+
}
|
|
93
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
94
|
+
if (!createOption) {
|
|
95
|
+
throw new Error(`Could not find HttpAuthOption create function for \`${schemeId}\``);
|
|
96
|
+
}
|
|
97
|
+
const option = createOption(authParameters);
|
|
98
|
+
option.schemeId = schemeId;
|
|
99
|
+
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
100
|
+
options.push(option);
|
|
101
|
+
}
|
|
102
|
+
return options;
|
|
103
|
+
};
|
|
104
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
105
|
+
};
|
|
106
|
+
const _defaultS3HttpAuthSchemeProvider = (authParameters) => {
|
|
107
|
+
const options = [];
|
|
108
|
+
switch (authParameters.operation) {
|
|
109
|
+
default: {
|
|
110
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
111
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return options;
|
|
115
|
+
};
|
|
116
|
+
exports.defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(endpointResolver_1.defaultEndpointResolver, _defaultS3HttpAuthSchemeProvider, {
|
|
117
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
118
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
119
|
+
});
|
|
120
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
121
|
+
const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
|
|
122
|
+
return {
|
|
123
|
+
...config_0,
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
|
package/dist-cjs/index.js
CHANGED
|
@@ -261,14 +261,15 @@ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
|
|
|
261
261
|
var import_middleware_logger = require("@aws-sdk/middleware-logger");
|
|
262
262
|
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
|
|
263
263
|
var import_middleware_sdk_s32 = require("@aws-sdk/middleware-sdk-s3");
|
|
264
|
-
var import_middleware_signing = require("@aws-sdk/middleware-signing");
|
|
265
264
|
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
|
|
266
265
|
var import_config_resolver = require("@smithy/config-resolver");
|
|
266
|
+
var import_core3 = require("@smithy/core");
|
|
267
267
|
var import_eventstream_serde_config_resolver = require("@smithy/eventstream-serde-config-resolver");
|
|
268
268
|
var import_middleware_content_length = require("@smithy/middleware-content-length");
|
|
269
269
|
|
|
270
270
|
var import_middleware_retry = require("@smithy/middleware-retry");
|
|
271
271
|
|
|
272
|
+
var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
|
|
272
273
|
|
|
273
274
|
// src/commands/CreateSessionCommand.ts
|
|
274
275
|
var import_middleware_sdk_s3 = require("@aws-sdk/middleware-sdk-s3");
|
|
@@ -8404,19 +8405,62 @@ var import_runtimeConfig = require("././runtimeConfig");
|
|
|
8404
8405
|
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
|
|
8405
8406
|
|
|
8406
8407
|
|
|
8408
|
+
|
|
8409
|
+
// src/auth/httpAuthExtensionConfiguration.ts
|
|
8410
|
+
var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
|
|
8411
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
8412
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
8413
|
+
let _credentials = runtimeConfig.credentials;
|
|
8414
|
+
return {
|
|
8415
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
8416
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
8417
|
+
if (index === -1) {
|
|
8418
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
8419
|
+
} else {
|
|
8420
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
8421
|
+
}
|
|
8422
|
+
},
|
|
8423
|
+
httpAuthSchemes() {
|
|
8424
|
+
return _httpAuthSchemes;
|
|
8425
|
+
},
|
|
8426
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
8427
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
8428
|
+
},
|
|
8429
|
+
httpAuthSchemeProvider() {
|
|
8430
|
+
return _httpAuthSchemeProvider;
|
|
8431
|
+
},
|
|
8432
|
+
setCredentials(credentials) {
|
|
8433
|
+
_credentials = credentials;
|
|
8434
|
+
},
|
|
8435
|
+
credentials() {
|
|
8436
|
+
return _credentials;
|
|
8437
|
+
}
|
|
8438
|
+
};
|
|
8439
|
+
}, "getHttpAuthExtensionConfiguration");
|
|
8440
|
+
var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
|
|
8441
|
+
return {
|
|
8442
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
8443
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
8444
|
+
credentials: config.credentials()
|
|
8445
|
+
};
|
|
8446
|
+
}, "resolveHttpAuthRuntimeConfig");
|
|
8447
|
+
|
|
8448
|
+
// src/runtimeExtensions.ts
|
|
8407
8449
|
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
|
|
8408
8450
|
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
|
|
8409
8451
|
const extensionConfiguration = {
|
|
8410
8452
|
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
|
|
8411
8453
|
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
8412
|
-
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
|
|
8454
|
+
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
|
|
8455
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
|
|
8413
8456
|
};
|
|
8414
8457
|
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
8415
8458
|
return {
|
|
8416
8459
|
...runtimeConfig,
|
|
8417
8460
|
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
8418
8461
|
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
8419
|
-
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
|
|
8462
|
+
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
8463
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration)
|
|
8420
8464
|
};
|
|
8421
8465
|
}, "resolveRuntimeExtensions");
|
|
8422
8466
|
|
|
@@ -8430,9 +8474,9 @@ var _S3Client = class _S3Client extends import_smithy_client.Client {
|
|
|
8430
8474
|
const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
|
|
8431
8475
|
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
|
|
8432
8476
|
const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
|
|
8433
|
-
const _config_7 = (0,
|
|
8434
|
-
const _config_8 = (0,
|
|
8435
|
-
const _config_9 = (0,
|
|
8477
|
+
const _config_7 = (0, import_eventstream_serde_config_resolver.resolveEventStreamSerdeConfig)(_config_6);
|
|
8478
|
+
const _config_8 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_7);
|
|
8479
|
+
const _config_9 = (0, import_middleware_sdk_s32.resolveS3Config)(_config_8, { session: [() => this, CreateSessionCommand] });
|
|
8436
8480
|
const _config_10 = resolveRuntimeExtensions(_config_9, (configuration == null ? void 0 : configuration.extensions) || []);
|
|
8437
8481
|
super(_config_10);
|
|
8438
8482
|
this.config = _config_10;
|
|
@@ -8442,11 +8486,21 @@ var _S3Client = class _S3Client extends import_smithy_client.Client {
|
|
|
8442
8486
|
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
|
|
8443
8487
|
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
|
|
8444
8488
|
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
|
|
8445
|
-
this.middlewareStack.use(
|
|
8489
|
+
this.middlewareStack.use(
|
|
8490
|
+
(0, import_core3.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
|
|
8491
|
+
httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultS3HttpAuthSchemeParametersProvider,
|
|
8492
|
+
identityProviderConfigProvider: async (config) => new import_core3.DefaultIdentityProviderConfig({
|
|
8493
|
+
"aws.auth#sigv4": config.credentials,
|
|
8494
|
+
"aws.auth#sigv4a": config.credentials
|
|
8495
|
+
})
|
|
8496
|
+
})
|
|
8497
|
+
);
|
|
8498
|
+
this.middlewareStack.use((0, import_core3.getHttpSigningPlugin)(this.config));
|
|
8446
8499
|
this.middlewareStack.use((0, import_middleware_sdk_s32.getValidateBucketNamePlugin)(this.config));
|
|
8447
8500
|
this.middlewareStack.use((0, import_middleware_expect_continue.getAddExpectContinuePlugin)(this.config));
|
|
8448
8501
|
this.middlewareStack.use((0, import_middleware_sdk_s32.getRegionRedirectMiddlewarePlugin)(this.config));
|
|
8449
8502
|
this.middlewareStack.use((0, import_middleware_sdk_s32.getS3ExpressPlugin)(this.config));
|
|
8503
|
+
this.middlewareStack.use((0, import_middleware_sdk_s32.getS3ExpressHttpSigningPlugin)(this.config));
|
|
8450
8504
|
}
|
|
8451
8505
|
/**
|
|
8452
8506
|
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
@@ -10538,16 +10592,16 @@ var S3 = _S3;
|
|
|
10538
10592
|
(0, import_smithy_client.createAggregatedClient)(commands, S3);
|
|
10539
10593
|
|
|
10540
10594
|
// src/pagination/ListDirectoryBucketsPaginator.ts
|
|
10541
|
-
var
|
|
10542
|
-
var paginateListDirectoryBuckets = (0,
|
|
10595
|
+
var import_core4 = require("@smithy/core");
|
|
10596
|
+
var paginateListDirectoryBuckets = (0, import_core4.createPaginator)(S3Client, ListDirectoryBucketsCommand, "ContinuationToken", "ContinuationToken", "MaxDirectoryBuckets");
|
|
10543
10597
|
|
|
10544
10598
|
// src/pagination/ListObjectsV2Paginator.ts
|
|
10545
|
-
var
|
|
10546
|
-
var paginateListObjectsV2 = (0,
|
|
10599
|
+
var import_core5 = require("@smithy/core");
|
|
10600
|
+
var paginateListObjectsV2 = (0, import_core5.createPaginator)(S3Client, ListObjectsV2Command, "ContinuationToken", "NextContinuationToken", "MaxKeys");
|
|
10547
10601
|
|
|
10548
10602
|
// src/pagination/ListPartsPaginator.ts
|
|
10549
|
-
var
|
|
10550
|
-
var paginateListParts = (0,
|
|
10603
|
+
var import_core6 = require("@smithy/core");
|
|
10604
|
+
var paginateListParts = (0, import_core6.createPaginator)(S3Client, ListPartsCommand, "PartNumberMarker", "NextPartNumberMarker", "MaxParts");
|
|
10551
10605
|
|
|
10552
10606
|
// src/waiters/waitForBucketExists.ts
|
|
10553
10607
|
var import_util_waiter = require("@smithy/util-waiter");
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const core_1 = require("@aws-sdk/core");
|
|
4
5
|
const signature_v4_multi_region_1 = require("@aws-sdk/signature-v4-multi-region");
|
|
5
6
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
7
|
const url_parser_1 = require("@smithy/url-parser");
|
|
7
8
|
const util_base64_1 = require("@smithy/util-base64");
|
|
8
9
|
const util_stream_1 = require("@smithy/util-stream");
|
|
9
10
|
const util_utf8_1 = require("@smithy/util-utf8");
|
|
11
|
+
const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
|
|
10
12
|
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
11
13
|
const getRuntimeConfig = (config) => {
|
|
12
14
|
return {
|
|
@@ -17,6 +19,19 @@ const getRuntimeConfig = (config) => {
|
|
|
17
19
|
endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
|
|
18
20
|
extensions: config?.extensions ?? [],
|
|
19
21
|
getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? util_stream_1.getAwsChunkedEncodingStream,
|
|
22
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultS3HttpAuthSchemeProvider,
|
|
23
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
24
|
+
{
|
|
25
|
+
schemeId: "aws.auth#sigv4",
|
|
26
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
27
|
+
signer: new core_1.AwsSdkSigV4Signer(),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
schemeId: "aws.auth#sigv4a",
|
|
31
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
32
|
+
signer: new core_1.AwsSdkSigV4ASigner(),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
20
35
|
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
21
36
|
sdkStreamMixin: config?.sdkStreamMixin ?? util_stream_1.sdkStreamMixin,
|
|
22
37
|
serviceId: config?.serviceId ?? "S3",
|
package/dist-es/S3Client.js
CHANGED
|
@@ -2,15 +2,16 @@ import { getAddExpectContinuePlugin } from "@aws-sdk/middleware-expect-continue"
|
|
|
2
2
|
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
3
3
|
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
4
4
|
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
5
|
-
import { getRegionRedirectMiddlewarePlugin, getS3ExpressPlugin, getValidateBucketNamePlugin, resolveS3Config, } from "@aws-sdk/middleware-sdk-s3";
|
|
6
|
-
import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
|
|
5
|
+
import { getRegionRedirectMiddlewarePlugin, getS3ExpressHttpSigningPlugin, getS3ExpressPlugin, getValidateBucketNamePlugin, resolveS3Config, } from "@aws-sdk/middleware-sdk-s3";
|
|
7
6
|
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
8
7
|
import { resolveRegionConfig } from "@smithy/config-resolver";
|
|
8
|
+
import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
|
|
9
9
|
import { resolveEventStreamSerdeConfig, } from "@smithy/eventstream-serde-config-resolver";
|
|
10
10
|
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
11
11
|
import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
|
|
12
12
|
import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
|
|
13
13
|
import { Client as __Client, } from "@smithy/smithy-client";
|
|
14
|
+
import { defaultS3HttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
|
|
14
15
|
import { CreateSessionCommand, } from "./commands/CreateSessionCommand";
|
|
15
16
|
import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
|
|
16
17
|
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
@@ -25,9 +26,9 @@ export class S3Client extends __Client {
|
|
|
25
26
|
const _config_4 = resolveRegionConfig(_config_3);
|
|
26
27
|
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
27
28
|
const _config_6 = resolveEndpointConfig(_config_5);
|
|
28
|
-
const _config_7 =
|
|
29
|
-
const _config_8 =
|
|
30
|
-
const _config_9 =
|
|
29
|
+
const _config_7 = resolveEventStreamSerdeConfig(_config_6);
|
|
30
|
+
const _config_8 = resolveHttpAuthSchemeConfig(_config_7);
|
|
31
|
+
const _config_9 = resolveS3Config(_config_8, { session: [() => this, CreateSessionCommand] });
|
|
31
32
|
const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []);
|
|
32
33
|
super(_config_10);
|
|
33
34
|
this.config = _config_10;
|
|
@@ -37,11 +38,19 @@ export class S3Client extends __Client {
|
|
|
37
38
|
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
38
39
|
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
39
40
|
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
40
|
-
this.middlewareStack.use(
|
|
41
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
42
|
+
httpAuthSchemeParametersProvider: defaultS3HttpAuthSchemeParametersProvider,
|
|
43
|
+
identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
|
|
44
|
+
"aws.auth#sigv4": config.credentials,
|
|
45
|
+
"aws.auth#sigv4a": config.credentials,
|
|
46
|
+
}),
|
|
47
|
+
}));
|
|
48
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
41
49
|
this.middlewareStack.use(getValidateBucketNamePlugin(this.config));
|
|
42
50
|
this.middlewareStack.use(getAddExpectContinuePlugin(this.config));
|
|
43
51
|
this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config));
|
|
44
52
|
this.middlewareStack.use(getS3ExpressPlugin(this.config));
|
|
53
|
+
this.middlewareStack.use(getS3ExpressHttpSigningPlugin(this.config));
|
|
45
54
|
}
|
|
46
55
|
destroy() {
|
|
47
56
|
super.destroy();
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
3
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
4
|
+
let _credentials = runtimeConfig.credentials;
|
|
5
|
+
return {
|
|
6
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
7
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
8
|
+
if (index === -1) {
|
|
9
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
httpAuthSchemes() {
|
|
16
|
+
return _httpAuthSchemes;
|
|
17
|
+
},
|
|
18
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
19
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
20
|
+
},
|
|
21
|
+
httpAuthSchemeProvider() {
|
|
22
|
+
return _httpAuthSchemeProvider;
|
|
23
|
+
},
|
|
24
|
+
setCredentials(credentials) {
|
|
25
|
+
_credentials = credentials;
|
|
26
|
+
},
|
|
27
|
+
credentials() {
|
|
28
|
+
return _credentials;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const resolveHttpAuthRuntimeConfig = (config) => {
|
|
33
|
+
return {
|
|
34
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
35
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
36
|
+
credentials: config.credentials(),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
|
|
2
|
+
import { signatureV4CrtContainer } from "@aws-sdk/signature-v4-multi-region";
|
|
3
|
+
import { resolveParams } from "@smithy/middleware-endpoint";
|
|
4
|
+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
|
|
5
|
+
import { defaultEndpointResolver } from "../endpoint/endpointResolver";
|
|
6
|
+
const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
|
|
7
|
+
if (!input) {
|
|
8
|
+
throw new Error(`Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\``);
|
|
9
|
+
}
|
|
10
|
+
const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
|
|
11
|
+
const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
|
|
12
|
+
?.getEndpointParameterInstructions;
|
|
13
|
+
if (!instructionsFn) {
|
|
14
|
+
throw new Error(`getEndpointParameterInstructions() is not defined on \`${context.commandName}\``);
|
|
15
|
+
}
|
|
16
|
+
const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
|
|
17
|
+
return Object.assign(defaultParameters, endpointParameters);
|
|
18
|
+
};
|
|
19
|
+
const _defaultS3HttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
20
|
+
return {
|
|
21
|
+
operation: getSmithyContext(context).operation,
|
|
22
|
+
region: (await normalizeProvider(config.region)()) ||
|
|
23
|
+
(() => {
|
|
24
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
25
|
+
})(),
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export const defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultS3HttpAuthSchemeParametersProvider);
|
|
29
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
30
|
+
return {
|
|
31
|
+
schemeId: "aws.auth#sigv4",
|
|
32
|
+
signingProperties: {
|
|
33
|
+
name: "s3",
|
|
34
|
+
region: authParameters.region,
|
|
35
|
+
},
|
|
36
|
+
propertiesExtractor: (config, context) => ({
|
|
37
|
+
signingProperties: {
|
|
38
|
+
config,
|
|
39
|
+
context,
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
|
|
45
|
+
return {
|
|
46
|
+
schemeId: "aws.auth#sigv4a",
|
|
47
|
+
signingProperties: {
|
|
48
|
+
name: "s3",
|
|
49
|
+
region: authParameters.region,
|
|
50
|
+
},
|
|
51
|
+
propertiesExtractor: (config, context) => ({
|
|
52
|
+
signingProperties: {
|
|
53
|
+
config,
|
|
54
|
+
context,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
|
|
60
|
+
const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
|
|
61
|
+
const endpoint = defaultEndpointResolver(authParameters);
|
|
62
|
+
const authSchemes = endpoint.properties?.authSchemes;
|
|
63
|
+
if (!authSchemes) {
|
|
64
|
+
return defaultHttpAuthSchemeResolver(authParameters);
|
|
65
|
+
}
|
|
66
|
+
const options = [];
|
|
67
|
+
for (const scheme of authSchemes) {
|
|
68
|
+
const { name: resolvedName, properties = {}, ...rest } = scheme;
|
|
69
|
+
const name = resolvedName.toLowerCase();
|
|
70
|
+
if (resolvedName !== name) {
|
|
71
|
+
console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${resolvedName}\` to \`${name}\``);
|
|
72
|
+
}
|
|
73
|
+
let schemeId;
|
|
74
|
+
if (name === "sigv4a") {
|
|
75
|
+
schemeId = "aws.auth#sigv4a";
|
|
76
|
+
const sigv4Present = authSchemes.find((s) => {
|
|
77
|
+
const name = s.name.toLowerCase();
|
|
78
|
+
return name !== "sigv4a" && name.startsWith("sigv4");
|
|
79
|
+
});
|
|
80
|
+
if (!signatureV4CrtContainer.CrtSignerV4 && sigv4Present) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else if (name.startsWith("sigv4")) {
|
|
85
|
+
schemeId = "aws.auth#sigv4";
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${name}\``);
|
|
89
|
+
}
|
|
90
|
+
const createOption = createHttpAuthOptionFunctions[schemeId];
|
|
91
|
+
if (!createOption) {
|
|
92
|
+
throw new Error(`Could not find HttpAuthOption create function for \`${schemeId}\``);
|
|
93
|
+
}
|
|
94
|
+
const option = createOption(authParameters);
|
|
95
|
+
option.schemeId = schemeId;
|
|
96
|
+
option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
|
|
97
|
+
options.push(option);
|
|
98
|
+
}
|
|
99
|
+
return options;
|
|
100
|
+
};
|
|
101
|
+
return endpointRuleSetHttpAuthSchemeProvider;
|
|
102
|
+
};
|
|
103
|
+
const _defaultS3HttpAuthSchemeProvider = (authParameters) => {
|
|
104
|
+
const options = [];
|
|
105
|
+
switch (authParameters.operation) {
|
|
106
|
+
default: {
|
|
107
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
108
|
+
options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return options;
|
|
112
|
+
};
|
|
113
|
+
export const defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultS3HttpAuthSchemeProvider, {
|
|
114
|
+
"aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
|
|
115
|
+
"aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
|
|
116
|
+
});
|
|
117
|
+
export const resolveHttpAuthSchemeConfig = (config) => {
|
|
118
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
119
|
+
return {
|
|
120
|
+
...config_0,
|
|
121
|
+
};
|
|
122
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
1
2
|
import { SignatureV4MultiRegion } from "@aws-sdk/signature-v4-multi-region";
|
|
2
3
|
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
4
|
import { parseUrl } from "@smithy/url-parser";
|
|
4
5
|
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
5
6
|
import { getAwsChunkedEncodingStream, sdkStreamMixin } from "@smithy/util-stream";
|
|
6
7
|
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
8
|
+
import { defaultS3HttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
7
9
|
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
8
10
|
export const getRuntimeConfig = (config) => {
|
|
9
11
|
return {
|
|
@@ -14,6 +16,19 @@ export const getRuntimeConfig = (config) => {
|
|
|
14
16
|
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
15
17
|
extensions: config?.extensions ?? [],
|
|
16
18
|
getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? getAwsChunkedEncodingStream,
|
|
19
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultS3HttpAuthSchemeProvider,
|
|
20
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
21
|
+
{
|
|
22
|
+
schemeId: "aws.auth#sigv4",
|
|
23
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
24
|
+
signer: new AwsSdkSigV4Signer(),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
schemeId: "aws.auth#sigv4a",
|
|
28
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
29
|
+
signer: new AwsSdkSigV4ASigner(),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
17
32
|
logger: config?.logger ?? new NoOpLogger(),
|
|
18
33
|
sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin,
|
|
19
34
|
serviceId: config?.serviceId ?? "S3",
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
2
|
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
3
|
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
4
5
|
const asPartial = (t) => t;
|
|
5
6
|
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
7
|
const extensionConfiguration = {
|
|
7
8
|
...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
|
|
8
9
|
...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
|
|
9
10
|
...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
|
|
11
|
+
...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
|
|
10
12
|
};
|
|
11
13
|
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
12
14
|
return {
|
|
@@ -14,5 +16,6 @@ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
|
14
16
|
...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
|
|
15
17
|
...resolveDefaultRuntimeConfig(extensionConfiguration),
|
|
16
18
|
...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
|
|
19
|
+
...resolveHttpAuthRuntimeConfig(extensionConfiguration),
|
|
17
20
|
};
|
|
18
21
|
};
|
package/dist-types/S3Client.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
|
|
3
3
|
import { S3InputConfig, S3ResolvedConfig } from "@aws-sdk/middleware-sdk-s3";
|
|
4
|
-
import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
|
|
5
4
|
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
6
|
-
import {
|
|
5
|
+
import { GetAwsChunkedEncodingStream } from "@aws-sdk/types";
|
|
7
6
|
import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
|
|
8
7
|
import { EventStreamSerdeInputConfig, EventStreamSerdeResolvedConfig } from "@smithy/eventstream-serde-config-resolver";
|
|
9
8
|
import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
|
|
10
9
|
import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
|
|
11
10
|
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
|
|
12
11
|
import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
|
|
13
|
-
import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, SdkStreamMixinInjector as __SdkStreamMixinInjector, StreamCollector as __StreamCollector, StreamHasher as __StreamHasher, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
|
|
12
|
+
import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, SdkStreamMixinInjector as __SdkStreamMixinInjector, StreamCollector as __StreamCollector, StreamHasher as __StreamHasher, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
|
|
14
13
|
import { Readable } from "stream";
|
|
14
|
+
import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
|
|
15
15
|
import { AbortMultipartUploadCommandInput, AbortMultipartUploadCommandOutput } from "./commands/AbortMultipartUploadCommand";
|
|
16
16
|
import { CompleteMultipartUploadCommandInput, CompleteMultipartUploadCommandOutput } from "./commands/CompleteMultipartUploadCommand";
|
|
17
17
|
import { CopyObjectCommandInput, CopyObjectCommandOutput } from "./commands/CopyObjectCommand";
|
|
@@ -224,17 +224,10 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
224
224
|
getAwsChunkedEncodingStream?: GetAwsChunkedEncodingStream;
|
|
225
225
|
/**
|
|
226
226
|
* Default credentials provider; Not available in browser runtime.
|
|
227
|
+
* @deprecated
|
|
227
228
|
* @internal
|
|
228
229
|
*/
|
|
229
|
-
credentialDefaultProvider?: (input: any) =>
|
|
230
|
-
/**
|
|
231
|
-
* Whether to escape request path when signing the request.
|
|
232
|
-
*/
|
|
233
|
-
signingEscapePath?: boolean;
|
|
234
|
-
/**
|
|
235
|
-
* Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false.
|
|
236
|
-
*/
|
|
237
|
-
useArnRegion?: boolean | Provider<boolean>;
|
|
230
|
+
credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
|
|
238
231
|
/**
|
|
239
232
|
* Value for how many times a request will be made at most in case of retry.
|
|
240
233
|
*/
|
|
@@ -261,6 +254,14 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
261
254
|
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
|
|
262
255
|
*/
|
|
263
256
|
defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
|
|
257
|
+
/**
|
|
258
|
+
* Whether to escape request path when signing the request.
|
|
259
|
+
*/
|
|
260
|
+
signingEscapePath?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false.
|
|
263
|
+
*/
|
|
264
|
+
useArnRegion?: boolean | Provider<boolean>;
|
|
264
265
|
/**
|
|
265
266
|
* The internal function that inject utilities to runtime-specific stream to help users consume the data
|
|
266
267
|
* @internal
|
|
@@ -270,7 +271,7 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
|
|
|
270
271
|
/**
|
|
271
272
|
* @public
|
|
272
273
|
*/
|
|
273
|
-
export type S3ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> &
|
|
274
|
+
export type S3ClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & UserAgentInputConfig & RetryInputConfig & RegionInputConfig & HostHeaderInputConfig & EndpointInputConfig<EndpointParameters> & EventStreamSerdeInputConfig & HttpAuthSchemeInputConfig & S3InputConfig & ClientInputEndpointParameters;
|
|
274
275
|
/**
|
|
275
276
|
* @public
|
|
276
277
|
*
|
|
@@ -281,7 +282,7 @@ export interface S3ClientConfig extends S3ClientConfigType {
|
|
|
281
282
|
/**
|
|
282
283
|
* @public
|
|
283
284
|
*/
|
|
284
|
-
export type S3ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> &
|
|
285
|
+
export type S3ClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & UserAgentResolvedConfig & RetryResolvedConfig & RegionResolvedConfig & HostHeaderResolvedConfig & EndpointResolvedConfig<EndpointParameters> & EventStreamSerdeResolvedConfig & HttpAuthSchemeResolvedConfig & S3ResolvedConfig & ClientResolvedEndpointParameters;
|
|
285
286
|
/**
|
|
286
287
|
* @public
|
|
287
288
|
*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types";
|
|
2
|
+
import { S3HttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface HttpAuthExtensionConfiguration {
|
|
7
|
+
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
|
|
8
|
+
httpAuthSchemes(): HttpAuthScheme[];
|
|
9
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider: S3HttpAuthSchemeProvider): void;
|
|
10
|
+
httpAuthSchemeProvider(): S3HttpAuthSchemeProvider;
|
|
11
|
+
setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void;
|
|
12
|
+
credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export type HttpAuthRuntimeConfig = Partial<{
|
|
18
|
+
httpAuthSchemes: HttpAuthScheme[];
|
|
19
|
+
httpAuthSchemeProvider: S3HttpAuthSchemeProvider;
|
|
20
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const getHttpAuthExtensionConfiguration: (runtimeConfig: HttpAuthRuntimeConfig) => HttpAuthExtensionConfiguration;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const resolveHttpAuthRuntimeConfig: (config: HttpAuthExtensionConfiguration) => HttpAuthRuntimeConfig;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AwsSdkSigV4AuthInputConfig, AwsSdkSigV4AuthResolvedConfig, AwsSdkSigV4PreviouslyResolved } from "@aws-sdk/core";
|
|
2
|
+
import { HandlerExecutionContext, HttpAuthScheme, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider } from "@smithy/types";
|
|
3
|
+
import { EndpointParameters } from "../endpoint/EndpointParameters";
|
|
4
|
+
import { S3ClientResolvedConfig } from "../S3Client";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
interface _S3HttpAuthSchemeParameters extends HttpAuthSchemeParameters {
|
|
9
|
+
region?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export interface S3HttpAuthSchemeParameters extends _S3HttpAuthSchemeParameters, EndpointParameters {
|
|
15
|
+
region?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export interface S3HttpAuthSchemeParametersProvider extends HttpAuthSchemeParametersProvider<S3ClientResolvedConfig, HandlerExecutionContext, S3HttpAuthSchemeParameters, object> {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const defaultS3HttpAuthSchemeParametersProvider: S3HttpAuthSchemeParametersProvider;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export interface S3HttpAuthSchemeProvider extends HttpAuthSchemeProvider<S3HttpAuthSchemeParameters> {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare const defaultS3HttpAuthSchemeProvider: S3HttpAuthSchemeProvider;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
|
|
39
|
+
/**
|
|
40
|
+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
httpAuthSchemes?: HttpAuthScheme[];
|
|
44
|
+
/**
|
|
45
|
+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
httpAuthSchemeProvider?: S3HttpAuthSchemeProvider;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
|
|
54
|
+
/**
|
|
55
|
+
* Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
readonly httpAuthSchemes: HttpAuthScheme[];
|
|
59
|
+
/**
|
|
60
|
+
* Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
readonly httpAuthSchemeProvider: S3HttpAuthSchemeProvider;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare const resolveHttpAuthSchemeConfig: <T>(config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved) => T & HttpAuthSchemeResolvedConfig;
|
|
69
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
|
|
2
2
|
import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
|
|
3
3
|
import { DefaultExtensionConfiguration } from "@smithy/types";
|
|
4
|
+
import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";
|
|
4
5
|
/**
|
|
5
6
|
* @internal
|
|
6
7
|
*/
|
|
7
|
-
export interface S3ExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration {
|
|
8
|
+
export interface S3ExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration, HttpAuthExtensionConfiguration {
|
|
8
9
|
}
|
|
@@ -8,7 +8,7 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
8
8
|
runtime: string;
|
|
9
9
|
defaultsMode: import("@smithy/types").Provider<import("@smithy/smithy-client").ResolvedDefaultsMode>;
|
|
10
10
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
11
|
-
credentialDefaultProvider: (input: any) => import("@smithy/types").
|
|
11
|
+
credentialDefaultProvider: (input: any) => import("@smithy/types").AwsCredentialIdentityProvider;
|
|
12
12
|
defaultUserAgentProvider: import("@smithy/types").Provider<import("@smithy/types").UserAgent>;
|
|
13
13
|
eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
|
|
14
14
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
@@ -31,10 +31,10 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
31
31
|
disableHostPrefix: boolean;
|
|
32
32
|
serviceId: string;
|
|
33
33
|
getAwsChunkedEncodingStream: import("@smithy/types").GetAwsChunkedEncodingStream<any> | import("@smithy/types").GetAwsChunkedEncodingStream<import("stream").Readable>;
|
|
34
|
-
signingEscapePath: boolean;
|
|
35
|
-
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
36
34
|
logger: import("@smithy/types").Logger;
|
|
37
35
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
36
|
+
signingEscapePath: boolean;
|
|
37
|
+
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
38
38
|
sdkStreamMixin: import("@smithy/types").SdkStreamMixinInjector;
|
|
39
39
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
40
40
|
retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2 | undefined;
|
|
@@ -43,7 +43,9 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
43
43
|
logger?: import("@smithy/types").Logger | undefined;
|
|
44
44
|
}) => import("@smithy/types").EndpointV2;
|
|
45
45
|
tls?: boolean | undefined;
|
|
46
|
-
|
|
46
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
47
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
48
|
+
credentials?: import("@smithy/types").AwsCredentialIdentity | import("@smithy/types").AwsCredentialIdentityProvider | undefined;
|
|
47
49
|
signer?: import("@smithy/types").RequestSigner | ((authScheme?: import("@smithy/types").AuthScheme | undefined) => Promise<import("@smithy/types").RequestSigner>) | undefined;
|
|
48
50
|
systemClockOffset?: number | undefined;
|
|
49
51
|
signingRegion?: string | undefined;
|
|
@@ -34,9 +34,9 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
34
34
|
disableHostPrefix: boolean;
|
|
35
35
|
serviceId: string;
|
|
36
36
|
getAwsChunkedEncodingStream: import("@aws-sdk/types").GetAwsChunkedEncodingStream<any> | import("@aws-sdk/types").GetAwsChunkedEncodingStream<import("stream").Readable>;
|
|
37
|
-
signingEscapePath: boolean;
|
|
38
37
|
logger: import("@aws-sdk/types").Logger;
|
|
39
38
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
39
|
+
signingEscapePath: boolean;
|
|
40
40
|
sdkStreamMixin: import("@aws-sdk/types").SdkStreamMixinInjector;
|
|
41
41
|
customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined;
|
|
42
42
|
retryStrategy?: import("@aws-sdk/types").RetryStrategy | import("@aws-sdk/types").RetryStrategyV2 | undefined;
|
|
@@ -45,7 +45,9 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
45
45
|
logger?: import("@aws-sdk/types").Logger | undefined;
|
|
46
46
|
}) => import("@aws-sdk/types").EndpointV2;
|
|
47
47
|
tls?: boolean | undefined;
|
|
48
|
-
|
|
48
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
49
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
50
|
+
credentials?: import("@aws-sdk/types").AwsCredentialIdentity | import("@aws-sdk/types").AwsCredentialIdentityProvider | undefined;
|
|
49
51
|
signer?: import("@aws-sdk/types").RequestSigner | ((authScheme?: import("@aws-sdk/types").AuthScheme | undefined) => Promise<import("@aws-sdk/types").RequestSigner>) | undefined;
|
|
50
52
|
systemClockOffset?: number | undefined;
|
|
51
53
|
signingRegion?: string | undefined;
|
|
@@ -25,15 +25,15 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
25
25
|
md5: import("@smithy/types").HashConstructor;
|
|
26
26
|
sha1: import("@smithy/types").HashConstructor;
|
|
27
27
|
getAwsChunkedEncodingStream: import("@smithy/types").GetAwsChunkedEncodingStream<any> | import("@smithy/types").GetAwsChunkedEncodingStream<import("stream").Readable>;
|
|
28
|
-
credentialDefaultProvider: (input: any) => import("@smithy/types").
|
|
29
|
-
signingEscapePath: boolean;
|
|
30
|
-
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
28
|
+
credentialDefaultProvider: (input: any) => import("@smithy/types").AwsCredentialIdentityProvider;
|
|
31
29
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
32
30
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
33
31
|
logger: import("@smithy/types").Logger;
|
|
34
32
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
35
33
|
eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
|
|
36
34
|
defaultsMode: import("@smithy/smithy-client").DefaultsMode | import("@smithy/types").Provider<import("@smithy/smithy-client").DefaultsMode>;
|
|
35
|
+
signingEscapePath: boolean;
|
|
36
|
+
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
37
37
|
sdkStreamMixin: import("@smithy/types").SdkStreamMixinInjector;
|
|
38
38
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
39
39
|
retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2 | undefined;
|
|
@@ -42,7 +42,9 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
42
42
|
logger?: import("@smithy/types").Logger | undefined;
|
|
43
43
|
}) => import("@smithy/types").EndpointV2;
|
|
44
44
|
tls?: boolean | undefined;
|
|
45
|
-
|
|
45
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
46
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
47
|
+
credentials?: import("@smithy/types").AwsCredentialIdentity | import("@smithy/types").AwsCredentialIdentityProvider | undefined;
|
|
46
48
|
signer?: import("@smithy/types").RequestSigner | ((authScheme?: import("@smithy/types").AuthScheme | undefined) => Promise<import("@smithy/types").RequestSigner>) | undefined;
|
|
47
49
|
systemClockOffset?: number | undefined;
|
|
48
50
|
signingRegion?: string | undefined;
|
|
@@ -14,6 +14,8 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
14
14
|
}) => import("@smithy/types").EndpointV2;
|
|
15
15
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
16
16
|
getAwsChunkedEncodingStream: import("@smithy/types").GetAwsChunkedEncodingStream<any> | import("@smithy/types").GetAwsChunkedEncodingStream<import("stream").Readable>;
|
|
17
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
18
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
17
19
|
logger: import("@smithy/types").Logger;
|
|
18
20
|
sdkStreamMixin: import("@smithy/types").SdkStreamMixinInjector;
|
|
19
21
|
serviceId: string;
|
|
@@ -3,18 +3,11 @@ import {
|
|
|
3
3
|
HostHeaderResolvedConfig,
|
|
4
4
|
} from "@aws-sdk/middleware-host-header";
|
|
5
5
|
import { S3InputConfig, S3ResolvedConfig } from "@aws-sdk/middleware-sdk-s3";
|
|
6
|
-
import {
|
|
7
|
-
AwsAuthInputConfig,
|
|
8
|
-
AwsAuthResolvedConfig,
|
|
9
|
-
} from "@aws-sdk/middleware-signing";
|
|
10
6
|
import {
|
|
11
7
|
UserAgentInputConfig,
|
|
12
8
|
UserAgentResolvedConfig,
|
|
13
9
|
} from "@aws-sdk/middleware-user-agent";
|
|
14
|
-
import {
|
|
15
|
-
Credentials as __Credentials,
|
|
16
|
-
GetAwsChunkedEncodingStream,
|
|
17
|
-
} from "@aws-sdk/types";
|
|
10
|
+
import { GetAwsChunkedEncodingStream } from "@aws-sdk/types";
|
|
18
11
|
import {
|
|
19
12
|
RegionInputConfig,
|
|
20
13
|
RegionResolvedConfig,
|
|
@@ -39,6 +32,7 @@ import {
|
|
|
39
32
|
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
|
|
40
33
|
} from "@smithy/smithy-client";
|
|
41
34
|
import {
|
|
35
|
+
AwsCredentialIdentityProvider,
|
|
42
36
|
BodyLengthCalculator as __BodyLengthCalculator,
|
|
43
37
|
CheckOptionalClientConfig as __CheckOptionalClientConfig,
|
|
44
38
|
ChecksumConstructor as __ChecksumConstructor,
|
|
@@ -57,6 +51,10 @@ import {
|
|
|
57
51
|
UserAgent as __UserAgent,
|
|
58
52
|
} from "@smithy/types";
|
|
59
53
|
import { Readable } from "stream";
|
|
54
|
+
import {
|
|
55
|
+
HttpAuthSchemeInputConfig,
|
|
56
|
+
HttpAuthSchemeResolvedConfig,
|
|
57
|
+
} from "./auth/httpAuthSchemeProvider";
|
|
60
58
|
import {
|
|
61
59
|
AbortMultipartUploadCommandInput,
|
|
62
60
|
AbortMultipartUploadCommandOutput,
|
|
@@ -658,15 +656,15 @@ export interface ClientDefaults
|
|
|
658
656
|
md5?: __ChecksumConstructor | __HashConstructor;
|
|
659
657
|
sha1?: __ChecksumConstructor | __HashConstructor;
|
|
660
658
|
getAwsChunkedEncodingStream?: GetAwsChunkedEncodingStream;
|
|
661
|
-
credentialDefaultProvider?: (input: any) =>
|
|
662
|
-
signingEscapePath?: boolean;
|
|
663
|
-
useArnRegion?: boolean | Provider<boolean>;
|
|
659
|
+
credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
|
|
664
660
|
maxAttempts?: number | __Provider<number>;
|
|
665
661
|
retryMode?: string | __Provider<string>;
|
|
666
662
|
logger?: __Logger;
|
|
667
663
|
extensions?: RuntimeExtension[];
|
|
668
664
|
eventStreamSerdeProvider?: __EventStreamSerdeProvider;
|
|
669
665
|
defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
|
|
666
|
+
signingEscapePath?: boolean;
|
|
667
|
+
useArnRegion?: boolean | Provider<boolean>;
|
|
670
668
|
sdkStreamMixin?: __SdkStreamMixinInjector;
|
|
671
669
|
}
|
|
672
670
|
export type S3ClientConfigType = Partial<
|
|
@@ -678,9 +676,9 @@ export type S3ClientConfigType = Partial<
|
|
|
678
676
|
RegionInputConfig &
|
|
679
677
|
HostHeaderInputConfig &
|
|
680
678
|
EndpointInputConfig<EndpointParameters> &
|
|
681
|
-
AwsAuthInputConfig &
|
|
682
|
-
S3InputConfig &
|
|
683
679
|
EventStreamSerdeInputConfig &
|
|
680
|
+
HttpAuthSchemeInputConfig &
|
|
681
|
+
S3InputConfig &
|
|
684
682
|
ClientInputEndpointParameters;
|
|
685
683
|
export interface S3ClientConfig extends S3ClientConfigType {}
|
|
686
684
|
export type S3ClientResolvedConfigType =
|
|
@@ -692,9 +690,9 @@ export type S3ClientResolvedConfigType =
|
|
|
692
690
|
RegionResolvedConfig &
|
|
693
691
|
HostHeaderResolvedConfig &
|
|
694
692
|
EndpointResolvedConfig<EndpointParameters> &
|
|
695
|
-
AwsAuthResolvedConfig &
|
|
696
|
-
S3ResolvedConfig &
|
|
697
693
|
EventStreamSerdeResolvedConfig &
|
|
694
|
+
HttpAuthSchemeResolvedConfig &
|
|
695
|
+
S3ResolvedConfig &
|
|
698
696
|
ClientResolvedEndpointParameters;
|
|
699
697
|
export interface S3ClientResolvedConfig extends S3ClientResolvedConfigType {}
|
|
700
698
|
export declare class S3Client extends __Client<
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AwsCredentialIdentity,
|
|
3
|
+
AwsCredentialIdentityProvider,
|
|
4
|
+
HttpAuthScheme,
|
|
5
|
+
} from "@smithy/types";
|
|
6
|
+
import { S3HttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
|
|
7
|
+
export interface HttpAuthExtensionConfiguration {
|
|
8
|
+
setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
|
|
9
|
+
httpAuthSchemes(): HttpAuthScheme[];
|
|
10
|
+
setHttpAuthSchemeProvider(
|
|
11
|
+
httpAuthSchemeProvider: S3HttpAuthSchemeProvider
|
|
12
|
+
): void;
|
|
13
|
+
httpAuthSchemeProvider(): S3HttpAuthSchemeProvider;
|
|
14
|
+
setCredentials(
|
|
15
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider
|
|
16
|
+
): void;
|
|
17
|
+
credentials():
|
|
18
|
+
| AwsCredentialIdentity
|
|
19
|
+
| AwsCredentialIdentityProvider
|
|
20
|
+
| undefined;
|
|
21
|
+
}
|
|
22
|
+
export type HttpAuthRuntimeConfig = Partial<{
|
|
23
|
+
httpAuthSchemes: HttpAuthScheme[];
|
|
24
|
+
httpAuthSchemeProvider: S3HttpAuthSchemeProvider;
|
|
25
|
+
credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const getHttpAuthExtensionConfiguration: (
|
|
28
|
+
runtimeConfig: HttpAuthRuntimeConfig
|
|
29
|
+
) => HttpAuthExtensionConfiguration;
|
|
30
|
+
export declare const resolveHttpAuthRuntimeConfig: (
|
|
31
|
+
config: HttpAuthExtensionConfiguration
|
|
32
|
+
) => HttpAuthRuntimeConfig;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AwsSdkSigV4AuthInputConfig,
|
|
3
|
+
AwsSdkSigV4AuthResolvedConfig,
|
|
4
|
+
AwsSdkSigV4PreviouslyResolved,
|
|
5
|
+
} from "@aws-sdk/core";
|
|
6
|
+
import {
|
|
7
|
+
HandlerExecutionContext,
|
|
8
|
+
HttpAuthScheme,
|
|
9
|
+
HttpAuthSchemeParameters,
|
|
10
|
+
HttpAuthSchemeParametersProvider,
|
|
11
|
+
HttpAuthSchemeProvider,
|
|
12
|
+
} from "@smithy/types";
|
|
13
|
+
import { EndpointParameters } from "../endpoint/EndpointParameters";
|
|
14
|
+
import { S3ClientResolvedConfig } from "../S3Client";
|
|
15
|
+
interface _S3HttpAuthSchemeParameters extends HttpAuthSchemeParameters {
|
|
16
|
+
region?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface S3HttpAuthSchemeParameters
|
|
19
|
+
extends _S3HttpAuthSchemeParameters,
|
|
20
|
+
EndpointParameters {
|
|
21
|
+
region?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface S3HttpAuthSchemeParametersProvider
|
|
24
|
+
extends HttpAuthSchemeParametersProvider<
|
|
25
|
+
S3ClientResolvedConfig,
|
|
26
|
+
HandlerExecutionContext,
|
|
27
|
+
S3HttpAuthSchemeParameters,
|
|
28
|
+
object
|
|
29
|
+
> {}
|
|
30
|
+
export declare const defaultS3HttpAuthSchemeParametersProvider: S3HttpAuthSchemeParametersProvider;
|
|
31
|
+
export interface S3HttpAuthSchemeProvider
|
|
32
|
+
extends HttpAuthSchemeProvider<S3HttpAuthSchemeParameters> {}
|
|
33
|
+
export declare const defaultS3HttpAuthSchemeProvider: S3HttpAuthSchemeProvider;
|
|
34
|
+
export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
|
|
35
|
+
httpAuthSchemes?: HttpAuthScheme[];
|
|
36
|
+
httpAuthSchemeProvider?: S3HttpAuthSchemeProvider;
|
|
37
|
+
}
|
|
38
|
+
export interface HttpAuthSchemeResolvedConfig
|
|
39
|
+
extends AwsSdkSigV4AuthResolvedConfig {
|
|
40
|
+
readonly httpAuthSchemes: HttpAuthScheme[];
|
|
41
|
+
readonly httpAuthSchemeProvider: S3HttpAuthSchemeProvider;
|
|
42
|
+
}
|
|
43
|
+
export declare const resolveHttpAuthSchemeConfig: <T>(
|
|
44
|
+
config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved
|
|
45
|
+
) => T & HttpAuthSchemeResolvedConfig;
|
|
46
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
|
|
2
2
|
import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
|
|
3
3
|
import { DefaultExtensionConfiguration } from "@smithy/types";
|
|
4
|
+
import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";
|
|
4
5
|
export interface S3ExtensionConfiguration
|
|
5
6
|
extends HttpHandlerExtensionConfiguration,
|
|
6
7
|
DefaultExtensionConfiguration,
|
|
7
|
-
AwsRegionExtensionConfiguration
|
|
8
|
+
AwsRegionExtensionConfiguration,
|
|
9
|
+
HttpAuthExtensionConfiguration {}
|
|
@@ -8,7 +8,7 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
8
8
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
9
9
|
credentialDefaultProvider: (
|
|
10
10
|
input: any
|
|
11
|
-
) => import("@smithy/types").
|
|
11
|
+
) => import("@smithy/types").AwsCredentialIdentityProvider;
|
|
12
12
|
defaultUserAgentProvider: import("@smithy/types").Provider<
|
|
13
13
|
import("@smithy/types").UserAgent
|
|
14
14
|
>;
|
|
@@ -41,10 +41,10 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
41
41
|
| import("@smithy/types").GetAwsChunkedEncodingStream<
|
|
42
42
|
import("stream").Readable
|
|
43
43
|
>;
|
|
44
|
-
signingEscapePath: boolean;
|
|
45
|
-
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
46
44
|
logger: import("@smithy/types").Logger;
|
|
47
45
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
46
|
+
signingEscapePath: boolean;
|
|
47
|
+
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
48
48
|
sdkStreamMixin: import("@smithy/types").SdkStreamMixinInjector;
|
|
49
49
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
50
50
|
retryStrategy?:
|
|
@@ -75,11 +75,11 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
75
75
|
}
|
|
76
76
|
) => import("@smithy/types").EndpointV2;
|
|
77
77
|
tls?: boolean | undefined;
|
|
78
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
79
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
78
80
|
credentials?:
|
|
79
81
|
| import("@smithy/types").AwsCredentialIdentity
|
|
80
|
-
| import("@smithy/types").
|
|
81
|
-
import("@smithy/types").AwsCredentialIdentity
|
|
82
|
-
>
|
|
82
|
+
| import("@smithy/types").AwsCredentialIdentityProvider
|
|
83
83
|
| undefined;
|
|
84
84
|
signer?:
|
|
85
85
|
| import("@smithy/types").RequestSigner
|
|
@@ -50,9 +50,9 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
50
50
|
| import("@aws-sdk/types").GetAwsChunkedEncodingStream<
|
|
51
51
|
import("stream").Readable
|
|
52
52
|
>;
|
|
53
|
-
signingEscapePath: boolean;
|
|
54
53
|
logger: import("@aws-sdk/types").Logger;
|
|
55
54
|
extensions: import("./runtimeExtensions").RuntimeExtension[];
|
|
55
|
+
signingEscapePath: boolean;
|
|
56
56
|
sdkStreamMixin: import("@aws-sdk/types").SdkStreamMixinInjector;
|
|
57
57
|
customUserAgent?: string | import("@aws-sdk/types").UserAgent | undefined;
|
|
58
58
|
retryStrategy?:
|
|
@@ -85,11 +85,11 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
85
85
|
}
|
|
86
86
|
) => import("@aws-sdk/types").EndpointV2;
|
|
87
87
|
tls?: boolean | undefined;
|
|
88
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
89
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
88
90
|
credentials?:
|
|
89
91
|
| import("@aws-sdk/types").AwsCredentialIdentity
|
|
90
|
-
| import("@aws-sdk/types").
|
|
91
|
-
import("@aws-sdk/types").AwsCredentialIdentity
|
|
92
|
-
>
|
|
92
|
+
| import("@aws-sdk/types").AwsCredentialIdentityProvider
|
|
93
93
|
| undefined;
|
|
94
94
|
signer?:
|
|
95
95
|
| import("@aws-sdk/types").RequestSigner
|
|
@@ -36,9 +36,7 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
36
36
|
>;
|
|
37
37
|
credentialDefaultProvider: (
|
|
38
38
|
input: any
|
|
39
|
-
) => import("@smithy/types").
|
|
40
|
-
signingEscapePath: boolean;
|
|
41
|
-
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
39
|
+
) => import("@smithy/types").AwsCredentialIdentityProvider;
|
|
42
40
|
maxAttempts: number | import("@smithy/types").Provider<number>;
|
|
43
41
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
44
42
|
logger: import("@smithy/types").Logger;
|
|
@@ -49,6 +47,8 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
49
47
|
| import("@smithy/types").Provider<
|
|
50
48
|
import("@smithy/smithy-client").DefaultsMode
|
|
51
49
|
>;
|
|
50
|
+
signingEscapePath: boolean;
|
|
51
|
+
useArnRegion: boolean | import("@smithy/types").Provider<boolean>;
|
|
52
52
|
sdkStreamMixin: import("@smithy/types").SdkStreamMixinInjector;
|
|
53
53
|
customUserAgent?: string | import("@smithy/types").UserAgent | undefined;
|
|
54
54
|
retryStrategy?:
|
|
@@ -69,11 +69,11 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
69
69
|
}
|
|
70
70
|
) => import("@smithy/types").EndpointV2;
|
|
71
71
|
tls?: boolean | undefined;
|
|
72
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
73
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
72
74
|
credentials?:
|
|
73
75
|
| import("@smithy/types").AwsCredentialIdentity
|
|
74
|
-
| import("@smithy/types").
|
|
75
|
-
import("@smithy/types").AwsCredentialIdentity
|
|
76
|
-
>
|
|
76
|
+
| import("@smithy/types").AwsCredentialIdentityProvider
|
|
77
77
|
| undefined;
|
|
78
78
|
signer?:
|
|
79
79
|
| import("@smithy/types").RequestSigner
|
|
@@ -17,6 +17,8 @@ export declare const getRuntimeConfig: (config: S3ClientConfig) => {
|
|
|
17
17
|
| import("@smithy/types").GetAwsChunkedEncodingStream<
|
|
18
18
|
import("stream").Readable
|
|
19
19
|
>;
|
|
20
|
+
httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").S3HttpAuthSchemeProvider;
|
|
21
|
+
httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
|
|
20
22
|
logger: import("@smithy/types").Logger;
|
|
21
23
|
sdkStreamMixin: import("@smithy/types").SdkStreamMixinInjector;
|
|
22
24
|
serviceId: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-s3",
|
|
3
3
|
"description": "AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.624.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-s3",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@aws-crypto/sha1-browser": "5.2.0",
|
|
27
27
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
28
28
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
29
|
-
"@aws-sdk/client-sso-oidc": "3.
|
|
30
|
-
"@aws-sdk/client-sts": "3.
|
|
31
|
-
"@aws-sdk/core": "3.
|
|
32
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
29
|
+
"@aws-sdk/client-sso-oidc": "3.624.0",
|
|
30
|
+
"@aws-sdk/client-sts": "3.624.0",
|
|
31
|
+
"@aws-sdk/core": "3.624.0",
|
|
32
|
+
"@aws-sdk/credential-provider-node": "3.624.0",
|
|
33
33
|
"@aws-sdk/middleware-bucket-endpoint": "3.620.0",
|
|
34
34
|
"@aws-sdk/middleware-expect-continue": "3.620.0",
|
|
35
35
|
"@aws-sdk/middleware-flexible-checksums": "3.620.0",
|
|
@@ -37,12 +37,11 @@
|
|
|
37
37
|
"@aws-sdk/middleware-location-constraint": "3.609.0",
|
|
38
38
|
"@aws-sdk/middleware-logger": "3.609.0",
|
|
39
39
|
"@aws-sdk/middleware-recursion-detection": "3.620.0",
|
|
40
|
-
"@aws-sdk/middleware-sdk-s3": "3.
|
|
41
|
-
"@aws-sdk/middleware-signing": "3.620.0",
|
|
40
|
+
"@aws-sdk/middleware-sdk-s3": "3.624.0",
|
|
42
41
|
"@aws-sdk/middleware-ssec": "3.609.0",
|
|
43
42
|
"@aws-sdk/middleware-user-agent": "3.620.0",
|
|
44
43
|
"@aws-sdk/region-config-resolver": "3.614.0",
|
|
45
|
-
"@aws-sdk/signature-v4-multi-region": "3.
|
|
44
|
+
"@aws-sdk/signature-v4-multi-region": "3.624.0",
|
|
46
45
|
"@aws-sdk/types": "3.609.0",
|
|
47
46
|
"@aws-sdk/util-endpoints": "3.614.0",
|
|
48
47
|
"@aws-sdk/util-user-agent-browser": "3.609.0",
|
|
@@ -76,6 +75,7 @@
|
|
|
76
75
|
"@smithy/util-defaults-mode-browser": "^3.0.14",
|
|
77
76
|
"@smithy/util-defaults-mode-node": "^3.0.14",
|
|
78
77
|
"@smithy/util-endpoints": "^2.0.5",
|
|
78
|
+
"@smithy/util-middleware": "^3.0.3",
|
|
79
79
|
"@smithy/util-retry": "^3.0.3",
|
|
80
80
|
"@smithy/util-stream": "^3.1.3",
|
|
81
81
|
"@smithy/util-utf8": "^3.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"tslib": "^2.6.2"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@aws-sdk/signature-v4-crt": "3.
|
|
86
|
+
"@aws-sdk/signature-v4-crt": "3.624.0",
|
|
87
87
|
"@tsconfig/node16": "16.1.3",
|
|
88
88
|
"@types/chai": "^4.2.11",
|
|
89
89
|
"@types/mocha": "^8.0.4",
|