@aws-sdk/signature-v4-crt 3.34.0 → 3.38.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist-cjs/CrtSignerV4.js +123 -0
  3. package/dist-cjs/constants.js +46 -0
  4. package/dist-cjs/headerUtil.js +32 -0
  5. package/dist-cjs/index.js +4 -0
  6. package/dist-cjs/suite.fixture.js +386 -0
  7. package/dist-es/CrtSignerV4.js +218 -0
  8. package/dist-es/constants.js +43 -0
  9. package/dist-es/headerUtil.js +60 -0
  10. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  11. package/dist-es/suite.fixture.js +383 -0
  12. package/{dist/types → dist-types}/CrtSignerV4.d.ts +0 -0
  13. package/{dist/types → dist-types}/constants.d.ts +0 -0
  14. package/{dist/types → dist-types}/headerUtil.d.ts +0 -0
  15. package/{src/index.ts → dist-types/index.d.ts} +0 -0
  16. package/{dist/types → dist-types}/suite.fixture.d.ts +0 -0
  17. package/dist-types/ts3.4/CrtSignerV4.d.ts +27 -0
  18. package/{dist/types → dist-types}/ts3.4/constants.d.ts +0 -0
  19. package/{dist/types → dist-types}/ts3.4/headerUtil.d.ts +0 -0
  20. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  21. package/{dist/types → dist-types}/ts3.4/suite.fixture.d.ts +0 -0
  22. package/package.json +16 -13
  23. package/dist/cjs/CrtSignerV4.js +0 -124
  24. package/dist/cjs/constants.js +0 -47
  25. package/dist/cjs/headerUtil.js +0 -33
  26. package/dist/cjs/index.js +0 -5
  27. package/dist/cjs/suite.fixture.js +0 -387
  28. package/dist/es/CrtSignerV4.js +0 -254
  29. package/dist/es/constants.js +0 -44
  30. package/dist/es/headerUtil.js +0 -63
  31. package/dist/es/index.js +0 -2
  32. package/dist/es/suite.fixture.js +0 -404
  33. package/dist/tsconfig.cjs.tsbuildinfo +0 -1
  34. package/dist/tsconfig.es.tsbuildinfo +0 -1
  35. package/dist/types/ts3.4/CrtSignerV4.d.ts +0 -55
  36. package/jest.config.js +0 -7
  37. package/src/CrtSignerV4.spec.ts +0 -142
  38. package/src/CrtSignerV4.ts +0 -279
  39. package/src/constants.ts +0 -53
  40. package/src/crtSuite.spec.ts +0 -30
  41. package/src/headerUtil.ts +0 -34
  42. package/src/suite.fixture.ts +0 -437
  43. package/tsconfig.cjs.json +0 -12
  44. package/tsconfig.es.json +0 -16
  45. package/tsconfig.types.json +0 -9
  46. package/tsconfig.types.tsbuildinfo +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.38.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.37.0...v3.38.0) (2021-10-22)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/signature-v4-crt
