@aws-sdk/middleware-ssec 3.489.0 → 3.495.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/index.js +74 -49
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -1,53 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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 src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
getSsecPlugin: () => getSsecPlugin,
|
|
24
|
+
ssecMiddleware: () => ssecMiddleware,
|
|
25
|
+
ssecMiddlewareOptions: () => ssecMiddlewareOptions
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
4
28
|
function ssecMiddleware(options) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
...args,
|
|
37
|
-
input,
|
|
38
|
-
});
|
|
39
|
-
};
|
|
29
|
+
return (next) => async (args) => {
|
|
30
|
+
let input = { ...args.input };
|
|
31
|
+
const properties = [
|
|
32
|
+
{
|
|
33
|
+
target: "SSECustomerKey",
|
|
34
|
+
hash: "SSECustomerKeyMD5"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
target: "CopySourceSSECustomerKey",
|
|
38
|
+
hash: "CopySourceSSECustomerKeyMD5"
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
for (const prop of properties) {
|
|
42
|
+
const value = input[prop.target];
|
|
43
|
+
if (value) {
|
|
44
|
+
const valueView = ArrayBuffer.isView(value) ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) : typeof value === "string" ? options.utf8Decoder(value) : new Uint8Array(value);
|
|
45
|
+
const encoded = options.base64Encoder(valueView);
|
|
46
|
+
const hash = new options.md5();
|
|
47
|
+
hash.update(valueView);
|
|
48
|
+
input = {
|
|
49
|
+
...input,
|
|
50
|
+
[prop.target]: encoded,
|
|
51
|
+
[prop.hash]: options.base64Encoder(await hash.digest())
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return next({
|
|
56
|
+
...args,
|
|
57
|
+
input
|
|
58
|
+
});
|
|
59
|
+
};
|
|
40
60
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
61
|
+
__name(ssecMiddleware, "ssecMiddleware");
|
|
62
|
+
var ssecMiddlewareOptions = {
|
|
63
|
+
name: "ssecMiddleware",
|
|
64
|
+
step: "initialize",
|
|
65
|
+
tags: ["SSE"],
|
|
66
|
+
override: true
|
|
47
67
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
var getSsecPlugin = /* @__PURE__ */ __name((config) => ({
|
|
69
|
+
applyToStack: (clientStack) => {
|
|
70
|
+
clientStack.add(ssecMiddleware(config), ssecMiddlewareOptions);
|
|
71
|
+
}
|
|
72
|
+
}), "getSsecPlugin");
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
getSsecPlugin,
|
|
76
|
+
ssecMiddleware,
|
|
77
|
+
ssecMiddlewareOptions
|
|
52
78
|
});
|
|
53
|
-
exports.getSsecPlugin = getSsecPlugin;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-ssec",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.495.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
|
-
"build:cjs": "
|
|
6
|
+
"build:cjs": "node ../../scripts/compilation/inline middleware-ssec",
|
|
7
7
|
"build:es": "tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
|
|
9
9
|
"build:types": "tsc -p tsconfig.types.json",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
25
|
-
"@smithy/types": "^2.
|
|
24
|
+
"@aws-sdk/types": "3.495.0",
|
|
25
|
+
"@smithy/types": "^2.9.0",
|
|
26
26
|
"tslib": "^2.5.0"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|