aws-sdk 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aws/core.rb +1 -1
- data/lib/aws/core/http/net_http_handler.rb +21 -62
- data/lib/aws/record/attribute_macros.rb +28 -4
- data/lib/aws/record/attributes/date.rb +89 -0
- data/lib/aws/record/base.rb +41 -4
- data/lib/aws/record/finder_methods.rb +7 -5
- data/lib/aws/record/scope.rb +32 -5
- data/lib/aws/s3/bucket.rb +14 -5
- data/lib/aws/s3/bucket_version_collection.rb +7 -11
- data/lib/aws/s3/client.rb +37 -1
- data/lib/aws/s3/client/xml.rb +8 -1
- data/lib/aws/s3/errors.rb +14 -0
- data/lib/aws/s3/multipart_upload_collection.rb +0 -3
- data/lib/aws/s3/object_collection.rb +182 -6
- data/lib/aws/s3/paginated_collection.rb +21 -40
- data/lib/aws/s3/prefix_and_delimiter_collection.rb +0 -7
- data/lib/aws/s3/presigned_post.rb +26 -11
- data/lib/aws/s3/request.rb +1 -1
- data/lib/aws/s3/s3_object.rb +10 -4
- data/lib/aws/s3/uploaded_part_collection.rb +3 -1
- data/lib/net/http/connection_pool.rb +193 -0
- data/lib/net/http/connection_pool/connection.rb +132 -0
- data/lib/net/http/connection_pool/session.rb +93 -0
- metadata +8 -4
@@ -0,0 +1,93 @@
|
|
1
|
+
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
+
# may not use this file except in compliance with the License. A copy of
|
5
|
+
# the License is located at
|
6
|
+
#
|
7
|
+
# http://aws.amazon.com/apache2.0/
|
8
|
+
#
|
9
|
+
# or in the "license" file accompanying this file. This file is
|
10
|
+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
+
# ANY KIND, either express or implied. See the License for the specific
|
12
|
+
# language governing permissions and limitations under the License.
|
13
|
+
|
14
|
+
require 'net/http'
|
15
|
+
require 'net/https'
|
16
|
+
require 'openssl'
|
17
|
+
|
18
|
+
class Net::HTTP::ConnectionPool
|
19
|
+
|
20
|
+
# @private
|
21
|
+
class Session
|
22
|
+
|
23
|
+
def initialize http_session, key
|
24
|
+
@http_session = http_session
|
25
|
+
@key = key
|
26
|
+
@created_at = Time.now
|
27
|
+
@last_used_at = nil
|
28
|
+
end
|
29
|
+
|
30
|
+
attr_reader :http_session
|
31
|
+
|
32
|
+
attr_reader :key
|
33
|
+
|
34
|
+
attr_reader :created_at
|
35
|
+
|
36
|
+
attr_reader :last_used_at
|
37
|
+
|
38
|
+
def request *args, &block
|
39
|
+
response = http_session.request(*args, &block)
|
40
|
+
@last_used_at = Time.now
|
41
|
+
response
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [nil]
|
45
|
+
def finish
|
46
|
+
begin
|
47
|
+
http_session.finish if http_session.started?
|
48
|
+
rescue IOError
|
49
|
+
end
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
class << self
|
54
|
+
|
55
|
+
def for connection, open_timeout
|
56
|
+
|
57
|
+
http_args = []
|
58
|
+
http_args << connection.host
|
59
|
+
http_args << connection.port
|
60
|
+
if connection.proxy?
|
61
|
+
http_args << connection.proxy_address
|
62
|
+
http_args << connection.proxy_port
|
63
|
+
http_args << connection.proxy_user
|
64
|
+
http_args << connection.proxy_password
|
65
|
+
end
|
66
|
+
|
67
|
+
http = Net::HTTP.new(*http_args)
|
68
|
+
#http.set_debug_output($stdout)
|
69
|
+
http.open_timeout = open_timeout
|
70
|
+
|
71
|
+
if connection.ssl?
|
72
|
+
http.use_ssl = true
|
73
|
+
if connection.ssl_verify_peer?
|
74
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
75
|
+
http.ca_file = connection.ssl_ca_file if connection.ssl_ca_file
|
76
|
+
http.ca_path = connection.ssl_ca_path if connection.ssl_ca_path
|
77
|
+
else
|
78
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
79
|
+
end
|
80
|
+
else
|
81
|
+
http.use_ssl = false
|
82
|
+
end
|
83
|
+
|
84
|
+
http.start
|
85
|
+
|
86
|
+
Session.new(http, connection.key)
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 4
|
10
|
+
version: 1.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Amazon Web Services
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-12-07 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -229,6 +229,7 @@ files:
|
|
229
229
|
- lib/aws/record/attribute.rb
|
230
230
|
- lib/aws/record/attribute_macros.rb
|
231
231
|
- lib/aws/record/attributes/boolean.rb
|
232
|
+
- lib/aws/record/attributes/date.rb
|
232
233
|
- lib/aws/record/attributes/datetime.rb
|
233
234
|
- lib/aws/record/attributes/float.rb
|
234
235
|
- lib/aws/record/attributes/integer.rb
|
@@ -353,6 +354,9 @@ files:
|
|
353
354
|
- lib/aws/sts.rb
|
354
355
|
- lib/aws-sdk.rb
|
355
356
|
- lib/aws.rb
|
357
|
+
- lib/net/http/connection_pool/connection.rb
|
358
|
+
- lib/net/http/connection_pool/session.rb
|
359
|
+
- lib/net/http/connection_pool.rb
|
356
360
|
- lib/aws/api_config/EC2-2011-02-28.yml
|
357
361
|
- lib/aws/api_config/ELB-2011-08-15.yml
|
358
362
|
- lib/aws/api_config/IAM-2010-07-15.yml
|