blob: 620923d6cdd9b8fa5461c367fdc58b7090cc36e7 (
plain) (
blame)
1
2
3
4
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/Region.h>
namespace Aws
{
namespace Region
{
Aws::String ComputeSignerRegion(const Aws::String& region)
{
if (region == Aws::Region::AWS_GLOBAL)
{
return Aws::Region::US_EAST_1;
}
else if (region == "fips-aws-global")
{
return Aws::Region::US_EAST_1;
}
else if (region == "s3-external-1")
{
return Aws::Region::US_EAST_1;
}
else if (region.size() >= 5 && region.compare(0, 5, "fips-") == 0)
{
return region.substr(5);
}
else if (region.size() >= 5 && region.compare(region.size() - 5, 5, "-fips") == 0)
{
return region.substr(0, region.size() - 5);
}
else
{
return region;
}
}
bool IsFipsRegion(const Aws::String& region)
{
if (region.size() >= 5 && region.compare(0, 5, "fips-") == 0)
{
return true;
}
else if (region.size() >= 5 && region.compare(region.size() - 5, 5, "-fips") == 0)
{
return true;
}
return false;
}
}
}
|