aws-sdk-s3control 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d00ae0c2db0f9204310e66f35add770d3c43567
4
+ data.tar.gz: 81ccf9923309be2636be6fd9d9ccd1092f1c32a0
5
+ SHA512:
6
+ metadata.gz: a48ff74973ce199a422edcbb1075029302878b1a1df110cc8e9c2179ae1c35034ad5e6542c1f310f35db32dedb56b9c2d8772e8786edaf62b9f92c3a6a6125dd
7
+ data.tar.gz: fccd21b1eba52e7f076b2cf3f88be5cac9ad9f12240f902b9f2bee0731749a6e3576b2a7af73a807ca36bb766958ca324d2e13da2353244dd034d04d5c03fec3
@@ -0,0 +1,338 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/endpoint_discovery.rb'
19
+ require 'aws-sdk-core/plugins/response_paging.rb'
20
+ require 'aws-sdk-core/plugins/stub_responses.rb'
21
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
22
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
23
+ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
24
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
25
+ require 'aws-sdk-core/plugins/protocols/rest_xml.rb'
26
+ require 'aws-sdk-s3control/plugins/s3_control_dns.rb'
27
+ require 'aws-sdk-s3control/plugins/s3_signer.rb'
28
+ require 'aws-sdk-s3control/plugins/dualstack.rb'
29
+ require 'aws-sdk-s3control/plugins/s3_host_id.rb'
30
+
31
+ Aws::Plugins::GlobalConfiguration.add_identifier(:s3control)
32
+
33
+ module Aws::S3Control
34
+ class Client < Seahorse::Client::Base
35
+
36
+ include Aws::ClientStubs
37
+
38
+ @identifier = :s3control
39
+
40
+ set_api(ClientApi::API)
41
+
42
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
43
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
44
+ add_plugin(Aws::Plugins::Logging)
45
+ add_plugin(Aws::Plugins::ParamConverter)
46
+ add_plugin(Aws::Plugins::ParamValidator)
47
+ add_plugin(Aws::Plugins::UserAgent)
48
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
49
+ add_plugin(Aws::Plugins::RetryErrors)
50
+ add_plugin(Aws::Plugins::GlobalConfiguration)
51
+ add_plugin(Aws::Plugins::RegionalEndpoint)
52
+ add_plugin(Aws::Plugins::EndpointDiscovery)
53
+ add_plugin(Aws::Plugins::ResponsePaging)
54
+ add_plugin(Aws::Plugins::StubResponses)
55
+ add_plugin(Aws::Plugins::IdempotencyToken)
56
+ add_plugin(Aws::Plugins::JsonvalueConverter)
57
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
58
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
59
+ add_plugin(Aws::Plugins::Protocols::RestXml)
60
+ add_plugin(Aws::S3Control::Plugins::S3ControlDns)
61
+ add_plugin(Aws::S3Control::Plugins::S3Signer)
62
+ add_plugin(Aws::S3Control::Plugins::Dualstack)
63
+ add_plugin(Aws::S3Control::Plugins::S3HostId)
64
+
65
+ # @overload initialize(options)
66
+ # @param [Hash] options
67
+ # @option options [required, Aws::CredentialProvider] :credentials
68
+ # Your AWS credentials. This can be an instance of any one of the
69
+ # following classes:
70
+ #
71
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
72
+ # credentials.
73
+ #
74
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
75
+ # from an EC2 IMDS on an EC2 instance.
76
+ #
77
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
78
+ # shared file, such as `~/.aws/config`.
79
+ #
80
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
81
+ #
82
+ # When `:credentials` are not configured directly, the following
83
+ # locations will be searched for credentials:
84
+ #
85
+ # * `Aws.config[:credentials]`
86
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
87
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
91
+ # very aggressive. Construct and pass an instance of
92
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
93
+ # timeouts.
94
+ #
95
+ # @option options [required, String] :region
96
+ # The AWS region to connect to. The configured `:region` is
97
+ # used to determine the service `:endpoint`. When not passed,
98
+ # a default `:region` is search for in the following locations:
99
+ #
100
+ # * `Aws.config[:region]`
101
+ # * `ENV['AWS_REGION']`
102
+ # * `ENV['AMAZON_REGION']`
103
+ # * `ENV['AWS_DEFAULT_REGION']`
104
+ # * `~/.aws/credentials`
105
+ # * `~/.aws/config`
106
+ #
107
+ # @option options [String] :access_key_id
108
+ #
109
+ # @option options [Boolean] :active_endpoint_cache (false)
110
+ # When set to `true`, a thread polling for endpoints will be running in
111
+ # the background every 60 secs (default). Defaults to `false`.
112
+ #
113
+ # @option options [Boolean] :client_side_monitoring (false)
114
+ # When `true`, client-side metrics will be collected for all API requests from
115
+ # this client.
116
+ #
117
+ # @option options [String] :client_side_monitoring_client_id ("")
118
+ # Allows you to provide an identifier for this client which will be attached to
119
+ # all generated client side metrics. Defaults to an empty string.
120
+ #
121
+ # @option options [Integer] :client_side_monitoring_port (31000)
122
+ # Required for publishing client metrics. The port that the client side monitoring
123
+ # agent is running on, where client metrics will be published via UDP.
124
+ #
125
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
126
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
127
+ # will use the Client Side Monitoring Agent Publisher.
128
+ #
129
+ # @option options [Boolean] :convert_params (true)
130
+ # When `true`, an attempt is made to coerce request parameters into
131
+ # the required types.
132
+ #
133
+ # @option options [String] :endpoint
134
+ # The client endpoint is normally constructed from the `:region`
135
+ # option. You should only configure an `:endpoint` when connecting
136
+ # to test endpoints. This should be avalid HTTP(S) URI.
137
+ #
138
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
139
+ # Used for the maximum size limit of the LRU cache storing endpoints data
140
+ # for endpoint discovery enabled operations. Defaults to 1000.
141
+ #
142
+ # @option options [Integer] :endpoint_cache_max_threads (10)
143
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
144
+ #
145
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
146
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
147
+ # Use this option to config the time interval in seconds for making
148
+ # requests fetching endpoints information. Defaults to 60 sec.
149
+ #
150
+ # @option options [Boolean] :endpoint_discovery (false)
151
+ # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
152
+ #
153
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
154
+ # The log formatter.
155
+ #
156
+ # @option options [Symbol] :log_level (:info)
157
+ # The log level to send messages to the `:logger` at.
158
+ #
159
+ # @option options [Logger] :logger
160
+ # The Logger instance to send log messages to. If this option
161
+ # is not set, logging will be disabled.
162
+ #
163
+ # @option options [String] :profile ("default")
164
+ # Used when loading credentials from the shared credentials file
165
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
166
+ #
167
+ # @option options [Float] :retry_base_delay (0.3)
168
+ # The base delay in seconds used by the default backoff function.
169
+ #
170
+ # @option options [Symbol] :retry_jitter (:none)
171
+ # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
172
+ #
173
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
174
+ #
175
+ # @option options [Integer] :retry_limit (3)
176
+ # The maximum number of times to retry failed requests. Only
177
+ # ~ 500 level server errors and certain ~ 400 level client errors
178
+ # are retried. Generally, these are throttling errors, data
179
+ # checksum errors, networking errors, timeout errors and auth
180
+ # errors from expired credentials.
181
+ #
182
+ # @option options [Integer] :retry_max_delay (0)
183
+ # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
184
+ #
185
+ # @option options [String] :secret_access_key
186
+ #
187
+ # @option options [String] :session_token
188
+ #
189
+ # @option options [Boolean] :stub_responses (false)
190
+ # Causes the client to return stubbed responses. By default
191
+ # fake responses are generated and returned. You can specify
192
+ # the response data to return or errors to raise by calling
193
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
194
+ #
195
+ # ** Please note ** When response stubbing is enabled, no HTTP
196
+ # requests are made, and retries are disabled.
197
+ #
198
+ # @option options [Boolean] :use_dualstack_endpoint (false)
199
+ # When set to `true`, IPv6-compatible bucket endpoints will be used
200
+ # for all operations.
201
+ #
202
+ # @option options [Boolean] :validate_params (true)
203
+ # When `true`, request parameters are validated before
204
+ # sending the request.
205
+ #
206
+ def initialize(*args)
207
+ super
208
+ end
209
+
210
+ # @!group API Operations
211
+
212
+ # Removes the Public Access Block configuration for an Amazon Web
213
+ # Services account.
214
+ #
215
+ # @option params [required, String] :account_id
216
+ # The Account ID for the Amazon Web Services account whose Public Access
217
+ # Block configuration you want to remove.
218
+ #
219
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
220
+ #
221
+ # @example Request syntax with placeholder values
222
+ #
223
+ # resp = client.delete_public_access_block({
224
+ # account_id: "AccountId", # required
225
+ # })
226
+ #
227
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlock AWS API Documentation
228
+ #
229
+ # @overload delete_public_access_block(params = {})
230
+ # @param [Hash] params ({})
231
+ def delete_public_access_block(params = {}, options = {})
232
+ req = build_request(:delete_public_access_block, params)
233
+ req.send_request(options)
234
+ end
235
+
236
+ # Retrieves the Public Access Block configuration for an Amazon Web
237
+ # Services account.
238
+ #
239
+ # @option params [required, String] :account_id
240
+ # The Account ID for the Amazon Web Services account whose Public Access
241
+ # Block configuration you want to retrieve.
242
+ #
243
+ # @return [Types::GetPublicAccessBlockOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
244
+ #
245
+ # * {Types::GetPublicAccessBlockOutput#public_access_block_configuration #public_access_block_configuration} => Types::PublicAccessBlockConfiguration
246
+ #
247
+ # @example Request syntax with placeholder values
248
+ #
249
+ # resp = client.get_public_access_block({
250
+ # account_id: "AccountId", # required
251
+ # })
252
+ #
253
+ # @example Response structure
254
+ #
255
+ # resp.public_access_block_configuration.block_public_acls #=> Boolean
256
+ # resp.public_access_block_configuration.ignore_public_acls #=> Boolean
257
+ # resp.public_access_block_configuration.block_public_policy #=> Boolean
258
+ # resp.public_access_block_configuration.restrict_public_buckets #=> Boolean
259
+ #
260
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock AWS API Documentation
261
+ #
262
+ # @overload get_public_access_block(params = {})
263
+ # @param [Hash] params ({})
264
+ def get_public_access_block(params = {}, options = {})
265
+ req = build_request(:get_public_access_block, params)
266
+ req.send_request(options)
267
+ end
268
+
269
+ # Creates or modifies the Public Access Block configuration for an
270
+ # Amazon Web Services account.
271
+ #
272
+ # @option params [required, Types::PublicAccessBlockConfiguration] :public_access_block_configuration
273
+ # The Public Access Block configuration that you want to apply to this
274
+ # Amazon Web Services account.
275
+ #
276
+ # @option params [required, String] :account_id
277
+ # The Account ID for the Amazon Web Services account whose Public Access
278
+ # Block configuration you want to set.
279
+ #
280
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
281
+ #
282
+ # @example Request syntax with placeholder values
283
+ #
284
+ # resp = client.put_public_access_block({
285
+ # public_access_block_configuration: { # required
286
+ # block_public_acls: false,
287
+ # ignore_public_acls: false,
288
+ # block_public_policy: false,
289
+ # restrict_public_buckets: false,
290
+ # },
291
+ # account_id: "AccountId", # required
292
+ # })
293
+ #
294
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock AWS API Documentation
295
+ #
296
+ # @overload put_public_access_block(params = {})
297
+ # @param [Hash] params ({})
298
+ def put_public_access_block(params = {}, options = {})
299
+ req = build_request(:put_public_access_block, params)
300
+ req.send_request(options)
301
+ end
302
+
303
+ # @!endgroup
304
+
305
+ # @param params ({})
306
+ # @api private
307
+ def build_request(operation_name, params = {})
308
+ handlers = @handlers.for(operation_name)
309
+ context = Seahorse::Client::RequestContext.new(
310
+ operation_name: operation_name,
311
+ operation: config.api.operation(operation_name),
312
+ client: self,
313
+ params: params,
314
+ config: config)
315
+ context[:gem_name] = 'aws-sdk-s3control'
316
+ context[:gem_version] = '1.0.0'
317
+ Seahorse::Client::Request.new(handlers, context)
318
+ end
319
+
320
+ # @api private
321
+ # @deprecated
322
+ def waiter_names
323
+ []
324
+ end
325
+
326
+ class << self
327
+
328
+ # @api private
329
+ attr_reader :identifier
330
+
331
+ # @api private
332
+ def errors_module
333
+ Errors
334
+ end
335
+
336
+ end
337
+ end
338
+ end
@@ -0,0 +1,91 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::S3Control
9
+ # @api private
10
+ module ClientApi
11
+
12
+ include Seahorse::Model
13
+
14
+ AccountId = Shapes::StringShape.new(name: 'AccountId')
15
+ DeletePublicAccessBlockRequest = Shapes::StructureShape.new(name: 'DeletePublicAccessBlockRequest')
16
+ GetPublicAccessBlockOutput = Shapes::StructureShape.new(name: 'GetPublicAccessBlockOutput')
17
+ GetPublicAccessBlockRequest = Shapes::StructureShape.new(name: 'GetPublicAccessBlockRequest')
18
+ NoSuchPublicAccessBlockConfiguration = Shapes::StructureShape.new(name: 'NoSuchPublicAccessBlockConfiguration')
19
+ NoSuchPublicAccessBlockConfigurationMessage = Shapes::StringShape.new(name: 'NoSuchPublicAccessBlockConfigurationMessage')
20
+ PublicAccessBlockConfiguration = Shapes::StructureShape.new(name: 'PublicAccessBlockConfiguration')
21
+ PutPublicAccessBlockRequest = Shapes::StructureShape.new(name: 'PutPublicAccessBlockRequest')
22
+ Setting = Shapes::BooleanShape.new(name: 'Setting')
23
+
24
+ DeletePublicAccessBlockRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, required: true, location: "header", location_name: "x-amz-account-id"))
25
+ DeletePublicAccessBlockRequest.struct_class = Types::DeletePublicAccessBlockRequest
26
+
27
+ GetPublicAccessBlockOutput.add_member(:public_access_block_configuration, Shapes::ShapeRef.new(shape: PublicAccessBlockConfiguration, location_name: "PublicAccessBlockConfiguration"))
28
+ GetPublicAccessBlockOutput.struct_class = Types::GetPublicAccessBlockOutput
29
+ GetPublicAccessBlockOutput[:payload] = :public_access_block_configuration
30
+ GetPublicAccessBlockOutput[:payload_member] = GetPublicAccessBlockOutput.member(:public_access_block_configuration)
31
+
32
+ GetPublicAccessBlockRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, required: true, location: "header", location_name: "x-amz-account-id"))
33
+ GetPublicAccessBlockRequest.struct_class = Types::GetPublicAccessBlockRequest
34
+
35
+ PublicAccessBlockConfiguration.add_member(:block_public_acls, Shapes::ShapeRef.new(shape: Setting, location_name: "BlockPublicAcls"))
36
+ PublicAccessBlockConfiguration.add_member(:ignore_public_acls, Shapes::ShapeRef.new(shape: Setting, location_name: "IgnorePublicAcls"))
37
+ PublicAccessBlockConfiguration.add_member(:block_public_policy, Shapes::ShapeRef.new(shape: Setting, location_name: "BlockPublicPolicy"))
38
+ PublicAccessBlockConfiguration.add_member(:restrict_public_buckets, Shapes::ShapeRef.new(shape: Setting, location_name: "RestrictPublicBuckets"))
39
+ PublicAccessBlockConfiguration.struct_class = Types::PublicAccessBlockConfiguration
40
+
41
+ PutPublicAccessBlockRequest.add_member(:public_access_block_configuration, Shapes::ShapeRef.new(shape: PublicAccessBlockConfiguration, required: true, location_name: "PublicAccessBlockConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://awss3control.amazonaws.com/doc/2018-08-20/"}}))
42
+ PutPublicAccessBlockRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, required: true, location: "header", location_name: "x-amz-account-id"))
43
+ PutPublicAccessBlockRequest.struct_class = Types::PutPublicAccessBlockRequest
44
+ PutPublicAccessBlockRequest[:payload] = :public_access_block_configuration
45
+ PutPublicAccessBlockRequest[:payload_member] = PutPublicAccessBlockRequest.member(:public_access_block_configuration)
46
+
47
+
48
+ # @api private
49
+ API = Seahorse::Model::Api.new.tap do |api|
50
+
51
+ api.version = "2018-08-20"
52
+
53
+ api.metadata = {
54
+ "apiVersion" => "2018-08-20",
55
+ "endpointPrefix" => "s3-control",
56
+ "protocol" => "rest-xml",
57
+ "serviceFullName" => "AWS S3 Control",
58
+ "serviceId" => "S3 Control",
59
+ "signatureVersion" => "s3v4",
60
+ "signingName" => "s3",
61
+ "uid" => "s3control-2018-08-20",
62
+ }
63
+
64
+ api.add_operation(:delete_public_access_block, Seahorse::Model::Operation.new.tap do |o|
65
+ o.name = "DeletePublicAccessBlock"
66
+ o.http_method = "DELETE"
67
+ o.http_request_uri = "/v20180820/configuration/publicAccessBlock"
68
+ o.input = Shapes::ShapeRef.new(shape: DeletePublicAccessBlockRequest)
69
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
70
+ end)
71
+
72
+ api.add_operation(:get_public_access_block, Seahorse::Model::Operation.new.tap do |o|
73
+ o.name = "GetPublicAccessBlock"
74
+ o.http_method = "GET"
75
+ o.http_request_uri = "/v20180820/configuration/publicAccessBlock"
76
+ o.input = Shapes::ShapeRef.new(shape: GetPublicAccessBlockRequest)
77
+ o.output = Shapes::ShapeRef.new(shape: GetPublicAccessBlockOutput)
78
+ o.errors << Shapes::ShapeRef.new(shape: NoSuchPublicAccessBlockConfiguration)
79
+ end)
80
+
81
+ api.add_operation(:put_public_access_block, Seahorse::Model::Operation.new.tap do |o|
82
+ o.name = "PutPublicAccessBlock"
83
+ o.http_method = "PUT"
84
+ o.http_request_uri = "/v20180820/configuration/publicAccessBlock"
85
+ o.input = Shapes::ShapeRef.new(shape: PutPublicAccessBlockRequest)
86
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
87
+ end)
88
+ end
89
+
90
+ end
91
+ end
File without changes
@@ -0,0 +1,14 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::S3Control
9
+ module Errors
10
+
11
+ extend Aws::Errors::DynamicErrors
12
+
13
+ end
14
+ end
@@ -0,0 +1,60 @@
1
+ module Aws
2
+ module S3Control
3
+ module Plugins
4
+ # @api private
5
+ class Dualstack < Seahorse::Client::Plugin
6
+
7
+ option(:use_dualstack_endpoint,
8
+ default: false,
9
+ doc_type: 'Boolean',
10
+ docstring: <<-DOCS)
11
+ When set to `true`, IPv6-compatible bucket endpoints will be used
12
+ for all operations.
13
+ DOCS
14
+
15
+ def add_handlers(handlers, config)
16
+ handlers.add(OptionHandler, step: :initialize)
17
+ handlers.add(DualstackHandler, step: :build, priority: 2)
18
+ end
19
+
20
+ # @api private
21
+ class OptionHandler < Seahorse::Client::Handler
22
+ def call(context)
23
+ dualstack = context.params.delete(:use_dualstack_endpoint)
24
+ dualstack = context.config.use_dualstack_endpoint if dualstack.nil?
25
+ context[:use_dualstack_endpoint] = dualstack
26
+ @handler.call(context)
27
+ end
28
+ end
29
+
30
+ # @api private
31
+ class DualstackHandler < Seahorse::Client::Handler
32
+ def call(context)
33
+ apply_dualstack_endpoint(context) if use_dualstack_endpoint?(context)
34
+ @handler.call(context)
35
+ end
36
+
37
+ private
38
+ def apply_dualstack_endpoint(context)
39
+ bucket_name = context.params[:bucket]
40
+ region = context.config.region
41
+ dns_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(
42
+ region
43
+ )
44
+ host = "s3-control.dualstack.#{region}.#{dns_suffix}"
45
+ endpoint = URI.parse(context.http_request.endpoint.to_s)
46
+ endpoint.scheme = context.http_request.endpoint.scheme
47
+ endpoint.port = context.http_request.endpoint.port
48
+ endpoint.host = host
49
+ context.http_request.endpoint = endpoint.to_s
50
+ end
51
+
52
+ def use_dualstack_endpoint?(context)
53
+ context[:use_dualstack_endpoint]
54
+ end
55
+ end
56
+
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,25 @@
1
+ module Aws
2
+ module S3Control
3
+ module Plugins
4
+ class S3ControlDns < Seahorse::Client::Plugin
5
+ def add_handlers(handlers, config)
6
+ handlers.add(Handler, step: :build, priority: 1)
7
+ end
8
+
9
+ class Handler < Seahorse::Client::Handler
10
+ def call(context)
11
+ move_account_id_to_subdomain(context)
12
+ @handler.call(context)
13
+ end
14
+
15
+ private
16
+ def move_account_id_to_subdomain(context)
17
+ account_id = context.params[:account_id]
18
+ endpoint = context.http_request.endpoint
19
+ endpoint.host = "#{account_id}.#{endpoint.host}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,28 @@
1
+ module Aws
2
+ module S3Control
3
+ module Plugins
4
+
5
+ # Support S3 host id, more information, see:
6
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/troubleshooting.html#sdk-request-ids
7
+ #
8
+ # This plugin adds :host_id for s3 responses when available
9
+ # @api private
10
+ class S3HostId < Seahorse::Client::Plugin
11
+
12
+ class Handler < Seahorse::Client::Handler
13
+
14
+ def call(context)
15
+ response = @handler.call(context)
16
+ h = context.http_response.headers
17
+ context[:s3_host_id] = h['x-amz-id-2']
18
+ response
19
+ end
20
+
21
+ end
22
+
23
+ handler(Handler, step: :sign)
24
+
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,83 @@
1
+ require 'aws-sigv4'
2
+
3
+ module Aws
4
+ module S3Control
5
+ module Plugins
6
+ # This plugin is an implementation detail and may be modified.
7
+ # @api private
8
+ class S3Signer < Seahorse::Client::Plugin
9
+
10
+ option(:sigv4_signer) do |cfg|
11
+ S3Signer.build_v4_signer(
12
+ region: cfg.sigv4_region,
13
+ credentials: cfg.credentials
14
+ )
15
+ end
16
+
17
+ option(:sigv4_region) do |cfg|
18
+ Aws::Partitions::EndpointProvider.signing_region(cfg.region, 's3')
19
+ end
20
+
21
+ def add_handlers(handlers, cfg)
22
+ handlers.add(V4Handler, step: :sign)
23
+ end
24
+
25
+ class V4Handler < Seahorse::Client::Handler
26
+
27
+ def call(context)
28
+ Aws::Plugins::SignatureV4.apply_signature(
29
+ context: context,
30
+ signer: sigv4_signer(context)
31
+ )
32
+ @handler.call(context)
33
+ end
34
+
35
+ private
36
+
37
+ def sigv4_signer(context)
38
+ # If the client was configured with the wrong region,
39
+ # we have to build a new signer.
40
+ if
41
+ context[:cached_sigv4_region] &&
42
+ context[:cached_sigv4_region] != context.config.sigv4_signer.region
43
+ then
44
+ S3Signer.build_v4_signer(
45
+ region: context[:cached_sigv4_region],
46
+ credentials: context.config.credentials
47
+ )
48
+ else
49
+ context.config.sigv4_signer
50
+ end
51
+ end
52
+ end
53
+
54
+ class << self
55
+
56
+ # @option options [required, String] :region
57
+ # @option options [required, #credentials] :credentials
58
+ # @api private
59
+ def build_v4_signer(options = {})
60
+ Aws::Sigv4::Signer.new({
61
+ service: 's3',
62
+ region: options[:region],
63
+ credentials_provider: options[:credentials],
64
+ uri_escape_path: false,
65
+ unsigned_headers: ['content-length', 'x-amzn-trace-id'],
66
+ })
67
+ end
68
+
69
+ def new_hostname(context, region)
70
+ bucket = context.params[:bucket]
71
+ if region == 'us-east-1'
72
+ "#{bucket}.s3.amazonaws.com"
73
+ else
74
+ endpoint = Aws::Partitions::EndpointProvider.resolve(region, 's3')
75
+ bucket + '.' + URI.parse(endpoint).host
76
+ end
77
+ end
78
+
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,23 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::S3Control
9
+ class Resource
10
+
11
+ # @param options ({})
12
+ # @option options [Client] :client
13
+ def initialize(options = {})
14
+ @client = options[:client] || Client.new(options)
15
+ end
16
+
17
+ # @return [Client]
18
+ def client
19
+ @client
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,205 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ module Aws::S3Control
9
+ module Types
10
+
11
+ # @note When making an API call, you may pass DeletePublicAccessBlockRequest
12
+ # data as a hash:
13
+ #
14
+ # {
15
+ # account_id: "AccountId", # required
16
+ # }
17
+ #
18
+ # @!attribute [rw] account_id
19
+ # The Account ID for the Amazon Web Services account whose Public
20
+ # Access Block configuration you want to remove.
21
+ # @return [String]
22
+ #
23
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlockRequest AWS API Documentation
24
+ #
25
+ class DeletePublicAccessBlockRequest < Struct.new(
26
+ :account_id)
27
+ include Aws::Structure
28
+ end
29
+
30
+ # @!attribute [rw] public_access_block_configuration
31
+ # The Public Access Block configuration currently in effect for this
32
+ # Amazon Web Services account.
33
+ # @return [Types::PublicAccessBlockConfiguration]
34
+ #
35
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlockOutput AWS API Documentation
36
+ #
37
+ class GetPublicAccessBlockOutput < Struct.new(
38
+ :public_access_block_configuration)
39
+ include Aws::Structure
40
+ end
41
+
42
+ # @note When making an API call, you may pass GetPublicAccessBlockRequest
43
+ # data as a hash:
44
+ #
45
+ # {
46
+ # account_id: "AccountId", # required
47
+ # }
48
+ #
49
+ # @!attribute [rw] account_id
50
+ # The Account ID for the Amazon Web Services account whose Public
51
+ # Access Block configuration you want to retrieve.
52
+ # @return [String]
53
+ #
54
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlockRequest AWS API Documentation
55
+ #
56
+ class GetPublicAccessBlockRequest < Struct.new(
57
+ :account_id)
58
+ include Aws::Structure
59
+ end
60
+
61
+ # The container element for all Public Access Block configuration
62
+ # options. You can enable the configuration options in any combination.
63
+ #
64
+ # Amazon S3 considers a bucket policy public unless at least one of the
65
+ # following conditions is true:
66
+ #
67
+ # 1. The policy limits access to a set of CIDRs using `aws:SourceIp`.
68
+ # For more information on CIDR, see
69
+ # [http://www.rfc-editor.org/rfc/rfc4632.txt][1]
70
+ #
71
+ # 2. The policy grants permissions, not including any "bad actions,"
72
+ # to one of the following:
73
+ #
74
+ # * A fixed AWS principal, user, role, or service principal
75
+ #
76
+ # * A fixed `aws:SourceArn`
77
+ #
78
+ # * A fixed `aws:SourceVpc`
79
+ #
80
+ # * A fixed `aws:SourceVpce`
81
+ #
82
+ # * A fixed `aws:SourceOwner`
83
+ #
84
+ # * A fixed `aws:SourceAccount`
85
+ #
86
+ # * A fixed value of
87
+ # `s3:x-amz-server-side-encryption-aws-kms-key-id`
88
+ #
89
+ # * A fixed value of `aws:userid` outside the pattern
90
+ # "`AROLEID:*`"
91
+ #
92
+ # "Bad actions" are those that could expose the data inside a bucket
93
+ # to reads or writes by the public. These actions are `s3:Get*`,
94
+ # `s3:List*`, `s3:AbortMultipartUpload`, `s3:Delete*`, `s3:Put*`, and
95
+ # `s3:RestoreObject`.
96
+ #
97
+ # The star notation for bad actions indicates that all matching
98
+ # operations are considered bad actions. For example, because `s3:Get*`
99
+ # is a bad action, `s3:GetObject`, `s3:GetObjectVersion`, and
100
+ # `s3:GetObjectAcl` are all bad actions.
101
+ #
102
+ #
103
+ #
104
+ # [1]: http://www.rfc-editor.org/rfc/rfc4632.txt
105
+ #
106
+ # @note When making an API call, you may pass PublicAccessBlockConfiguration
107
+ # data as a hash:
108
+ #
109
+ # {
110
+ # block_public_acls: false,
111
+ # ignore_public_acls: false,
112
+ # block_public_policy: false,
113
+ # restrict_public_buckets: false,
114
+ # }
115
+ #
116
+ # @!attribute [rw] block_public_acls
117
+ # Specifies whether Amazon S3 should block public ACLs for buckets in
118
+ # this account. Setting this element to `TRUE` causes the following
119
+ # behavior:
120
+ #
121
+ # * PUT Bucket acl and PUT Object acl calls will fail if the specified
122
+ # ACL allows public access.
123
+ #
124
+ # * PUT Object calls will fail if the request includes an object ACL.
125
+ #
126
+ # Note that enabling this setting doesn't affect existing policies or
127
+ # ACLs.
128
+ # @return [Boolean]
129
+ #
130
+ # @!attribute [rw] ignore_public_acls
131
+ # Specifies whether Amazon S3 should ignore public ACLs for buckets in
132
+ # this account. Setting this element to `TRUE` causes Amazon S3 to
133
+ # ignore all public ACLs on buckets in this account and any objects
134
+ # that they contain.
135
+ #
136
+ # Note that enabling this setting doesn't affect the persistence of
137
+ # any existing ACLs and doesn't prevent new public ACLs from being
138
+ # set.
139
+ # @return [Boolean]
140
+ #
141
+ # @!attribute [rw] block_public_policy
142
+ # Specifies whether Amazon S3 should block public bucket policies for
143
+ # buckets in this account. Setting this element to `TRUE` causes
144
+ # Amazon S3 to reject calls to PUT Bucket policy if the specified
145
+ # bucket policy allows public access.
146
+ #
147
+ # Note that enabling this setting doesn't affect existing bucket
148
+ # policies.
149
+ # @return [Boolean]
150
+ #
151
+ # @!attribute [rw] restrict_public_buckets
152
+ # Specifies whether Amazon S3 should restrict public bucket policies
153
+ # for buckets in this account. If this element is set to `TRUE`, then
154
+ # only the bucket owner and AWS Services can access buckets with
155
+ # public policies.
156
+ #
157
+ # Note that enabling this setting doesn't affect previously stored
158
+ # bucket policies, except that public and cross-account access within
159
+ # any public bucket policy, including non-public delegation to
160
+ # specific accounts, is blocked.
161
+ # @return [Boolean]
162
+ #
163
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PublicAccessBlockConfiguration AWS API Documentation
164
+ #
165
+ class PublicAccessBlockConfiguration < Struct.new(
166
+ :block_public_acls,
167
+ :ignore_public_acls,
168
+ :block_public_policy,
169
+ :restrict_public_buckets)
170
+ include Aws::Structure
171
+ end
172
+
173
+ # @note When making an API call, you may pass PutPublicAccessBlockRequest
174
+ # data as a hash:
175
+ #
176
+ # {
177
+ # public_access_block_configuration: { # required
178
+ # block_public_acls: false,
179
+ # ignore_public_acls: false,
180
+ # block_public_policy: false,
181
+ # restrict_public_buckets: false,
182
+ # },
183
+ # account_id: "AccountId", # required
184
+ # }
185
+ #
186
+ # @!attribute [rw] public_access_block_configuration
187
+ # The Public Access Block configuration that you want to apply to this
188
+ # Amazon Web Services account.
189
+ # @return [Types::PublicAccessBlockConfiguration]
190
+ #
191
+ # @!attribute [rw] account_id
192
+ # The Account ID for the Amazon Web Services account whose Public
193
+ # Access Block configuration you want to set.
194
+ # @return [String]
195
+ #
196
+ # @see http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlockRequest AWS API Documentation
197
+ #
198
+ class PutPublicAccessBlockRequest < Struct.new(
199
+ :public_access_block_configuration,
200
+ :account_id)
201
+ include Aws::Structure
202
+ end
203
+
204
+ end
205
+ end
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sigv4'
9
+ require 'aws-sdk-core'
10
+
11
+ require_relative 'aws-sdk-s3control/types'
12
+ require_relative 'aws-sdk-s3control/client_api'
13
+ require_relative 'aws-sdk-s3control/client'
14
+ require_relative 'aws-sdk-s3control/errors'
15
+ require_relative 'aws-sdk-s3control/resource'
16
+ require_relative 'aws-sdk-s3control/customizations'
17
+
18
+ # This module provides support for AWS S3 Control. This module is available in the
19
+ # `aws-sdk-s3control` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWS S3 Control all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::S3Control::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::S3Control
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-s3control
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-11-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sigv4
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk-core
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 3.26.0
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.26.0
47
+ description: Official AWS Ruby gem for AWS S3 Control. This gem is part of the AWS
48
+ SDK for Ruby.
49
+ email:
50
+ - trevrowe@amazon.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - lib/aws-sdk-s3control.rb
56
+ - lib/aws-sdk-s3control/client.rb
57
+ - lib/aws-sdk-s3control/client_api.rb
58
+ - lib/aws-sdk-s3control/customizations.rb
59
+ - lib/aws-sdk-s3control/errors.rb
60
+ - lib/aws-sdk-s3control/plugins/dualstack.rb
61
+ - lib/aws-sdk-s3control/plugins/s3_control_dns.rb
62
+ - lib/aws-sdk-s3control/plugins/s3_host_id.rb
63
+ - lib/aws-sdk-s3control/plugins/s3_signer.rb
64
+ - lib/aws-sdk-s3control/resource.rb
65
+ - lib/aws-sdk-s3control/types.rb
66
+ homepage: http://github.com/aws/aws-sdk-ruby
67
+ licenses:
68
+ - Apache-2.0
69
+ metadata:
70
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-s3control
71
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-s3control/CHANGELOG.md
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.5.2.3
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: AWS SDK for Ruby - AWS S3 Control
92
+ test_files: []