@aws-amplify/core 5.2.1-unstable.eca5078.2 → 5.3.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/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Platform/version.js.map +1 -1
- package/lib/Signer.d.ts +1 -1
- package/lib/Signer.js +59 -256
- package/lib/Signer.js.map +1 -1
- package/lib/clients/middleware/signing/signer/signatureV4/constants.d.ts +17 -0
- package/lib/clients/middleware/signing/signer/signatureV4/constants.js +26 -0
- package/lib/clients/middleware/signing/signer/signatureV4/constants.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.d.ts +3 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.js +12 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.d.ts +4 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +13 -0
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.d.ts +9 -0
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js +40 -0
- package/lib/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/signRequest.d.ts +10 -0
- package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js +36 -0
- package/lib/clients/middleware/signing/signer/signatureV4/signRequest.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/types/index.d.ts +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/types/index.js +5 -0
- package/lib/clients/middleware/signing/signer/signatureV4/types/index.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/types/signer.d.ts +20 -0
- package/lib/clients/middleware/signing/signer/signatureV4/types/signer.js +5 -0
- package/lib/clients/middleware/signing/signer/signatureV4/types/signer.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.d.ts +18 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +35 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +12 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +31 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.d.ts +12 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +39 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.d.ts +16 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +35 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.d.ts +10 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +17 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.d.ts +12 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +18 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.d.ts +12 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +22 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +10 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +35 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.d.ts +13 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +31 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignature.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +10 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +20 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.d.ts +13 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +27 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.d.ts +11 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +34 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js.map +1 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.d.ts +16 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +24 -0
- package/lib/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js.map +1 -0
- package/lib/clients/types/aws.d.ts +2 -0
- package/lib/clients/types/aws.js +5 -0
- package/lib/clients/types/aws.js.map +1 -0
- package/lib/clients/types/core.d.ts +13 -0
- package/lib/clients/types/core.js +5 -0
- package/lib/clients/types/core.js.map +1 -0
- package/lib/clients/types/http.d.ts +26 -0
- package/lib/clients/types/http.js +5 -0
- package/lib/clients/types/http.js.map +1 -0
- package/lib/clients/types/index.d.ts +2 -0
- package/lib/clients/types/index.js +5 -0
- package/lib/clients/types/index.js.map +1 -0
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Platform/version.js.map +1 -1
- package/lib-esm/Signer.d.ts +1 -1
- package/lib-esm/Signer.js +60 -257
- package/lib-esm/Signer.js.map +1 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.d.ts +17 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js +24 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/constants.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.d.ts +3 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js +7 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.d.ts +4 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +8 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.d.ts +9 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js +38 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/presignUrl.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.d.ts +10 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js +34 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/signRequest.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.d.ts +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.js +3 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/index.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.d.ts +20 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.js +3 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/types/signer.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.d.ts +18 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +33 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.d.ts +12 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js +29 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.d.ts +12 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js +37 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.d.ts +16 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js +33 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.d.ts +10 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js +15 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.d.ts +12 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js +16 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.d.ts +12 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js +20 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.d.ts +10 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js +33 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.d.ts +13 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js +29 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.d.ts +10 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js +18 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.d.ts +13 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js +25 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.d.ts +11 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js +32 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.js.map +1 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.d.ts +16 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js +22 -0
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.js.map +1 -0
- package/lib-esm/clients/types/aws.d.ts +2 -0
- package/lib-esm/clients/types/aws.js +3 -0
- package/lib-esm/clients/types/aws.js.map +1 -0
- package/lib-esm/clients/types/core.d.ts +13 -0
- package/lib-esm/clients/types/core.js +3 -0
- package/lib-esm/clients/types/core.js.map +1 -0
- package/lib-esm/clients/types/http.d.ts +26 -0
- package/lib-esm/clients/types/http.js +3 -0
- package/lib-esm/clients/types/http.js.map +1 -0
- package/lib-esm/clients/types/index.d.ts +2 -0
- package/lib-esm/clients/types/index.js +3 -0
- package/lib-esm/clients/types/index.js.map +1 -0
- package/package.json +6 -2
- package/src/Platform/version.ts +1 -1
- package/src/Signer.ts +89 -344
- package/src/clients/middleware/signing/signer/signatureV4/constants.ts +28 -0
- package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +9 -0
- package/src/clients/middleware/signing/signer/signatureV4/index.ts +7 -0
- package/src/clients/middleware/signing/signer/signatureV4/presignUrl.ts +59 -0
- package/src/clients/middleware/signing/signer/signatureV4/signRequest.ts +51 -0
- package/src/clients/middleware/signing/signer/signatureV4/types/index.ts +4 -0
- package/src/clients/middleware/signing/signer/signatureV4/types/signer.ts +31 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +42 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.ts +25 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.ts +32 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.ts +38 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.ts +14 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.ts +21 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.ts +22 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.ts +38 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSignature.ts +52 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.ts +19 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.ts +31 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.ts +43 -0
- package/src/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.ts +28 -0
- package/src/clients/types/aws.ts +6 -0
- package/src/clients/types/core.ts +17 -0
- package/src/clients/types/http.ts +33 -0
- package/src/clients/types/index.ts +5 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../../../src/clients/middleware/signing/signer/signatureV4/index.native.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,gCAAgC,CAAC;AAExC,0BAA0B;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Presignable, PresignUrlOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Given a `Presignable` object, returns a Signature Version 4 presigned `URL` object.
|
|
4
|
+
*
|
|
5
|
+
* @param presignable `Presignable` object containing at least a url to be presigned with authentication query params.
|
|
6
|
+
* @param presignUrlOptions `PresignUrlOptions` object containing values used to construct the signature.
|
|
7
|
+
* @returns A `URL` with authentication query params which can grant temporary access to AWS resources.
|
|
8
|
+
*/
|
|
9
|
+
export declare const presignUrl: ({ body, method, url }: Presignable, { expiration, ...options }: PresignUrlOptions) => URL;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __assign, __read, __rest } from "tslib";
|
|
4
|
+
import { ALGORITHM_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, EXPIRES_QUERY_PARAM, HOST_HEADER, SHA256_ALGORITHM_IDENTIFIER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_QUERY_PARAM, } from './constants';
|
|
5
|
+
import { getSigningValues } from './utils/getSigningValues';
|
|
6
|
+
import { getSignature } from './utils/getSignature';
|
|
7
|
+
/**
|
|
8
|
+
* Given a `Presignable` object, returns a Signature Version 4 presigned `URL` object.
|
|
9
|
+
*
|
|
10
|
+
* @param presignable `Presignable` object containing at least a url to be presigned with authentication query params.
|
|
11
|
+
* @param presignUrlOptions `PresignUrlOptions` object containing values used to construct the signature.
|
|
12
|
+
* @returns A `URL` with authentication query params which can grant temporary access to AWS resources.
|
|
13
|
+
*/
|
|
14
|
+
export var presignUrl = function (_a, _b) {
|
|
15
|
+
var _c, _d, _e, _f;
|
|
16
|
+
var body = _a.body, _g = _a.method, method = _g === void 0 ? 'GET' : _g, url = _a.url;
|
|
17
|
+
var expiration = _b.expiration, options = __rest(_b, ["expiration"]);
|
|
18
|
+
var signingValues = getSigningValues(options);
|
|
19
|
+
var accessKeyId = signingValues.accessKeyId, credentialScope = signingValues.credentialScope, longDate = signingValues.longDate, sessionToken = signingValues.sessionToken;
|
|
20
|
+
// create the request to sign
|
|
21
|
+
// @ts-ignore URL constructor accepts a URL object
|
|
22
|
+
var presignedUrl = new URL(url);
|
|
23
|
+
Object.entries(__assign(__assign((_c = {}, _c[ALGORITHM_QUERY_PARAM] = SHA256_ALGORITHM_IDENTIFIER, _c[CREDENTIAL_QUERY_PARAM] = accessKeyId + "/" + credentialScope, _c[AMZ_DATE_QUERY_PARAM] = longDate, _c[SIGNED_HEADERS_QUERY_PARAM] = HOST_HEADER, _c), (expiration && (_d = {}, _d[EXPIRES_QUERY_PARAM] = expiration.toString(), _d))), (sessionToken && (_e = {}, _e[TOKEN_QUERY_PARAM] = sessionToken, _e)))).forEach(function (_a) {
|
|
24
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
25
|
+
presignedUrl.searchParams.append(key, value);
|
|
26
|
+
});
|
|
27
|
+
var requestToSign = {
|
|
28
|
+
body: body,
|
|
29
|
+
headers: (_f = {}, _f[HOST_HEADER] = url.host, _f),
|
|
30
|
+
method: method,
|
|
31
|
+
url: presignedUrl,
|
|
32
|
+
};
|
|
33
|
+
// calculate and add the signature to the url
|
|
34
|
+
var signature = getSignature(requestToSign, signingValues);
|
|
35
|
+
presignedUrl.searchParams.append(SIGNATURE_QUERY_PARAM, signature);
|
|
36
|
+
return presignedUrl;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=presignUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presignUrl.js","sourceRoot":"","sources":["../../../../../../src/clients/middleware/signing/signer/signatureV4/presignUrl.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAGtC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,UAAU,GAAG,UACzB,EAA0C,EAC1C,EAA6C;;QAD3C,cAAI,EAAE,cAAc,EAAd,mCAAc,EAAE,YAAG;IACzB,IAAA,0BAAU,EAAE,oCAAU;IAExB,IAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAA,uCAAW,EAAE,+CAAe,EAAE,iCAAQ,EAAE,yCAAY,CAC7C;IAEf,6BAA6B;IAC7B,kDAAkD;IAClD,IAAM,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,CAAC,OAAO,gCACZ,qBAAqB,IAAG,2BAA2B,KACnD,sBAAsB,IAAM,WAAW,SAAI,eAAiB,KAC5D,oBAAoB,IAAG,QAAQ,KAC/B,0BAA0B,IAAG,WAAW,OACtC,CAAC,UAAU,cAAM,GAAC,mBAAmB,IAAG,UAAU,CAAC,QAAQ,EAAE,KAAE,CAAC,GAChE,CAAC,YAAY,cAAM,GAAC,iBAAiB,IAAG,YAAY,KAAE,CAAC,EACzD,CAAC,OAAO,CAAC,UAAC,EAAY;YAAZ,kBAAY,EAAX,WAAG,EAAE,aAAK;QACtB,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,IAAM,aAAa,GAAG;QACrB,IAAI,MAAA;QACJ,OAAO,YAAI,GAAC,WAAW,IAAG,GAAG,CAAC,IAAI,KAAE;QACpC,MAAM,QAAA;QACN,GAAG,EAAE,YAAY;KACjB,CAAC;IAEF,6CAA6C;IAC7C,IAAM,SAAS,GAAG,YAAY,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAC7D,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAEnE,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpRequest } from '../../../../types';
|
|
2
|
+
import { SignRequestOptions } from './types/signer';
|
|
3
|
+
/**
|
|
4
|
+
* Given a `HttpRequest`, returns a Signature Version 4 signed `HttpRequest`.
|
|
5
|
+
*
|
|
6
|
+
* @param request `HttpRequest` to be signed.
|
|
7
|
+
* @param signRequestOptions `SignRequestOptions` object containing values used to construct the signature.
|
|
8
|
+
* @returns A `HttpRequest` with authentication headers which can grant temporary access to AWS resources.
|
|
9
|
+
*/
|
|
10
|
+
export declare const signRequest: (request: HttpRequest, options: SignRequestOptions) => HttpRequest;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __assign } from "tslib";
|
|
4
|
+
import { getSignedHeaders } from './utils/getSignedHeaders';
|
|
5
|
+
import { getSigningValues } from './utils/getSigningValues';
|
|
6
|
+
import { AMZ_DATE_HEADER, AUTH_HEADER, HOST_HEADER, SHA256_ALGORITHM_IDENTIFIER, TOKEN_HEADER, } from './constants';
|
|
7
|
+
import { getSignature } from './utils/getSignature';
|
|
8
|
+
/**
|
|
9
|
+
* Given a `HttpRequest`, returns a Signature Version 4 signed `HttpRequest`.
|
|
10
|
+
*
|
|
11
|
+
* @param request `HttpRequest` to be signed.
|
|
12
|
+
* @param signRequestOptions `SignRequestOptions` object containing values used to construct the signature.
|
|
13
|
+
* @returns A `HttpRequest` with authentication headers which can grant temporary access to AWS resources.
|
|
14
|
+
*/
|
|
15
|
+
export var signRequest = function (request, options) {
|
|
16
|
+
var signingValues = getSigningValues(options);
|
|
17
|
+
var accessKeyId = signingValues.accessKeyId, credentialScope = signingValues.credentialScope, longDate = signingValues.longDate, sessionToken = signingValues.sessionToken;
|
|
18
|
+
// create the request to sign
|
|
19
|
+
var headers = __assign({}, request.headers);
|
|
20
|
+
headers[HOST_HEADER] = request.url.host;
|
|
21
|
+
headers[AMZ_DATE_HEADER] = longDate;
|
|
22
|
+
if (sessionToken) {
|
|
23
|
+
headers[TOKEN_HEADER] = sessionToken;
|
|
24
|
+
}
|
|
25
|
+
var requestToSign = __assign(__assign({}, request), { headers: headers });
|
|
26
|
+
// calculate and add the signature to the request
|
|
27
|
+
var signature = getSignature(requestToSign, signingValues);
|
|
28
|
+
var credentialEntry = "Credential=" + accessKeyId + "/" + credentialScope;
|
|
29
|
+
var signedHeadersEntry = "SignedHeaders=" + getSignedHeaders(headers);
|
|
30
|
+
var signatureEntry = "Signature=" + signature;
|
|
31
|
+
headers[AUTH_HEADER] = SHA256_ALGORITHM_IDENTIFIER + " " + credentialEntry + ", " + signedHeadersEntry + ", " + signatureEntry;
|
|
32
|
+
return requestToSign;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=signRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signRequest.js","sourceRoot":"","sources":["../../../../../../src/clients/middleware/signing/signer/signatureV4/signRequest.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAItC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,2BAA2B,EAC3B,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,UAC1B,OAAoB,EACpB,OAA2B;IAE3B,IAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAA,uCAAW,EAAE,+CAAe,EAAE,iCAAQ,EAAE,yCAAY,CAC7C;IAEf,6BAA6B;IAC7B,IAAM,OAAO,gBAAQ,OAAO,CAAC,OAAO,CAAE,CAAC;IACvC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;IACxC,OAAO,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC;IACpC,IAAI,YAAY,EAAE;QACjB,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;KACrC;IACD,IAAM,aAAa,yBAAQ,OAAO,KAAE,OAAO,SAAA,GAAE,CAAC;IAE9C,iDAAiD;IACjD,IAAM,SAAS,GAAG,YAAY,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAC7D,IAAM,eAAe,GAAG,gBAAc,WAAW,SAAI,eAAiB,CAAC;IACvE,IAAM,kBAAkB,GAAG,mBAAiB,gBAAgB,CAAC,OAAO,CAAG,CAAC;IACxE,IAAM,cAAc,GAAG,eAAa,SAAW,CAAC;IAChD,OAAO,CACN,WAAW,CACX,GAAM,2BAA2B,SAAI,eAAe,UAAK,kBAAkB,UAAK,cAAgB,CAAC;IAElG,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Presignable, PresignUrlOptions, SignRequestOptions } from './signer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Credentials, HttpRequest } from '../../../../../types';
|
|
2
|
+
export interface SignRequestOptions {
|
|
3
|
+
credentials: Credentials;
|
|
4
|
+
signingDate?: Date;
|
|
5
|
+
signingRegion: string;
|
|
6
|
+
signingService: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PresignUrlOptions extends SignRequestOptions {
|
|
9
|
+
expiration?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Presignable extends Pick<HttpRequest, 'body' | 'url'> {
|
|
12
|
+
method?: HttpRequest['method'];
|
|
13
|
+
}
|
|
14
|
+
export interface FormattedDates {
|
|
15
|
+
longDate: string;
|
|
16
|
+
shortDate: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SigningValues extends Credentials, FormattedDates, Pick<SignRequestOptions, 'signingRegion' | 'signingService'> {
|
|
19
|
+
credentialScope: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/types/signer.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the hashed data a `Uint8Array`.
|
|
3
|
+
*
|
|
4
|
+
* @param key `SourceData` to be used as hashing key.
|
|
5
|
+
* @param data Hashable `SourceData`.
|
|
6
|
+
* @returns `Uint8Array` created from the data as input to a hash function.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getHashedData: (key: string | ArrayBuffer | ArrayBufferView, data: string | ArrayBuffer | ArrayBufferView) => Uint8Array;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the hashed data as a hex string.
|
|
11
|
+
*
|
|
12
|
+
* @param key `SourceData` to be used as hashing key.
|
|
13
|
+
* @param data Hashable `SourceData`.
|
|
14
|
+
* @returns String using lowercase hexadecimal characters created from the data as input to a hash function.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const getHashedDataAsHex: (key: string | ArrayBuffer | ArrayBufferView, data: string | ArrayBuffer | ArrayBufferView) => string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// TODO: V6 update to different crypto dependency?
|
|
4
|
+
import { Sha256 } from '@aws-crypto/sha256-js';
|
|
5
|
+
import { toHex } from '@aws-sdk/util-hex-encoding';
|
|
6
|
+
/**
|
|
7
|
+
* Returns the hashed data a `Uint8Array`.
|
|
8
|
+
*
|
|
9
|
+
* @param key `SourceData` to be used as hashing key.
|
|
10
|
+
* @param data Hashable `SourceData`.
|
|
11
|
+
* @returns `Uint8Array` created from the data as input to a hash function.
|
|
12
|
+
*/
|
|
13
|
+
export var getHashedData = function (key, data) {
|
|
14
|
+
var sha256 = new Sha256(key);
|
|
15
|
+
sha256.update(data);
|
|
16
|
+
// TODO: V6 flip to async digest
|
|
17
|
+
var hashedData = sha256.digestSync();
|
|
18
|
+
return hashedData;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Returns the hashed data as a hex string.
|
|
22
|
+
*
|
|
23
|
+
* @param key `SourceData` to be used as hashing key.
|
|
24
|
+
* @param data Hashable `SourceData`.
|
|
25
|
+
* @returns String using lowercase hexadecimal characters created from the data as input to a hash function.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export var getHashedDataAsHex = function (key, data) {
|
|
30
|
+
var hashedData = getHashedData(key, data);
|
|
31
|
+
return toHex(hashedData);
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=dataHashHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataHashHelpers.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,kDAAkD;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,UAC5B,GAAsB,EACtB,IAAgB;IAEhB,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,gCAAgC;IAChC,IAAM,UAAU,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACvC,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,kBAAkB,GAAG,UACjC,GAAsB,EACtB,IAAgB;IAEhB,IAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns canonical headers.
|
|
3
|
+
*
|
|
4
|
+
* @param headers Headers from the request.
|
|
5
|
+
* @returns Request headers that will be signed, and their values, separated by newline characters. Header names must
|
|
6
|
+
* use lowercase characters, must appear in alphabetical order, and must be followed by a colon (:). For the values,
|
|
7
|
+
* trim any leading or trailing spaces, convert sequential spaces to a single space, and separate the values
|
|
8
|
+
* for a multi-value header using commas.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const getCanonicalHeaders: (headers: Record<string, string>) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __read } from "tslib";
|
|
4
|
+
/**
|
|
5
|
+
* Returns canonical headers.
|
|
6
|
+
*
|
|
7
|
+
* @param headers Headers from the request.
|
|
8
|
+
* @returns Request headers that will be signed, and their values, separated by newline characters. Header names must
|
|
9
|
+
* use lowercase characters, must appear in alphabetical order, and must be followed by a colon (:). For the values,
|
|
10
|
+
* trim any leading or trailing spaces, convert sequential spaces to a single space, and separate the values
|
|
11
|
+
* for a multi-value header using commas.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export var getCanonicalHeaders = function (headers) {
|
|
16
|
+
return Object.entries(headers)
|
|
17
|
+
.map(function (_a) {
|
|
18
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
19
|
+
var _c;
|
|
20
|
+
return ({
|
|
21
|
+
key: key.toLowerCase(),
|
|
22
|
+
value: (_c = value === null || value === void 0 ? void 0 : value.trim().replace(/\s+/g, ' ')) !== null && _c !== void 0 ? _c : '',
|
|
23
|
+
});
|
|
24
|
+
})
|
|
25
|
+
.sort(function (a, b) { return (a.key < b.key ? -1 : 1); })
|
|
26
|
+
.map(function (entry) { return entry.key + ":" + entry.value + "\n"; })
|
|
27
|
+
.join('');
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=getCanonicalHeaders.js.map
|
package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCanonicalHeaders.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAItC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,OAA+B;IAClE,OAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SACrB,GAAG,CAAC,UAAC,EAAY;YAAZ,kBAAY,EAAX,WAAG,EAAE,aAAK;;QAAM,OAAA,CAAC;YACvB,GAAG,EAAE,GAAG,CAAC,WAAW,EAAE;YACtB,KAAK,QAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,oCAAK,EAAE;SAC/C,CAAC,CAAA;KAAA,CAAC;SACF,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAxB,CAAwB,CAAC;SACxC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAG,KAAK,CAAC,GAAG,SAAI,KAAK,CAAC,KAAK,OAAI,EAA/B,CAA+B,CAAC;SAC7C,IAAI,CAAC,EAAE,CAAC;AAPV,CAOU,CAAC"}
|
package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a canonical query string.
|
|
3
|
+
*
|
|
4
|
+
* @param searchParams `searchParams` from the request url.
|
|
5
|
+
* @returns URL-encoded query string parameters, separated by ampersands (&). Percent-encode reserved characters,
|
|
6
|
+
* including the space character. Encode names and values separately. If there are empty parameters, append the equals
|
|
7
|
+
* sign to the parameter name before encoding. After encoding, sort the parameters alphabetically by key name. If there
|
|
8
|
+
* is no query string, use an empty string ("").
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const getCanonicalQueryString: (searchParams: URLSearchParams) => string;
|
package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __read } from "tslib";
|
|
4
|
+
/**
|
|
5
|
+
* Returns a canonical query string.
|
|
6
|
+
*
|
|
7
|
+
* @param searchParams `searchParams` from the request url.
|
|
8
|
+
* @returns URL-encoded query string parameters, separated by ampersands (&). Percent-encode reserved characters,
|
|
9
|
+
* including the space character. Encode names and values separately. If there are empty parameters, append the equals
|
|
10
|
+
* sign to the parameter name before encoding. After encoding, sort the parameters alphabetically by key name. If there
|
|
11
|
+
* is no query string, use an empty string ("").
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export var getCanonicalQueryString = function (searchParams) {
|
|
16
|
+
return Array.from(searchParams)
|
|
17
|
+
.sort(function (_a, _b) {
|
|
18
|
+
var _c = __read(_a, 2), keyA = _c[0], valA = _c[1];
|
|
19
|
+
var _d = __read(_b, 2), keyB = _d[0], valB = _d[1];
|
|
20
|
+
if (keyA === keyB) {
|
|
21
|
+
return valA < valB ? -1 : 1;
|
|
22
|
+
}
|
|
23
|
+
return keyA < keyB ? -1 : 1;
|
|
24
|
+
})
|
|
25
|
+
.map(function (_a) {
|
|
26
|
+
var _b = __read(_a, 2), key = _b[0], val = _b[1];
|
|
27
|
+
return escapeUri(key) + "=" + escapeUri(val);
|
|
28
|
+
})
|
|
29
|
+
.join('&');
|
|
30
|
+
};
|
|
31
|
+
var escapeUri = function (uri) {
|
|
32
|
+
return encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
|
|
33
|
+
};
|
|
34
|
+
var hexEncode = function (c) {
|
|
35
|
+
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=getCanonicalQueryString.js.map
|
package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCanonicalQueryString.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,IAAM,uBAAuB,GAAG,UACtC,YAA6B;IAE7B,OAAA,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC;SACtB,IAAI,CAAC,UAAC,EAAY,EAAE,EAAY;YAA1B,kBAAY,EAAX,YAAI,EAAE,YAAI;YAAG,kBAAY,EAAX,YAAI,EAAE,YAAI;QAC/B,IAAI,IAAI,KAAK,IAAI,EAAE;YAClB,OAAO,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5B;QACD,OAAO,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC;SACD,GAAG,CAAC,UAAC,EAAU;YAAV,kBAAU,EAAT,WAAG,EAAE,WAAG;QAAM,OAAG,SAAS,CAAC,GAAG,CAAC,SAAI,SAAS,CAAC,GAAG,CAAG;IAArC,CAAqC,CAAC;SAC1D,IAAI,CAAC,GAAG,CAAC;AARX,CAQW,CAAC;AAEb,IAAM,SAAS,GAAG,UAAC,GAAW;IAC7B,OAAA,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC;AAAtD,CAAsD,CAAC;AAExD,IAAM,SAAS,GAAG,UAAC,CAAS;IAC3B,OAAA,MAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAI;AAAhD,CAAgD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HttpRequest } from '../../../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a canonical request.
|
|
4
|
+
*
|
|
5
|
+
* @param request `HttpRequest` from which to create the canonical request from.
|
|
6
|
+
* @returns String created by by concatenating the following strings, separated by newline characters:
|
|
7
|
+
* - HTTPMethod
|
|
8
|
+
* - CanonicalUri
|
|
9
|
+
* - CanonicalQueryString
|
|
10
|
+
* - CanonicalHeaders
|
|
11
|
+
* - SignedHeaders
|
|
12
|
+
* - HashedPayload
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const getCanonicalRequest: ({ body, headers, method, url, }: HttpRequest) => string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { getCanonicalHeaders } from './getCanonicalHeaders';
|
|
4
|
+
import { getCanonicalQueryString } from './getCanonicalQueryString';
|
|
5
|
+
import { getCanonicalUri } from './getCanonicalUri';
|
|
6
|
+
import { getHashedPayload } from './getHashedPayload';
|
|
7
|
+
import { getSignedHeaders } from './getSignedHeaders';
|
|
8
|
+
/**
|
|
9
|
+
* Returns a canonical request.
|
|
10
|
+
*
|
|
11
|
+
* @param request `HttpRequest` from which to create the canonical request from.
|
|
12
|
+
* @returns String created by by concatenating the following strings, separated by newline characters:
|
|
13
|
+
* - HTTPMethod
|
|
14
|
+
* - CanonicalUri
|
|
15
|
+
* - CanonicalQueryString
|
|
16
|
+
* - CanonicalHeaders
|
|
17
|
+
* - SignedHeaders
|
|
18
|
+
* - HashedPayload
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export var getCanonicalRequest = function (_a) {
|
|
23
|
+
var body = _a.body, headers = _a.headers, method = _a.method, url = _a.url;
|
|
24
|
+
return [
|
|
25
|
+
method,
|
|
26
|
+
getCanonicalUri(url.pathname),
|
|
27
|
+
getCanonicalQueryString(url.searchParams),
|
|
28
|
+
getCanonicalHeaders(headers),
|
|
29
|
+
getSignedHeaders(headers),
|
|
30
|
+
getHashedPayload(body),
|
|
31
|
+
].join('\n');
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=getCanonicalRequest.js.map
|
package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCanonicalRequest.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,EAKtB;QAJb,cAAI,EACJ,oBAAO,EACP,kBAAM,EACN,YAAG;IAEH,OAAA;QACC,MAAM;QACN,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC7B,uBAAuB,CAAC,GAAG,CAAC,YAAY,CAAC;QACzC,mBAAmB,CAAC,OAAO,CAAC;QAC5B,gBAAgB,CAAC,OAAO,CAAC;QACzB,gBAAgB,CAAC,IAAI,CAAC;KACtB,CAAC,IAAI,CAAC,IAAI,CAAC;AAPZ,CAOY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a canonical uri.
|
|
3
|
+
*
|
|
4
|
+
* @param pathname `pathname` from request url.
|
|
5
|
+
* @returns URI-encoded version of the absolute path component URL (everything between the host and the question mark
|
|
6
|
+
* character (?) that starts the query string parameters). If the absolute path is empty, a forward slash character (/).
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const getCanonicalUri: (pathname: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Returns a canonical uri.
|
|
5
|
+
*
|
|
6
|
+
* @param pathname `pathname` from request url.
|
|
7
|
+
* @returns URI-encoded version of the absolute path component URL (everything between the host and the question mark
|
|
8
|
+
* character (?) that starts the query string parameters). If the absolute path is empty, a forward slash character (/).
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export var getCanonicalUri = function (pathname) {
|
|
13
|
+
return pathname ? encodeURIComponent(pathname).replace(/%2F/g, '/') : '/';
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=getCanonicalUri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCanonicalUri.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,QAAgB;IAC/C,OAAA,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;AAAlE,CAAkE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the credential scope which restricts the resulting signature to the specified region and service.
|
|
3
|
+
*
|
|
4
|
+
* @param date Current date in the format 'YYYYMMDD'.
|
|
5
|
+
* @param region AWS region in which the service resides.
|
|
6
|
+
* @param service Service to which the signed request is being sent.
|
|
7
|
+
*
|
|
8
|
+
* @returns A string representing the credential scope with format 'YYYYMMDD/region/service/aws4_request'.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const getCredentialScope: (date: string, region: string, service: string) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { KEY_TYPE_IDENTIFIER } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the credential scope which restricts the resulting signature to the specified region and service.
|
|
6
|
+
*
|
|
7
|
+
* @param date Current date in the format 'YYYYMMDD'.
|
|
8
|
+
* @param region AWS region in which the service resides.
|
|
9
|
+
* @param service Service to which the signed request is being sent.
|
|
10
|
+
*
|
|
11
|
+
* @returns A string representing the credential scope with format 'YYYYMMDD/region/service/aws4_request'.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export var getCredentialScope = function (date, region, service) { return date + "/" + region + "/" + service + "/" + KEY_TYPE_IDENTIFIER; };
|
|
16
|
+
//# sourceMappingURL=getCredentialScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCredentialScope.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,IAAM,kBAAkB,GAAG,UACjC,IAAY,EACZ,MAAc,EACd,OAAe,IACH,OAAG,IAAI,SAAI,MAAM,SAAI,OAAO,SAAI,mBAAqB,EAArD,CAAqD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FormattedDates } from '../types/signer';
|
|
2
|
+
/**
|
|
3
|
+
* Returns expected date strings to be used in signing.
|
|
4
|
+
*
|
|
5
|
+
* @param date JavaScript `Date` object.
|
|
6
|
+
* @returns `FormattedDates` object containing the following:
|
|
7
|
+
* - longDate: A date string in 'YYYYMMDDThhmmssZ' format
|
|
8
|
+
* - shortDate: A date string in 'YYYYMMDD' format
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const getFormattedDates: (date: Date) => FormattedDates;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Returns expected date strings to be used in signing.
|
|
5
|
+
*
|
|
6
|
+
* @param date JavaScript `Date` object.
|
|
7
|
+
* @returns `FormattedDates` object containing the following:
|
|
8
|
+
* - longDate: A date string in 'YYYYMMDDThhmmssZ' format
|
|
9
|
+
* - shortDate: A date string in 'YYYYMMDD' format
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export var getFormattedDates = function (date) {
|
|
14
|
+
var longDate = date.toISOString().replace(/[:\-]|\.\d{3}/g, '');
|
|
15
|
+
return {
|
|
16
|
+
longDate: longDate,
|
|
17
|
+
shortDate: longDate.slice(0, 8),
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=getFormattedDates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFormattedDates.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC;;;;;;;;;GASG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,IAAU;IAC3C,IAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAClE,OAAO;QACN,QAAQ,UAAA;QACR,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;KAC/B,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the hashed payload.
|
|
3
|
+
*
|
|
4
|
+
* @param body `body` (payload) from the request.
|
|
5
|
+
* @returns String created using the payload in the body of the HTTP request as input to a hash function. This string
|
|
6
|
+
* uses lowercase hexadecimal characters. If the payload is empty, return precalculated result of an empty hash.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const getHashedPayload: (body: BodyInit) => string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { EMPTY_HASH, UNSIGNED_PAYLOAD } from '../constants';
|
|
4
|
+
import { getHashedDataAsHex } from './dataHashHelpers';
|
|
5
|
+
/**
|
|
6
|
+
* Returns the hashed payload.
|
|
7
|
+
*
|
|
8
|
+
* @param body `body` (payload) from the request.
|
|
9
|
+
* @returns String created using the payload in the body of the HTTP request as input to a hash function. This string
|
|
10
|
+
* uses lowercase hexadecimal characters. If the payload is empty, return precalculated result of an empty hash.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export var getHashedPayload = function (body) {
|
|
15
|
+
// return precalculated empty hash if body is undefined or null
|
|
16
|
+
if (body == null) {
|
|
17
|
+
return EMPTY_HASH;
|
|
18
|
+
}
|
|
19
|
+
if (isSourceData(body)) {
|
|
20
|
+
var hashedData = getHashedDataAsHex(null, body);
|
|
21
|
+
return hashedData;
|
|
22
|
+
}
|
|
23
|
+
// Defined body is not signable. Return unsigned payload which may or may not be accepted by the service.
|
|
24
|
+
return UNSIGNED_PAYLOAD;
|
|
25
|
+
};
|
|
26
|
+
var isSourceData = function (body) {
|
|
27
|
+
return typeof body === 'string' || ArrayBuffer.isView(body) || isArrayBuffer(body);
|
|
28
|
+
};
|
|
29
|
+
var isArrayBuffer = function (arg) {
|
|
30
|
+
return (typeof ArrayBuffer === 'function' && arg instanceof ArrayBuffer) ||
|
|
31
|
+
Object.prototype.toString.call(arg) === '[object ArrayBuffer]';
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=getHashedPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHashedPayload.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,IAAyB;IACzD,+DAA+D;IAC/D,IAAI,IAAI,IAAI,IAAI,EAAE;QACjB,OAAO,UAAU,CAAC;KAClB;IAED,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE;QACvB,IAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,UAAU,CAAC;KAClB;IAED,yGAAyG;IACzG,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF,IAAM,YAAY,GAAG,UAAC,IAAyB;IAC9C,OAAA,OAAO,IAAI,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC;AAA3E,CAA2E,CAAC;AAE7E,IAAM,aAAa,GAAG,UAAC,GAAQ;IAC9B,OAAA,CAAC,OAAO,WAAW,KAAK,UAAU,IAAI,GAAG,YAAY,WAAW,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,sBAAsB;AAD9D,CAC8D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpRequest } from '../../../../../types';
|
|
2
|
+
import { SigningValues } from '../types/signer';
|
|
3
|
+
/**
|
|
4
|
+
* Calculates and returns an AWS API Signature.
|
|
5
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html
|
|
6
|
+
*
|
|
7
|
+
* @param request `HttpRequest` to be signed.
|
|
8
|
+
* @param signRequestOptions `SignRequestOptions` object containing values used to construct the signature.
|
|
9
|
+
* @returns AWS API Signature to sign a request or url with.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare const getSignature: (request: HttpRequest, { credentialScope, longDate, secretAccessKey, shortDate, signingRegion, signingService, }: SigningValues) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { getHashedDataAsHex } from './dataHashHelpers';
|
|
4
|
+
import { getCanonicalRequest } from './getCanonicalRequest';
|
|
5
|
+
import { getSigningKey } from './getSigningKey';
|
|
6
|
+
import { getStringToSign } from './getStringToSign';
|
|
7
|
+
/**
|
|
8
|
+
* Calculates and returns an AWS API Signature.
|
|
9
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html
|
|
10
|
+
*
|
|
11
|
+
* @param request `HttpRequest` to be signed.
|
|
12
|
+
* @param signRequestOptions `SignRequestOptions` object containing values used to construct the signature.
|
|
13
|
+
* @returns AWS API Signature to sign a request or url with.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export var getSignature = function (request, _a) {
|
|
18
|
+
var credentialScope = _a.credentialScope, longDate = _a.longDate, secretAccessKey = _a.secretAccessKey, shortDate = _a.shortDate, signingRegion = _a.signingRegion, signingService = _a.signingService;
|
|
19
|
+
// step 1: create a canonical request
|
|
20
|
+
var canonicalRequest = getCanonicalRequest(request);
|
|
21
|
+
// step 2: create a hash of the canonical request
|
|
22
|
+
var hashedRequest = getHashedDataAsHex(null, canonicalRequest);
|
|
23
|
+
// step 3: create a string to sign
|
|
24
|
+
var stringToSign = getStringToSign(longDate, credentialScope, hashedRequest);
|
|
25
|
+
// step 4: calculate the signature
|
|
26
|
+
var signature = getHashedDataAsHex(getSigningKey(secretAccessKey, shortDate, signingRegion, signingService), stringToSign);
|
|
27
|
+
return signature;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=getSignature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignature.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getSignature.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,UAC3B,OAAoB,EACpB,EAOgB;QANf,oCAAe,EACf,sBAAQ,EACR,oCAAe,EACf,wBAAS,EACT,gCAAa,EACb,kCAAc;IAGf,qCAAqC;IACrC,IAAM,gBAAgB,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAEtD,iDAAiD;IACjD,IAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAEjE,kCAAkC;IAClC,IAAM,YAAY,GAAG,eAAe,CACnC,QAAQ,EACR,eAAe,EACf,aAAa,CACb,CAAC;IAEF,kCAAkC;IAClC,IAAM,SAAS,GAAG,kBAAkB,CACnC,aAAa,CAAC,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,EACxE,YAAY,CACZ,CAAC;IAEF,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns signed headers.
|
|
3
|
+
*
|
|
4
|
+
* @param headers `headers` from the request.
|
|
5
|
+
* @returns List of headers included in canonical headers, separated by semicolons (;). This indicates which headers
|
|
6
|
+
* are part of the signing process. Header names must use lowercase characters and must appear in alphabetical order.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const getSignedHeaders: (headers: Record<string, string>) => string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* Returns signed headers.
|
|
5
|
+
*
|
|
6
|
+
* @param headers `headers` from the request.
|
|
7
|
+
* @returns List of headers included in canonical headers, separated by semicolons (;). This indicates which headers
|
|
8
|
+
* are part of the signing process. Header names must use lowercase characters and must appear in alphabetical order.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export var getSignedHeaders = function (headers) {
|
|
13
|
+
return Object.keys(headers)
|
|
14
|
+
.map(function (key) { return key.toLowerCase(); })
|
|
15
|
+
.sort()
|
|
16
|
+
.join(';');
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=getSignedHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignedHeaders.js","sourceRoot":"","sources":["../../../../../../../src/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC;;;;;;;;GAQG;AACH,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,OAA+B;IAC/D,OAAA,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;SAClB,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,WAAW,EAAE,EAAjB,CAAiB,CAAC;SAC7B,IAAI,EAAE;SACN,IAAI,CAAC,GAAG,CAAC;AAHX,CAGW,CAAC"}
|