aws-sdk-core 2.3.23 → 3.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/VERSION +1 -0
- data/ca-bundle.crt +3615 -3541
- data/lib/aws-sdk-core.rb +106 -404
- data/lib/aws-sdk-core/arn.rb +77 -0
- data/lib/aws-sdk-core/arn_parser.rb +38 -0
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +101 -0
- 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 +49 -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 +0 -29
- data/lib/aws-sdk-core/credential_provider_chain.rb +56 -6
- data/lib/aws-sdk-core/deprecations.rb +16 -10
- data/lib/aws-sdk-core/ecs_credentials.rb +14 -10
- data/lib/aws-sdk-core/endpoint_cache.rb +191 -0
- data/lib/aws-sdk-core/errors.rb +221 -11
- data/lib/aws-sdk-core/event_emitter.rb +62 -0
- data/lib/aws-sdk-core/ini_parser.rb +41 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +133 -42
- data/lib/aws-sdk-core/json.rb +9 -10
- 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/formatter.rb +7 -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 +60 -26
- 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 +280 -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 +48 -19
- data/lib/aws-sdk-core/plugins/response_paging.rb +5 -18
- data/lib/aws-sdk-core/plugins/retry_errors.rb +102 -24
- 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 -10
- data/lib/aws-sdk-core/process_credentials.rb +80 -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 +451 -0
- data/lib/aws-sdk-core/shared_credentials.rb +16 -53
- data/lib/aws-sdk-core/structure.rb +22 -13
- 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 +3 -2
- 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 +2156 -0
- data/lib/aws-sdk-sts/client_api.rb +336 -0
- data/lib/aws-sdk-sts/customizations.rb +2 -0
- data/lib/aws-sdk-sts/errors.rb +142 -0
- data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +32 -0
- data/lib/aws-sdk-sts/presigner.rb +67 -0
- data/lib/aws-sdk-sts/resource.rb +23 -0
- data/lib/aws-sdk-sts/types.rb +1504 -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 +5 -9
- data/lib/seahorse/client/configuration.rb +10 -2
- data/lib/seahorse/client/events.rb +1 -1
- data/lib/seahorse/client/h2/connection.rb +246 -0
- data/lib/seahorse/client/h2/handler.rb +151 -0
- data/lib/seahorse/client/handler_list_entry.rb +2 -2
- data/lib/seahorse/client/http/async_response.rb +42 -0
- data/lib/seahorse/client/http/response.rb +13 -8
- data/lib/seahorse/client/logging/formatter.rb +7 -1
- data/lib/seahorse/client/logging/handler.rb +2 -0
- data/lib/seahorse/client/net_http/connection_pool.rb +46 -28
- data/lib/seahorse/client/net_http/handler.rb +17 -3
- 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 +67 -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 +127 -360
- 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 -1819
- 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 -1742
- 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 -67
- 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
|
@@ -6,6 +6,9 @@ module Aws
|
|
|
6
6
|
# return when a client is using stubbed responses. Pass
|
|
7
7
|
# `:stub_responses => true` to a client constructor to enable this
|
|
8
8
|
# behavior.
|
|
9
|
+
#
|
|
10
|
+
# Also allows you to see the requests made by the client by reading the
|
|
11
|
+
# api_requests instance variable
|
|
9
12
|
module ClientStubs
|
|
10
13
|
|
|
11
14
|
# @api private
|
|
@@ -16,7 +19,19 @@ module Aws
|
|
|
16
19
|
@config.stub_responses.each do |operation_name, stubs|
|
|
17
20
|
apply_stubs(operation_name, Array === stubs ? stubs : [stubs])
|
|
18
21
|
end
|
|
19
|
-
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# When a client is stubbed allow the user to access the requests made
|
|
25
|
+
@api_requests = []
|
|
26
|
+
|
|
27
|
+
requests = @api_requests
|
|
28
|
+
self.handle do |context|
|
|
29
|
+
requests << {
|
|
30
|
+
operation_name: context.operation_name,
|
|
31
|
+
params: context.params,
|
|
32
|
+
context: context
|
|
33
|
+
}
|
|
34
|
+
@handler.call(context)
|
|
20
35
|
end
|
|
21
36
|
end
|
|
22
37
|
|
|
@@ -50,8 +65,18 @@ module Aws
|
|
|
50
65
|
# buckets: [{ name: 'my-bucket' }]
|
|
51
66
|
# })
|
|
52
67
|
#
|
|
53
|
-
# client.list_buckets.buckets.map(&:name)
|
|
54
|
-
# #=> ['
|
|
68
|
+
# client.list_buckets.buckets.map(&:name)
|
|
69
|
+
# #=> ['my-bucket']
|
|
70
|
+
#
|
|
71
|
+
# With a Resource class {#stub_responses} on the corresponding client:
|
|
72
|
+
#
|
|
73
|
+
# s3 = Aws::S3::Resource.new(stub_responses: true)
|
|
74
|
+
# s3.client.stub_responses(:list_buckets, {
|
|
75
|
+
# buckets: [{ name: 'my-bucket' }]
|
|
76
|
+
# })
|
|
77
|
+
#
|
|
78
|
+
# s3.buckets.map(&:name)
|
|
79
|
+
# #=> ['my-bucket']
|
|
55
80
|
#
|
|
56
81
|
# Lastly, default stubs can be configured via `Aws.config`:
|
|
57
82
|
#
|
|
@@ -64,6 +89,22 @@ module Aws
|
|
|
64
89
|
# Aws::S3::Client.new.list_buckets.buckets.map(&:name)
|
|
65
90
|
# #=> ['my-bucket']
|
|
66
91
|
#
|
|
92
|
+
# Aws::S3::Resource.new.buckets.map(&:name)
|
|
93
|
+
# #=> ['my-bucket']
|
|
94
|
+
#
|
|
95
|
+
# ## Dynamic Stubbing
|
|
96
|
+
#
|
|
97
|
+
# In addition to creating static stubs, it's also possible to generate
|
|
98
|
+
# stubs dynamically based on the parameters with which operations were
|
|
99
|
+
# called, by passing a `Proc` object:
|
|
100
|
+
#
|
|
101
|
+
# s3 = Aws::S3::Resource.new(stub_responses: true)
|
|
102
|
+
# s3.client.stub_responses(:put_object, -> (context) {
|
|
103
|
+
# s3.client.stub_responses(:get_object, content_type: context.params[:content_type])
|
|
104
|
+
# })
|
|
105
|
+
#
|
|
106
|
+
# The yielded object is an instance of {Seahorse::Client::RequestContext}.
|
|
107
|
+
#
|
|
67
108
|
# ## Stubbing Errors
|
|
68
109
|
#
|
|
69
110
|
# When stubbing is enabled, the SDK will default to generate
|
|
@@ -141,6 +182,27 @@ module Aws
|
|
|
141
182
|
end
|
|
142
183
|
end
|
|
143
184
|
|
|
185
|
+
# Allows you to access all of the requests that the stubbed client has made
|
|
186
|
+
#
|
|
187
|
+
# @params [Boolean] exclude_presign Setting to true for filtering out not sent requests from
|
|
188
|
+
# generating presigned urls. Default to false.
|
|
189
|
+
# @return [Array] Returns an array of the api requests made, each request object contains the
|
|
190
|
+
# :operation_name, :params, and :context of the request.
|
|
191
|
+
# @raise [NotImplementedError] Raises `NotImplementedError` when the client is not stubbed
|
|
192
|
+
def api_requests(options = {})
|
|
193
|
+
if config.stub_responses
|
|
194
|
+
if options[:exclude_presign]
|
|
195
|
+
@api_requests.reject {|req| req[:context][:presigned_url] }
|
|
196
|
+
else
|
|
197
|
+
@api_requests
|
|
198
|
+
end
|
|
199
|
+
else
|
|
200
|
+
msg = 'This method is only implemented for stubbed clients, and is '
|
|
201
|
+
msg << 'available when you enable stubbing in the constructor with `stub_responses: true`'
|
|
202
|
+
raise NotImplementedError.new(msg)
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
144
206
|
# Generates and returns stubbed response data from the named operation.
|
|
145
207
|
#
|
|
146
208
|
# s3 = Aws::S3::Client.new
|
|
@@ -160,7 +222,7 @@ module Aws
|
|
|
160
222
|
# @return [Structure] Returns a stubbed response data structure. The
|
|
161
223
|
# actual class returned will depend on the given `operation_name`.
|
|
162
224
|
def stub_data(operation_name, data = {})
|
|
163
|
-
Stubbing::StubData.new(operation(operation_name)).stub(data)
|
|
225
|
+
Stubbing::StubData.new(config.api.operation(operation_name)).stub(data)
|
|
164
226
|
end
|
|
165
227
|
|
|
166
228
|
# @api private
|
|
@@ -229,17 +291,18 @@ module Aws
|
|
|
229
291
|
def data_to_http_resp(operation_name, data)
|
|
230
292
|
api = config.api
|
|
231
293
|
operation = api.operation(operation_name)
|
|
232
|
-
ParamValidator.
|
|
294
|
+
ParamValidator.new(operation.output, input: false).validate!(data)
|
|
233
295
|
protocol_helper.stub_data(api, operation, data)
|
|
234
296
|
end
|
|
235
297
|
|
|
236
298
|
def protocol_helper
|
|
237
299
|
case config.api.metadata['protocol']
|
|
238
|
-
when 'json'
|
|
239
|
-
when 'query'
|
|
240
|
-
when 'ec2'
|
|
241
|
-
when 'rest-json'
|
|
242
|
-
when 'rest-xml'
|
|
300
|
+
when 'json' then Stubbing::Protocols::Json
|
|
301
|
+
when 'query' then Stubbing::Protocols::Query
|
|
302
|
+
when 'ec2' then Stubbing::Protocols::EC2
|
|
303
|
+
when 'rest-json' then Stubbing::Protocols::RestJson
|
|
304
|
+
when 'rest-xml' then Stubbing::Protocols::RestXml
|
|
305
|
+
when 'api-gateway' then Stubbing::Protocols::ApiGateway
|
|
243
306
|
else raise "unsupported protocol"
|
|
244
307
|
end.new
|
|
245
308
|
end
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
module Aws
|
|
2
2
|
module CredentialProvider
|
|
3
3
|
|
|
4
|
-
extend Deprecations
|
|
5
|
-
|
|
6
4
|
# @return [Credentials]
|
|
7
5
|
attr_reader :credentials
|
|
8
6
|
|
|
@@ -11,32 +9,5 @@ module Aws
|
|
|
11
9
|
!!credentials && credentials.set?
|
|
12
10
|
end
|
|
13
11
|
|
|
14
|
-
# @deprecated Deprecated in 2.1.0. This method is subject to errors
|
|
15
|
-
# from a race condition when called against refreshable credential
|
|
16
|
-
# objects. Will be removed in 2.2.0.
|
|
17
|
-
# @see #credentials
|
|
18
|
-
def access_key_id
|
|
19
|
-
credentials ? credentials.access_key_id : nil
|
|
20
|
-
end
|
|
21
|
-
deprecated(:access_key_id, use: '#credentials')
|
|
22
|
-
|
|
23
|
-
# @deprecated Deprecated in 2.1.0. This method is subject to errors
|
|
24
|
-
# from a race condition when called against refreshable credential
|
|
25
|
-
# objects. Will be removed in 2.2.0.
|
|
26
|
-
# @see #credentials
|
|
27
|
-
def secret_access_key
|
|
28
|
-
credentials ? credentials.secret_access_key : nil
|
|
29
|
-
end
|
|
30
|
-
deprecated(:secret_access_key, use: '#credentials')
|
|
31
|
-
|
|
32
|
-
# @deprecated Deprecated in 2.1.0. This method is subject to errors
|
|
33
|
-
# from a race condition when called against refreshable credential
|
|
34
|
-
# objects. Will be removed in 2.2.0.
|
|
35
|
-
# @see #credentials
|
|
36
|
-
def session_token
|
|
37
|
-
credentials ? credentials.session_token : nil
|
|
38
|
-
end
|
|
39
|
-
deprecated(:session_token, use: '#credentials')
|
|
40
|
-
|
|
41
12
|
end
|
|
42
13
|
end
|
|
@@ -21,11 +21,14 @@ module Aws
|
|
|
21
21
|
[
|
|
22
22
|
[:static_credentials, {}],
|
|
23
23
|
[:env_credentials, {}],
|
|
24
|
+
[:assume_role_web_identity_credentials, {}],
|
|
25
|
+
[:assume_role_credentials, {}],
|
|
24
26
|
[:shared_credentials, {}],
|
|
27
|
+
[:process_credentials, {}],
|
|
25
28
|
[:instance_profile_credentials, {
|
|
26
|
-
retries: 0,
|
|
27
|
-
http_open_timeout: 1,
|
|
28
|
-
http_read_timeout: 1,
|
|
29
|
+
retries: @config ? @config.instance_profile_credentials_retries : 0,
|
|
30
|
+
http_open_timeout: @config ? @config.instance_profile_credentials_timeout : 1,
|
|
31
|
+
http_read_timeout: @config ? @config.instance_profile_credentials_timeout : 1,
|
|
29
32
|
}],
|
|
30
33
|
]
|
|
31
34
|
end
|
|
@@ -57,16 +60,53 @@ module Aws
|
|
|
57
60
|
nil
|
|
58
61
|
end
|
|
59
62
|
|
|
63
|
+
def determine_profile_name(options)
|
|
64
|
+
(options[:config] && options[:config].profile) || ENV['AWS_PROFILE'] || ENV['AWS_DEFAULT_PROFILE'] || 'default'
|
|
65
|
+
end
|
|
66
|
+
|
|
60
67
|
def shared_credentials(options)
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
profile_name = determine_profile_name(options)
|
|
69
|
+
SharedCredentials.new(profile_name: profile_name)
|
|
70
|
+
rescue Errors::NoSuchProfileError
|
|
71
|
+
nil
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def process_credentials(options)
|
|
75
|
+
config = Aws.shared_config
|
|
76
|
+
profile_name = determine_profile_name(options)
|
|
77
|
+
if config.config_enabled? && process_provider = config.credentials_process(profile_name)
|
|
78
|
+
ProcessCredentials.new(process_provider)
|
|
63
79
|
else
|
|
64
|
-
|
|
80
|
+
nil
|
|
65
81
|
end
|
|
66
82
|
rescue Errors::NoSuchProfileError
|
|
67
83
|
nil
|
|
68
84
|
end
|
|
69
85
|
|
|
86
|
+
def assume_role_credentials(options)
|
|
87
|
+
if Aws.shared_config.config_enabled?
|
|
88
|
+
assume_role_with_profile(options)
|
|
89
|
+
else
|
|
90
|
+
nil
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def assume_role_web_identity_credentials(options)
|
|
95
|
+
if (role_arn = ENV['AWS_ROLE_ARN']) &&
|
|
96
|
+
(token_file = ENV['AWS_WEB_IDENTITY_TOKEN_FILE'])
|
|
97
|
+
AssumeRoleWebIdentityCredentials.new(
|
|
98
|
+
role_arn: role_arn,
|
|
99
|
+
web_identity_token_file: token_file,
|
|
100
|
+
role_session_name: ENV['AWS_ROLE_SESSION_NAME']
|
|
101
|
+
)
|
|
102
|
+
elsif Aws.shared_config.config_enabled?
|
|
103
|
+
profile = options[:config].profile if options[:config]
|
|
104
|
+
Aws.shared_config.assume_role_web_identity_credentials_from_config(profile)
|
|
105
|
+
else
|
|
106
|
+
nil
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
70
110
|
def instance_profile_credentials(options)
|
|
71
111
|
if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
|
|
72
112
|
ECSCredentials.new(options)
|
|
@@ -75,5 +115,15 @@ module Aws
|
|
|
75
115
|
end
|
|
76
116
|
end
|
|
77
117
|
|
|
118
|
+
def assume_role_with_profile(options)
|
|
119
|
+
profile_name = determine_profile_name(options)
|
|
120
|
+
region = (options[:config] && options[:config].region)
|
|
121
|
+
Aws.shared_config.assume_role_credentials_from_config(
|
|
122
|
+
profile: profile_name,
|
|
123
|
+
region: region,
|
|
124
|
+
chain_config: @config
|
|
125
|
+
)
|
|
126
|
+
end
|
|
127
|
+
|
|
78
128
|
end
|
|
79
129
|
end
|
|
@@ -35,33 +35,39 @@ module Aws
|
|
|
35
35
|
# @api private
|
|
36
36
|
module Deprecations
|
|
37
37
|
|
|
38
|
-
# @param [Symbol]
|
|
38
|
+
# @param [Symbol] method The name of the deprecated method.
|
|
39
39
|
#
|
|
40
40
|
# @option options [String] :message The warning message to issue
|
|
41
41
|
# when the deprecated method is called.
|
|
42
42
|
#
|
|
43
|
-
# @option options [
|
|
44
|
-
# method that should be used.
|
|
43
|
+
# @option options [String] :use The name of a method that should be used.
|
|
45
44
|
#
|
|
46
|
-
|
|
45
|
+
# @option options [String] :version The version that will remove the
|
|
46
|
+
# deprecated method.
|
|
47
|
+
#
|
|
48
|
+
def deprecated(method, options = {})
|
|
47
49
|
|
|
48
50
|
deprecation_msg = options[:message] || begin
|
|
49
|
-
msg = "DEPRECATION WARNING
|
|
50
|
-
msg << "of
|
|
51
|
-
msg << "
|
|
51
|
+
msg = "#################### DEPRECATION WARNING ####################\n"
|
|
52
|
+
msg << "Called deprecated method `#{method}` of #{self}."
|
|
53
|
+
msg << " Use `#{options[:use]}` instead.\n" if options[:use]
|
|
54
|
+
if options[:version]
|
|
55
|
+
msg << "Method `#{method}` will be removed in #{options[:version]}."
|
|
56
|
+
end
|
|
57
|
+
msg << "\n#############################################################"
|
|
52
58
|
msg
|
|
53
59
|
end
|
|
54
60
|
|
|
55
|
-
alias_method(:"deprecated_#{
|
|
61
|
+
alias_method(:"deprecated_#{method}", method)
|
|
56
62
|
|
|
57
63
|
warned = false # we only want to issue this warning once
|
|
58
64
|
|
|
59
|
-
define_method(
|
|
65
|
+
define_method(method) do |*args, &block|
|
|
60
66
|
unless warned
|
|
61
67
|
warned = true
|
|
62
68
|
warn(deprecation_msg + "\n" + caller.join("\n"))
|
|
63
69
|
end
|
|
64
|
-
send("deprecated_#{
|
|
70
|
+
send("deprecated_#{method}", *args, &block)
|
|
65
71
|
end
|
|
66
72
|
end
|
|
67
73
|
|
|
@@ -60,7 +60,7 @@ module Aws
|
|
|
60
60
|
super
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
# @return [Integer] The number of times to retry failed
|
|
63
|
+
# @return [Integer] The number of times to retry failed attempts to
|
|
64
64
|
# fetch credentials from the instance metadata service. Defaults to 0.
|
|
65
65
|
attr_reader :retries
|
|
66
66
|
|
|
@@ -78,14 +78,18 @@ module Aws
|
|
|
78
78
|
# Retry loading credentials up to 3 times is the instance metadata
|
|
79
79
|
# service is responding but is returning invalid JSON documents
|
|
80
80
|
# in response to the GET profile credentials call.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
begin
|
|
82
|
+
retry_errors([JSON::ParserError, StandardError], max_retries: 3) do
|
|
83
|
+
c = JSON.parse(get_credentials.to_s)
|
|
84
|
+
@credentials = Credentials.new(
|
|
85
|
+
c['AccessKeyId'],
|
|
86
|
+
c['SecretAccessKey'],
|
|
87
|
+
c['Token']
|
|
88
|
+
)
|
|
89
|
+
@expiration = c['Expiration'] ? Time.iso8601(c['Expiration']) : nil
|
|
90
|
+
end
|
|
91
|
+
rescue JSON::ParserError
|
|
92
|
+
raise Aws::Errors::MetadataParserError.new
|
|
89
93
|
end
|
|
90
94
|
end
|
|
91
95
|
|
|
@@ -126,7 +130,7 @@ module Aws
|
|
|
126
130
|
retries = 0
|
|
127
131
|
begin
|
|
128
132
|
yield
|
|
129
|
-
rescue *error_classes =>
|
|
133
|
+
rescue *error_classes => _error
|
|
130
134
|
if retries < max_retries
|
|
131
135
|
@backoff.call(retries)
|
|
132
136
|
retries += 1
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
# @api private
|
|
3
|
+
# a LRU cache caching endpoints data
|
|
4
|
+
class EndpointCache
|
|
5
|
+
|
|
6
|
+
# default cache entries limit
|
|
7
|
+
MAX_ENTRIES = 1000
|
|
8
|
+
|
|
9
|
+
# default max threads pool size
|
|
10
|
+
MAX_THREADS = 10
|
|
11
|
+
|
|
12
|
+
def initialize(options = {})
|
|
13
|
+
@max_entries = options[:max_entries] || MAX_ENTRIES
|
|
14
|
+
@entries = {} # store endpoints
|
|
15
|
+
@max_threads = options[:max_threads] || MAX_THREADS
|
|
16
|
+
@pool = {} # store polling threads
|
|
17
|
+
@mutex = Mutex.new
|
|
18
|
+
@require_identifier = nil # whether endpoint operation support identifier
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [Integer] Max size limit of cache
|
|
22
|
+
attr_reader :max_entries
|
|
23
|
+
|
|
24
|
+
# @return [Integer] Max count of polling threads
|
|
25
|
+
attr_reader :max_threads
|
|
26
|
+
|
|
27
|
+
# return [Hash] Polling threads pool
|
|
28
|
+
attr_reader :pool
|
|
29
|
+
|
|
30
|
+
# @param [String] key
|
|
31
|
+
# @return [Endpoint]
|
|
32
|
+
def [](key)
|
|
33
|
+
@mutex.synchronize do
|
|
34
|
+
# fetching an existing endpoint delete it and then append it
|
|
35
|
+
endpoint = @entries[key]
|
|
36
|
+
if endpoint
|
|
37
|
+
@entries.delete(key)
|
|
38
|
+
@entries[key] = endpoint
|
|
39
|
+
end
|
|
40
|
+
endpoint
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @param [String] key
|
|
45
|
+
# @param [Hash] value
|
|
46
|
+
def []=(key, value)
|
|
47
|
+
@mutex.synchronize do
|
|
48
|
+
# delete the least recent used endpoint when cache is full
|
|
49
|
+
unless @entries.size < @max_entries
|
|
50
|
+
old_key, = @entries.shift
|
|
51
|
+
delete_polling_thread(old_key)
|
|
52
|
+
end
|
|
53
|
+
# delete old value if exists
|
|
54
|
+
@entries.delete(key)
|
|
55
|
+
@entries[key] = Endpoint.new(value.to_hash)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# checking whether an unexpired endpoint key exists in cache
|
|
60
|
+
# @param [String] key
|
|
61
|
+
# @return [Boolean]
|
|
62
|
+
def key?(key)
|
|
63
|
+
@mutex.synchronize do
|
|
64
|
+
if @entries.key?(key) && (@entries[key].nil? || @entries[key].expired?)
|
|
65
|
+
@entries.delete(key)
|
|
66
|
+
end
|
|
67
|
+
@entries.key?(key)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# checking whether an polling thread exist for the key
|
|
72
|
+
# @param [String] key
|
|
73
|
+
# @return [Boolean]
|
|
74
|
+
def threads_key?(key)
|
|
75
|
+
@pool.key?(key)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# remove entry only
|
|
79
|
+
# @param [String] key
|
|
80
|
+
def delete(key)
|
|
81
|
+
@mutex.synchronize do
|
|
82
|
+
@entries.delete(key)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# kill the old polling thread and remove it from pool
|
|
87
|
+
# @param [String] key
|
|
88
|
+
def delete_polling_thread(key)
|
|
89
|
+
Thread.kill(@pool[key]) if threads_key?(key)
|
|
90
|
+
@pool.delete(key)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# update cache with requests (using service endpoint operation)
|
|
94
|
+
# to fetch endpoint list (with identifiers when available)
|
|
95
|
+
# @param [String] key
|
|
96
|
+
# @param [RequestContext] ctx
|
|
97
|
+
def update(key, ctx)
|
|
98
|
+
resp = _request_endpoint(ctx)
|
|
99
|
+
if resp && resp.endpoints
|
|
100
|
+
resp.endpoints.each { |e| self[key] = e }
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# extract the key to be used in the cache from request context
|
|
105
|
+
# @param [RequestContext] ctx
|
|
106
|
+
# @return [String]
|
|
107
|
+
def extract_key(ctx)
|
|
108
|
+
parts = []
|
|
109
|
+
# fetching from cred provider directly gives warnings
|
|
110
|
+
parts << ctx.config.credentials.credentials.access_key_id
|
|
111
|
+
if _endpoint_operation_identifier(ctx)
|
|
112
|
+
parts << ctx.operation_name
|
|
113
|
+
ctx.operation.input.shape.members.inject(parts) do |p, (name, ref)|
|
|
114
|
+
p << ctx.params[name] if ref['endpointdiscoveryid']
|
|
115
|
+
p
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
parts.join('_')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# update polling threads pool
|
|
122
|
+
# param [String] key
|
|
123
|
+
# param [Thread] thread
|
|
124
|
+
def update_polling_pool(key, thread)
|
|
125
|
+
unless @pool.size < @max_threads
|
|
126
|
+
_, thread = @pool.shift
|
|
127
|
+
Thread.kill(thread)
|
|
128
|
+
end
|
|
129
|
+
@pool[key] = thread
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# kill all polling threads
|
|
133
|
+
def stop_polling!
|
|
134
|
+
@pool.each { |_, t| Thread.kill(t) }
|
|
135
|
+
@pool = {}
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
private
|
|
139
|
+
|
|
140
|
+
def _request_endpoint(ctx)
|
|
141
|
+
params = {}
|
|
142
|
+
if _endpoint_operation_identifier(ctx)
|
|
143
|
+
# build identifier params when available
|
|
144
|
+
params[:operation] = ctx.operation.name
|
|
145
|
+
ctx.operation.input.shape.members.inject(params) do |p, (name, ref)|
|
|
146
|
+
if ref['endpointdiscoveryid']
|
|
147
|
+
p[:identifiers] ||= {}
|
|
148
|
+
p[:identifiers][ref.location_name] = ctx.params[name]
|
|
149
|
+
end
|
|
150
|
+
p
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
begin
|
|
155
|
+
endpoint_operation_name = ctx.config.api.endpoint_operation
|
|
156
|
+
ctx.client.send(endpoint_operation_name, params)
|
|
157
|
+
rescue Aws::Errors::ServiceError
|
|
158
|
+
nil
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def _endpoint_operation_identifier(ctx)
|
|
163
|
+
return @require_identifier unless @require_identifier.nil?
|
|
164
|
+
|
|
165
|
+
operation_name = ctx.config.api.endpoint_operation
|
|
166
|
+
operation = ctx.config.api.operation(operation_name)
|
|
167
|
+
@require_identifier = operation.input.shape.members.any?
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
class Endpoint
|
|
171
|
+
|
|
172
|
+
# default endpoint cache time, 1 minute
|
|
173
|
+
CACHE_PERIOD = 1
|
|
174
|
+
|
|
175
|
+
def initialize(options)
|
|
176
|
+
@address = options.fetch(:address)
|
|
177
|
+
@cache_period = options[:cache_period_in_minutes] || CACHE_PERIOD
|
|
178
|
+
@created_time = Time.now
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# [String] valid URI address (with path)
|
|
182
|
+
attr_reader :address
|
|
183
|
+
|
|
184
|
+
def expired?
|
|
185
|
+
Time.now - @created_time > @cache_period * 60
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
191
|
+
end
|