aws-partitions 1.227.0 → 1.228.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85a0e95d14bdc5765f56a53d577b6f6f946c6fd9
4
- data.tar.gz: fb466b498a608082ad29a2045b3b665b3db90f24
3
+ metadata.gz: cbde7aa09867b8f1375e528edfec5fcc92c89023
4
+ data.tar.gz: 3a162f5b850437bcb9db85f04eddb8eba76057dc
5
5
  SHA512:
6
- metadata.gz: 3d1d6a0eee3f6422967960347bba4632fd2ca8e060b2597b10ebe83d95b945af86a4b4e0eff90fab7de2a52b7739ac08a235760118d2e9f61beed0927893d722
7
- data.tar.gz: '090b1fa6eff7fbc4f48a60e3af312147b7ea93bae8bb2e26475455059649b8dadd4f40a2c002ff135d499467110531f9fe654384b1b7845a90e328eb921d9eee'
6
+ metadata.gz: aed6f7a8eabc25b22c0586bec7257c08e42891dd898458d7cef9fd71bcde3aba9607fbcff028041f7f197e236fa2ac7f7fae6d5c148f4d13290ddb390059142d
7
+ data.tar.gz: 1051e16f96ae0f7dfc291d3d60026175cc00e70125f62905f0099cc346d0699424ee15306ac67640599d82d3834ef2aeaa6dda1382d9be66d247e09b272dd1fd
@@ -3,6 +3,28 @@ module Aws
3
3
  # @api private
4
4
  class EndpointProvider
5
5
 
6
+ # when sts_regional_endpoint set to `legacy`
7
+ # endpoint pattern stays global for
8
+ # following regions
9
+ STS_LEGACY_REGIONS = %w(
10
+ ap-northeast-1
11
+ ap-south-1
12
+ ap-southeast-1
13
+ ap-southeast-2
14
+ aws-global
15
+ ca-central-1
16
+ eu-central-1
17
+ eu-north-1
18
+ eu-west-1
19
+ eu-west-2
20
+ eu-west-3
21
+ sa-east-1
22
+ us-east-1
23
+ us-east-2
24
+ us-west-1
25
+ us-west-2
26
+ )
27
+
6
28
  # Intentionally marked private. The format of the endpoint rules
7
29
  # is an implementation detail.
8
30
  # @api private
@@ -13,9 +35,12 @@ module Aws
13
35
  # @param [String] region
14
36
  # @param [String] service The endpoint prefix for the service, e.g. "monitoring" for
15
37
  # cloudwatch.
38
+ # @param [String] sts_regional_endpoints [STS only] Whether to use `legacy` (global endpoint for
39
+ # legacy regions) or `regional` mode for using regional endpoint for supported regions
40
+ # except 'aws-global'
16
41
  # @api private Use the static class methods instead.
17
- def resolve(region, service)
18
- "https://" + endpoint_for(region, service)
42
+ def resolve(region, service, sts_regional_endpoints = nil)
43
+ "https://" + endpoint_for(region, service, sts_regional_endpoints)
19
44
  end
20
45
 
21
46
  # @api private Use the static class methods instead.
@@ -37,7 +62,7 @@ module Aws
37
62
 
38
63
  private
39
64
 
40
- def endpoint_for(region, service)
65
+ def endpoint_for(region, service, sts_regional_endpoints)
41
66
  partition = get_partition(region)
42
67
  endpoint = default_endpoint(partition, service, region)
43
68
  service_cfg = partition.fetch("services", {}).fetch(service, {})
@@ -45,8 +70,13 @@ module Aws
45
70
  # Check for service-level default endpoint.
46
71
  endpoint = service_cfg.fetch("defaults", {}).fetch("hostname", endpoint)
47
72
 
73
+ # Check for sts legacy behavior
74
+ sts_legacy = service == 'sts' &&
75
+ sts_regional_endpoints == 'legacy' &&
76
+ STS_LEGACY_REGIONS.include?(region)
77
+
48
78
  # Check for global endpoint.
49
- if service_cfg["isRegionalized"] == false
79
+ if sts_legacy || service_cfg["isRegionalized"] == false
50
80
  region = service_cfg.fetch("partitionEndpoint", region)
51
81
  end
52
82
 
@@ -91,8 +121,8 @@ module Aws
91
121
 
92
122
  class << self
93
123
 
94
- def resolve(region, service)
95
- default_provider.resolve(region, service)
124
+ def resolve(region, service, sts_regional_endpoints = nil)
125
+ default_provider.resolve(region, service, sts_regional_endpoints)
96
126
  end
97
127
 
98
128
  def signing_region(region, service)
@@ -3382,42 +3382,26 @@
3382
3382
  }
3383
3383
  },
3384
3384
  "sts" : {
3385
- "defaults" : {
3386
- "credentialScope" : {
3387
- "region" : "us-east-1"
3388
- },
3389
- "hostname" : "sts.amazonaws.com"
3390
- },
3391
3385
  "endpoints" : {
3392
- "ap-east-1" : {
3393
- "credentialScope" : {
3394
- "region" : "ap-east-1"
3395
- },
3396
- "hostname" : "sts.ap-east-1.amazonaws.com"
3397
- },
3386
+ "ap-east-1" : { },
3398
3387
  "ap-northeast-1" : { },
3399
- "ap-northeast-2" : {
3400
- "credentialScope" : {
3401
- "region" : "ap-northeast-2"
3402
- },
3403
- "hostname" : "sts.ap-northeast-2.amazonaws.com"
3404
- },
3388
+ "ap-northeast-2" : { },
3405
3389
  "ap-south-1" : { },
3406
3390
  "ap-southeast-1" : { },
3407
3391
  "ap-southeast-2" : { },
3408
- "aws-global" : { },
3392
+ "aws-global" : {
3393
+ "credentialScope" : {
3394
+ "region" : "us-east-1"
3395
+ },
3396
+ "hostname" : "sts.amazonaws.com"
3397
+ },
3409
3398
  "ca-central-1" : { },
3410
3399
  "eu-central-1" : { },
3411
3400
  "eu-north-1" : { },
3412
3401
  "eu-west-1" : { },
3413
3402
  "eu-west-2" : { },
3414
3403
  "eu-west-3" : { },
3415
- "me-south-1" : {
3416
- "credentialScope" : {
3417
- "region" : "me-south-1"
3418
- },
3419
- "hostname" : "sts.me-south-1.amazonaws.com"
3420
- },
3404
+ "me-south-1" : { },
3421
3405
  "sa-east-1" : { },
3422
3406
  "us-east-1" : { },
3423
3407
  "us-east-1-fips" : {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-partitions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.227.0
4
+ version: 1.228.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2019-10-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provides interfaces to enumerate AWS partitions, regions, and services.
14
14
  email: