aws-sdk-core 3.82.0 → 3.83.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core.rb +4 -0
- data/lib/aws-sdk-core/arn.rb +77 -0
- data/lib/aws-sdk-core/arn_parser.rb +38 -0
- data/lib/aws-sdk-core/errors.rb +23 -2
- data/lib/aws-sdk-core/instance_profile_credentials.rb +1 -0
- data/lib/aws-sdk-core/log/param_filter.rb +1 -1
- data/lib/aws-sdk-core/shared_config.rb +15 -0
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/seahorse/client/h2/connection.rb +2 -0
- data/lib/seahorse/client/plugin.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4be4dfeeb3e69ca503b141449cc3fe7a620235e
|
4
|
+
data.tar.gz: c7c5965da447713bc2fbc8885141b2b7bad7ae89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e732094ceaf8343e98409f51d3de9a7d6d81f111950157f9886e6e3292e90478848c0a6701c4df63f69dd947c88e9c3860dfac4f881cdb6a9195c59900f0431b
|
7
|
+
data.tar.gz: 4e253edb0e0abb5f621dfe8ea09dcba9b196628c709cff9ba2b5f7e399b48faafd4e25fe06f83abcc7591b7131639dd8b400c54c70ec75913b8633f22a9d8720
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.83.0
|
data/lib/aws-sdk-core.rb
CHANGED
@@ -79,6 +79,10 @@ require_relative 'aws-sdk-core/endpoint_cache'
|
|
79
79
|
require_relative 'aws-sdk-core/client_side_monitoring/request_metrics'
|
80
80
|
require_relative 'aws-sdk-core/client_side_monitoring/publisher'
|
81
81
|
|
82
|
+
# arn
|
83
|
+
require_relative 'aws-sdk-core/arn'
|
84
|
+
require_relative 'aws-sdk-core/arn_parser'
|
85
|
+
|
82
86
|
# aws-sdk-sts is vendored to support Aws::AssumeRoleCredentials
|
83
87
|
|
84
88
|
require 'aws-sdk-sts'
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Aws
|
2
|
+
# Create and provide access to components of Amazon Resource Names (ARN).
|
3
|
+
#
|
4
|
+
# You can create an ARN and access it's components like the following:
|
5
|
+
#
|
6
|
+
# arn = Aws::ARN.new(
|
7
|
+
# partition: 'aws',
|
8
|
+
# service: 's3',
|
9
|
+
# region: 'us-west-2',
|
10
|
+
# account_id: '12345678910',
|
11
|
+
# resource: 'foo/bar'
|
12
|
+
# )
|
13
|
+
# # => #<Aws::ARN ...>
|
14
|
+
#
|
15
|
+
# arn.to_s
|
16
|
+
# # => "arn:aws:s3:us-west-2:12345678910:foo/bar"
|
17
|
+
#
|
18
|
+
# arn.partition
|
19
|
+
# # => 'aws'
|
20
|
+
# arn.service
|
21
|
+
# # => 's3'
|
22
|
+
# arn.resource
|
23
|
+
# # => foo/bar
|
24
|
+
#
|
25
|
+
# # Note: parser available for parsing resource details
|
26
|
+
# @see Aws::ARNParser#parse_resource
|
27
|
+
#
|
28
|
+
# @see https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-arns
|
29
|
+
class ARN
|
30
|
+
|
31
|
+
# @param [Hash] options
|
32
|
+
# @option options [String] :partition
|
33
|
+
# @option options [String] :service
|
34
|
+
# @option options [String] :region
|
35
|
+
# @option options [String] :account_id
|
36
|
+
# @option options [String] :resource
|
37
|
+
def initialize(options = {})
|
38
|
+
@partition = options[:partition]
|
39
|
+
@service = options[:service]
|
40
|
+
@region = options[:region]
|
41
|
+
@account_id = options[:account_id]
|
42
|
+
@resource = options[:resource]
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [String]
|
46
|
+
attr_reader :partition
|
47
|
+
|
48
|
+
# @return [String]
|
49
|
+
attr_reader :service
|
50
|
+
|
51
|
+
# @return [String]
|
52
|
+
attr_reader :region
|
53
|
+
|
54
|
+
# @return [String]
|
55
|
+
attr_reader :account_id
|
56
|
+
|
57
|
+
# @return [String]
|
58
|
+
attr_reader :resource
|
59
|
+
|
60
|
+
# Validates ARN contains non-empty required components.
|
61
|
+
# Region and account_id can be optional.
|
62
|
+
#
|
63
|
+
# @return [Boolean]
|
64
|
+
def valid?
|
65
|
+
!partition.nil? && !partition.empty? &&
|
66
|
+
!service.nil? && !service.empty? &&
|
67
|
+
!resource.nil? && !resource.empty?
|
68
|
+
end
|
69
|
+
|
70
|
+
# Return the ARN format in string
|
71
|
+
#
|
72
|
+
# @return [String]
|
73
|
+
def to_s
|
74
|
+
"arn:#{partition}:#{service}:#{region}:#{account_id}:#{resource}"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Aws
|
2
|
+
module ARNParser
|
3
|
+
# Parse a string with an ARN format into an {Aws::ARN} object.
|
4
|
+
# `InvalidARNError` would be raised when encountering a parsing error or the
|
5
|
+
# ARN object contains invalid components (nil/empty).
|
6
|
+
#
|
7
|
+
# @param [String] arn_str
|
8
|
+
#
|
9
|
+
# @return [Aws::ARN]
|
10
|
+
# @see https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-arns
|
11
|
+
def self.parse(arn_str)
|
12
|
+
parts = arn_str.nil? ? [] : arn_str.split(':', 6)
|
13
|
+
raise Aws::Errors::InvalidARNError if parts.size < 6
|
14
|
+
|
15
|
+
# part[0] is "arn"
|
16
|
+
arn = ARN.new(
|
17
|
+
partition: parts[1],
|
18
|
+
service: parts[2],
|
19
|
+
region: parts[3],
|
20
|
+
account_id: parts[4],
|
21
|
+
resource: parts[5]
|
22
|
+
)
|
23
|
+
raise Aws::Errors::InvalidARNError unless arn.valid?
|
24
|
+
|
25
|
+
arn
|
26
|
+
end
|
27
|
+
|
28
|
+
# Checks whether a String could be a ARN or not. An ARN starts with 'arn:'
|
29
|
+
# and has at least 6 segments separated by a colon (:).
|
30
|
+
#
|
31
|
+
# @param [String] str
|
32
|
+
#
|
33
|
+
# @return [Boolean]
|
34
|
+
def self.arn?(str)
|
35
|
+
!str.nil? && str.start_with?('arn:') && str.scan(/:/).length >= 5
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/aws-sdk-core/errors.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'thread'
|
2
|
-
|
3
1
|
module Aws
|
4
2
|
module Errors
|
5
3
|
|
@@ -125,6 +123,29 @@ module Aws
|
|
125
123
|
|
126
124
|
end
|
127
125
|
|
126
|
+
# Raised when ARN string input doesn't follow the standard:
|
127
|
+
# https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-arns
|
128
|
+
class InvalidARNError < RuntimeError; end
|
129
|
+
|
130
|
+
# Raised when the region from the ARN string is different from the :region
|
131
|
+
# configured on the service client.
|
132
|
+
class InvalidARNRegionError < RuntimeError
|
133
|
+
def initialize(*args)
|
134
|
+
msg = 'ARN region is different from the configured client region.'
|
135
|
+
super(msg)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Raised when the partition of the ARN region is different than the
|
140
|
+
# partition of the :region configured on the service client.
|
141
|
+
class InvalidARNPartitionError < RuntimeError
|
142
|
+
def initialize(*args)
|
143
|
+
msg = 'ARN region partition is different from the configured '\
|
144
|
+
'client region partition.'
|
145
|
+
super(msg)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
128
149
|
# Various plugins perform client-side checksums of responses.
|
129
150
|
# This error indicates a checksum failed.
|
130
151
|
class ChecksumError < RuntimeError; end
|
@@ -11,7 +11,7 @@ module Aws
|
|
11
11
|
#
|
12
12
|
# @api private
|
13
13
|
# begin
|
14
|
-
SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :artifact_credentials, :auth_code, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :block, :block_address, :body, :bot_configuration, :bot_email, :calling_name, :cause, :client_id, :client_request_token, :client_secret, :comment, :configuration, :copy_source_sse_customer_key, :credentials, :current_password, :custom_attributes, :custom_private_key, :db_password, :default_phone_number, :definition, :description, :destination_access_token, :digest_tip_address, :display_name, :e164_phone_number, :email, :email_address, :email_message, :embed_url, :error, :external_user_id, :feedback_token, :file, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :key_id, :key_material, :key_store_password, :kms_key_id, :kms_master_key_id, :lambda_function_arn, :last_name, :local_console_password, :master_account_email, :master_user_password, :meeting_host_id, :message, :name, :new_password, :next_password, :notes, :number, :old_password, :outbound_events_https_endpoint, :output, :owner_information, :parameters, :passphrase, :password, :payload, :phone_number, :plaintext, :previous_password, :primary_email, :primary_provisioned_number, :private_key, :private_key_plaintext, :proof, :proposed_password, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :revision, :search_query, :secret_access_key, :secret_binary, :secret_code, :secret_hash, :secret_string, :secret_to_authenticate_initiator, :secret_to_authenticate_target, :security_token, :service_password, :session_attributes, :session_token, :share_notes, :shared_secret, :slots, :sns_topic_arn, :source_access_token, :sqs_queue_arn, :sse_customer_key, :ssekms_encryption_context, :ssekms_key_id, :status_message, :tag_key_list, :tags, :target_address, :task_parameters, :tech_contact, :temporary_password, :text, :token, :trust_password, :type, :upload_credentials, :upload_url, :uri, :user_data, :user_email, :user_name, :user_password, :username, :value, :values, :variables, :vpn_psk, :zip_file]
|
14
|
+
SENSITIVE = [:access_token, :account_name, :account_password, :address, :admin_contact, :admin_password, :artifact_credentials, :auth_code, :authentication_token, :authorization_result, :backup_plan_tags, :backup_vault_tags, :base_32_string_seed, :block, :block_address, :body, :bot_configuration, :bot_email, :calling_name, :cause, :client_id, :client_request_token, :client_secret, :comment, :configuration, :copy_source_sse_customer_key, :credentials, :current_password, :custom_attributes, :custom_private_key, :db_password, :default_phone_number, :definition, :description, :destination_access_token, :digest_tip_address, :display_name, :e164_phone_number, :email, :email_address, :email_message, :embed_url, :error, :external_model_endpoint_data_blobs, :external_user_id, :feedback_token, :file, :first_name, :full_name, :host_key, :id, :id_token, :input, :input_text, :ion_text, :join_token, :key_id, :key_material, :key_store_password, :kms_key_id, :kms_master_key_id, :lambda_function_arn, :last_name, :local_console_password, :master_account_email, :master_user_password, :meeting_host_id, :message, :name, :new_password, :next_password, :notes, :number, :old_password, :outbound_events_https_endpoint, :output, :owner_information, :parameters, :passphrase, :password, :payload, :phone_number, :plaintext, :previous_password, :primary_email, :primary_provisioned_number, :private_key, :private_key_plaintext, :proof, :proposed_password, :public_key, :qr_code_png, :query, :random_password, :recovery_point_tags, :refresh_token, :registrant_contact, :request_attributes, :revision, :search_query, :secret_access_key, :secret_binary, :secret_code, :secret_hash, :secret_string, :secret_to_authenticate_initiator, :secret_to_authenticate_target, :security_token, :service_password, :session_attributes, :session_token, :share_notes, :shared_secret, :slots, :sns_topic_arn, :source_access_token, :sqs_queue_arn, :sse_customer_key, :ssekms_encryption_context, :ssekms_key_id, :status_message, :tag_key_list, :tags, :target_address, :task_parameters, :tech_contact, :temporary_password, :text, :token, :trust_password, :type, :upload_credentials, :upload_url, :uri, :user_data, :user_email, :user_name, :user_password, :username, :value, :values, :variables, :vpn_psk, :zip_file]
|
15
15
|
# end
|
16
16
|
|
17
17
|
def initialize(options = {})
|
@@ -183,6 +183,21 @@ module Aws
|
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
|
+
def s3_use_arn_region(opts = {})
|
187
|
+
p = opts[:profile] || @profile_name
|
188
|
+
if @config_enabled
|
189
|
+
if @parsed_credentials
|
190
|
+
value = @parsed_credentials.fetch(p, {})["s3_use_arn_region"]
|
191
|
+
end
|
192
|
+
if @parsed_config
|
193
|
+
value ||= @parsed_config.fetch(p, {})["s3_use_arn_region"]
|
194
|
+
end
|
195
|
+
value
|
196
|
+
else
|
197
|
+
nil
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
186
201
|
def endpoint_discovery(opts = {})
|
187
202
|
p = opts[:profile] || @profile_name
|
188
203
|
if @config_enabled && @parsed_config
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.83.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-
|
11
|
+
date: 2019-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|
@@ -88,6 +88,8 @@ files:
|
|
88
88
|
- VERSION
|
89
89
|
- ca-bundle.crt
|
90
90
|
- lib/aws-sdk-core.rb
|
91
|
+
- lib/aws-sdk-core/arn.rb
|
92
|
+
- lib/aws-sdk-core/arn_parser.rb
|
91
93
|
- lib/aws-sdk-core/assume_role_credentials.rb
|
92
94
|
- lib/aws-sdk-core/assume_role_web_identity_credentials.rb
|
93
95
|
- lib/aws-sdk-core/async_client_stubs.rb
|