aws-sdk-core 2.3.23 → 3.89.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,103 @@
|
|
1
|
+
module Aws
|
2
|
+
module Rest
|
3
|
+
module Request
|
4
|
+
class QuerystringBuilder
|
5
|
+
|
6
|
+
include Seahorse::Model::Shapes
|
7
|
+
|
8
|
+
# Provide shape references and param values:
|
9
|
+
#
|
10
|
+
# [
|
11
|
+
# [shape_ref1, 123],
|
12
|
+
# [shape_ref2, "text"]
|
13
|
+
# ]
|
14
|
+
#
|
15
|
+
# Returns a querystring:
|
16
|
+
#
|
17
|
+
# "Count=123&Words=text"
|
18
|
+
#
|
19
|
+
# @param [Array<Array<Seahorse::Model::ShapeRef, Object>>] params An array of
|
20
|
+
# model shape references and request parameter value pairs.
|
21
|
+
#
|
22
|
+
# @return [String] Returns a built querystring
|
23
|
+
def build(params)
|
24
|
+
params.map do |(shape_ref, param_value)|
|
25
|
+
build_part(shape_ref, param_value)
|
26
|
+
end.join('&')
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def build_part(shape_ref, param_value)
|
32
|
+
case shape_ref.shape
|
33
|
+
# supported scalar types
|
34
|
+
when StringShape, BooleanShape, FloatShape, IntegerShape, StringShape
|
35
|
+
param_name = shape_ref.location_name
|
36
|
+
"#{param_name}=#{escape(param_value.to_s)}"
|
37
|
+
when TimestampShape
|
38
|
+
param_name = shape_ref.location_name
|
39
|
+
"#{param_name}=#{escape(timestamp(shape_ref, param_value))}"
|
40
|
+
when MapShape
|
41
|
+
if StringShape === shape_ref.shape.value.shape
|
42
|
+
query_map_of_string(param_value)
|
43
|
+
elsif ListShape === shape_ref.shape.value.shape
|
44
|
+
query_map_of_string_list(param_value)
|
45
|
+
else
|
46
|
+
msg = "only map of string and string list supported"
|
47
|
+
raise NotImplementedError, msg
|
48
|
+
end
|
49
|
+
when ListShape
|
50
|
+
if StringShape === shape_ref.shape.member.shape
|
51
|
+
list_of_strings(shape_ref.location_name, param_value)
|
52
|
+
else
|
53
|
+
msg = "Only list of strings supported, got "
|
54
|
+
msg << shape_ref.shape.member.shape.class.name
|
55
|
+
raise NotImplementedError, msg
|
56
|
+
end
|
57
|
+
else
|
58
|
+
raise NotImplementedError
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def timestamp(ref, value)
|
63
|
+
case ref['timestampFormat'] || ref.shape['timestampFormat']
|
64
|
+
when 'unixTimestamp' then value.to_i
|
65
|
+
when 'rfc822' then value.utc.httpdate
|
66
|
+
else
|
67
|
+
# querystring defaults to iso8601
|
68
|
+
value.utc.iso8601
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def query_map_of_string(hash)
|
73
|
+
list = []
|
74
|
+
hash.each_pair do |key, value|
|
75
|
+
list << "#{escape(key)}=#{escape(value)}"
|
76
|
+
end
|
77
|
+
list
|
78
|
+
end
|
79
|
+
|
80
|
+
def query_map_of_string_list(hash)
|
81
|
+
list = []
|
82
|
+
hash.each_pair do |key, values|
|
83
|
+
values.each do |value|
|
84
|
+
list << "#{escape(key)}=#{escape(value)}"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
list
|
88
|
+
end
|
89
|
+
|
90
|
+
def list_of_strings(name, values)
|
91
|
+
values.map do |value|
|
92
|
+
"#{name}=#{escape(value)}"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def escape(string)
|
97
|
+
Seahorse::Util.uri_escape(string)
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -15,7 +15,9 @@ module Aws
|
|
15
15
|
# @param [IO] body
|
16
16
|
# @param [Hash, Struct] data
|
17
17
|
def apply(body, data)
|
18
|
-
if
|
18
|
+
if event_stream?
|
19
|
+
data[@rules[:payload]] = parse_eventstream(body)
|
20
|
+
elsif streaming?
|
19
21
|
data[@rules[:payload]] = body
|
20
22
|
elsif @rules[:payload]
|
21
23
|
data[@rules[:payload]] = parse(body.read, @rules[:payload_member])
|
@@ -26,6 +28,10 @@ module Aws
|
|
26
28
|
|
27
29
|
private
|
28
30
|
|
31
|
+
def event_stream?
|
32
|
+
@rules[:payload] && @rules[:payload_member].eventstream
|
33
|
+
end
|
34
|
+
|
29
35
|
def streaming?
|
30
36
|
@rules[:payload] && (
|
31
37
|
BlobShape === @rules[:payload_member].shape ||
|
@@ -37,6 +43,13 @@ module Aws
|
|
37
43
|
@parser_class.new(rules).parse(body, target) if body.size > 0
|
38
44
|
end
|
39
45
|
|
46
|
+
def parse_eventstream(body)
|
47
|
+
# body contains an array of parsed event when they arrive
|
48
|
+
@rules[:payload_member].shape.struct_class.new do |payload|
|
49
|
+
body.each { |event| payload << event }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
40
53
|
end
|
41
54
|
end
|
42
55
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'time'
|
2
|
+
require 'base64'
|
3
|
+
require 'json'
|
2
4
|
|
3
5
|
module Aws
|
4
6
|
module Rest
|
@@ -31,6 +33,7 @@ module Aws
|
|
31
33
|
end
|
32
34
|
|
33
35
|
def cast_value(ref, value)
|
36
|
+
value = extract_json_trait(value) if ref['jsonvalue']
|
34
37
|
case ref.shape
|
35
38
|
when StringShape then value
|
36
39
|
when IntegerShape then value.to_i
|
@@ -39,6 +42,8 @@ module Aws
|
|
39
42
|
when TimestampShape
|
40
43
|
if value =~ /\d+(\.\d*)/
|
41
44
|
Time.at(value.to_f)
|
45
|
+
elsif value =~ /^\d+$/
|
46
|
+
Time.at(value.to_i)
|
42
47
|
else
|
43
48
|
begin
|
44
49
|
Time.parse(value)
|
@@ -60,6 +65,10 @@ module Aws
|
|
60
65
|
end
|
61
66
|
end
|
62
67
|
|
68
|
+
def extract_json_trait(value)
|
69
|
+
JSON.parse(Base64.decode64(value))
|
70
|
+
end
|
71
|
+
|
63
72
|
end
|
64
73
|
end
|
65
74
|
end
|
@@ -5,31 +5,34 @@ module Aws
|
|
5
5
|
|
6
6
|
def apply(response)
|
7
7
|
# TODO : remove this unless check once response stubbing is fixed
|
8
|
-
|
9
|
-
response.data =
|
8
|
+
if rules = response.context.operation.output
|
9
|
+
response.data = rules.shape.struct_class.new
|
10
|
+
extract_status_code(rules, response)
|
11
|
+
extract_headers(rules, response)
|
12
|
+
extract_body(rules, response)
|
13
|
+
else
|
14
|
+
response.data = EmptyStructure.new
|
10
15
|
end
|
11
|
-
extract_status_code(response)
|
12
|
-
extract_headers(response)
|
13
|
-
extract_body(response)
|
14
16
|
end
|
15
17
|
|
16
18
|
private
|
17
19
|
|
18
|
-
def extract_status_code(response)
|
19
|
-
status_code = StatusCode.new(
|
20
|
+
def extract_status_code(rules, response)
|
21
|
+
status_code = StatusCode.new(rules)
|
20
22
|
status_code.apply(response.context.http_response, response.data)
|
21
23
|
end
|
22
24
|
|
23
|
-
def extract_headers(response)
|
24
|
-
headers = Headers.new(
|
25
|
+
def extract_headers(rules, response)
|
26
|
+
headers = Headers.new(rules)
|
25
27
|
headers.apply(response.context.http_response, response.data)
|
26
28
|
end
|
27
29
|
|
28
|
-
def extract_body(response)
|
29
|
-
Body.new(
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
def extract_body(rules, response)
|
31
|
+
Body.new(parser_class(response), rules).
|
32
|
+
apply(
|
33
|
+
response.context.http_response.body,
|
34
|
+
response.data
|
35
|
+
)
|
33
36
|
end
|
34
37
|
|
35
38
|
def parser_class(response)
|
@@ -37,6 +40,7 @@ module Aws
|
|
37
40
|
case protocol
|
38
41
|
when 'rest-xml' then Xml::Parser
|
39
42
|
when 'rest-json' then Json::Parser
|
43
|
+
when 'api-gateway' then Json::Parser
|
40
44
|
else raise "unsupported protocol #{protocol}"
|
41
45
|
end
|
42
46
|
end
|
@@ -0,0 +1,451 @@
|
|
1
|
+
module Aws
|
2
|
+
|
3
|
+
# @api private
|
4
|
+
class SharedConfig
|
5
|
+
|
6
|
+
# @return [String]
|
7
|
+
attr_reader :credentials_path
|
8
|
+
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :config_path
|
11
|
+
|
12
|
+
# @return [String]
|
13
|
+
attr_reader :profile_name
|
14
|
+
|
15
|
+
# Constructs a new SharedConfig provider object. This will load the shared
|
16
|
+
# credentials file, and optionally the shared configuration file, as ini
|
17
|
+
# files which support profiles.
|
18
|
+
#
|
19
|
+
# By default, the shared credential file (the default path for which is
|
20
|
+
# `~/.aws/credentials`) and the shared config file (the default path for
|
21
|
+
# which is `~/.aws/config`) are loaded. However, if you set the
|
22
|
+
# `ENV['AWS_SDK_CONFIG_OPT_OUT']` environment variable, only the shared
|
23
|
+
# credential file will be loaded. You can specify the shared credential
|
24
|
+
# file path with the `ENV['AWS_SHARED_CREDENTIALS_FILE']` environment
|
25
|
+
# variable or with the `:credentials_path` option. Similarly, you can
|
26
|
+
# specify the shared config file path with the `ENV['AWS_CONFIG_FILE']`
|
27
|
+
# environment variable or with the `:config_path` option.
|
28
|
+
#
|
29
|
+
# The default profile name is 'default'. You can specify the profile name
|
30
|
+
# with the `ENV['AWS_PROFILE']` environment variable or with the
|
31
|
+
# `:profile_name` option.
|
32
|
+
#
|
33
|
+
# @param [Hash] options
|
34
|
+
# @option options [String] :credentials_path Path to the shared credentials
|
35
|
+
# file. If not specified, will check `ENV['AWS_SHARED_CREDENTIALS_FILE']`
|
36
|
+
# before using the default value of "#{Dir.home}/.aws/credentials".
|
37
|
+
# @option options [String] :config_path Path to the shared config file.
|
38
|
+
# If not specified, will check `ENV['AWS_CONFIG_FILE']` before using the
|
39
|
+
# default value of "#{Dir.home}/.aws/config".
|
40
|
+
# @option options [String] :profile_name The credential/config profile name
|
41
|
+
# to use. If not specified, will check `ENV['AWS_PROFILE']` before using
|
42
|
+
# the fixed default value of 'default'.
|
43
|
+
# @option options [Boolean] :config_enabled If true, loads the shared config
|
44
|
+
# file and enables new config values outside of the old shared credential
|
45
|
+
# spec.
|
46
|
+
def initialize(options = {})
|
47
|
+
@parsed_config = nil
|
48
|
+
@profile_name = determine_profile(options)
|
49
|
+
@config_enabled = options[:config_enabled]
|
50
|
+
@credentials_path = options[:credentials_path] ||
|
51
|
+
determine_credentials_path
|
52
|
+
@parsed_credentials = {}
|
53
|
+
load_credentials_file if loadable?(@credentials_path)
|
54
|
+
if @config_enabled
|
55
|
+
@config_path = options[:config_path] || determine_config_path
|
56
|
+
load_config_file if loadable?(@config_path)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# @api private
|
61
|
+
def fresh(options = {})
|
62
|
+
@profile_name = nil
|
63
|
+
@credentials_path = nil
|
64
|
+
@config_path = nil
|
65
|
+
@parsed_credentials = {}
|
66
|
+
@parsed_config = nil
|
67
|
+
@config_enabled = options[:config_enabled] ? true : false
|
68
|
+
@profile_name = determine_profile(options)
|
69
|
+
@credentials_path = options[:credentials_path] ||
|
70
|
+
determine_credentials_path
|
71
|
+
load_credentials_file if loadable?(@credentials_path)
|
72
|
+
if @config_enabled
|
73
|
+
@config_path = options[:config_path] || determine_config_path
|
74
|
+
load_config_file if loadable?(@config_path)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# @return [Boolean] Returns `true` if a credential file
|
79
|
+
# exists and has appropriate read permissions at {#path}.
|
80
|
+
# @note This method does not indicate if the file found at {#path}
|
81
|
+
# will be parsable, only if it can be read.
|
82
|
+
def loadable?(path)
|
83
|
+
!path.nil? && File.exist?(path) && File.readable?(path)
|
84
|
+
end
|
85
|
+
|
86
|
+
# @return [Boolean] returns `true` if use of the shared config file is
|
87
|
+
# enabled.
|
88
|
+
def config_enabled?
|
89
|
+
@config_enabled ? true : false
|
90
|
+
end
|
91
|
+
|
92
|
+
# Sources static credentials from shared credential/config files.
|
93
|
+
#
|
94
|
+
# @param [Hash] opts
|
95
|
+
# @option options [String] :profile the name of the configuration file from
|
96
|
+
# which credentials are being sourced.
|
97
|
+
# @return [Aws::Credentials] credentials sourced from configuration values,
|
98
|
+
# or `nil` if no valid credentials were found.
|
99
|
+
def credentials(opts = {})
|
100
|
+
p = opts[:profile] || @profile_name
|
101
|
+
validate_profile_exists(p) if credentials_present?
|
102
|
+
if (credentials = credentials_from_shared(p, opts))
|
103
|
+
credentials
|
104
|
+
elsif (credentials = credentials_from_config(p, opts))
|
105
|
+
credentials
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# Attempts to assume a role from shared config or shared credentials file.
|
110
|
+
# Will always attempt first to assume a role from the shared credentials
|
111
|
+
# file, if present.
|
112
|
+
def assume_role_credentials_from_config(opts = {})
|
113
|
+
p = opts.delete(:profile) || @profile_name
|
114
|
+
chain_config = opts.delete(:chain_config)
|
115
|
+
credentials = assume_role_from_profile(@parsed_credentials, p, opts, chain_config)
|
116
|
+
if @parsed_config
|
117
|
+
credentials ||= assume_role_from_profile(@parsed_config, p, opts, chain_config)
|
118
|
+
end
|
119
|
+
credentials
|
120
|
+
end
|
121
|
+
|
122
|
+
def assume_role_web_identity_credentials_from_config(profile)
|
123
|
+
p = profile || @profile_name
|
124
|
+
if @config_enabled && @parsed_config
|
125
|
+
entry = @parsed_config.fetch(p, {})
|
126
|
+
if entry['web_identity_token_file'] &&
|
127
|
+
entry['role_arn']
|
128
|
+
AssumeRoleWebIdentityCredentials.new(
|
129
|
+
role_arn: entry['role_arn'],
|
130
|
+
web_identity_token_file: entry['web_identity_token_file'],
|
131
|
+
role_session_name: entry['role_session_name']
|
132
|
+
)
|
133
|
+
else
|
134
|
+
nil
|
135
|
+
end
|
136
|
+
else
|
137
|
+
nil
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def region(opts = {})
|
142
|
+
p = opts[:profile] || @profile_name
|
143
|
+
if @config_enabled
|
144
|
+
if @parsed_credentials
|
145
|
+
region = @parsed_credentials.fetch(p, {})["region"]
|
146
|
+
end
|
147
|
+
if @parsed_config
|
148
|
+
region ||= @parsed_config.fetch(p, {})["region"]
|
149
|
+
end
|
150
|
+
region
|
151
|
+
else
|
152
|
+
nil
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def sts_regional_endpoints(opts = {})
|
157
|
+
p = opts[:profile] || @profile_name
|
158
|
+
if @config_enabled
|
159
|
+
if @parsed_credentials
|
160
|
+
mode = @parsed_credentials.fetch(p, {})["sts_regional_endpoints"]
|
161
|
+
end
|
162
|
+
if @parsed_config
|
163
|
+
mode ||= @parsed_config.fetch(p, {})["sts_regional_endpoints"]
|
164
|
+
end
|
165
|
+
mode
|
166
|
+
else
|
167
|
+
nil
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def s3_us_east_1_regional_endpoint(opts = {})
|
172
|
+
p = opts[:profile] || @profile_name
|
173
|
+
if @config_enabled
|
174
|
+
if @parsed_credentials
|
175
|
+
mode = @parsed_credentials.fetch(p, {})["s3_us_east_1_regional_endpoint"]
|
176
|
+
end
|
177
|
+
if @parsed_config
|
178
|
+
mode ||= @parsed_config.fetch(p, {})["s3_us_east_1_regional_endpoint"]
|
179
|
+
end
|
180
|
+
mode
|
181
|
+
else
|
182
|
+
nil
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def s3_use_arn_region(opts = {})
|
187
|
+
p = opts[:profile] || @profile_name
|
188
|
+
if @config_enabled
|
189
|
+
if @parsed_credentials
|
190
|
+
value = @parsed_credentials.fetch(p, {})["s3_use_arn_region"]
|
191
|
+
end
|
192
|
+
if @parsed_config
|
193
|
+
value ||= @parsed_config.fetch(p, {})["s3_use_arn_region"]
|
194
|
+
end
|
195
|
+
value
|
196
|
+
else
|
197
|
+
nil
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
def endpoint_discovery(opts = {})
|
202
|
+
p = opts[:profile] || @profile_name
|
203
|
+
if @config_enabled && @parsed_config
|
204
|
+
@parsed_config.fetch(p, {})["endpoint_discovery_enabled"]
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
def credentials_process(profile)
|
209
|
+
validate_profile_exists(profile)
|
210
|
+
@parsed_config[profile]['credential_process']
|
211
|
+
end
|
212
|
+
|
213
|
+
def csm_enabled(opts = {})
|
214
|
+
p = opts[:profile] || @profile_name
|
215
|
+
if @config_enabled
|
216
|
+
if @parsed_credentials
|
217
|
+
value = @parsed_credentials.fetch(p, {})["csm_enabled"]
|
218
|
+
end
|
219
|
+
if @parsed_config
|
220
|
+
value ||= @parsed_config.fetch(p, {})["csm_enabled"]
|
221
|
+
end
|
222
|
+
value
|
223
|
+
else
|
224
|
+
nil
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
def csm_client_id(opts = {})
|
229
|
+
p = opts[:profile] || @profile_name
|
230
|
+
if @config_enabled
|
231
|
+
if @parsed_credentials
|
232
|
+
value = @parsed_credentials.fetch(p, {})["csm_client_id"]
|
233
|
+
end
|
234
|
+
if @parsed_config
|
235
|
+
value ||= @parsed_config.fetch(p, {})["csm_client_id"]
|
236
|
+
end
|
237
|
+
value
|
238
|
+
else
|
239
|
+
nil
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
def csm_port(opts = {})
|
244
|
+
p = opts[:profile] || @profile_name
|
245
|
+
if @config_enabled
|
246
|
+
if @parsed_credentials
|
247
|
+
value = @parsed_credentials.fetch(p, {})["csm_port"]
|
248
|
+
end
|
249
|
+
if @parsed_config
|
250
|
+
value ||= @parsed_config.fetch(p, {})["csm_port"]
|
251
|
+
end
|
252
|
+
value
|
253
|
+
else
|
254
|
+
nil
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
def csm_host(opts = {})
|
259
|
+
p = opts[:profile] || @profile_name
|
260
|
+
if @config_enabled
|
261
|
+
if @parsed_credentials
|
262
|
+
value = @parsed_credentials.fetch(p, {})["csm_host"]
|
263
|
+
end
|
264
|
+
if @parsed_config
|
265
|
+
value ||= @parsed_config.fetch(p, {})["csm_host"]
|
266
|
+
end
|
267
|
+
value
|
268
|
+
else
|
269
|
+
nil
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
private
|
274
|
+
|
275
|
+
def credentials_present?
|
276
|
+
(@parsed_credentials && !@parsed_credentials.empty?) ||
|
277
|
+
(@parsed_config && !@parsed_config.empty?)
|
278
|
+
end
|
279
|
+
|
280
|
+
def assume_role_from_profile(cfg, profile, opts, chain_config)
|
281
|
+
if cfg && prof_cfg = cfg[profile]
|
282
|
+
opts[:source_profile] ||= prof_cfg["source_profile"]
|
283
|
+
credential_source = opts.delete(:credential_source)
|
284
|
+
credential_source ||= prof_cfg["credential_source"]
|
285
|
+
if opts[:source_profile] && credential_source
|
286
|
+
raise Errors::CredentialSourceConflictError.new(
|
287
|
+
"Profile #{profile} has a source_profile, and "\
|
288
|
+
"a credential_source. For assume role credentials, must "\
|
289
|
+
"provide only source_profile or credential_source, not both."
|
290
|
+
)
|
291
|
+
elsif opts[:source_profile]
|
292
|
+
opts[:credentials] = resolve_source_profile(opts[:source_profile])
|
293
|
+
if opts[:credentials]
|
294
|
+
opts[:role_session_name] ||= prof_cfg["role_session_name"]
|
295
|
+
opts[:role_session_name] ||= "default_session"
|
296
|
+
opts[:role_arn] ||= prof_cfg["role_arn"]
|
297
|
+
opts[:duration_seconds] ||= prof_cfg["duration_seconds"]
|
298
|
+
opts[:external_id] ||= prof_cfg["external_id"]
|
299
|
+
opts[:serial_number] ||= prof_cfg["mfa_serial"]
|
300
|
+
opts[:profile] = opts.delete(:source_profile)
|
301
|
+
AssumeRoleCredentials.new(opts)
|
302
|
+
else
|
303
|
+
raise Errors::NoSourceProfileError.new(
|
304
|
+
"Profile #{profile} has a role_arn, and source_profile, but the"\
|
305
|
+
" source_profile does not have credentials."
|
306
|
+
)
|
307
|
+
end
|
308
|
+
elsif credential_source
|
309
|
+
opts[:credentials] = credentials_from_source(
|
310
|
+
credential_source,
|
311
|
+
chain_config
|
312
|
+
)
|
313
|
+
if opts[:credentials]
|
314
|
+
opts[:role_session_name] ||= prof_cfg["role_session_name"]
|
315
|
+
opts[:role_session_name] ||= "default_session"
|
316
|
+
opts[:role_arn] ||= prof_cfg["role_arn"]
|
317
|
+
opts[:duration_seconds] ||= prof_cfg["duration_seconds"]
|
318
|
+
opts[:external_id] ||= prof_cfg["external_id"]
|
319
|
+
opts[:serial_number] ||= prof_cfg["mfa_serial"]
|
320
|
+
opts.delete(:source_profile) # Cleanup
|
321
|
+
AssumeRoleCredentials.new(opts)
|
322
|
+
else
|
323
|
+
raise Errors::NoSourceCredentials.new(
|
324
|
+
"Profile #{profile} could not get source credentials from"\
|
325
|
+
" provider #{credential_source}"
|
326
|
+
)
|
327
|
+
end
|
328
|
+
elsif prof_cfg["role_arn"]
|
329
|
+
raise Errors::NoSourceProfileError.new(
|
330
|
+
"Profile #{profile} has a role_arn, but no source_profile."
|
331
|
+
)
|
332
|
+
else
|
333
|
+
nil
|
334
|
+
end
|
335
|
+
else
|
336
|
+
nil
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
def resolve_source_profile(profile)
|
341
|
+
if (creds = credentials(profile: profile))
|
342
|
+
creds # static credentials
|
343
|
+
elsif (provider = assume_role_web_identity_credentials_from_config(profile))
|
344
|
+
if provider.credentials.set?
|
345
|
+
provider.credentials
|
346
|
+
end
|
347
|
+
elsif (provider = assume_role_process_credentials_from_config(profile))
|
348
|
+
if provider.credentials.set?
|
349
|
+
provider.credentials
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
def credentials_from_source(credential_source, config)
|
355
|
+
case credential_source
|
356
|
+
when "Ec2InstanceMetadata"
|
357
|
+
InstanceProfileCredentials.new(
|
358
|
+
retries: config ? config.instance_profile_credentials_retries : 0,
|
359
|
+
http_open_timeout: config ? config.instance_profile_credentials_timeout : 1,
|
360
|
+
http_read_timeout: config ? config.instance_profile_credentials_timeout : 1
|
361
|
+
)
|
362
|
+
when "EcsContainer"
|
363
|
+
ECSCredentials.new
|
364
|
+
else
|
365
|
+
raise Errors::InvalidCredentialSourceError.new(
|
366
|
+
"Unsupported credential_source: #{credential_source}"
|
367
|
+
)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
def assume_role_process_credentials_from_config(profile)
|
372
|
+
credential_process = credentials_process(profile)
|
373
|
+
ProcessCredentials.new(credential_process) if credential_process
|
374
|
+
end
|
375
|
+
|
376
|
+
def credentials_from_shared(profile, opts)
|
377
|
+
if @parsed_credentials && prof_config = @parsed_credentials[profile]
|
378
|
+
credentials_from_profile(prof_config)
|
379
|
+
else
|
380
|
+
nil
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
def credentials_from_config(profile, opts)
|
385
|
+
if @parsed_config && prof_config = @parsed_config[profile]
|
386
|
+
credentials_from_profile(prof_config)
|
387
|
+
else
|
388
|
+
nil
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
def credentials_from_profile(prof_config)
|
393
|
+
creds = Credentials.new(
|
394
|
+
prof_config['aws_access_key_id'],
|
395
|
+
prof_config['aws_secret_access_key'],
|
396
|
+
prof_config['aws_session_token']
|
397
|
+
)
|
398
|
+
if credentials_complete(creds)
|
399
|
+
creds
|
400
|
+
else
|
401
|
+
nil
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
def credentials_complete(creds)
|
406
|
+
creds.set?
|
407
|
+
end
|
408
|
+
|
409
|
+
def load_credentials_file
|
410
|
+
@parsed_credentials = IniParser.ini_parse(
|
411
|
+
File.read(@credentials_path)
|
412
|
+
)
|
413
|
+
end
|
414
|
+
|
415
|
+
def load_config_file
|
416
|
+
@parsed_config = IniParser.ini_parse(File.read(@config_path))
|
417
|
+
end
|
418
|
+
|
419
|
+
def determine_credentials_path
|
420
|
+
ENV['AWS_SHARED_CREDENTIALS_FILE'] || default_shared_config_path('credentials')
|
421
|
+
end
|
422
|
+
|
423
|
+
def determine_config_path
|
424
|
+
ENV['AWS_CONFIG_FILE'] || default_shared_config_path('config')
|
425
|
+
end
|
426
|
+
|
427
|
+
def default_shared_config_path(file)
|
428
|
+
File.join(Dir.home, '.aws', file)
|
429
|
+
rescue ArgumentError
|
430
|
+
# Dir.home raises ArgumentError when ENV['home'] is not set
|
431
|
+
nil
|
432
|
+
end
|
433
|
+
|
434
|
+
def validate_profile_exists(profile)
|
435
|
+
unless (@parsed_credentials && @parsed_credentials[profile]) ||
|
436
|
+
(@parsed_config && @parsed_config[profile])
|
437
|
+
msg = "Profile `#{profile}' not found in #{@credentials_path}"
|
438
|
+
msg << " or #{@config_path}" if @config_path
|
439
|
+
raise Errors::NoSuchProfileError.new(msg)
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
def determine_profile(options)
|
444
|
+
ret = options[:profile_name]
|
445
|
+
ret ||= ENV["AWS_PROFILE"]
|
446
|
+
ret ||= "default"
|
447
|
+
ret
|
448
|
+
end
|
449
|
+
|
450
|
+
end
|
451
|
+
end
|