aws-sdk-core 2.0.0.rc14 → 2.0.0
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 +4 -4
- data/apis/AutoScaling.api.json +1943 -0
- data/apis/CloudFormation.api.json +785 -0
- data/apis/CloudFront.api.json +2581 -0
- data/apis/CloudSearch.api.json +1955 -0
- data/apis/CloudSearchDomain.api.json +349 -0
- data/apis/CloudTrail.api.json +559 -0
- data/apis/CloudWatch.api.json +917 -0
- data/apis/CloudWatchLogs.api.json +816 -0
- data/apis/CognitoIdentity.api.json +631 -0
- data/apis/CognitoSync.api.json +721 -0
- data/apis/DataPipeline.api.json +940 -0
- data/apis/DirectConnect.api.json +833 -0
- data/apis/DynamoDB.api.json +1210 -0
- data/apis/{dynamodb-2012-08-10.paginators.json → DynamoDB.paginators.json} +0 -1
- data/apis/EC2.api.json +9914 -0
- data/apis/{ec2-2014-06-15.resources.json → EC2.resources.json} +16 -0
- data/apis/EMR.api.json +1339 -0
- data/apis/ElastiCache.api.json +3410 -0
- data/apis/ElasticBeanstalk.api.json +1543 -0
- data/apis/ElasticLoadBalancing.api.json +2131 -0
- data/apis/ElasticTranscoder.api.json +1647 -0
- data/apis/Glacier.api.json +1456 -0
- data/apis/{glacier-2012-06-01.resources.json → Glacier.resources.json} +5 -9
- data/apis/IAM.api.json +4033 -0
- data/apis/{iam-2010-05-08.resources.json → IAM.resources.json} +1 -1
- data/apis/ImportExport.api.json +515 -0
- data/apis/Kinesis.api.json +706 -0
- data/apis/{kinesis-2013-12-02.paginators.json → Kinesis.paginators.json} +0 -6
- data/apis/OpsWorks.api.json +2555 -0
- data/apis/OpsWorks.resources.json +181 -0
- data/apis/RDS.api.json +4473 -0
- data/apis/Redshift.api.json +4482 -0
- data/apis/Route53.api.json +1935 -0
- data/apis/Route53Domains.api.json +1129 -0
- data/apis/{s3-2006-03-01.api.json → S3.api.json} +336 -942
- data/apis/{s3-2006-03-01.paginators.json → S3.paginators.json} +1 -1
- data/apis/{s3-2006-03-01.resources.json → S3.resources.json} +13 -2
- data/apis/SES.api.json +644 -0
- data/apis/SNS.api.json +1760 -0
- data/apis/SQS.api.json +1113 -0
- data/apis/{sqs-2012-11-05.resources.json → SQS.resources.json} +0 -10
- data/apis/STS.api.json +594 -0
- data/apis/SWF.api.json +2656 -0
- data/apis/SimpleDB.api.json +954 -0
- data/apis/StorageGateway.api.json +2311 -0
- data/apis/Support.api.json +869 -0
- data/bin/aws.rb +19 -0
- data/lib/aws-sdk-core/api/docstrings.rb +35 -0
- data/lib/aws-sdk-core/api/documenter.rb +241 -0
- data/lib/{aws/api/documentor.rb → aws-sdk-core/api/operation_documenter.rb} +9 -5
- data/lib/{aws/api/doc_example.rb → aws-sdk-core/api/operation_example.rb} +8 -7
- data/lib/{aws → aws-sdk-core}/api/service_customizations.rb +3 -1
- data/lib/aws-sdk-core/autoscaling.rb +5 -0
- data/lib/aws-sdk-core/client.rb +121 -0
- data/lib/aws-sdk-core/cloudformation.rb +5 -0
- data/lib/aws-sdk-core/cloudfront.rb +6 -0
- data/lib/aws-sdk-core/cloudsearch.rb +5 -0
- data/lib/aws-sdk-core/cloudsearchdomain.rb +4 -0
- data/lib/aws-sdk-core/cloudtrail.rb +5 -0
- data/lib/aws-sdk-core/cloudwatch.rb +5 -0
- data/lib/aws-sdk-core/cloudwatchlogs.rb +5 -0
- data/lib/aws-sdk-core/cognitoidentity.rb +4 -0
- data/lib/aws-sdk-core/cognitosync.rb +4 -0
- data/lib/{aws → aws-sdk-core}/credential_provider_chain.rb +4 -1
- data/lib/aws-sdk-core/datapipeline.rb +5 -0
- data/lib/aws-sdk-core/directconnect.rb +5 -0
- data/lib/aws-sdk-core/dynamodb/attribute_value.rb +87 -0
- data/lib/aws-sdk-core/dynamodb.rb +12 -0
- data/lib/aws-sdk-core/ec2.rb +7 -0
- data/lib/aws-sdk-core/elasticache.rb +5 -0
- data/lib/aws-sdk-core/elasticbeanstalk.rb +5 -0
- data/lib/aws-sdk-core/elasticloadbalancing.rb +5 -0
- data/lib/aws-sdk-core/elastictranscoder.rb +5 -0
- data/lib/{aws → aws-sdk-core}/empty_structure.rb +4 -3
- data/lib/aws-sdk-core/emr.rb +5 -0
- data/lib/{aws → aws-sdk-core}/endpoint_provider.rb +1 -0
- data/lib/{aws → aws-sdk-core}/errors.rb +18 -7
- data/lib/aws-sdk-core/glacier.rb +7 -0
- data/lib/aws-sdk-core/iam.rb +6 -0
- data/lib/aws-sdk-core/importexport.rb +5 -0
- data/lib/{aws → aws-sdk-core}/instance_profile_credentials.rb +1 -1
- data/lib/aws-sdk-core/kinesis.rb +5 -0
- data/lib/aws-sdk-core/opsworks.rb +6 -0
- data/lib/{aws → aws-sdk-core}/pageable_response.rb +1 -1
- data/lib/aws-sdk-core/plugins/csd_conditional_signing.rb +37 -0
- data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +179 -0
- data/lib/{aws → aws-sdk-core}/plugins/global_configuration.rb +13 -3
- data/lib/{aws → aws-sdk-core}/plugins/protocols/json_rpc.rb +9 -7
- data/lib/{aws → aws-sdk-core}/plugins/regional_endpoint.rb +1 -1
- data/lib/{aws → aws-sdk-core}/plugins/request_signer.rb +13 -6
- data/lib/aws-sdk-core/plugins/response_paging.rb +25 -0
- data/lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb +92 -0
- data/lib/{aws → aws-sdk-core}/plugins/user_agent.rb +1 -2
- data/lib/{aws → aws-sdk-core}/query/handler.rb +4 -5
- data/lib/aws-sdk-core/rds.rb +6 -0
- data/lib/aws-sdk-core/redshift.rb +6 -0
- data/lib/aws-sdk-core/route53.rb +5 -0
- data/lib/aws-sdk-core/route53domains.rb +4 -0
- data/lib/aws-sdk-core/s3/presigner.rb +64 -0
- data/lib/aws-sdk-core/s3.rb +13 -0
- data/lib/aws-sdk-core/service.rb +4 -0
- data/lib/aws-sdk-core/ses.rb +6 -0
- data/lib/{aws → aws-sdk-core}/signers/v4.rb +6 -5
- data/lib/aws-sdk-core/simpledb.rb +5 -0
- data/lib/aws-sdk-core/sns.rb +6 -0
- data/lib/aws-sdk-core/sqs.rb +6 -0
- data/lib/aws-sdk-core/storagegateway.rb +5 -0
- data/lib/{aws → aws-sdk-core}/structure.rb +49 -2
- data/lib/aws-sdk-core/sts.rb +4 -0
- data/lib/aws-sdk-core/support.rb +5 -0
- data/lib/aws-sdk-core/swf.rb +5 -0
- data/lib/aws-sdk-core/version.rb +3 -0
- data/lib/aws-sdk-core/waiters/errors.rb +30 -0
- data/lib/aws-sdk-core/waiters/null_provider.rb +12 -0
- data/lib/aws-sdk-core/waiters/provider.rb +54 -0
- data/lib/aws-sdk-core/waiters/waiter.rb +194 -0
- data/lib/{aws → aws-sdk-core}/xml/builder.rb +1 -0
- data/lib/aws-sdk-core/xml/default_list.rb +10 -0
- data/lib/{aws → aws-sdk-core}/xml/parser.rb +6 -1
- data/lib/aws-sdk-core.rb +288 -1
- data/lib/seahorse/client/base.rb +45 -20
- data/lib/seahorse/client/handler_list.rb +17 -3
- data/lib/seahorse/client/http/request.rb +0 -8
- data/lib/seahorse/client/param_converter.rb +2 -2
- data/lib/seahorse/client/plugins/restful_bindings.rb +1 -1
- data/lib/seahorse/client/request.rb +1 -1
- data/lib/seahorse/client/response.rb +0 -2
- data/lib/seahorse/client/xml/builder.rb +0 -1
- data/lib/seahorse/model/shape_map.rb +1 -0
- data/lib/seahorse/model/shapes.rb +11 -2
- data/lib/seahorse.rb +2 -3
- metadata +214 -187
- data/LICENSE.txt +0 -12
- data/README.md +0 -272
- data/apis/autoscaling-2011-01-01.api.json +0 -3063
- data/apis/cloudformation-2010-05-15.api.json +0 -1306
- data/apis/cloudfront-2014-01-31.api.json +0 -3478
- data/apis/cloudfront-2014-01-31.paginators.json +0 -32
- data/apis/cloudfront-2014-05-31.api.json +0 -3540
- data/apis/cloudfront-2014-05-31.waiters.json +0 -29
- data/apis/cloudsearch-2011-02-01.api.json +0 -2093
- data/apis/cloudsearch-2011-02-01.paginators.json +0 -13
- data/apis/cloudsearch-2013-01-01.api.json +0 -2655
- data/apis/cloudsearchdomain-2013-01-01.api.json +0 -508
- data/apis/cloudtrail-2013-11-01.api.json +0 -773
- data/apis/cognito-identity-2014-06-30.api.json +0 -884
- data/apis/cognito-sync-2014-06-30.api.json +0 -1029
- data/apis/datapipeline-2012-10-29.api.json +0 -1432
- data/apis/directconnect-2012-10-25.api.json +0 -1174
- data/apis/dynamodb-2011-12-05.api.json +0 -1208
- data/apis/dynamodb-2011-12-05.paginators.json +0 -26
- data/apis/dynamodb-2011-12-05.waiters.json +0 -27
- data/apis/dynamodb-2012-08-10.api.json +0 -1857
- data/apis/ec2-2014-06-15.api.json +0 -11670
- data/apis/elasticache-2014-03-24.api.json +0 -4789
- data/apis/elasticache-2014-07-15.api.json +0 -4826
- data/apis/elasticache-2014-07-15.paginators.json +0 -76
- data/apis/elasticbeanstalk-2010-12-01.api.json +0 -2442
- data/apis/elasticloadbalancing-2012-06-01.api.json +0 -2605
- data/apis/elasticmapreduce-2009-03-31.api.json +0 -2282
- data/apis/elastictranscoder-2012-09-25.api.json +0 -2478
- data/apis/email-2010-12-01.api.json +0 -954
- data/apis/glacier-2012-06-01.api.json +0 -2012
- data/apis/iam-2010-05-08.api.json +0 -5322
- data/apis/importexport-2010-06-01.api.json +0 -687
- data/apis/kinesis-2013-12-02.api.json +0 -769
- data/apis/logs-2014-03-28.api.json +0 -942
- data/apis/manifest.json +0 -259
- data/apis/monitoring-2010-08-01.api.json +0 -1338
- data/apis/opsworks-2013-02-18.api.json +0 -4348
- data/apis/rds-2013-01-10.api.json +0 -6074
- data/apis/rds-2013-01-10.paginators.json +0 -97
- data/apis/rds-2013-02-12.api.json +0 -6392
- data/apis/rds-2013-09-09.api.json +0 -6564
- data/apis/rds-2013-09-09.paginators.json +0 -110
- data/apis/redshift-2012-12-01.api.json +0 -6318
- data/apis/route53-2013-04-01.api.json +0 -2493
- data/apis/route53domains-2014-05-15.api.json +0 -1622
- data/apis/sdb-2009-04-15.api.json +0 -1178
- data/apis/sns-2010-03-31.api.json +0 -2275
- data/apis/sqs-2012-11-05.api.json +0 -1438
- data/apis/storagegateway-2013-06-30.api.json +0 -3153
- data/apis/sts-2011-06-15.api.json +0 -786
- data/apis/support-2013-04-15.api.json +0 -1379
- data/apis/swf-2012-01-25.api.json +0 -4463
- data/lib/aws/api/manifest.rb +0 -29
- data/lib/aws/api/manifest_builder.rb +0 -57
- data/lib/aws/api/minifier.rb +0 -42
- data/lib/aws/plugins/response_paging.rb +0 -20
- data/lib/aws/response_handler.rb +0 -38
- data/lib/aws/service.rb +0 -26
- data/lib/aws/service_builder.rb +0 -56
- data/lib/aws/version.rb +0 -3
- data/lib/aws.rb +0 -227
- data/lib/seahorse/client/plugins/api.rb +0 -11
- /data/apis/{autoscaling-2011-01-01.paginators.json → AutoScaling.paginators.json} +0 -0
- /data/apis/{cloudformation-2010-05-15.paginators.json → CloudFormation.paginators.json} +0 -0
- /data/apis/{cloudfront-2014-05-31.paginators.json → CloudFront.paginators.json} +0 -0
- /data/apis/{cloudfront-2014-01-31.waiters.json → CloudFront.waiters.json} +0 -0
- /data/apis/{cloudsearch-2013-01-01.paginators.json → CloudSearch.paginators.json} +0 -0
- /data/apis/{cloudtrail-2013-11-01.paginators.json → CloudTrail.paginators.json} +0 -0
- /data/apis/{monitoring-2010-08-01.paginators.json → CloudWatch.paginators.json} +0 -0
- /data/apis/{logs-2014-03-28.paginators.json → CloudWatchLogs.paginators.json} +0 -0
- /data/apis/{datapipeline-2012-10-29.paginators.json → DataPipeline.paginators.json} +0 -0
- /data/apis/{directconnect-2012-10-25.paginators.json → DirectConnect.paginators.json} +0 -0
- /data/apis/{dynamodb-2012-08-10.waiters.json → DynamoDB.waiters.json} +0 -0
- /data/apis/{ec2-2014-06-15.paginators.json → EC2.paginators.json} +0 -0
- /data/apis/{ec2-2014-06-15.waiters.json → EC2.waiters.json} +0 -0
- /data/apis/{elasticmapreduce-2009-03-31.paginators.json → EMR.paginators.json} +0 -0
- /data/apis/{elasticache-2014-03-24.paginators.json → ElastiCache.paginators.json} +0 -0
- /data/apis/{elasticbeanstalk-2010-12-01.paginators.json → ElasticBeanstalk.paginators.json} +0 -0
- /data/apis/{elasticloadbalancing-2012-06-01.paginators.json → ElasticLoadBalancing.paginators.json} +0 -0
- /data/apis/{elastictranscoder-2012-09-25.paginators.json → ElasticTranscoder.paginators.json} +0 -0
- /data/apis/{glacier-2012-06-01.paginators.json → Glacier.paginators.json} +0 -0
- /data/apis/{glacier-2012-06-01.waiters.json → Glacier.waiters.json} +0 -0
- /data/apis/{iam-2010-05-08.paginators.json → IAM.paginators.json} +0 -0
- /data/apis/{importexport-2010-06-01.paginators.json → ImportExport.paginators.json} +0 -0
- /data/apis/{opsworks-2013-02-18.paginators.json → OpsWorks.paginators.json} +0 -0
- /data/apis/{rds-2013-02-12.paginators.json → RDS.paginators.json} +0 -0
- /data/apis/{rds-2013-09-09.waiters.json → RDS.waiters.json} +0 -0
- /data/apis/{redshift-2012-12-01.paginators.json → Redshift.paginators.json} +0 -0
- /data/apis/{redshift-2012-12-01.waiters.json → Redshift.waiters.json} +0 -0
- /data/apis/{route53-2013-04-01.paginators.json → Route53.paginators.json} +0 -0
- /data/apis/{s3-2006-03-01.waiters.json → S3.waiters.json} +0 -0
- /data/apis/{email-2010-12-01.paginators.json → SES.paginators.json} +0 -0
- /data/apis/{email-2010-12-01.waiters.json → SES.waiters.json} +0 -0
- /data/apis/{sns-2010-03-31.paginators.json → SNS.paginators.json} +0 -0
- /data/apis/{sns-2010-03-31.resources.json → SNS.resources.json} +0 -0
- /data/apis/{sqs-2012-11-05.paginators.json → SQS.paginators.json} +0 -0
- /data/apis/{swf-2012-01-25.paginators.json → SWF.paginators.json} +0 -0
- /data/apis/{sdb-2009-04-15.paginators.json → SimpleDB.paginators.json} +0 -0
- /data/apis/{storagegateway-2013-06-30.paginators.json → StorageGateway.paginators.json} +0 -0
- /data/apis/{support-2013-04-15.paginators.json → Support.paginators.json} +0 -0
- /data/lib/{aws → aws-sdk-core}/api/customizer.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/credentials.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/builder.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/error_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/parser.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/rest_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/rpc_body_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/rpc_headers_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/simple_body_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/null_pager.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/null_provider.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/pager.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/provider.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/dynamodb_extended_retries.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/ec2_copy_encrypted_snapshot.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/glacier_account_id.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/glacier_api_version.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/glacier_checksums.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/ec2.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/query.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_json.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_xml.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/retry_errors.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/route_53_id_fix.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_bucket_dns.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_complete_multipart_upload_fix.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_expect_100_continue.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_get_bucket_location_fix.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_location_constraint.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_md5s.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_redirects.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_sse_cpk.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/sqs_queue_urls.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/swf_read_timeouts.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/ec2_param_builder.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/param.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/param_builder.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/param_list.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/rest_body_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/shared_credentials.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/base.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/s3.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/v2.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/v3.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/tree_hash.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/xml/error_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/xml/rest_handler.rb +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Plugins
|
|
5
|
+
|
|
6
|
+
# This plugin auto-populates the `:encoding_type` request parameter
|
|
7
|
+
# to all calls made to Amazon S3 that accept it.
|
|
8
|
+
#
|
|
9
|
+
# This enables Amazon S3 to return object keys that might contain
|
|
10
|
+
# invalid XML characters as URL encoded strings. This plugin also
|
|
11
|
+
# automatically decodes these keys so that the key management is
|
|
12
|
+
# transparent to the user.
|
|
13
|
+
#
|
|
14
|
+
# If you specify the `:encoding_type` parameter, then this plugin
|
|
15
|
+
# will be disabled, and you will need to decode the keys yourself.
|
|
16
|
+
#
|
|
17
|
+
# The following operations are managed:
|
|
18
|
+
#
|
|
19
|
+
# * {S3::Client#list_objects}
|
|
20
|
+
# * {S3::Client#list_multipart_uploads}
|
|
21
|
+
# * {S3::Client#list_object_versions}
|
|
22
|
+
#
|
|
23
|
+
class S3UrlEncodedKeys < Seahorse::Client::Plugin
|
|
24
|
+
|
|
25
|
+
class Handler < Seahorse::Client::Handler
|
|
26
|
+
|
|
27
|
+
def call(context)
|
|
28
|
+
if context.params.key?(:encoding_type)
|
|
29
|
+
@handler.call(context) # user managed
|
|
30
|
+
else
|
|
31
|
+
manage_keys(context)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def manage_keys(context)
|
|
38
|
+
context.params[:encoding_type] = 'url'
|
|
39
|
+
@handler.call(context).on_success do |resp|
|
|
40
|
+
send("decode_#{resp.context.operation_name}_keys", resp.data)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def decode_list_objects_keys(data)
|
|
45
|
+
decode(:marker, data)
|
|
46
|
+
decode(:next_marker, data)
|
|
47
|
+
decode(:prefix, data)
|
|
48
|
+
decode(:delimiter, data)
|
|
49
|
+
data.contents.each { |o| decode(:key, o) } if data.contents
|
|
50
|
+
data.common_prefixes.each { |o| decode(:prefix, o) } if data.common_prefixes
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def decode_list_object_versions_keys(data)
|
|
54
|
+
decode(:key_marker, data)
|
|
55
|
+
decode(:next_key_marker, data)
|
|
56
|
+
decode(:prefix, data)
|
|
57
|
+
decode(:delimiter, data)
|
|
58
|
+
data.versions.each { |o| decode(:key, o) } if data.versions
|
|
59
|
+
data.delete_markers.each { |o| decode(:key, o) } if data.delete_markers
|
|
60
|
+
data.common_prefixes.each { |o| decode(:prefix, o) } if data.common_prefixes
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def decode_list_multipart_uploads_keys(data)
|
|
64
|
+
decode(:key_marker, data)
|
|
65
|
+
decode(:next_key_marker, data)
|
|
66
|
+
decode(:prefix, data)
|
|
67
|
+
decode(:delimiter, data)
|
|
68
|
+
data.uploads.each { |o| decode(:key, o) } if data.uploads
|
|
69
|
+
data.common_prefixes.each { |o| decode(:prefix, o) } if data.common_prefixes
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def decode(member, struct)
|
|
73
|
+
if struct[member]
|
|
74
|
+
struct[member] = CGI.unescape(struct[member])
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
handler(Handler,
|
|
81
|
+
step: :build,
|
|
82
|
+
priority: 60, # run this just before/after the XML builder/parser
|
|
83
|
+
operations: [
|
|
84
|
+
:list_objects,
|
|
85
|
+
:list_object_versions,
|
|
86
|
+
:list_multipart_uploads,
|
|
87
|
+
]
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -13,11 +13,10 @@ module Aws
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def set_user_agent(context)
|
|
16
|
-
ua = "aws-sdk-ruby2/#{VERSION} %s/%s %s
|
|
16
|
+
ua = "aws-sdk-ruby2/#{VERSION} %s/%s %s %s" % [
|
|
17
17
|
(RUBY_ENGINE rescue nil or "ruby"),
|
|
18
18
|
RUBY_VERSION,
|
|
19
19
|
RUBY_PLATFORM,
|
|
20
|
-
Seahorse::VERSION,
|
|
21
20
|
context.config.user_agent_suffix,
|
|
22
21
|
]
|
|
23
22
|
context.http_request.headers['User-Agent'] = ua.strip
|
|
@@ -33,9 +33,8 @@ module Aws
|
|
|
33
33
|
|
|
34
34
|
def parse_xml(context)
|
|
35
35
|
if rules = context.operation.output
|
|
36
|
-
|
|
37
|
-
data
|
|
38
|
-
remove_wrapper(data, context)
|
|
36
|
+
data = Xml::Parser.new(apply_wrapper(rules)).parse(xml(context))
|
|
37
|
+
remove_wrapper(data, context, rules)
|
|
39
38
|
else
|
|
40
39
|
EmptyStructure.new
|
|
41
40
|
end
|
|
@@ -59,10 +58,10 @@ module Aws
|
|
|
59
58
|
}, shape_map: shape.shape_map)
|
|
60
59
|
end
|
|
61
60
|
|
|
62
|
-
def remove_wrapper(data, context)
|
|
61
|
+
def remove_wrapper(data, context, rules)
|
|
63
62
|
if context.operation.output.metadata('resultWrapper')
|
|
64
63
|
context[:request_id] = data.response_metadata.request_id
|
|
65
|
-
data[data.members.first]
|
|
64
|
+
data[data.members.first] || Structure.new(rules.member_names)
|
|
66
65
|
else
|
|
67
66
|
data
|
|
68
67
|
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Aws.add_service(:Redshift, {
|
|
2
|
+
api: File.join(Aws::APIS_DIR, 'Redshift.api.json'),
|
|
3
|
+
docs: File.join(Aws::APIS_DIR, 'Redshift.docs.json'),
|
|
4
|
+
paginators: File.join(Aws::APIS_DIR, 'Redshift.paginators.json'),
|
|
5
|
+
waiters: File.join(Aws::APIS_DIR, 'Redshift.waiters.json'),
|
|
6
|
+
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
module Aws
|
|
2
|
+
module S3
|
|
3
|
+
|
|
4
|
+
# Allows you to create presigned URLs for S3 operations.
|
|
5
|
+
#
|
|
6
|
+
# Example Use:
|
|
7
|
+
#
|
|
8
|
+
# signer = Aws::S3::Presigner.new
|
|
9
|
+
# url = signer.presigned_url(:get_object, bucket: "bucket", key: "key")
|
|
10
|
+
class Presigner
|
|
11
|
+
|
|
12
|
+
# @option options [Client] :client Optionally provide an existing
|
|
13
|
+
# S3 client
|
|
14
|
+
def initialize(options = {})
|
|
15
|
+
@client = options[:client] || Aws::S3::Client.new
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @param [Symbol] method Symbolized method name of the operation you want
|
|
19
|
+
# to presign.
|
|
20
|
+
# @option params [Integer] :expires_in (86400) The number of seconds
|
|
21
|
+
# before the presigned URL expires. Must be less than 604800 seconds
|
|
22
|
+
# (one week).
|
|
23
|
+
def presigned_url(method, params = {})
|
|
24
|
+
request = @client.build_request(method, params)
|
|
25
|
+
request.handle(PresignHandler, step: :sign, priority: 99)
|
|
26
|
+
expires_in = params.delete(:expires_in) || 86400
|
|
27
|
+
validate_expires_in_header(expires_in)
|
|
28
|
+
request.context[:presigned_expires_in] = expires_in
|
|
29
|
+
request.send_request.data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
private
|
|
33
|
+
def validate_expires_in_header(expires_in)
|
|
34
|
+
if(expires_in > 604800)
|
|
35
|
+
raise ArgumentError.new(
|
|
36
|
+
"expires_in value of #{expires_in} exceeds one-week maximum"
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @api private
|
|
42
|
+
class PresignHandler < Seahorse::Client::Handler
|
|
43
|
+
def call(context)
|
|
44
|
+
Seahorse::Client::Response.new(
|
|
45
|
+
context: context,
|
|
46
|
+
data: presigned_url(context)
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def presigned_url(context)
|
|
51
|
+
signer = Signers::V4.new(
|
|
52
|
+
context.config.credentials, 's3',
|
|
53
|
+
context.config.region
|
|
54
|
+
)
|
|
55
|
+
signer.presigned_url(
|
|
56
|
+
context.http_request,
|
|
57
|
+
expires_in: context[:presigned_expires_in],
|
|
58
|
+
body_digest: "UNSIGNED-PAYLOAD"
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Aws.add_service(:S3, {
|
|
2
|
+
api: File.join(Aws::APIS_DIR, 'S3.api.json'),
|
|
3
|
+
docs: File.join(Aws::APIS_DIR, 'S3.docs.json'),
|
|
4
|
+
paginators: File.join(Aws::APIS_DIR, 'S3.paginators.json'),
|
|
5
|
+
resources: File.join(Aws::APIS_DIR, 'S3.resources.json'),
|
|
6
|
+
waiters: File.join(Aws::APIS_DIR, 'S3.waiters.json'),
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
module Aws
|
|
10
|
+
module S3
|
|
11
|
+
autoload :Presigner, 'aws-sdk-core/s3/presigner'
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -44,7 +44,7 @@ module Aws
|
|
|
44
44
|
# @option options [required, Integer<Seconds>] :expires_in
|
|
45
45
|
# @option options [optional, String] :body_digest The SHA256 hexdigest of
|
|
46
46
|
# the payload to sign. For S3, this should be the string literal
|
|
47
|
-
# `UNSIGNED-
|
|
47
|
+
# `UNSIGNED-PAYLOAD`.
|
|
48
48
|
# @return [Seahorse::Client::Http::Request] the signed request.
|
|
49
49
|
# @api private
|
|
50
50
|
def presigned_url(request, options = {})
|
|
@@ -123,7 +123,7 @@ module Aws
|
|
|
123
123
|
[
|
|
124
124
|
request.http_method,
|
|
125
125
|
path(request.endpoint),
|
|
126
|
-
normalized_querystring(request.endpoint.query),
|
|
126
|
+
normalized_querystring(request.endpoint.query || ''),
|
|
127
127
|
canonical_headers(request) + "\n",
|
|
128
128
|
signed_headers(request),
|
|
129
129
|
body_digest
|
|
@@ -140,9 +140,10 @@ module Aws
|
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
def normalized_querystring(querystring)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
params = querystring.split('&')
|
|
144
|
+
params = params.map { |p| p.match(/=/) ? p : p + '=' }
|
|
145
|
+
params = params.sort { |a, b| a.split('=')[0] <=> b.split('=')[0] }
|
|
146
|
+
params.join('&')
|
|
146
147
|
end
|
|
147
148
|
|
|
148
149
|
def signed_headers(request)
|
|
@@ -1,13 +1,62 @@
|
|
|
1
1
|
require 'thread'
|
|
2
2
|
|
|
3
3
|
module Aws
|
|
4
|
+
|
|
5
|
+
# A utilty class that makes it easier to work with Struct objects.
|
|
6
|
+
#
|
|
7
|
+
# ## Construction
|
|
8
|
+
#
|
|
9
|
+
# You can construct a Structure with a simple hash.
|
|
10
|
+
#
|
|
11
|
+
# person = Structure.new(name: 'John Doe', age: 40)
|
|
12
|
+
# #=> #<struct name="John Doe", age=40>
|
|
13
|
+
#
|
|
14
|
+
# ## Empty Structures
|
|
15
|
+
#
|
|
16
|
+
# The stdlib Struct class does not work with empty member lists.
|
|
17
|
+
# Structure solves this by introducing the EmptyStructure class.
|
|
18
|
+
#
|
|
19
|
+
# struct = Structure.new({})
|
|
20
|
+
# #=> #<struct>
|
|
21
|
+
#
|
|
22
|
+
# ## Structure Classes
|
|
23
|
+
#
|
|
24
|
+
# In addition to simpler object construction, struct classes are re-used
|
|
25
|
+
# automatically.
|
|
26
|
+
#
|
|
27
|
+
# person1 = Structure.new(name: 'John Doe', age: 40)
|
|
28
|
+
# person2 = Structure.new(name: 'Jane Doe', age: 40)
|
|
29
|
+
#
|
|
30
|
+
# person1.class == person2.class
|
|
31
|
+
#
|
|
32
|
+
# ## Hash Conversion
|
|
33
|
+
#
|
|
34
|
+
# Calling {#to_h} or {#to_hash} on a Structure object performs a deep
|
|
35
|
+
# conversion of Structure objects into hashes.
|
|
36
|
+
#
|
|
37
|
+
# person = Structure.new(
|
|
38
|
+
# name: "John",
|
|
39
|
+
# age: 40,
|
|
40
|
+
# friend: Structure.new(name: "Jane", age: 40, friend: nil)
|
|
41
|
+
# )
|
|
42
|
+
# person.to_h
|
|
43
|
+
# #=> {:name=>"John", :age=>40, :friend=>{:name=>"Jane", :age=>40}}
|
|
44
|
+
#
|
|
4
45
|
class Structure < Struct
|
|
5
46
|
|
|
6
47
|
@@classes = {}
|
|
7
48
|
@@classes_mutex = Mutex.new
|
|
8
49
|
|
|
50
|
+
if Struct.instance_methods.include?(:to_h)
|
|
51
|
+
alias orig_to_h to_h
|
|
52
|
+
end
|
|
53
|
+
|
|
9
54
|
# Deeply converts the Structure into a hash. Structure members that
|
|
10
55
|
# are `nil` are omitted from the resultant hash.
|
|
56
|
+
#
|
|
57
|
+
# You can call #orig_to_h to get vanilla #to_h behavior as defined
|
|
58
|
+
# in stdlib Struct.
|
|
59
|
+
#
|
|
11
60
|
# @return [Hash]
|
|
12
61
|
def to_h(obj = self)
|
|
13
62
|
case obj
|
|
@@ -22,8 +71,6 @@ module Aws
|
|
|
22
71
|
end
|
|
23
72
|
when Array
|
|
24
73
|
obj.collect { |value| to_hash(value) }
|
|
25
|
-
when StringIO
|
|
26
|
-
obj.string
|
|
27
74
|
else
|
|
28
75
|
obj
|
|
29
76
|
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'jamespath'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Waiters
|
|
5
|
+
module Errors
|
|
6
|
+
|
|
7
|
+
# Raised when a waiter detects a condition where the waiter can never
|
|
8
|
+
# succeed.
|
|
9
|
+
class WaiterFailed < StandardError; end
|
|
10
|
+
|
|
11
|
+
# Raised when attempting to get a waiter by name and the waiter has not
|
|
12
|
+
# been defined.
|
|
13
|
+
class NoSuchWaiter < ArgumentError
|
|
14
|
+
def initialize(waiter_name, waiter_names)
|
|
15
|
+
msg = "no definition found for #{waiter_name.inspect}"
|
|
16
|
+
msg << "; valid waiter names are:"
|
|
17
|
+
waiter_names.sort.each.with_index do |name, n|
|
|
18
|
+
if n % 3 == 0
|
|
19
|
+
msg << "\n #{name.inspect}"
|
|
20
|
+
else
|
|
21
|
+
msg << ", #{name.inspect}"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
super(msg)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
require 'set'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Waiters
|
|
5
|
+
# @api private
|
|
6
|
+
class Provider
|
|
7
|
+
|
|
8
|
+
def initialize(definitions)
|
|
9
|
+
@waiter_names = Set.new
|
|
10
|
+
@definitions = definitions['waiters'].each.with_object({}) do |(k,v),h|
|
|
11
|
+
if k.match(/^__/)
|
|
12
|
+
h[k] = v
|
|
13
|
+
else
|
|
14
|
+
underscore(k).to_sym.tap do |name|
|
|
15
|
+
@waiter_names << name
|
|
16
|
+
h[name] = v
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# @return [Array<Symbol>]
|
|
23
|
+
def waiter_names
|
|
24
|
+
@waiter_names.to_a
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# @param [Symbol] waiter_name
|
|
28
|
+
# @return [Waiter]
|
|
29
|
+
# @raise [ArgumentError]
|
|
30
|
+
def waiter(waiter_name)
|
|
31
|
+
if @waiter_names.include?(waiter_name)
|
|
32
|
+
Waiter.new(resolve('extends' => waiter_name))
|
|
33
|
+
else
|
|
34
|
+
raise Errors::NoSuchWaiter.new(waiter_name, waiter_names)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
def resolve(definition)
|
|
41
|
+
if extends = definition.delete('extends')
|
|
42
|
+
resolve(@definitions[extends].merge(definition))
|
|
43
|
+
else
|
|
44
|
+
(@definitions['__default__'] || {}).merge(definition)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def underscore(str)
|
|
49
|
+
str.gsub(/\w+/) { |part| Seahorse::Util.underscore(part) }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|