@aws-amplify/core
Version:
Core category of aws-amplify
16 lines (15 loc) • 757 B
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { KEY_TYPE_IDENTIFIER } from '../constants';
/**
* Returns the credential scope which restricts the resulting signature to the specified region and service.
*
* @param date Current date in the format 'YYYYMMDD'.
* @param region AWS region in which the service resides.
* @param service Service to which the signed request is being sent.
*
* @returns A string representing the credential scope with format 'YYYYMMDD/region/service/aws4_request'.
*
* @internal
*/
export var getCredentialScope = function (date, region, service) { return "".concat(date, "/").concat(region, "/").concat(service, "/").concat(KEY_TYPE_IDENTIFIER); };