9
+
10
+
11
+
12
+
13
+
14
+ # [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/signature-v4-crt
17
+
18
+
19
+
20
+
21
+
22
+ # [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08)
23
+
24
+
25
+ ### Features
26
+
27
+ * publish files in dist-* only ([#2873](https://github.com/aws/aws-sdk-js-v3/issues/2873)) ([53b4243](https://github.com/aws/aws-sdk-js-v3/commit/53b4243b066f25ff2412d5f0dea1036054b2df32))
28
+
29
+
30
+
31
+
32
+
33
+ # [3.35.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.34.0...v3.35.0) (2021-10-04)
34
+
35
+ **Note:** Version bump only for package @aws-sdk/signature-v4-crt
36
+
37
+
38
+
39
+
40
+
6
41
  # [3.34.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.33.0...v3.34.0) (2021-09-24)
7
42
 
8
43
 
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CrtSignerV4 = void 0;
4
+ const querystring_parser_1 = require("@aws-sdk/querystring-parser");
5
+ const signature_v4_1 = require("@aws-sdk/signature-v4");
6
+ const aws_crt_1 = require("aws-crt");
7
+ const constants_1 = require("./constants");
8
+ const headerUtil_1 = require("./headerUtil");
9
+ function sdkHttpRequest2crtHttpRequest(sdkRequest) {
10
+ headerUtil_1.deleteHeader(constants_1.SHA256_HEADER, sdkRequest.headers);
11
+ const headersArray = Object.entries(sdkRequest.headers);
12
+ const crtHttpHeaders = new aws_crt_1.http.HttpHeaders(headersArray);
13
+ const queryString = signature_v4_1.getCanonicalQuery(sdkRequest);
14
+ return new aws_crt_1.http.HttpRequest(sdkRequest.method, sdkRequest.path + "?" + queryString, crtHttpHeaders);
15
+ }
16
+ class CrtSignerV4 {
17
+ constructor({ credentials, region, service, sha256, applyChecksum = true, uriEscapePath = true, signingAlgorithm = aws_crt_1.auth.AwsSigningAlgorithm.SigV4, }) {
18
+ this.service = service;
19
+ this.sha256 = sha256;
20
+ this.uriEscapePath = uriEscapePath;
21
+ this.signingAlgorithm = signingAlgorithm;
22
+ this.applyChecksum = applyChecksum;
23
+ this.regionProvider = signature_v4_1.normalizeRegionProvider(region);
24
+ this.credentialProvider = signature_v4_1.normalizeCredentialsProvider(credentials);
25
+ aws_crt_1.io.enable_logging(aws_crt_1.io.LogLevel.ERROR);
26
+ }
27
+ async options2crtConfigure({ signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}, viaHeader, payloadHash, expiresIn) {
28
+ const credentials = await this.credentialProvider();
29
+ const region = signingRegion !== null && signingRegion !== void 0 ? signingRegion : (await this.regionProvider());
30
+ const service = signingService !== null && signingService !== void 0 ? signingService : this.service;
31
+ if ((signableHeaders === null || signableHeaders === void 0 ? void 0 : signableHeaders.has("x-amzn-trace-id")) || (signableHeaders === null || signableHeaders === void 0 ? void 0 : signableHeaders.has("user-agent"))) {
32
+ throw new Error("internal check (x-amzn-trace-id, user-agent) is not supported to be included to sign with CRT.");
33
+ }
34
+ const headersUnsignable = getHeadersUnsignable(unsignableHeaders, signableHeaders);
35
+ return {
36
+ algorithm: this.signingAlgorithm,
37
+ signature_type: viaHeader
38
+ ? aws_crt_1.auth.AwsSignatureType.HttpRequestViaHeaders
39
+ : aws_crt_1.auth.AwsSignatureType.HttpRequestViaQueryParams,
40
+ provider: sdk2crtCredentialsProvider(credentials),
41
+ region: region,
42
+ service: service,
43
+ date: new Date(signingDate),
44
+ header_blacklist: headersUnsignable,
45
+ use_double_uri_encode: this.uriEscapePath,
46
+ signed_body_value: payloadHash,
47
+ signed_body_header: this.applyChecksum && viaHeader
48
+ ? aws_crt_1.auth.AwsSignedBodyHeaderType.XAmzContentSha256
49
+ : aws_crt_1.auth.AwsSignedBodyHeaderType.None,
50
+ expiration_in_seconds: expiresIn,
51
+ };
52
+ }
53
+ async presign(originalRequest, options = {}) {
54
+ if (options.expiresIn && options.expiresIn > constants_1.MAX_PRESIGNED_TTL) {
55
+ return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future");
56
+ }
57
+ const request = signature_v4_1.moveHeadersToQuery(signature_v4_1.prepareRequest(originalRequest));
58
+ const crtSignedRequest = await this.signRequest(request, await this.options2crtConfigure(options, false, await signature_v4_1.getPayloadHash(originalRequest, this.sha256), options.expiresIn ? options.expiresIn : 3600));
59
+ request.query = this.getQueryParam(crtSignedRequest.path);
60
+ return request;
61
+ }
62
+ async sign(toSign, options) {
63
+ const request = signature_v4_1.prepareRequest(toSign);
64
+ const crtSignedRequest = await this.signRequest(request, await this.options2crtConfigure(options, true, await signature_v4_1.getPayloadHash(toSign, this.sha256)));
65
+ request.headers = crtSignedRequest.headers._flatten().reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
66
+ return request;
67
+ }
68
+ getQueryParam(crtPath) {
69
+ const start = crtPath.search(/\?/);
70
+ const startHash = crtPath.search(/\#/);
71
+ const end = startHash == -1 ? undefined : startHash;
72
+ const queryParam = {};
73
+ if (start == -1) {
74
+ return queryParam;
75
+ }
76
+ const queryString = crtPath.slice(start + 1, end);
77
+ return querystring_parser_1.parseQueryString(queryString);
78
+ }
79
+ async signRequest(requestToSign, crtConfig) {
80
+ const request = sdkHttpRequest2crtHttpRequest(requestToSign);
81
+ try {
82
+ return await aws_crt_1.auth.aws_sign_request(request, crtConfig);
83
+ }
84
+ catch (error) {
85
+ throw new Error(error);
86
+ }
87
+ }
88
+ async verifySigv4aSigning(request, signature, expectedCanonicalRequest, eccPubKeyX, eccPubKeyY, options = {}) {
89
+ const sdkRequest = signature_v4_1.prepareRequest(request);
90
+ const crtRequest = sdkHttpRequest2crtHttpRequest(sdkRequest);
91
+ const payloadHash = await signature_v4_1.getPayloadHash(request, this.sha256);
92
+ const crtConfig = await this.options2crtConfigure(options, true, payloadHash);
93
+ return aws_crt_1.auth.aws_verify_sigv4a_signing(crtRequest, crtConfig, expectedCanonicalRequest, signature, eccPubKeyX, eccPubKeyY);
94
+ }
95
+ async verifySigv4aPreSigning(request, signature, expectedCanonicalRequest, eccPubKeyX, eccPubKeyY, options = {}) {
96
+ if (typeof signature != "string") {
97
+ return false;
98
+ }
99
+ const sdkRequest = signature_v4_1.prepareRequest(request);
100
+ const crtRequest = sdkHttpRequest2crtHttpRequest(sdkRequest);
101
+ const crtConfig = await this.options2crtConfigure(options, false, await signature_v4_1.getPayloadHash(request, this.sha256), options.expiresIn ? options.expiresIn : 3600);
102
+ return aws_crt_1.auth.aws_verify_sigv4a_signing(crtRequest, crtConfig, expectedCanonicalRequest, signature, eccPubKeyX, eccPubKeyY);
103
+ }
104
+ }
105
+ exports.CrtSignerV4 = CrtSignerV4;
106
+ function sdk2crtCredentialsProvider(credentials) {
107
+ return aws_crt_1.auth.AwsCredentialsProvider.newStatic(credentials.accessKeyId, credentials.secretAccessKey, credentials.sessionToken);
108
+ }
109
+ function getHeadersUnsignable(unsignableHeaders, signableHeaders) {
110
+ if (!unsignableHeaders) {
111
+ return [];
112
+ }
113
+ if (!signableHeaders) {
114
+ return [...unsignableHeaders];
115
+ }
116
+ const result = new Set([...unsignableHeaders]);
117
+ for (let it = signableHeaders.values(), val = null; (val = it.next().value);) {
118
+ if (result.has(val)) {
119
+ result.delete(val);
120
+ }
121
+ }
122
+ return [...result];
123
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_PRESIGNED_TTL = exports.KEY_TYPE_IDENTIFIER = exports.MAX_CACHE_SIZE = exports.UNSIGNED_PAYLOAD = exports.EVENT_ALGORITHM_IDENTIFIER = exports.ALGORITHM_IDENTIFIER_V4A = exports.ALGORITHM_IDENTIFIER = exports.UNSIGNABLE_PATTERNS = exports.SEC_HEADER_PATTERN = exports.PROXY_HEADER_PATTERN = exports.ALWAYS_UNSIGNABLE_HEADERS = exports.HOST_HEADER = exports.TOKEN_HEADER = exports.SHA256_HEADER = exports.SIGNATURE_HEADER = exports.GENERATED_HEADERS = exports.DATE_HEADER = exports.AMZ_DATE_HEADER = exports.AUTH_HEADER = exports.REGION_SET_PARAM = exports.TOKEN_QUERY_PARAM = exports.SIGNATURE_QUERY_PARAM = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = void 0;
4
+ exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
5
+ exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
6
+ exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
7
+ exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
8
+ exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires";
9
+ exports.SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
10
+ exports.TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
11
+ exports.REGION_SET_PARAM = "X-Amz-Region-Set";
12
+ exports.AUTH_HEADER = "authorization";
13
+ exports.AMZ_DATE_HEADER = exports.AMZ_DATE_QUERY_PARAM.toLowerCase();
14
+ exports.DATE_HEADER = "date";
15
+ exports.GENERATED_HEADERS = [exports.AUTH_HEADER, exports.AMZ_DATE_HEADER, exports.DATE_HEADER];
16
+ exports.SIGNATURE_HEADER = exports.SIGNATURE_QUERY_PARAM.toLowerCase();
17
+ exports.SHA256_HEADER = "x-amz-content-sha256";
18
+ exports.TOKEN_HEADER = exports.TOKEN_QUERY_PARAM.toLowerCase();
19
+ exports.HOST_HEADER = "host";
20
+ exports.ALWAYS_UNSIGNABLE_HEADERS = {
21
+ authorization: true,
22
+ "cache-control": true,
23
+ connection: true,
24
+ expect: true,
25
+ from: true,
26
+ "keep-alive": true,
27
+ "max-forwards": true,
28
+ pragma: true,
29
+ referer: true,
30
+ te: true,
31
+ trailer: true,
32
+ "transfer-encoding": true,
33
+ upgrade: true,
34
+ "user-agent": true,
35
+ "x-amzn-trace-id": true,
36
+ };
37
+ exports.PROXY_HEADER_PATTERN = /^proxy-/;
38
+ exports.SEC_HEADER_PATTERN = /^sec-/;
39
+ exports.UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i];
40
+ exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
41
+ exports.ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256";
42
+ exports.EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
43
+ exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
44
+ exports.MAX_CACHE_SIZE = 50;
45
+ exports.KEY_TYPE_IDENTIFIER = "aws4_request";
46
+ exports.MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteHeader = exports.getHeaderValue = exports.hasHeader = void 0;
4
+ function hasHeader(soughtHeader, headers) {
5
+ soughtHeader = soughtHeader.toLowerCase();
6
+ for (const headerName of Object.keys(headers)) {
7
+ if (soughtHeader === headerName.toLowerCase()) {
8
+ return true;
9
+ }
10
+ }
11
+ return false;
12
+ }
13
+ exports.hasHeader = hasHeader;
14
+ function getHeaderValue(soughtHeader, headers) {
15
+ soughtHeader = soughtHeader.toLowerCase();
16
+ for (const headerName of Object.keys(headers)) {
17
+ if (soughtHeader === headerName.toLowerCase()) {
18
+ return headers[headerName];
19
+ }
20
+ }
21
+ return undefined;
22
+ }
23
+ exports.getHeaderValue = getHeaderValue;
24
+ function deleteHeader(soughtHeader, headers) {
25
+ soughtHeader = soughtHeader.toLowerCase();
26
+ for (const headerName of Object.keys(headers)) {
27
+ if (soughtHeader === headerName.toLowerCase()) {
28
+ delete headers[headerName];
29
+ }
30
+ }
31
+ }
32
+ exports.deleteHeader = deleteHeader;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./CrtSignerV4"), exports);
@@ -0,0 +1,386 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requests = exports.signingDate = exports.credentials = exports.service = exports.region = void 0;
4
+ exports.region = "us-east-1";
5
+ exports.service = "service";
6
+ exports.credentials = {
7
+ accessKeyId: "AKIDEXAMPLE",
8
+ secretAccessKey: "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY",
9
+ };
10
+ exports.signingDate = new Date("2015-08-30T12:36:00Z");
11
+ exports.requests = [
12
+ {
13
+ name: "get-header-key-duplicate",
14
+ request: {
15
+ protocol: "https:",
16
+ method: "GET",
17
+ hostname: "example.amazonaws.com",
18
+ query: {},
19
+ headers: {
20
+ host: "example.amazonaws.com",
21
+ "my-header1": "value2,value2,value1",
22
+ "x-amz-date": "20150830T123600Z",
23
+ },
24
+ path: "/",
25
+ },
26
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c9d5ea9f3f72853aea855b47ea873832890dbdd183b4468f858259531a5138ea",
27
+ },
28
+ {
29
+ name: "get-header-value-multiline",
30
+ request: {
31
+ protocol: "https:",
32
+ method: "GET",
33
+ hostname: "example.amazonaws.com",
34
+ query: {},
35
+ headers: {
36
+ host: "example.amazonaws.com",
37
+ "my-header1": "value1,value2,value3",
38
+ "x-amz-date": "20150830T123600Z",
39
+ },
40
+ path: "/",
41
+ },
42
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=ba17b383a53190154eb5fa66a1b836cc297cc0a3d70a5d00705980573d8ff790",
43
+ },
44
+ {
45
+ name: "get-header-value-order",
46
+ request: {
47
+ protocol: "https:",
48
+ method: "GET",
49
+ hostname: "example.amazonaws.com",
50
+ query: {},
51
+ headers: {
52
+ host: "example.amazonaws.com",
53
+ "my-header1": "value4,value1,value3,value2",
54
+ "x-amz-date": "20150830T123600Z",
55
+ },
56
+ path: "/",
57
+ },
58
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=08c7e5a9acfcfeb3ab6b2185e75ce8b1deb5e634ec47601a50643f830c755c01",
59
+ },
60
+ {
61
+ name: "get-header-value-trim",
62
+ request: {
63
+ protocol: "https:",
64
+ method: "GET",
65
+ hostname: "example.amazonaws.com",
66
+ query: {},
67
+ headers: {
68
+ host: "example.amazonaws.com",
69
+ "my-header1": "value1",
70
+ "my-header2": '"a b c"',
71
+ "x-amz-date": "20150830T123600Z",
72
+ },
73
+ path: "/",
74
+ },
75
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;my-header2;x-amz-date, Signature=acc3ed3afb60bb290fc8d2dd0098b9911fcaa05412b367055dee359757a9c736",
76
+ },
77
+ {
78
+ name: "get-unreserved",
79
+ request: {
80
+ protocol: "https:",
81
+ method: "GET",
82
+ hostname: "example.amazonaws.com",
83
+ query: {},
84
+ headers: {
85
+ host: "example.amazonaws.com",
86
+ "x-amz-date": "20150830T123600Z",
87
+ },
88
+ path: "/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
89
+ },
90
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=07ef7494c76fa4850883e2b006601f940f8a34d404d0cfa977f52a65bbf5f24f",
91
+ },
92
+ {
93
+ name: "get-utf8",
94
+ request: {
95
+ protocol: "https:",
96
+ method: "GET",
97
+ hostname: "example.amazonaws.com",
98
+ query: {},
99
+ headers: {
100
+ host: "example.amazonaws.com",
101
+ "x-amz-date": "20150830T123600Z",
102
+ },
103
+ path: "/ሴ",
104
+ },
105
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=8318018e0b0f223aa2bbf98705b62bb787dc9c0e678f255a891fd03141be5d85",
106
+ },
107
+ {
108
+ name: "get-vanilla",
109
+ request: {
110
+ protocol: "https:",
111
+ method: "GET",
112
+ hostname: "example.amazonaws.com",
113
+ query: {},
114
+ headers: {
115
+ host: "example.amazonaws.com",
116
+ "x-amz-date": "20150830T123600Z",
117
+ },
118
+ path: "/",
119
+ },
120
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31",
121
+ },
122
+ {
123
+ name: "get-vanilla-empty-query-key",
124
+ request: {
125
+ protocol: "https:",
126
+ method: "GET",
127
+ hostname: "example.amazonaws.com",
128
+ query: {
129
+ Param1: "value1",
130
+ },
131
+ headers: {
132
+ host: "example.amazonaws.com",
133
+ "x-amz-date": "20150830T123600Z",
134
+ },
135
+ path: "/",
136
+ },
137
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=a67d582fa61cc504c4bae71f336f98b97f1ea3c7a6bfe1b6e45aec72011b9aeb",
138
+ },
139
+ {
140
+ name: "get-vanilla-query",
141
+ request: {
142
+ protocol: "https:",
143
+ method: "GET",
144
+ hostname: "example.amazonaws.com",
145
+ query: {},
146
+ headers: {
147
+ host: "example.amazonaws.com",
148
+ "x-amz-date": "20150830T123600Z",
149
+ },
150
+ path: "/",
151
+ },
152
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31",
153
+ },
154
+ {
155
+ name: "get-vanilla-query-order-key-case",
156
+ request: {
157
+ protocol: "https:",
158
+ method: "GET",
159
+ hostname: "example.amazonaws.com",
160
+ query: {
161
+ Param2: "value2",
162
+ Param1: "value1",
163
+ },
164
+ headers: {
165
+ host: "example.amazonaws.com",
166
+ "x-amz-date": "20150830T123600Z",
167
+ },
168
+ path: "/",
169
+ },
170
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=b97d918cfa904a5beff61c982a1b6f458b799221646efd99d3219ec94cdf2500",
171
+ },
172
+ {
173
+ name: "get-vanilla-query-unreserved",
174
+ request: {
175
+ protocol: "https:",
176
+ method: "GET",
177
+ hostname: "example.amazonaws.com",
178
+ query: {
179
+ "-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz": "-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
180
+ },
181
+ headers: {
182
+ host: "example.amazonaws.com",
183
+ "x-amz-date": "20150830T123600Z",
184
+ },
185
+ path: "/",
186
+ },
187
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=9c3e54bfcdf0b19771a7f523ee5669cdf59bc7cc0884027167c21bb143a40197",
188
+ },
189
+ {
190
+ name: "get-vanilla-utf8-query",
191
+ request: {
192
+ protocol: "https:",
193
+ method: "GET",
194
+ hostname: "example.amazonaws.com",
195
+ query: {
196
+ ሴ: "bar",
197
+ },
198
+ headers: {
199
+ host: "example.amazonaws.com",
200
+ "x-amz-date": "20150830T123600Z",
201
+ },
202
+ path: "/",
203
+ },
204
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=2cdec8eed098649ff3a119c94853b13c643bcf08f8b0a1d91e12c9027818dd04",
205
+ },
206
+ {
207
+ name: "post-header-key-case",
208
+ request: {
209
+ protocol: "https:",
210
+ method: "POST",
211
+ hostname: "example.amazonaws.com",
212
+ query: {},
213
+ headers: {
214
+ host: "example.amazonaws.com",
215
+ "x-amz-date": "20150830T123600Z",
216
+ },
217
+ path: "/",
218
+ },
219
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b",
220
+ },
221
+ {
222
+ name: "post-header-key-sort",
223
+ request: {
224
+ protocol: "https:",
225
+ method: "POST",
226
+ hostname: "example.amazonaws.com",
227
+ query: {},
228
+ headers: {
229
+ host: "example.amazonaws.com",
230
+ "my-header1": "value1",
231
+ "x-amz-date": "20150830T123600Z",
232
+ },
233
+ path: "/",
234
+ },
235
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=c5410059b04c1ee005303aed430f6e6645f61f4dc9e1461ec8f8916fdf18852c",
236
+ },
237
+ {
238
+ name: "post-header-value-case",
239
+ request: {
240
+ protocol: "https:",
241
+ method: "POST",
242
+ hostname: "example.amazonaws.com",
243
+ query: {},
244
+ headers: {
245
+ host: "example.amazonaws.com",
246
+ "my-header1": "VALUE1",
247
+ "x-amz-date": "20150830T123600Z",
248
+ },
249
+ path: "/",
250
+ },
251
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;my-header1;x-amz-date, Signature=cdbc9802e29d2942e5e10b5bccfdd67c5f22c7c4e8ae67b53629efa58b974b7d",
252
+ },
253
+ {
254
+ name: "post-sts-header-after",
255
+ request: {
256
+ protocol: "https:",
257
+ method: "POST",
258
+ hostname: "example.amazonaws.com",
259
+ query: {},
260
+ headers: {
261
+ host: "example.amazonaws.com",
262
+ "x-amz-date": "20150830T123600Z",
263
+ },
264
+ path: "/",
265
+ },
266
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b",
267
+ },
268
+ {
269
+ name: "post-vanilla",
270
+ request: {
271
+ protocol: "https:",
272
+ method: "POST",
273
+ hostname: "example.amazonaws.com",
274
+ query: {},
275
+ headers: {
276
+ host: "example.amazonaws.com",
277
+ "x-amz-date": "20150830T123600Z",
278
+ },
279
+ path: "/",
280
+ },
281
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5da7c1a2acd57cee7505fc6676e4e544621c30862966e37dddb68e92efbe5d6b",
282
+ },
283
+ {
284
+ name: "post-vanilla-empty-query-value",
285
+ request: {
286
+ protocol: "https:",
287
+ method: "POST",
288
+ hostname: "example.amazonaws.com",
289
+ query: {
290
+ Param1: "value1",
291
+ },
292
+ headers: {
293
+ host: "example.amazonaws.com",
294
+ "x-amz-date": "20150830T123600Z",
295
+ },
296
+ path: "/",
297
+ },
298
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11",
299
+ },
300
+ {
301
+ name: "post-vanilla-query",
302
+ request: {
303
+ protocol: "https:",
304
+ method: "POST",
305
+ hostname: "example.amazonaws.com",
306
+ query: {
307
+ Param1: "value1",
308
+ },
309
+ headers: {
310
+ host: "example.amazonaws.com",
311
+ "x-amz-date": "20150830T123600Z",
312
+ },
313
+ path: "/",
314
+ },
315
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=28038455d6de14eafc1f9222cf5aa6f1a96197d7deb8263271d420d138af7f11",
316
+ },
317
+ {
318
+ name: "post-vanilla-query-nonunreserved",
319
+ request: {
320
+ protocol: "https:",
321
+ method: "POST",
322
+ hostname: "example.amazonaws.com",
323
+ query: {
324
+ "@#$%^": "",
325
+ "+": '/,?><`";:\\|][{}',
326
+ },
327
+ headers: {
328
+ host: "example.amazonaws.com",
329
+ "x-amz-date": "20150830T123600Z",
330
+ },
331
+ path: "/",
332
+ },
333
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=66c82657c86e26fb25238d0e69f011edc4c6df5ae71119d7cb98ed9b87393c1e",
334
+ },
335
+ {
336
+ name: "post-vanilla-query-space",
337
+ request: {
338
+ protocol: "https:",
339
+ method: "POST",
340
+ hostname: "example.amazonaws.com",
341
+ query: {
342
+ p: "",
343
+ },
344
+ headers: {
345
+ host: "example.amazonaws.com",
346
+ "x-amz-date": "20150830T123600Z",
347
+ },
348
+ path: "/",
349
+ },
350
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=e71688addb58a26418614085fb730ba3faa623b461c17f48f2fbdb9361b94a9b",
351
+ },
352
+ {
353
+ name: "post-x-www-form-urlencoded",
354
+ request: {
355
+ protocol: "https:",
356
+ method: "POST",
357
+ hostname: "example.amazonaws.com",
358
+ query: {},
359
+ headers: {
360
+ "content-type": "application/x-www-form-urlencoded",
361
+ host: "example.amazonaws.com",
362
+ "x-amz-date": "20150830T123600Z",
363
+ },
364
+ body: "Param1=value1",
365
+ path: "/",
366
+ },
367
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=ff11897932ad3f4e8b18135d722051e5ac45fc38421b1da7b9d196a0fe09473a",
368
+ },
369
+ {
370
+ name: "post-x-www-form-urlencoded-parameters",
371
+ request: {
372
+ protocol: "https:",
373
+ method: "POST",
374
+ hostname: "example.amazonaws.com",
375
+ query: {},
376
+ headers: {
377
+ "content-type": "application/x-www-form-urlencoded; charset=utf8",
378
+ host: "example.amazonaws.com",
379
+ "x-amz-date": "20150830T123600Z",
380
+ },
381
+ body: "Param1=value1",
382
+ path: "/",
383
+ },
384
+ authorization: "AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=1a72ec8f64bd914b0e42e42607c7fbce7fb2c7465f63e3092b3b0d39fa77a6fe",
385
+ },
386
+ ];