Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/3rdparty.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php')
-rw-r--r--aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php26
1 files changed, 4 insertions, 22 deletions
diff --git a/aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php b/aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php
index 72c4fb39..3c35c4b9 100644
--- a/aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php
+++ b/aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php
@@ -48,19 +48,14 @@ trait EndpointRegionHelperTrait
return $region;
}
- private function isFipsPseudoRegion($region)
- {
- return strpos($region, 'fips-') !== false || strpos($region, '-fips') !== false;
- }
-
private function isMatchingSigningRegion(
$arnRegion,
$clientRegion,
$service,
PartitionEndpointProvider $provider
) {
- $arnRegion = $this->stripPseudoRegions(strtolower($arnRegion));
- $clientRegion = $this->stripPseudoRegions(strtolower($clientRegion));
+ $arnRegion = \Aws\strip_fips_pseudo_regions(strtolower($arnRegion));
+ $clientRegion = strtolower($clientRegion);
if ($arnRegion === $clientRegion) {
return true;
}
@@ -70,13 +65,9 @@ trait EndpointRegionHelperTrait
return false;
}
- private function stripPseudoRegions($region)
- {
- return str_replace(['fips-', '-fips'], ['', ''], $region);
- }
-
private function validateFipsConfigurations(ArnInterface $arn)
{
+ $useFipsEndpoint = !empty($this->config['use_fips_endpoint']);
if ($arn instanceof OutpostsArnInterface) {
if (empty($this->config['use_arn_region'])
|| !($this->config['use_arn_region']->isUseArnRegion())
@@ -85,22 +76,13 @@ trait EndpointRegionHelperTrait
} else {
$region = $arn->getRegion();
}
-
- if ($this->isFipsPseudoRegion($region)) {
+ if (\Aws\is_fips_pseudo_region($region)) {
throw new InvalidRegionException(
'Fips is currently not supported with S3 Outposts access'
. ' points. Please provide a non-fips region or do not supply an'
. ' access point ARN.');
}
}
- if ($this->isFipsPseudoRegion($this->region)
- && $this->stripPseudoRegions($this->region) != $arn->getRegion()
- ) {
- throw new InvalidRegionException(
- 'Fips is currently not supported with cross region'
- . ' requests. Please provide a non-fips region or supply a matching'
- . ' access point ARN region and client region.');
- }
}
private function validateMatchingRegion(ArnInterface $arn)