trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gan...@apache.org
Subject [trafficserver] branch master updated: s3_auth_v4: update default region map
Date Mon, 08 Oct 2018 21:39:26 GMT
This is an automated email from the ASF dual-hosted git repository.

gancho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 13c827e  s3_auth_v4: update default region map
13c827e is described below

commit 13c827e57fbe042d3113c24861e60bfb1d13fc11
Author: Gancho Tenev <gancho@apache.org>
AuthorDate: Mon Oct 8 13:31:04 2018 -0700

    s3_auth_v4: update default region map
    
    Update the default region mapping based on the latest changes in AWS
    Regions and Endpoints spec:
        https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
    May be if one day AWS naming/mapping becomes 100% consistent we could
    just extract / calculate the right region from hostname.
    
    The default region mapping can be overridden by using --v4-region-map
    parameter (more info in the s3 plugin docs).
---
 plugins/s3_auth/aws_auth_v4.cc | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index da5bbe9..61f595d 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -401,6 +401,8 @@ getCanonicalRequestSha256Hash(TsInterface &api, bool signPayload,
const StringSe
  * @see http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
  * it is used to get the region programmatically  w/o configuration
  * parameters and can (meant to) be overwritten if necessary.
+ * @todo may be if one day AWS naming/mapping becomes 100% consistent
+ * we could just extract (calculate) the right region from hostname.
  */
 const StringMap
 createDefaultRegionMap()
@@ -412,47 +414,67 @@ createDefaultRegionMap()
   m["s3.dualstack.us-east-2.amazonaws.com"] = "us-east-2";
   /* "us-east-1" */
   m["s3.amazonaws.com"]                     = "us-east-1";
+  m["s3.us-east-1.amazonaws.com"]           = "us-east-1";
   m["s3-external-1.amazonaws.com"]          = "us-east-1";
   m["s3.dualstack.us-east-1.amazonaws.com"] = "us-east-1";
   /* us-west-1 */
+  m["s3.us-west-1.amazonaws.com"]           = "us-west-1";
   m["s3-us-west-1.amazonaws.com"]           = "us-west-1";
   m["s3.dualstack.us-west-1.amazonaws.com"] = "us-west-1";
   /* us-west-2 */
+  m["s3.us-west-2.amazonaws.com"]           = "us-west-2";
   m["s3-us-west-2.amazonaws.com"]           = "us-west-2";
   m["s3.dualstack.us-west-2.amazonaws.com"] = "us-west-2";
-  /* ca-central-1 */
-  m["s3.ca-central-1.amazonaws.com"]           = "ca-central-1";
-  m["s3-ca-central-1.amazonaws.com"]           = "ca-central-1";
-  m["s3.dualstack.ca-central-1.amazonaws.com"] = "ca-central-1";
   /* ap-south-1 */
   m["s3.ap-south-1.amazonaws.com"]           = "ap-south-1";
   m["s3-ap-south-1.amazonaws.com"]           = "ap-south-1";
   m["s3.dualstack.ap-south-1.amazonaws.com"] = "ap-south-1";
+  /* ap-northeast-3 */
+  m["s3.ap-northeast-3.amazonaws.com"]           = "ap-northeast-3";
+  m["s3-ap-northeast-3.amazonaws.com"]           = "ap-northeast-3";
+  m["s3.dualstack.ap-northeast-3.amazonaws.com"] = "ap-northeast-3";
   /* ap-northeast-2 */
   m["s3.ap-northeast-2.amazonaws.com"]           = "ap-northeast-2";
   m["s3-ap-northeast-2.amazonaws.com"]           = "ap-northeast-2";
   m["s3.dualstack.ap-northeast-2.amazonaws.com"] = "ap-northeast-2";
   /* ap-southeast-1 */
+  m["s3.ap-southeast-1.amazonaws.com"]           = "ap-southeast-1";
   m["s3-ap-southeast-1.amazonaws.com"]           = "ap-southeast-1";
   m["s3.dualstack.ap-southeast-1.amazonaws.com"] = "ap-southeast-1";
   /* ap-southeast-2 */
+  m["s3.ap-southeast-2.amazonaws.com"]           = "ap-southeast-2";
   m["s3-ap-southeast-2.amazonaws.com"]           = "ap-southeast-2";
   m["s3.dualstack.ap-southeast-2.amazonaws.com"] = "ap-southeast-2";
   /* ap-northeast-1 */
+  m["s3.ap-northeast-1.amazonaws.com"]           = "ap-northeast-1";
   m["s3-ap-northeast-1.amazonaws.com"]           = "ap-northeast-1";
   m["s3.dualstack.ap-northeast-1.amazonaws.com"] = "ap-northeast-1";
+  /* ca-central-1 */
+  m["s3.ca-central-1.amazonaws.com"]           = "ca-central-1";
+  m["s3-ca-central-1.amazonaws.com"]           = "ca-central-1";
+  m["s3.dualstack.ca-central-1.amazonaws.com"] = "ca-central-1";
+  /* cn-north-1 */
+  m["s3.cn-north-1.amazonaws.com.cn"] = "cn-north-1";
+  /* cn-northwest-1 */
+  m["s3.cn-northwest-1.amazonaws.com.cn"] = "cn-northwest-1";
   /* eu-central-1 */
   m["s3.eu-central-1.amazonaws.com"]           = "eu-central-1";
   m["s3-eu-central-1.amazonaws.com"]           = "eu-central-1";
   m["s3.dualstack.eu-central-1.amazonaws.com"] = "eu-central-1";
   /* eu-west-1 */
-  m["s3-eu-west-1.amazonaws.com"]           = "eu-central-1";
-  m["s3.dualstack.eu-west-1.amazonaws.com"] = "eu-central-1";
+  m["s3.eu-west-1.amazonaws.com"]           = "eu-west-1";
+  m["s3-eu-west-1.amazonaws.com"]           = "eu-west-1";
+  m["s3.dualstack.eu-west-1.amazonaws.com"] = "eu-west-1";
   /* eu-west-2 */
   m["s3.eu-west-2.amazonaws.com"]           = "eu-west-2";
   m["s3-eu-west-2.amazonaws.com"]           = "eu-west-2";
   m["s3.dualstack.eu-west-2.amazonaws.com"] = "eu-west-2";
+  /* eu-west-3 */
+  m["s3.eu-west-3.amazonaws.com"]           = "eu-west-3";
+  m["s3-eu-west-3.amazonaws.com"]           = "eu-west-3";
+  m["s3.dualstack.eu-west-3.amazonaws.com"] = "eu-west-3";
   /* sa-east-1 */
+  m["s3.sa-east-1.amazonaws.com"]           = "sa-east-1";
   m["s3-sa-east-1.amazonaws.com"]           = "sa-east-1";
   m["s3.dualstack.sa-east-1.amazonaws.com"] = "sa-east-1";
   /* default "us-east-1" * */


Mime
View raw message