aws-sdk-core 2.4.0 → 3.53.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 -0
- data/ca-bundle.crt +3615 -3541
- data/lib/aws-sdk-core.rb +96 -408
- data/lib/aws-sdk-core/async_client_stubs.rb +80 -0
- data/lib/aws-sdk-core/binary.rb +6 -0
- data/lib/aws-sdk-core/binary/decode_handler.rb +56 -0
- data/lib/aws-sdk-core/binary/encode_handler.rb +32 -0
- data/lib/aws-sdk-core/binary/event_builder.rb +122 -0
- data/lib/aws-sdk-core/binary/event_parser.rb +134 -0
- data/lib/aws-sdk-core/binary/event_stream_decoder.rb +62 -0
- data/lib/aws-sdk-core/binary/event_stream_encoder.rb +53 -0
- data/lib/aws-sdk-core/client_side_monitoring/publisher.rb +41 -0
- data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +197 -0
- data/lib/aws-sdk-core/client_stubs.rb +73 -10
- data/lib/aws-sdk-core/credential_provider.rb +2 -0
- data/lib/aws-sdk-core/credential_provider_chain.rb +22 -5
- data/lib/aws-sdk-core/ecs_credentials.rb +3 -3
- data/lib/aws-sdk-core/endpoint_cache.rb +188 -0
- data/lib/aws-sdk-core/errors.rb +174 -10
- data/lib/aws-sdk-core/event_emitter.rb +62 -0
- data/lib/aws-sdk-core/ini_parser.rb +1 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +21 -12
- data/lib/aws-sdk-core/json.rb +4 -5
- data/lib/aws-sdk-core/json/builder.rb +4 -2
- data/lib/aws-sdk-core/json/error_handler.rb +19 -2
- data/lib/aws-sdk-core/json/handler.rb +22 -3
- data/lib/aws-sdk-core/json/parser.rb +1 -1
- data/lib/aws-sdk-core/log/param_filter.rb +4 -3
- data/lib/aws-sdk-core/pageable_response.rb +1 -0
- data/lib/aws-sdk-core/pager.rb +30 -25
- data/lib/aws-sdk-core/param_converter.rb +3 -3
- data/lib/aws-sdk-core/param_validator.rb +56 -21
- data/lib/aws-sdk-core/plugins/api_key.rb +52 -0
- data/lib/aws-sdk-core/plugins/apig_authorizer_token.rb +30 -0
- data/lib/aws-sdk-core/plugins/apig_credentials_configuration.rb +34 -0
- data/lib/aws-sdk-core/plugins/apig_user_agent.rb +37 -0
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +256 -0
- data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +84 -0
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +62 -0
- data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +160 -0
- data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +63 -0
- data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +30 -0
- data/lib/aws-sdk-core/plugins/global_configuration.rb +19 -10
- data/lib/aws-sdk-core/plugins/helpful_socket_errors.rb +41 -0
- data/lib/aws-sdk-core/plugins/idempotency_token.rb +36 -0
- data/lib/aws-sdk-core/plugins/invocation_id.rb +33 -0
- data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +29 -0
- data/lib/aws-sdk-core/plugins/logging.rb +18 -18
- data/lib/aws-sdk-core/plugins/param_converter.rb +9 -5
- data/lib/aws-sdk-core/plugins/param_validator.rb +8 -5
- data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +10 -0
- data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -1
- data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +13 -12
- data/lib/aws-sdk-core/plugins/protocols/query.rb +2 -2
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +28 -16
- data/lib/aws-sdk-core/plugins/response_paging.rb +5 -18
- data/lib/aws-sdk-core/plugins/retry_errors.rb +97 -23
- data/lib/aws-sdk-core/plugins/signature_v2.rb +51 -0
- data/lib/aws-sdk-core/plugins/signature_v4.rb +141 -0
- data/lib/aws-sdk-core/plugins/stub_responses.rb +35 -18
- data/lib/aws-sdk-core/plugins/transfer_encoding.rb +53 -0
- data/lib/aws-sdk-core/plugins/user_agent.rb +23 -6
- data/lib/aws-sdk-core/process_credentials.rb +76 -0
- data/lib/aws-sdk-core/query.rb +5 -0
- data/lib/aws-sdk-core/query/ec2_param_builder.rb +9 -3
- data/lib/aws-sdk-core/query/handler.rb +20 -16
- data/lib/aws-sdk-core/query/param_builder.rb +10 -4
- data/lib/aws-sdk-core/refreshing_credentials.rb +1 -1
- data/lib/aws-sdk-core/resources/collection.rb +121 -0
- data/lib/aws-sdk-core/rest.rb +10 -0
- data/lib/aws-sdk-core/rest/handler.rb +1 -0
- data/lib/aws-sdk-core/rest/request/builder.rb +2 -1
- data/lib/aws-sdk-core/rest/request/endpoint.rb +11 -66
- data/lib/aws-sdk-core/rest/request/headers.rb +20 -1
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +103 -0
- data/lib/aws-sdk-core/rest/response/body.rb +14 -1
- data/lib/aws-sdk-core/rest/response/headers.rb +9 -0
- data/lib/aws-sdk-core/rest/response/parser.rb +18 -14
- data/lib/aws-sdk-core/shared_config.rb +132 -18
- data/lib/aws-sdk-core/shared_credentials.rb +2 -0
- data/lib/aws-sdk-core/structure.rb +21 -11
- data/lib/aws-sdk-core/stubbing/data_applicator.rb +1 -1
- data/lib/aws-sdk-core/stubbing/empty_stub.rb +10 -3
- data/lib/aws-sdk-core/stubbing/protocols/api_gateway.rb +8 -0
- data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +1 -1
- data/lib/aws-sdk-core/stubbing/protocols/rest.rb +99 -1
- data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +5 -1
- data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +9 -5
- data/lib/aws-sdk-core/stubbing/stub_data.rb +16 -3
- data/lib/aws-sdk-core/util.rb +66 -0
- data/lib/aws-sdk-core/waiters.rb +3 -0
- data/lib/aws-sdk-core/waiters/poller.rb +5 -7
- data/lib/aws-sdk-core/waiters/waiter.rb +1 -0
- data/lib/aws-sdk-core/xml.rb +9 -0
- data/lib/aws-sdk-core/xml/builder.rb +11 -5
- data/lib/aws-sdk-core/xml/error_handler.rb +27 -5
- data/lib/aws-sdk-core/xml/parser.rb +1 -11
- data/lib/aws-sdk-core/xml/parser/engines/ox.rb +5 -1
- data/lib/aws-sdk-core/xml/parser/frame.rb +6 -6
- data/lib/aws-sdk-sts.rb +45 -0
- data/lib/aws-sdk-sts/client.rb +1761 -0
- data/lib/aws-sdk-sts/client_api.rb +304 -0
- data/lib/aws-sdk-sts/customizations.rb +0 -0
- data/lib/aws-sdk-sts/errors.rb +142 -0
- data/lib/aws-sdk-sts/resource.rb +23 -0
- data/lib/aws-sdk-sts/types.rb +1279 -0
- data/lib/seahorse.rb +60 -60
- data/lib/seahorse/client/async_base.rb +50 -0
- data/lib/seahorse/client/async_response.rb +62 -0
- data/lib/seahorse/client/base.rb +2 -8
- data/lib/seahorse/client/configuration.rb +9 -1
- data/lib/seahorse/client/h2/connection.rb +244 -0
- data/lib/seahorse/client/h2/handler.rb +151 -0
- data/lib/seahorse/client/http/async_response.rb +42 -0
- data/lib/seahorse/client/http/response.rb +10 -5
- data/lib/seahorse/client/logging/formatter.rb +5 -1
- data/lib/seahorse/client/logging/handler.rb +2 -0
- data/lib/seahorse/client/net_http/connection_pool.rb +27 -11
- data/lib/seahorse/client/net_http/handler.rb +10 -2
- data/lib/seahorse/client/net_http/patches.rb +9 -1
- data/lib/seahorse/client/networking_error.rb +28 -0
- data/lib/seahorse/client/plugin.rb +66 -6
- data/lib/seahorse/client/plugin_list.rb +3 -1
- data/lib/seahorse/client/plugins/content_length.rb +7 -2
- data/lib/seahorse/client/plugins/endpoint.rb +14 -10
- data/lib/seahorse/client/plugins/h2.rb +64 -0
- data/lib/seahorse/client/plugins/logging.rb +17 -19
- data/lib/seahorse/client/plugins/net_http.rb +23 -15
- data/lib/seahorse/client/plugins/raise_response_errors.rb +4 -4
- data/lib/seahorse/client/plugins/response_target.rb +10 -1
- data/lib/seahorse/client/request_context.rb +5 -0
- data/lib/seahorse/client/response.rb +9 -20
- data/lib/seahorse/model/api.rb +37 -0
- data/lib/seahorse/model/authorizer.rb +21 -0
- data/lib/seahorse/model/operation.rb +20 -0
- data/lib/seahorse/model/shapes.rb +44 -2
- data/lib/seahorse/util.rb +1 -21
- metadata +112 -359
- data/apis/acm/2015-12-08/api-2.json +0 -495
- data/apis/acm/2015-12-08/examples-1.json +0 -5
- data/apis/acm/2015-12-08/paginators-1.json +0 -10
- data/apis/apigateway/2015-07-09/api-2.json +0 -3347
- data/apis/apigateway/2015-07-09/examples-1.json +0 -5
- data/apis/apigateway/2015-07-09/paginators-1.json +0 -52
- data/apis/application-autoscaling/2016-02-06/api-2.json +0 -502
- data/apis/application-autoscaling/2016-02-06/examples-1.json +0 -5
- data/apis/application-autoscaling/2016-02-06/paginators-1.json +0 -22
- data/apis/autoscaling/2011-01-01/api-2.json +0 -2038
- data/apis/autoscaling/2011-01-01/examples-1.json +0 -5
- data/apis/autoscaling/2011-01-01/paginators-1.json +0 -52
- data/apis/autoscaling/2011-01-01/resources-1.json +0 -1613
- data/apis/autoscaling/2011-01-01/waiters-2.json +0 -62
- data/apis/cloudformation/2010-05-15/api-2.json +0 -1299
- data/apis/cloudformation/2010-05-15/examples-1.json +0 -5
- data/apis/cloudformation/2010-05-15/paginators-1.json +0 -27
- data/apis/cloudformation/2010-05-15/resources-1.json +0 -202
- data/apis/cloudformation/2010-05-15/waiters-2.json +0 -235
- data/apis/cloudfront/2016-01-28/api-2.json +0 -2218
- data/apis/cloudfront/2016-01-28/examples-1.json +0 -5
- data/apis/cloudfront/2016-01-28/paginators-1.json +0 -32
- data/apis/cloudfront/2016-01-28/waiters-2.json +0 -47
- data/apis/cloudhsm/2014-05-30/api-2.json +0 -877
- data/apis/cloudhsm/2014-05-30/examples-1.json +0 -5
- data/apis/cloudsearch/2013-01-01/api-2.json +0 -2001
- data/apis/cloudsearch/2013-01-01/paginators-1.json +0 -20
- data/apis/cloudsearchdomain/2013-01-01/api-2.json +0 -373
- data/apis/cloudsearchdomain/2013-01-01/examples-1.json +0 -5
- data/apis/cloudtrail/2013-11-01/api-2.json +0 -801
- data/apis/cloudtrail/2013-11-01/examples-1.json +0 -5
- data/apis/cloudtrail/2013-11-01/paginators-1.json +0 -7
- data/apis/codecommit/2015-04-13/api-2.json +0 -916
- data/apis/codecommit/2015-04-13/examples-1.json +0 -5
- data/apis/codecommit/2015-04-13/paginators-1.json +0 -14
- data/apis/codedeploy/2014-10-06/api-2.json +0 -1954
- data/apis/codedeploy/2014-10-06/examples-1.json +0 -5
- data/apis/codedeploy/2014-10-06/paginators-1.json +0 -34
- data/apis/codepipeline/2015-07-09/api-2.json +0 -1633
- data/apis/codepipeline/2015-07-09/examples-1.json +0 -902
- data/apis/cognito-identity/2014-06-30/api-2.json +0 -859
- data/apis/cognito-identity/2014-06-30/examples-1.json +0 -5
- data/apis/cognito-idp/2016-04-18/api-2.json +0 -1657
- data/apis/cognito-idp/2016-04-18/examples-1.json +0 -5
- data/apis/cognito-sync/2014-06-30/api-2.json +0 -1874
- data/apis/config/2014-11-12/api-2.json +0 -1303
- data/apis/config/2014-11-12/examples-1.json +0 -5
- data/apis/config/2014-11-12/paginators-1.json +0 -10
- data/apis/datapipeline/2012-10-29/api-2.json +0 -1167
- data/apis/datapipeline/2012-10-29/paginators-1.json +0 -26
- data/apis/devicefarm/2015-06-23/api-2.json +0 -2030
- data/apis/devicefarm/2015-06-23/examples-1.json +0 -5
- data/apis/devicefarm/2015-06-23/paginators-1.json +0 -74
- data/apis/directconnect/2012-10-25/api-2.json +0 -793
- data/apis/directconnect/2012-10-25/examples-1.json +0 -5
- data/apis/directconnect/2012-10-25/paginators-1.json +0 -22
- data/apis/discovery/2015-11-01/api-2.json +0 -556
- data/apis/discovery/2015-11-01/examples-1.json +0 -5
- data/apis/dms/2016-01-01/api-2.json +0 -1469
- data/apis/dms/2016-01-01/examples-1.json +0 -5
- data/apis/ds/2015-04-16/api-2.json +0 -1674
- data/apis/ds/2015-04-16/examples-1.json +0 -5
- data/apis/dynamodb/2012-08-10/api-2.json +0 -1200
- data/apis/dynamodb/2012-08-10/examples-1.json +0 -5
- data/apis/dynamodb/2012-08-10/paginators-1.json +0 -26
- data/apis/dynamodb/2012-08-10/resources-1.json +0 -136
- data/apis/dynamodb/2012-08-10/waiters-2.json +0 -35
- data/apis/ec2/2015-10-01/api-2.json +0 -13759
- data/apis/ec2/2015-10-01/examples-1.json +0 -5
- data/apis/ec2/2015-10-01/paginators-1.json +0 -138
- data/apis/ec2/2015-10-01/resources-1.json +0 -2582
- data/apis/ec2/2015-10-01/waiters-2.json +0 -593
- data/apis/ec2/2016-04-01/api-2.json +0 -13842
- data/apis/ec2/2016-04-01/examples-1.json +0 -5
- data/apis/ec2/2016-04-01/paginators-1.json +0 -138
- data/apis/ec2/2016-04-01/resources-1.json +0 -2582
- data/apis/ec2/2016-04-01/waiters-2.json +0 -593
- data/apis/ecr/2015-09-21/api-2.json +0 -849
- data/apis/ecr/2015-09-21/examples-1.json +0 -5
- data/apis/ecs/2014-11-13/api-2.json +0 -1396
- data/apis/ecs/2014-11-13/examples-1.json +0 -5
- data/apis/ecs/2014-11-13/paginators-1.json +0 -40
- data/apis/ecs/2014-11-13/waiters-2.json +0 -93
- data/apis/elasticache/2015-02-02/api-2.json +0 -2426
- data/apis/elasticache/2015-02-02/examples-1.json +0 -5
- data/apis/elasticache/2015-02-02/paginators-1.json +0 -76
- data/apis/elasticache/2015-02-02/waiters-2.json +0 -143
- data/apis/elasticbeanstalk/2010-12-01/api-2.json +0 -1894
- data/apis/elasticbeanstalk/2010-12-01/examples-1.json +0 -1109
- data/apis/elasticbeanstalk/2010-12-01/paginators-1.json +0 -25
- data/apis/elasticfilesystem/2015-02-01/api-2.json +0 -713
- data/apis/elasticfilesystem/2015-02-01/examples-1.json +0 -5
- data/apis/elasticloadbalancing/2012-06-01/api-2.json +0 -2145
- data/apis/elasticloadbalancing/2012-06-01/paginators-1.json +0 -18
- data/apis/elasticloadbalancing/2012-06-01/waiters-2.json +0 -49
- data/apis/elasticmapreduce/2009-03-31/api-2.json +0 -1341
- data/apis/elasticmapreduce/2009-03-31/examples-1.json +0 -5
- data/apis/elasticmapreduce/2009-03-31/paginators-1.json +0 -32
- data/apis/elasticmapreduce/2009-03-31/waiters-2.json +0 -67
- data/apis/elastictranscoder/2012-09-25/api-2.json +0 -1807
- data/apis/elastictranscoder/2012-09-25/paginators-1.json +0 -24
- data/apis/elastictranscoder/2012-09-25/waiters-2.json +0 -30
- data/apis/email/2010-12-01/api-2.json +0 -1791
- data/apis/email/2010-12-01/examples-1.json +0 -5
- data/apis/email/2010-12-01/paginators-1.json +0 -13
- data/apis/email/2010-12-01/waiters-2.json +0 -18
- data/apis/es/2015-01-01/api-2.json +0 -764
- data/apis/events/2015-10-07/api-2.json +0 -643
- data/apis/events/2015-10-07/examples-1.json +0 -5
- data/apis/firehose/2015-08-04/api-2.json +0 -719
- data/apis/gamelift/2015-10-01/api-2.json +0 -2307
- data/apis/gamelift/2015-10-01/examples-1.json +0 -5
- data/apis/glacier/2012-06-01/api-2.json +0 -2144
- data/apis/glacier/2012-06-01/paginators-1.json +0 -28
- data/apis/glacier/2012-06-01/resources-1.json +0 -563
- data/apis/glacier/2012-06-01/waiters-2.json +0 -39
- data/apis/iam/2010-05-08/api-2.json +0 -4514
- data/apis/iam/2010-05-08/examples-1.json +0 -5
- data/apis/iam/2010-05-08/paginators-1.json +0 -198
- data/apis/iam/2010-05-08/resources-1.json +0 -1740
- data/apis/iam/2010-05-08/waiters-2.json +0 -39
- data/apis/importexport/2010-06-01/api-2.json +0 -666
- data/apis/importexport/2010-06-01/paginators-1.json +0 -11
- data/apis/inspector/2016-02-16/api-2.json +0 -1964
- data/apis/inspector/2016-02-16/examples-1.json +0 -5
- data/apis/iot-data/2015-05-28/api-2.json +0 -263
- data/apis/iot/2015-05-28/api-2.json +0 -3800
- data/apis/iot/2015-05-28/examples-1.json +0 -5
- data/apis/kinesis/2013-12-02/api-2.json +0 -822
- data/apis/kinesis/2013-12-02/examples-1.json +0 -5
- data/apis/kinesis/2013-12-02/paginators-1.json +0 -18
- data/apis/kinesis/2013-12-02/waiters-2.json +0 -18
- data/apis/kms/2014-11-01/api-2.json +0 -1209
- data/apis/kms/2014-11-01/examples-1.json +0 -5
- data/apis/kms/2014-11-01/paginators-1.json +0 -32
- data/apis/lambda/2014-11-11/api-2.json +0 -667
- data/apis/lambda/2014-11-11/paginators-1.json +0 -16
- data/apis/lambda/2015-03-31/api-2.json +0 -1342
- data/apis/lambda/2015-03-31/examples-1.json +0 -5
- data/apis/lambda/2015-03-31/paginators-1.json +0 -16
- data/apis/logs/2014-03-28/api-2.json +0 -1138
- data/apis/logs/2014-03-28/examples-1.json +0 -5
- data/apis/logs/2014-03-28/paginators-1.json +0 -49
- data/apis/machinelearning/2014-12-12/api-2.json +0 -1947
- data/apis/machinelearning/2014-12-12/paginators-1.json +0 -28
- data/apis/machinelearning/2014-12-12/waiters-2.json +0 -81
- data/apis/marketplacecommerceanalytics/2015-07-01/api-2.json +0 -120
- data/apis/marketplacecommerceanalytics/2015-07-01/examples-1.json +0 -5
- data/apis/meteringmarketplace/2016-01-14/api-2.json +0 -127
- data/apis/meteringmarketplace/2016-01-14/examples-1.json +0 -5
- data/apis/monitoring/2010-08-01/api-2.json +0 -790
- data/apis/monitoring/2010-08-01/examples-1.json +0 -5
- data/apis/monitoring/2010-08-01/paginators-1.json +0 -24
- data/apis/monitoring/2010-08-01/resources-1.json +0 -346
- data/apis/monitoring/2010-08-01/waiters-2.json +0 -18
- data/apis/opsworks/2013-02-18/api-2.json +0 -2606
- data/apis/opsworks/2013-02-18/examples-1.json +0 -5
- data/apis/opsworks/2013-02-18/paginators-1.json +0 -55
- data/apis/opsworks/2013-02-18/resources-1.json +0 -173
- data/apis/opsworks/2013-02-18/waiters-2.json +0 -295
- data/apis/rds/2014-10-31/api-2.json +0 -4757
- data/apis/rds/2014-10-31/examples-1.json +0 -5
- data/apis/rds/2014-10-31/paginators-1.json +0 -110
- data/apis/rds/2014-10-31/resources-1.json +0 -3272
- data/apis/rds/2014-10-31/waiters-2.json +0 -102
- data/apis/redshift/2012-12-01/api-2.json +0 -3768
- data/apis/redshift/2012-12-01/examples-1.json +0 -5
- data/apis/redshift/2012-12-01/paginators-1.json +0 -94
- data/apis/redshift/2012-12-01/waiters-2.json +0 -97
- data/apis/route53/2013-04-01/api-2.json +0 -3245
- data/apis/route53/2013-04-01/examples-1.json +0 -5
- data/apis/route53/2013-04-01/paginators-1.json +0 -33
- data/apis/route53/2013-04-01/waiters-2.json +0 -18
- data/apis/route53domains/2014-05-15/api-2.json +0 -1197
- data/apis/route53domains/2014-05-15/paginators-1.json +0 -17
- data/apis/s3/2006-03-01/api-2.json +0 -4517
- data/apis/s3/2006-03-01/examples-1.json +0 -5
- data/apis/s3/2006-03-01/paginators-1.json +0 -66
- data/apis/s3/2006-03-01/resources-1.json +0 -1176
- data/apis/s3/2006-03-01/waiters-2.json +0 -73
- data/apis/sdb/2009-04-15/api-2.json +0 -954
- data/apis/sdb/2009-04-15/paginators-1.json +0 -15
- data/apis/servicecatalog/2015-12-10/api-2.json +0 -749
- data/apis/servicecatalog/2015-12-10/examples-1.json +0 -5
- data/apis/sns/2010-03-31/api-2.json +0 -1139
- data/apis/sns/2010-03-31/paginators-1.json +0 -29
- data/apis/sns/2010-03-31/resources-1.json +0 -327
- data/apis/sqs/2012-11-05/api-2.json +0 -950
- data/apis/sqs/2012-11-05/examples-1.json +0 -44
- data/apis/sqs/2012-11-05/paginators-1.json +0 -7
- data/apis/ssm/2014-11-06/api-2.json +0 -1796
- data/apis/ssm/2014-11-06/examples-1.json +0 -5
- data/apis/ssm/2014-11-06/paginators-1.json +0 -34
- data/apis/storagegateway/2013-06-30/api-2.json +0 -2275
- data/apis/storagegateway/2013-06-30/examples-1.json +0 -5
- data/apis/storagegateway/2013-06-30/paginators-1.json +0 -52
- data/apis/streams.dynamodb/2012-08-10/api-2.json +0 -397
- data/apis/streams.dynamodb/2012-08-10/examples-1.json +0 -5
- data/apis/sts/2011-06-15/api-2.json +0 -521
- data/apis/sts/2011-06-15/examples-1.json +0 -5
- data/apis/support/2013-04-15/api-2.json +0 -869
- data/apis/support/2013-04-15/paginators-1.json +0 -25
- data/apis/swf/2012-01-25/api-2.json +0 -2838
- data/apis/swf/2012-01-25/paginators-1.json +0 -46
- data/apis/waf/2015-08-24/api-2.json +0 -1959
- data/apis/waf/2015-08-24/examples-1.json +0 -5
- data/apis/workspaces/2015-04-08/api-2.json +0 -632
- data/apis/workspaces/2015-04-08/examples-1.json +0 -5
- data/apis/workspaces/2015-04-08/paginators-1.json +0 -20
- data/bin/aws.rb +0 -180
- data/endpoints.json +0 -1460
- data/lib/aws-sdk-core/acm.rb +0 -6
- data/lib/aws-sdk-core/api/builder.rb +0 -106
- data/lib/aws-sdk-core/api/customizations.rb +0 -217
- data/lib/aws-sdk-core/api/docs/builder.rb +0 -220
- data/lib/aws-sdk-core/api/docs/client_type_documenter.rb +0 -109
- data/lib/aws-sdk-core/api/docs/docstring_provider.rb +0 -75
- data/lib/aws-sdk-core/api/docs/operation_documenter.rb +0 -138
- data/lib/aws-sdk-core/api/docs/param_formatter.rb +0 -163
- data/lib/aws-sdk-core/api/docs/request_syntax_example.rb +0 -22
- data/lib/aws-sdk-core/api/docs/response_structure_example.rb +0 -91
- data/lib/aws-sdk-core/api/docs/shared_example.rb +0 -100
- data/lib/aws-sdk-core/api/docs/utils.rb +0 -133
- data/lib/aws-sdk-core/api/shape_map.rb +0 -142
- data/lib/aws-sdk-core/apigateway.rb +0 -6
- data/lib/aws-sdk-core/applicationautoscaling.rb +0 -6
- data/lib/aws-sdk-core/applicationdiscoveryservice.rb +0 -5
- data/lib/aws-sdk-core/autoscaling.rb +0 -8
- data/lib/aws-sdk-core/checksums.rb +0 -51
- data/lib/aws-sdk-core/client.rb +0 -57
- data/lib/aws-sdk-core/client_waiters.rb +0 -120
- data/lib/aws-sdk-core/cloudformation.rb +0 -8
- data/lib/aws-sdk-core/cloudfront.rb +0 -15
- data/lib/aws-sdk-core/cloudfront/url_signer.rb +0 -167
- data/lib/aws-sdk-core/cloudhsm.rb +0 -5
- data/lib/aws-sdk-core/cloudsearch.rb +0 -5
- data/lib/aws-sdk-core/cloudsearchdomain.rb +0 -5
- data/lib/aws-sdk-core/cloudtrail.rb +0 -6
- data/lib/aws-sdk-core/cloudwatch.rb +0 -8
- data/lib/aws-sdk-core/cloudwatchevents.rb +0 -5
- data/lib/aws-sdk-core/cloudwatchlogs.rb +0 -6
- data/lib/aws-sdk-core/codecommit.rb +0 -6
- data/lib/aws-sdk-core/codedeploy.rb +0 -6
- data/lib/aws-sdk-core/codepipeline.rb +0 -5
- data/lib/aws-sdk-core/cognitoidentity.rb +0 -5
- data/lib/aws-sdk-core/cognitoidentityprovider.rb +0 -5
- data/lib/aws-sdk-core/cognitosync.rb +0 -4
- data/lib/aws-sdk-core/configservice.rb +0 -6
- data/lib/aws-sdk-core/databasemigrationservice.rb +0 -5
- data/lib/aws-sdk-core/datapipeline.rb +0 -5
- data/lib/aws-sdk-core/devicefarm.rb +0 -6
- data/lib/aws-sdk-core/directconnect.rb +0 -6
- data/lib/aws-sdk-core/directoryservice.rb +0 -5
- data/lib/aws-sdk-core/dynamodb.rb +0 -40
- data/lib/aws-sdk-core/dynamodb/attribute_value.rb +0 -108
- data/lib/aws-sdk-core/dynamodbstreams.rb +0 -5
- data/lib/aws-sdk-core/ec2.rb +0 -8
- data/lib/aws-sdk-core/ecr.rb +0 -5
- data/lib/aws-sdk-core/ecs.rb +0 -7
- data/lib/aws-sdk-core/efs.rb +0 -5
- data/lib/aws-sdk-core/elasticache.rb +0 -7
- data/lib/aws-sdk-core/elasticbeanstalk.rb +0 -6
- data/lib/aws-sdk-core/elasticloadbalancing.rb +0 -6
- data/lib/aws-sdk-core/elasticsearchservice.rb +0 -4
- data/lib/aws-sdk-core/elastictranscoder.rb +0 -6
- data/lib/aws-sdk-core/empty_structure.rb +0 -3
- data/lib/aws-sdk-core/emr.rb +0 -7
- data/lib/aws-sdk-core/endpoint_provider.rb +0 -95
- data/lib/aws-sdk-core/firehose.rb +0 -4
- data/lib/aws-sdk-core/gamelift.rb +0 -5
- data/lib/aws-sdk-core/glacier.rb +0 -7
- data/lib/aws-sdk-core/iam.rb +0 -8
- data/lib/aws-sdk-core/importexport.rb +0 -5
- data/lib/aws-sdk-core/inspector.rb +0 -5
- data/lib/aws-sdk-core/iot.rb +0 -5
- data/lib/aws-sdk-core/iotdataplane.rb +0 -4
- data/lib/aws-sdk-core/kinesis.rb +0 -7
- data/lib/aws-sdk-core/kms.rb +0 -6
- data/lib/aws-sdk-core/lambda.rb +0 -6
- data/lib/aws-sdk-core/lambdapreview.rb +0 -5
- data/lib/aws-sdk-core/machinelearning.rb +0 -6
- data/lib/aws-sdk-core/marketplacecommerceanalytics.rb +0 -5
- data/lib/aws-sdk-core/marketplacemetering.rb +0 -5
- data/lib/aws-sdk-core/opsworks.rb +0 -8
- data/lib/aws-sdk-core/partitions.rb +0 -174
- data/lib/aws-sdk-core/partitions/partition.rb +0 -95
- data/lib/aws-sdk-core/partitions/partition_list.rb +0 -60
- data/lib/aws-sdk-core/partitions/region.rb +0 -78
- data/lib/aws-sdk-core/partitions/service.rb +0 -84
- data/lib/aws-sdk-core/plugins/api_gateway_header.rb +0 -19
- data/lib/aws-sdk-core/plugins/csd_conditional_signing.rb +0 -30
- data/lib/aws-sdk-core/plugins/dynamodb_crc32_validation.rb +0 -52
- data/lib/aws-sdk-core/plugins/dynamodb_extended_retries.rb +0 -22
- data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +0 -209
- data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +0 -87
- data/lib/aws-sdk-core/plugins/ec2_region_validation.rb +0 -17
- data/lib/aws-sdk-core/plugins/glacier_account_id.rb +0 -19
- data/lib/aws-sdk-core/plugins/glacier_api_version.rb +0 -19
- data/lib/aws-sdk-core/plugins/glacier_checksums.rb +0 -87
- data/lib/aws-sdk-core/plugins/machine_learning_predict_endpoint.rb +0 -20
- data/lib/aws-sdk-core/plugins/request_signer.rb +0 -138
- data/lib/aws-sdk-core/plugins/route_53_id_fix.rb +0 -55
- data/lib/aws-sdk-core/plugins/s3_accelerate.rb +0 -73
- data/lib/aws-sdk-core/plugins/s3_bucket_dns.rb +0 -86
- data/lib/aws-sdk-core/plugins/s3_bucket_name_restrictions.rb +0 -21
- data/lib/aws-sdk-core/plugins/s3_expect_100_continue.rb +0 -27
- data/lib/aws-sdk-core/plugins/s3_get_bucket_location_fix.rb +0 -21
- data/lib/aws-sdk-core/plugins/s3_http_200_errors.rb +0 -45
- data/lib/aws-sdk-core/plugins/s3_location_constraint.rb +0 -31
- data/lib/aws-sdk-core/plugins/s3_md5s.rb +0 -50
- data/lib/aws-sdk-core/plugins/s3_redirects.rb +0 -37
- data/lib/aws-sdk-core/plugins/s3_request_signer.rb +0 -166
- data/lib/aws-sdk-core/plugins/s3_sse_cpk.rb +0 -64
- data/lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb +0 -92
- data/lib/aws-sdk-core/plugins/sqs_md5s.rb +0 -162
- data/lib/aws-sdk-core/plugins/sqs_queue_urls.rb +0 -34
- data/lib/aws-sdk-core/plugins/swf_read_timeouts.rb +0 -23
- data/lib/aws-sdk-core/rds.rb +0 -8
- data/lib/aws-sdk-core/redshift.rb +0 -7
- data/lib/aws-sdk-core/route53.rb +0 -7
- data/lib/aws-sdk-core/route53domains.rb +0 -5
- data/lib/aws-sdk-core/s3.rb +0 -26
- data/lib/aws-sdk-core/s3/bucket_region_cache.rb +0 -75
- data/lib/aws-sdk-core/s3/presigner.rb +0 -113
- data/lib/aws-sdk-core/service.rb +0 -4
- data/lib/aws-sdk-core/servicecatalog.rb +0 -5
- data/lib/aws-sdk-core/ses.rb +0 -7
- data/lib/aws-sdk-core/signers/base.rb +0 -31
- data/lib/aws-sdk-core/signers/s3.rb +0 -184
- data/lib/aws-sdk-core/signers/v2.rb +0 -51
- data/lib/aws-sdk-core/signers/v3.rb +0 -34
- data/lib/aws-sdk-core/signers/v4.rb +0 -233
- data/lib/aws-sdk-core/simpledb.rb +0 -5
- data/lib/aws-sdk-core/sns.rb +0 -6
- data/lib/aws-sdk-core/sqs.rb +0 -6
- data/lib/aws-sdk-core/ssm.rb +0 -6
- data/lib/aws-sdk-core/storagegateway.rb +0 -6
- data/lib/aws-sdk-core/sts.rb +0 -5
- data/lib/aws-sdk-core/support.rb +0 -5
- data/lib/aws-sdk-core/swf.rb +0 -5
- data/lib/aws-sdk-core/tree_hash.rb +0 -69
- data/lib/aws-sdk-core/version.rb +0 -3
- data/lib/aws-sdk-core/waf.rb +0 -5
- data/lib/aws-sdk-core/waiters/null_provider.rb +0 -12
- data/lib/aws-sdk-core/waiters/provider.rb +0 -35
- data/lib/aws-sdk-core/workspaces.rb +0 -6
- data/lib/seahorse/client/plugins/restful_bindings.rb +0 -127
- data/service-models.json +0 -285
@@ -1,73 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
|
4
|
-
# Provides support for using `Aws::S3::Client` with Amazon S3 Transfer
|
5
|
-
# Acceleration.
|
6
|
-
#
|
7
|
-
# Go here for more information about transfer acceleration:
|
8
|
-
# [http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html)
|
9
|
-
#
|
10
|
-
# @seahorse.client.option [Boolean] :use_accelerate_endpoint (false)
|
11
|
-
# When set to `true`, accelerated bucket endpoints will be used
|
12
|
-
# for all object operations. You must first enable
|
13
|
-
# accelerate for each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html).
|
14
|
-
#
|
15
|
-
class S3Accelerate < Seahorse::Client::Plugin
|
16
|
-
|
17
|
-
option(:use_accelerate_endpoint, false)
|
18
|
-
|
19
|
-
def add_handlers(handlers, config)
|
20
|
-
operations = config.api.operation_names - [
|
21
|
-
:create_bucket, :list_buckets, :delete_bucket,
|
22
|
-
]
|
23
|
-
handlers.add(OptionHandler, step: :initialize, operations: operations)
|
24
|
-
handlers.add(AccelerateHandler, step: :build, priority: 0, operations: operations)
|
25
|
-
end
|
26
|
-
|
27
|
-
# @api private
|
28
|
-
class OptionHandler < Seahorse::Client::Handler
|
29
|
-
def call(context)
|
30
|
-
accelerate = context.params.delete(:use_accelerate_endpoint)
|
31
|
-
accelerate = context.config.use_accelerate_endpoint if accelerate.nil?
|
32
|
-
context[:use_accelerate_endpoint] = accelerate
|
33
|
-
@handler.call(context)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
# @api private
|
38
|
-
class AccelerateHandler < Seahorse::Client::Handler
|
39
|
-
|
40
|
-
def call(context)
|
41
|
-
use_accelerate_endpoint(context) if context[:use_accelerate_endpoint]
|
42
|
-
@handler.call(context)
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
|
47
|
-
def use_accelerate_endpoint(context)
|
48
|
-
bucket_name = context.params[:bucket]
|
49
|
-
validate_bucket_name!(bucket_name)
|
50
|
-
endpoint = URI.parse(context.http_request.endpoint.to_s)
|
51
|
-
endpoint.scheme = 'https'
|
52
|
-
endpoint.port = 443
|
53
|
-
endpoint.host = "#{bucket_name}.s3-accelerate.amazonaws.com"
|
54
|
-
context.http_request.endpoint = endpoint.to_s
|
55
|
-
end
|
56
|
-
|
57
|
-
def validate_bucket_name!(bucket_name)
|
58
|
-
unless S3BucketDns.dns_compatible?(bucket_name, ssl = true)
|
59
|
-
msg = "unable to use `accelerate: true` on buckets with "
|
60
|
-
msg << "non-DNS compatible names"
|
61
|
-
raise ArgumentError, msg
|
62
|
-
end
|
63
|
-
if bucket_name.include?('.')
|
64
|
-
msg = "unable to use `accelerate: true` on buckets with dots"
|
65
|
-
msg << "in their name: #{bucket_name.inspect}"
|
66
|
-
raise ArgumentError, msg
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,86 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
|
4
|
-
# Amazon S3 requires DNS style addressing for buckets outside of
|
5
|
-
# the classic region when possible.
|
6
|
-
#
|
7
|
-
# @seahorse.client.option [Boolean] :force_path_style (false)
|
8
|
-
# When set to `true`, the bucket name is always left in the
|
9
|
-
# request URI and never moved to the host as a sub-domain.
|
10
|
-
#
|
11
|
-
class S3BucketDns < Seahorse::Client::Plugin
|
12
|
-
|
13
|
-
# When set to `false` DNS compatible bucket names are moved from
|
14
|
-
# the request URI path to the host as a subdomain, unless the request
|
15
|
-
# is using SSL and the bucket name contains a dot.
|
16
|
-
#
|
17
|
-
# When set to `true`, the bucket name is always forced to be part
|
18
|
-
# of the request URI path. This will not work with buckets outside
|
19
|
-
# the classic region.
|
20
|
-
option(:force_path_style, false)
|
21
|
-
|
22
|
-
def add_handlers(handlers, config)
|
23
|
-
handlers.add(Handler) unless config.force_path_style
|
24
|
-
end
|
25
|
-
|
26
|
-
# @api private
|
27
|
-
class Handler < Seahorse::Client::Handler
|
28
|
-
|
29
|
-
def call(context)
|
30
|
-
move_dns_compat_bucket_to_subdomain(context)
|
31
|
-
@handler.call(context)
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
def move_dns_compat_bucket_to_subdomain(context)
|
37
|
-
bucket_name = context.params[:bucket]
|
38
|
-
endpoint = context.http_request.endpoint
|
39
|
-
if
|
40
|
-
bucket_name &&
|
41
|
-
S3BucketDns.dns_compatible?(bucket_name, https?(endpoint)) &&
|
42
|
-
context.operation_name != 'get_bucket_location'
|
43
|
-
then
|
44
|
-
move_bucket_to_subdomain(bucket_name, endpoint)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def move_bucket_to_subdomain(bucket_name, endpoint)
|
49
|
-
endpoint.host = "#{bucket_name}.#{endpoint.host}"
|
50
|
-
path = endpoint.path.sub("/#{bucket_name}", '')
|
51
|
-
path = "/#{path}" unless path.match(/^\//)
|
52
|
-
endpoint.path = path
|
53
|
-
end
|
54
|
-
|
55
|
-
def https?(uri)
|
56
|
-
uri.scheme == 'https'
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
class << self
|
62
|
-
|
63
|
-
# @param [String] bucket_name
|
64
|
-
# @param [Boolean] ssl
|
65
|
-
# @return [Boolean]
|
66
|
-
def dns_compatible?(bucket_name, ssl)
|
67
|
-
if valid_subdomain?(bucket_name)
|
68
|
-
bucket_name.match(/\./) && ssl ? false : true
|
69
|
-
else
|
70
|
-
false
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
private
|
75
|
-
|
76
|
-
def valid_subdomain?(bucket_name)
|
77
|
-
bucket_name.size < 64 &&
|
78
|
-
bucket_name =~ /^[a-z0-9][a-z0-9.-]+[a-z0-9]$/ &&
|
79
|
-
bucket_name !~ /(\d+\.){3}\d+/ &&
|
80
|
-
bucket_name !~ /[.-]{2}/
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
# @api private
|
4
|
-
class S3BucketNameRestrictions < Seahorse::Client::Plugin
|
5
|
-
class Handler < Seahorse::Client::Handler
|
6
|
-
|
7
|
-
def call(context)
|
8
|
-
if context.params.key?(:bucket) && context.params[:bucket].include?('/')
|
9
|
-
msg = ":bucket option must not contain a forward-slash (/)"
|
10
|
-
raise ArgumentError, msg
|
11
|
-
end
|
12
|
-
@handler.call(context)
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
handler(Handler)
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
class S3Expect100Continue < Seahorse::Client::Plugin
|
4
|
-
|
5
|
-
def add_handlers(handlers, config)
|
6
|
-
if config.http_continue_timeout && config.http_continue_timeout > 0
|
7
|
-
handlers.add(Handler)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
# @api private
|
12
|
-
class Handler < Seahorse::Client::Handler
|
13
|
-
|
14
|
-
def call(context)
|
15
|
-
if
|
16
|
-
context.http_request.body &&
|
17
|
-
context.http_request.body.size > 0
|
18
|
-
then
|
19
|
-
context.http_request.headers['expect'] = '100-continue'
|
20
|
-
end
|
21
|
-
@handler.call(context)
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
class S3GetBucketLocationFix < Seahorse::Client::Plugin
|
4
|
-
|
5
|
-
class Handler < Seahorse::Client::Handler
|
6
|
-
|
7
|
-
def call(context)
|
8
|
-
@handler.call(context).on(200) do |response|
|
9
|
-
response.data = S3::Types::GetBucketLocationOutput.new
|
10
|
-
xml = context.http_response.body_contents
|
11
|
-
matches = xml.match(/>(.+?)<\/LocationConstraint>/)
|
12
|
-
response.data[:location_constraint] = matches ? matches[1] : ''
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
handler(Handler, priority: 60, operations: [:get_bucket_location])
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
|
4
|
-
# A handful of Amazon S3 operations will respond with a 200 status
|
5
|
-
# code but will send an error in the response body. This plugin
|
6
|
-
# injects a handler that will parse 200 response bodies for potential
|
7
|
-
# errors, allowing them to be retried.
|
8
|
-
# @api private
|
9
|
-
class S3Http200Errors < Seahorse::Client::Plugin
|
10
|
-
|
11
|
-
class Handler < Seahorse::Client::Handler
|
12
|
-
|
13
|
-
def call(context)
|
14
|
-
@handler.call(context).on(200) do |response|
|
15
|
-
if error = check_for_error(context)
|
16
|
-
context.http_response.status_code = 500
|
17
|
-
response.data = nil
|
18
|
-
response.error = error
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def check_for_error(context)
|
24
|
-
xml = context.http_response.body_contents
|
25
|
-
if xml.match(/<Error>/)
|
26
|
-
error_code = xml.match(/<Code>(.+?)<\/Code>/)[1]
|
27
|
-
error_message = xml.match(/<Message>(.+?)<\/Message>/)[1]
|
28
|
-
S3::Errors.error_class(error_code).new(context, error_message)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
handler(Handler,
|
35
|
-
step: :sign,
|
36
|
-
operations: [
|
37
|
-
:complete_multipart_upload,
|
38
|
-
:copy_object,
|
39
|
-
:upload_part_copy,
|
40
|
-
]
|
41
|
-
)
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
|
4
|
-
# When making calls to {S3::Client#create_bucket} outside the
|
5
|
-
# "classic" region, the bucket location constraint must be specified.
|
6
|
-
# This plugin auto populates the constraint to the configured region.
|
7
|
-
class S3LocationConstraint < Seahorse::Client::Plugin
|
8
|
-
|
9
|
-
class Handler < Seahorse::Client::Handler
|
10
|
-
|
11
|
-
def call(context)
|
12
|
-
unless context.config.region == 'us-east-1'
|
13
|
-
populate_location_constraint(context.params, context.config.region)
|
14
|
-
end
|
15
|
-
@handler.call(context)
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def populate_location_constraint(params, region)
|
21
|
-
params[:create_bucket_configuration] ||= {}
|
22
|
-
params[:create_bucket_configuration][:location_constraint] ||= region
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
handler(Handler, step: :initialize, operations: [:create_bucket])
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'openssl'
|
2
|
-
require 'base64'
|
3
|
-
|
4
|
-
module Aws
|
5
|
-
module Plugins
|
6
|
-
|
7
|
-
# @seahorse.client.option [Boolean] :compute_checksums (true)
|
8
|
-
# When `true` a MD5 checksum will be computed for every request that
|
9
|
-
# sends a body. When `false`, MD5 checksums will only be computed
|
10
|
-
# for operations that require them. Checksum errors returned by Amazon
|
11
|
-
# S3 are automatically retried up to `:retry_limit` times.
|
12
|
-
class S3Md5s < Seahorse::Client::Plugin
|
13
|
-
|
14
|
-
# Amazon S3 requires these operations to have an MD5 checksum
|
15
|
-
REQUIRED_OPERATIONS = [
|
16
|
-
:delete_objects,
|
17
|
-
:put_bucket_cors,
|
18
|
-
:put_bucket_lifecycle,
|
19
|
-
:put_bucket_policy,
|
20
|
-
:put_bucket_tagging,
|
21
|
-
]
|
22
|
-
|
23
|
-
# @api private
|
24
|
-
class Handler < Seahorse::Client::Handler
|
25
|
-
|
26
|
-
def call(context)
|
27
|
-
body = context.http_request.body
|
28
|
-
if body.size > 0
|
29
|
-
context.http_request.headers['Content-Md5'] ||= Checksums.md5(body)
|
30
|
-
end
|
31
|
-
@handler.call(context)
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
|
36
|
-
option(:compute_checksums, true)
|
37
|
-
|
38
|
-
def add_handlers(handlers, config)
|
39
|
-
# priority set low to ensure md5 is computed AFTER the request is
|
40
|
-
# built but before it is signed
|
41
|
-
handlers.add(Handler, {
|
42
|
-
priority: 10,
|
43
|
-
step: :build,
|
44
|
-
operations: config.compute_checksums ? nil : REQUIRED_OPERATIONS,
|
45
|
-
})
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module Aws
|
2
|
-
module Plugins
|
3
|
-
|
4
|
-
# @seahorse.client.option [Boolean] :follow_redirects (true)
|
5
|
-
# When `true`, this client will follow 307 redirects returned
|
6
|
-
# by Amazon S3.
|
7
|
-
class S3Redirects < Seahorse::Client::Plugin
|
8
|
-
|
9
|
-
option(:follow_redirects, true)
|
10
|
-
|
11
|
-
# @api private
|
12
|
-
class Handler < Seahorse::Client::Handler
|
13
|
-
|
14
|
-
def call(context)
|
15
|
-
response = @handler.call(context)
|
16
|
-
if context.http_response.status_code == 307
|
17
|
-
endpoint = context.http_response.headers['location']
|
18
|
-
context.http_request.endpoint = endpoint
|
19
|
-
context.http_response.body.truncate(0)
|
20
|
-
@handler.call(context)
|
21
|
-
else
|
22
|
-
response
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
def add_handlers(handlers, config)
|
29
|
-
if config.follow_redirects
|
30
|
-
# we want to re-trigger request signing
|
31
|
-
handlers.add(Handler, step: :sign, priority: 90)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,166 +0,0 @@
|
|
1
|
-
require 'set'
|
2
|
-
|
3
|
-
module Aws
|
4
|
-
module Plugins
|
5
|
-
# This plugin is an implementation detail and may be modified.
|
6
|
-
# @api private
|
7
|
-
class S3RequestSigner < Seahorse::Client::Plugin
|
8
|
-
|
9
|
-
option(:signature_version, 'v4')
|
10
|
-
|
11
|
-
class SigningHandler < RequestSigner::Handler
|
12
|
-
|
13
|
-
def call(context)
|
14
|
-
require_credentials(context)
|
15
|
-
version = context.config.signature_version
|
16
|
-
case version
|
17
|
-
when 'v4' then apply_v4_signature(context)
|
18
|
-
when 's3' then apply_s3_legacy_signature(context)
|
19
|
-
else
|
20
|
-
raise "unsupported signature version #{version.inspect}, valid"\
|
21
|
-
" options: 'v4' (default), 's3'"
|
22
|
-
end
|
23
|
-
@handler.call(context)
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def apply_v4_signature(context)
|
29
|
-
Signers::V4.new(
|
30
|
-
context.config.credentials, 's3',
|
31
|
-
context[:cached_sigv4_region] || context.config.sigv4_region,
|
32
|
-
).sign(context.http_request)
|
33
|
-
end
|
34
|
-
|
35
|
-
def apply_s3_legacy_signature(context)
|
36
|
-
Signers::S3.sign(context)
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
# Abstract base class for the other two handlers
|
42
|
-
class Handler < Seahorse::Client::Handler
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def new_hostname(context, region)
|
47
|
-
bucket = context.params[:bucket]
|
48
|
-
if region == 'us-east-1'
|
49
|
-
"#{bucket}.s3.amazonaws.com"
|
50
|
-
else
|
51
|
-
bucket + '.' + URI.parse(EndpointProvider.resolve(region, 's3')).host
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
# This handler will update the http endpoint when the bucket region
|
58
|
-
# is known/cached.
|
59
|
-
class CachedBucketRegionHandler < Handler
|
60
|
-
|
61
|
-
def call(context)
|
62
|
-
if bucket = context.params[:bucket]
|
63
|
-
use_regional_endpoint_when_known(context, bucket)
|
64
|
-
end
|
65
|
-
@handler.call(context)
|
66
|
-
end
|
67
|
-
|
68
|
-
private
|
69
|
-
|
70
|
-
def use_regional_endpoint_when_known(context, bucket)
|
71
|
-
cached_region = S3::BUCKET_REGIONS[bucket]
|
72
|
-
if cached_region && cached_region != context.config.region
|
73
|
-
context.http_request.endpoint.host = new_hostname(context, cached_region)
|
74
|
-
context[:cached_sigv4_region] = cached_region
|
75
|
-
context[:cached_signature_version] = :v4
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
# This handler detects when a request fails because of a mismatched bucket
|
82
|
-
# region. It follows up by making a request to determine the correct
|
83
|
-
# region, then finally a version 4 signed request against the correct
|
84
|
-
# regional endpoint.
|
85
|
-
class BucketRegionErrorHandler < Handler
|
86
|
-
|
87
|
-
def call(context)
|
88
|
-
response = @handler.call(context)
|
89
|
-
handle_region_errors(response)
|
90
|
-
end
|
91
|
-
|
92
|
-
private
|
93
|
-
|
94
|
-
def handle_region_errors(response)
|
95
|
-
if wrong_sigv4_region?(response)
|
96
|
-
get_region_and_retry(response.context)
|
97
|
-
else
|
98
|
-
response
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def get_region_and_retry(context)
|
103
|
-
actual_region = context.http_response.headers['x-amz-bucket-region']
|
104
|
-
actual_region ||= region_from_body(context.http_response.body_contents)
|
105
|
-
update_bucket_cache(context, actual_region)
|
106
|
-
log_warning(context, actual_region)
|
107
|
-
update_region_header(context, actual_region)
|
108
|
-
@handler.call(context)
|
109
|
-
end
|
110
|
-
|
111
|
-
def update_bucket_cache(context, actual_region)
|
112
|
-
S3::BUCKET_REGIONS[context.params[:bucket]] = actual_region
|
113
|
-
end
|
114
|
-
|
115
|
-
def wrong_sigv4_region?(resp)
|
116
|
-
resp.context.http_response.status_code == 400 &&
|
117
|
-
(
|
118
|
-
resp.context.http_response.headers['x-amz-bucket-region'] ||
|
119
|
-
resp.context.http_response.body_contents.match(/<Region>.+?<\/Region>/)
|
120
|
-
)
|
121
|
-
end
|
122
|
-
|
123
|
-
def update_region_header(context, region)
|
124
|
-
context.http_response.body.truncate(0)
|
125
|
-
context.http_request.headers.delete('authorization')
|
126
|
-
context.http_request.headers.delete('x-amz-security-token')
|
127
|
-
context.http_request.endpoint.host = new_hostname(context, region)
|
128
|
-
signer = Signers::V4.new(context.config.credentials, 's3', region)
|
129
|
-
signer.sign(context.http_request)
|
130
|
-
end
|
131
|
-
|
132
|
-
def region_from_body(body)
|
133
|
-
region = body.match(/<Region>(.+?)<\/Region>/)[1]
|
134
|
-
if region.nil? || region == ""
|
135
|
-
raise "couldn't get region from body: #{body}"
|
136
|
-
else
|
137
|
-
region
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
def log_warning(context, actual_region)
|
142
|
-
msg = "S3 client configured for #{context.config.region.inspect} " +
|
143
|
-
"but the bucket #{context.params[:bucket].inspect} is in " +
|
144
|
-
"#{actual_region.inspect}; Please configure the proper region " +
|
145
|
-
"to avoid multiple unnecessary redirects and signing attempts\n"
|
146
|
-
if logger = context.config.logger
|
147
|
-
logger.warn(msg)
|
148
|
-
else
|
149
|
-
warn(msg)
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
end
|
154
|
-
|
155
|
-
# BEFORE signing
|
156
|
-
handle(CachedBucketRegionHandler, step: :sign, priority: 60)
|
157
|
-
|
158
|
-
# sign the request
|
159
|
-
handler(SigningHandler, step: :sign)
|
160
|
-
|
161
|
-
# AFTER signing
|
162
|
-
handle(BucketRegionErrorHandler, step: :sign, priority: 40)
|
163
|
-
|
164
|
-
end
|
165
|
-
end
|
166
|
-
end
|