@aws-amplify/core
Version:
Core category of aws-amplify
26 lines (25 loc) • 969 B
JavaScript
;
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStringToSign = void 0;
var constants_1 = require("../constants");
/**
* Returns a string to be signed.
*
* @param date Current date in the format 'YYYYMMDDThhmmssZ'.
* @param credentialScope String representing the credential scope with format 'YYYYMMDD/region/service/aws4_request'.
* @param hashedRequest Hashed canonical request.
*
* @returns A string created by by concatenating the following strings, separated by newline characters:
* - Algorithm
* - RequestDateTime
* - CredentialScope
* - HashedCanonicalRequest
*
* @internal
*/
var getStringToSign = function (date, credentialScope, hashedRequest) {
return [constants_1.SHA256_ALGORITHM_IDENTIFIER, date, credentialScope, hashedRequest].join('\n');
};
exports.getStringToSign = getStringToSign;