oso-cloud 1.9.0 → 1.9.1.pre.vendored.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.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/Gemfile +5 -0
  4. data/Gemfile.lock +31 -12
  5. data/lib/oso/api.rb +18 -2
  6. data/lib/oso/version.rb +1 -1
  7. data/vendor/gems/faraday-2.5.2/CHANGELOG.md +574 -0
  8. data/vendor/gems/faraday-2.5.2/LICENSE.md +20 -0
  9. data/vendor/gems/faraday-2.5.2/README.md +55 -0
  10. data/vendor/gems/faraday-2.5.2/Rakefile +7 -0
  11. data/vendor/gems/faraday-2.5.2/examples/client_spec.rb +119 -0
  12. data/vendor/gems/faraday-2.5.2/examples/client_test.rb +144 -0
  13. data/vendor/gems/faraday-2.5.2/lib/faraday/adapter/test.rb +298 -0
  14. data/vendor/gems/faraday-2.5.2/lib/faraday/adapter.rb +102 -0
  15. data/vendor/gems/faraday-2.5.2/lib/faraday/adapter_registry.rb +30 -0
  16. data/vendor/gems/faraday-2.5.2/lib/faraday/connection.rb +561 -0
  17. data/vendor/gems/faraday-2.5.2/lib/faraday/encoders/flat_params_encoder.rb +105 -0
  18. data/vendor/gems/faraday-2.5.2/lib/faraday/encoders/nested_params_encoder.rb +183 -0
  19. data/vendor/gems/faraday-2.5.2/lib/faraday/error.rb +147 -0
  20. data/vendor/gems/faraday-2.5.2/lib/faraday/logging/formatter.rb +106 -0
  21. data/vendor/gems/faraday-2.5.2/lib/faraday/methods.rb +6 -0
  22. data/vendor/gems/faraday-2.5.2/lib/faraday/middleware.rb +30 -0
  23. data/vendor/gems/faraday-2.5.2/lib/faraday/middleware_registry.rb +83 -0
  24. data/vendor/gems/faraday-2.5.2/lib/faraday/options/connection_options.rb +22 -0
  25. data/vendor/gems/faraday-2.5.2/lib/faraday/options/env.rb +199 -0
  26. data/vendor/gems/faraday-2.5.2/lib/faraday/options/proxy_options.rb +32 -0
  27. data/vendor/gems/faraday-2.5.2/lib/faraday/options/request_options.rb +22 -0
  28. data/vendor/gems/faraday-2.5.2/lib/faraday/options/ssl_options.rb +69 -0
  29. data/vendor/gems/faraday-2.5.2/lib/faraday/options.rb +218 -0
  30. data/vendor/gems/faraday-2.5.2/lib/faraday/parameters.rb +5 -0
  31. data/vendor/gems/faraday-2.5.2/lib/faraday/rack_builder.rb +252 -0
  32. data/vendor/gems/faraday-2.5.2/lib/faraday/request/authorization.rb +49 -0
  33. data/vendor/gems/faraday-2.5.2/lib/faraday/request/instrumentation.rb +56 -0
  34. data/vendor/gems/faraday-2.5.2/lib/faraday/request/json.rb +55 -0
  35. data/vendor/gems/faraday-2.5.2/lib/faraday/request/url_encoded.rb +60 -0
  36. data/vendor/gems/faraday-2.5.2/lib/faraday/request.rb +136 -0
  37. data/vendor/gems/faraday-2.5.2/lib/faraday/response/json.rb +54 -0
  38. data/vendor/gems/faraday-2.5.2/lib/faraday/response/logger.rb +33 -0
  39. data/vendor/gems/faraday-2.5.2/lib/faraday/response/raise_error.rb +64 -0
  40. data/vendor/gems/faraday-2.5.2/lib/faraday/response.rb +90 -0
  41. data/vendor/gems/faraday-2.5.2/lib/faraday/utils/headers.rb +139 -0
  42. data/vendor/gems/faraday-2.5.2/lib/faraday/utils/params_hash.rb +61 -0
  43. data/vendor/gems/faraday-2.5.2/lib/faraday/utils.rb +122 -0
  44. data/vendor/gems/faraday-2.5.2/lib/faraday/version.rb +5 -0
  45. data/vendor/gems/faraday-2.5.2/lib/faraday.rb +157 -0
  46. data/vendor/gems/faraday-2.5.2/spec/external_adapters/faraday_specs_setup.rb +14 -0
  47. data/vendor/gems/faraday-2.5.2/spec/faraday/adapter/test_spec.rb +413 -0
  48. data/vendor/gems/faraday-2.5.2/spec/faraday/adapter_registry_spec.rb +28 -0
  49. data/vendor/gems/faraday-2.5.2/spec/faraday/adapter_spec.rb +55 -0
  50. data/vendor/gems/faraday-2.5.2/spec/faraday/connection_spec.rb +793 -0
  51. data/vendor/gems/faraday-2.5.2/spec/faraday/error_spec.rb +60 -0
  52. data/vendor/gems/faraday-2.5.2/spec/faraday/middleware_registry_spec.rb +31 -0
  53. data/vendor/gems/faraday-2.5.2/spec/faraday/middleware_spec.rb +52 -0
  54. data/vendor/gems/faraday-2.5.2/spec/faraday/options/env_spec.rb +76 -0
  55. data/vendor/gems/faraday-2.5.2/spec/faraday/options/options_spec.rb +297 -0
  56. data/vendor/gems/faraday-2.5.2/spec/faraday/options/proxy_options_spec.rb +44 -0
  57. data/vendor/gems/faraday-2.5.2/spec/faraday/options/request_options_spec.rb +19 -0
  58. data/vendor/gems/faraday-2.5.2/spec/faraday/params_encoders/flat_spec.rb +42 -0
  59. data/vendor/gems/faraday-2.5.2/spec/faraday/params_encoders/nested_spec.rb +150 -0
  60. data/vendor/gems/faraday-2.5.2/spec/faraday/rack_builder_spec.rb +317 -0
  61. data/vendor/gems/faraday-2.5.2/spec/faraday/request/authorization_spec.rb +83 -0
  62. data/vendor/gems/faraday-2.5.2/spec/faraday/request/instrumentation_spec.rb +74 -0
  63. data/vendor/gems/faraday-2.5.2/spec/faraday/request/json_spec.rb +111 -0
  64. data/vendor/gems/faraday-2.5.2/spec/faraday/request/url_encoded_spec.rb +93 -0
  65. data/vendor/gems/faraday-2.5.2/spec/faraday/request_spec.rb +110 -0
  66. data/vendor/gems/faraday-2.5.2/spec/faraday/response/json_spec.rb +117 -0
  67. data/vendor/gems/faraday-2.5.2/spec/faraday/response/logger_spec.rb +220 -0
  68. data/vendor/gems/faraday-2.5.2/spec/faraday/response/raise_error_spec.rb +172 -0
  69. data/vendor/gems/faraday-2.5.2/spec/faraday/response_spec.rb +75 -0
  70. data/vendor/gems/faraday-2.5.2/spec/faraday/utils/headers_spec.rb +82 -0
  71. data/vendor/gems/faraday-2.5.2/spec/faraday/utils_spec.rb +118 -0
  72. data/vendor/gems/faraday-2.5.2/spec/faraday_spec.rb +37 -0
  73. data/vendor/gems/faraday-2.5.2/spec/spec_helper.rb +132 -0
  74. data/vendor/gems/faraday-2.5.2/spec/support/disabling_stub.rb +14 -0
  75. data/vendor/gems/faraday-2.5.2/spec/support/fake_safe_buffer.rb +15 -0
  76. data/vendor/gems/faraday-2.5.2/spec/support/helper_methods.rb +96 -0
  77. data/vendor/gems/faraday-2.5.2/spec/support/shared_examples/adapter.rb +105 -0
  78. data/vendor/gems/faraday-2.5.2/spec/support/shared_examples/params_encoder.rb +18 -0
  79. data/vendor/gems/faraday-2.5.2/spec/support/shared_examples/request_method.rb +263 -0
  80. data/vendor/gems/faraday-2.5.2/spec/support/streaming_response_checker.rb +35 -0
  81. data/vendor/gems/faraday-net_http-3.0.2/LICENSE.md +21 -0
  82. data/vendor/gems/faraday-net_http-3.0.2/README.md +57 -0
  83. data/vendor/gems/faraday-net_http-3.0.2/lib/faraday/adapter/net_http.rb +208 -0
  84. data/vendor/gems/faraday-net_http-3.0.2/lib/faraday/net_http/version.rb +7 -0
  85. data/vendor/gems/faraday-net_http-3.0.2/lib/faraday/net_http.rb +10 -0
  86. data/vendor/gems/faraday-net_http_persistent-2.3.0/LICENSE.md +21 -0
  87. data/vendor/gems/faraday-net_http_persistent-2.3.0/README.md +66 -0
  88. data/vendor/gems/faraday-net_http_persistent-2.3.0/lib/faraday/adapter/net_http_persistent.rb +234 -0
  89. data/vendor/gems/faraday-net_http_persistent-2.3.0/lib/faraday/net_http_persistent/version.rb +7 -0
  90. data/vendor/gems/faraday-net_http_persistent-2.3.0/lib/faraday/net_http_persistent.rb +18 -0
  91. data/vendor/gems/faraday-retry-2.0.0/CHANGELOG.md +24 -0
  92. data/vendor/gems/faraday-retry-2.0.0/LICENSE.md +21 -0
  93. data/vendor/gems/faraday-retry-2.0.0/README.md +169 -0
  94. data/vendor/gems/faraday-retry-2.0.0/lib/faraday/retriable_response.rb +8 -0
  95. data/vendor/gems/faraday-retry-2.0.0/lib/faraday/retry/middleware.rb +254 -0
  96. data/vendor/gems/faraday-retry-2.0.0/lib/faraday/retry/version.rb +7 -0
  97. data/vendor/gems/faraday-retry-2.0.0/lib/faraday/retry.rb +13 -0
  98. data/vendor/gems/net-http-persistent-4.0.5/.autotest +9 -0
  99. data/vendor/gems/net-http-persistent-4.0.5/.gemtest +0 -0
  100. data/vendor/gems/net-http-persistent-4.0.5/Gemfile +14 -0
  101. data/vendor/gems/net-http-persistent-4.0.5/History.txt +460 -0
  102. data/vendor/gems/net-http-persistent-4.0.5/Manifest.txt +13 -0
  103. data/vendor/gems/net-http-persistent-4.0.5/README.rdoc +82 -0
  104. data/vendor/gems/net-http-persistent-4.0.5/Rakefile +25 -0
  105. data/vendor/gems/net-http-persistent-4.0.5/lib/net/http/persistent/connection.rb +41 -0
  106. data/vendor/gems/net-http-persistent-4.0.5/lib/net/http/persistent/pool.rb +65 -0
  107. data/vendor/gems/net-http-persistent-4.0.5/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  108. data/vendor/gems/net-http-persistent-4.0.5/lib/net/http/persistent.rb +1158 -0
  109. data/vendor/gems/net-http-persistent-4.0.5/test/test_net_http_persistent.rb +1512 -0
  110. data/vendor/gems/net-http-persistent-4.0.5/test/test_net_http_persistent_timed_stack_multi.rb +151 -0
  111. metadata +108 -4
@@ -0,0 +1,460 @@
1
+ === 4.0.5 / 2024-12-04
2
+
3
+ Bug fixes:
4
+
5
+ * Allow setting extra_chain_cert=
6
+
7
+ === 4.0.4 / 2024-09-09
8
+
9
+ Bug fixes:
10
+
11
+ * Allow setting verify_hostname to false
12
+
13
+ === 4.0.3 / 2024-09-09
14
+
15
+ Bug fixes:
16
+
17
+ * Handle Net::HTTP#verify_hostname was added in Ruby 3.0 or later. #120
18
+
19
+ === 4.0.2 / 2023-03-29
20
+
21
+ Bug fixes:
22
+
23
+ * Fix compatibility with `connection_pool 2.4+`
24
+
25
+ === 4.0.1 / 2021-01-12
26
+
27
+ Bug fixes:
28
+
29
+ * Loosen Ruby version requirement so Ruby 3.0 will work.
30
+
31
+ === 4.0.0 / 2020-04-30
32
+
33
+ Breaking changes:
34
+
35
+ * Removed built-in support for retrying failed requests as Net::HTTP has this
36
+ built-in for all supported versions. Pull request #100 by Michael Grosser.
37
+ * Dropped support for EoL ruby versions (< 2.4). Future feature releases may
38
+ drop support for ruby versions that are at end-of-life or in security-only
39
+ maintenance mode with any release. Pull request #113 by David Rodríguez
40
+
41
+ New features:
42
+
43
+ * Added Net::HTTP::Persistent#max_retries= to configure the number of retries
44
+ performed on a request for ruby versions that support it (2.5+).
45
+ * URI-ness is determined through #respond_to? to allow compatibility with
46
+ Addressable::URI. Pull request #67 by Ryan McKern.
47
+ * Use require_relative to reduce patch burden for vendored versions. Pull
48
+ Request #106 by David Rodríguez
49
+
50
+ Bug fixes:
51
+
52
+ * Stop wasting a connection when the keep-alive timeout is less than the idle
53
+ timeout. Pull request #115 by Yap Sok Ann.
54
+ * Improved use of URI#hostname for IPv6 connections. Pull request #76 by
55
+ Tomas Koutsky.
56
+ * Improved check for Process::RLIMIT_NOFILE support. Pull request #109 by Vít
57
+ Ondruch.
58
+ * Fix namespace in comments for escape/unescape wrappers. Pull request #114
59
+ by David Rodríguez.
60
+ * Fix History.txt timestamp for 3.0.0 release. Pull request #107 by Joe Van
61
+ Dyk.
62
+ * Fix link to PR #98 in 3.1.0 release notes. Pull request #110 by Justin
63
+ Reid.
64
+
65
+ Other:
66
+
67
+ * Updated Net::HTTP::Persistent#reconnect documentation to indicate that all
68
+ connections are reset. Issue #117 by Taisuke Miyazaki.
69
+
70
+ === 3.1.0 / 2019-07-24
71
+
72
+ New features:
73
+ * Support ruby 2.6 Net::HTTP#write_timeout=. Pull request #99 by Víctor
74
+ Roldán Betancort.
75
+ * Support setting TLS min/max version. Pull request #94 by Bart.
76
+
77
+ Bug fixes:
78
+ * Reduce potential for memory leak through Hash default proc bindings. Pull
79
+ request #64 by Dominic Metzger.
80
+ * Test proxy auto detection from no_proxy in ENV. Pull request #60 by
81
+ HINOHARA Hiroshi.
82
+ * Add missing timestamp for 3.0 release. Pull request #78 by Joe Van Dyk.
83
+ * Support IPv6 URLs in proxy checks. Pull request #82 by Nicolás Sanguinetti.
84
+ * Use Net::HTTPGenericRequest#method to check idempotence for improved
85
+ compatibility. Pull request #83 by Fotos Georgiadis.
86
+ * Run net-http-pipeline tests in travis. Pull request #86 by T.J. Schuck.
87
+ * Correct +no_proxy+ support to override Net::HTTP proxy fallback. Pull
88
+ request #88 by Jared Kauppila.
89
+ * Mitigate memory leak when combined with faraday. Pull request #105 by Yohei
90
+ Kitamura.
91
+ * Set default connection pool size for Windows. Pull request #90 by Jared
92
+ Kauppila.
93
+ * Fix missing +name:+ argument in documentation. Pull requests #85 by T.J.
94
+ Schuck, #84 by James White.
95
+ * Fix memory leak from connection pooling. Pull request #98 by Aaron
96
+ Patterson.
97
+ * Update tests for minitest assert_equal deprecation. Pull request #92 by
98
+ Olle Jonsson.
99
+ * Fix typo in Net::HTTP::Persistent#pipeline. Pull request #91 by Kazuma
100
+ Furuhashi.
101
+
102
+ Other:
103
+ * Added bundler hoe plugin. Pull request #103 by Michael Grosser.
104
+ * Updated ruby versions in Travis CI. Pull request #93 by Olle Jonsson. Pull
105
+ request #103 by Michael Grosser.
106
+
107
+ === 3.0 / 2016-10-05
108
+
109
+ Breaking changes:
110
+
111
+ * No longer supports ruby 2.0 and earlier
112
+ * Net::HTTP::Persistent::new now uses keyword arguments for +name+ and
113
+ +proxy+.
114
+ * Removed #max_age, use #expired?
115
+
116
+ New features:
117
+
118
+ * Uses connection_pool to manage all connections for a Net::HTTP::Persistent
119
+ instance.
120
+
121
+ Bug fixes:
122
+
123
+ * Add missing SSL options ca_path, ciphers, ssl_timeout, verify_depth.
124
+ Issue #63 by Johnneylee Jack Rollins.
125
+
126
+ === 2.9.4 / 2014-02-10
127
+
128
+ * Bug fixes
129
+ * Improve proxy escaping from 2.9.2. Pull request #59 by Mislav Marohnić.
130
+
131
+ === 2.9.3 / 2014-02-06
132
+
133
+ * Bug fixes
134
+ * Fix breakage in 2.9.2 for users without proxies. Pull request #56 by
135
+ Yoshihiro TAKAHARA (merged), #57 by ChuckLin, #58 by Kenny Meyer.
136
+
137
+ === 2.9.2 / 2014-02-05
138
+
139
+ * Bug fixes
140
+ * Special characters in proxy passwords are now handled correctly. Issue
141
+ #48 by Mislav Marohnić. Pull request #54 by Juha Kajava
142
+
143
+ === 2.9.1 / 2014-01-22
144
+
145
+ * Bug fixes
146
+ * Added license to gemspec. Issue #47 by Benjamin Fleischer
147
+ * Set Net::HTTP#keep_alive_timeout when supported by ruby. Pull request #53
148
+ by Dylan Thacker-Smith.
149
+ * The backtrace is preserved for errors in #reset to help with debugging.
150
+ Issue #41 by Andrew Cholakian.
151
+
152
+ === 2.9 / 2013-07-24
153
+
154
+ * Minor enhancement
155
+ * Added Net::HTTP::Persistent#max_requests to avoid ECONNRESET for a server
156
+ that allows a limited number of requests on a connection. Pull request
157
+ #42 by James Tucker.
158
+ * Request failures are now raised with the backtrace of the original
159
+ exception. This gives better insight into the reason for the failure.
160
+ See #41 by Andrew Cholakian.
161
+ * OpenSSL is no longer required. If OpenSSL is not available an exception
162
+ will be raised when attempting to access HTTPS resources. Feature request
163
+ by André Arko
164
+
165
+ * Bug fixes
166
+ * Explain the proper way of sending parameters depending upon the request
167
+ method. Issue #35 by André Arko.
168
+ * Handle Errno::ETIMEDOUT by retrying the request. Issue #36 by André Arko.
169
+ * Requests retried by ruby 2.x are no longer retried by net-http-persistent.
170
+ * Finish the connection if an otherwise unhandled exception happens during a
171
+ request. Bug #46 by Mark Oude Veldhuis.
172
+ * Net::HTTP::Persistent::detect_idle_timeout now assumes a StandardError
173
+ indicates the idle timeout has been found. Bug #43 by James Tucker.
174
+
175
+ === 2.8 / 2012-10-17
176
+
177
+ * Minor enhancements
178
+ * Added Net::HTTP::Persistent::detect_idle_timeout which can be used to
179
+ determine the idle timeout for a host.
180
+ * The read timeout may now be updated for every request. Issue #33 by
181
+ Mislav Marohnić
182
+ * Added NO_PROXY support. Pull Request #31 by Laurence Rowe.
183
+ * Added #cert and #key aliases for Net::HTTP compatibility. Pull request
184
+ #26 by dlee.
185
+ * The artifice gem now disables SSL session reuse to prevent breakage of
186
+ testing frameworks. Pull Request #29 by Christopher Cooke.
187
+ * Disabled Net::HTTP::Persistent::SSLReuse on Ruby 2+. This feature is now
188
+ built-in to Net::HTTP.
189
+ * Bug fixes
190
+ * Socket options are set again following connection reset. Pull request #28
191
+ by cmaion.
192
+ * #shutdown now works even if no connections were made. Pull Request #24 by
193
+ James Tucker.
194
+ * Updated test RSA key size to 1024 bits. Bug #25 by Gunnar Wolf.
195
+ * The correct host:port are shown in the exception when a proxy connection
196
+ fails. Bug #30 by glebtv.
197
+
198
+ === 2.7 / 2012-06-06
199
+
200
+ * Minor enhancement
201
+ * Added JRuby compatibility by default for HTTPS connections. (JRuby lacks
202
+ OpenSSL::SSL::Session.)
203
+
204
+ === 2.6 / 2012-03-26
205
+
206
+ * Minor enhancement
207
+ * Net::HTTP::Persistent#idle_timeout may be set to nil to disable expiration
208
+ of connections. Pull Request #21 by Aaron Stone
209
+
210
+ === 2.5.2 / 2012-02-13
211
+
212
+ * Bug fix
213
+ * Fix variable shadowing warning.
214
+
215
+ === 2.5.1 / 2012-02-10
216
+
217
+ * Bug fix
218
+ * Reusing SSL connections with HTTP proxies now works. Issue #15 by Paul
219
+ Ingham and mcrmfc
220
+
221
+ === 2.5 / 2012-02-07
222
+
223
+ * Minor enhancements
224
+ * The proxy may be changed at any time.
225
+ * The allowed SSL version may now be set via #ssl_version.
226
+ Issue #16 by astera
227
+ * Added Net::HTTP::Persistent#override_headers which allows overriding
228
+ * Net::HTTP default headers like User-Agent. See
229
+ Net::HTTP::Persistent@Headers for details. Issue #17 by andkerosine
230
+
231
+ * Bug fixes
232
+ * The ruby 1.8 speed monkeypatch now handles EAGAIN for windows users.
233
+ Issue #12 by Alwyn Schoeman
234
+ * Fixed POST example in README. Submitted by injekt.
235
+ * Fixed various bugs in the shutdown of connections especially cross-thread
236
+ (which you shouldn't be doing anyways).
237
+
238
+ === 2.4.1 / 2012-02-03
239
+
240
+ * Bug fixes
241
+ * When FakeWeb or WebMock are loaded SSL sessions will not be reused to
242
+ prevent breakage of testing frameworks. Issue #13 by Matt Brictson, pull
243
+ request #14 by Zachary Scott
244
+ * SSL connections are reset when the SSL parameters change.
245
+ Mechanize issue #194 by dsisnero
246
+ * Last-use times are now cleaned up in #shutdown.
247
+
248
+ === 2.4 / 2012-01-31
249
+
250
+ * Minor enhancement
251
+ * net-http-persistent now complains if OpenSSL::SSL::VERIFY_PEER is equal to
252
+ OpenSSL::SSL::VERIFY_NONE. If you have a platform that is broken this way
253
+ you must define the constant:
254
+
255
+ I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil
256
+
257
+ at the top level of your application to disable the warning.
258
+
259
+ * Bug fix
260
+ * Fix persisting SSL sessions through HTTP proxies. Mechanize issue #178 by
261
+ Robert Poor, net-http-persistent issues #10, #11.
262
+
263
+ === 2.3.2 / 2011-12-21
264
+
265
+ * Bug fix
266
+ * Finish connections that were closed by Net::HTTP so they can be restarted.
267
+
268
+ === 2.3.1 / 2011-10-26
269
+
270
+ * Bug fix
271
+ * If a request object already contains a Connection header it will no longer
272
+ be overridden. This allows keep-alive connections to be disabled on a
273
+ per-request basis.
274
+
275
+ === 2.3 / 2011-10-25
276
+
277
+ * Minor Enhancement
278
+ * The time since last use for a connection is now recorded in error
279
+ messages for the connection.
280
+
281
+ === 2.2 / 2011-10-24
282
+
283
+ * Minor Enhancements
284
+ * Added timeouts for idle connections which are set through #idle_timeout.
285
+ The default timeout is 5 seconds. Reducing the idle timeout is preferred
286
+ over setting #retry_change_requests to true if you wish to avoid the "too
287
+ many connection resets" error when POSTing data.
288
+ * Documented tunables and settings in one place in Net::HTTP::Persistent
289
+
290
+ === 2.1 / 2011-09-19
291
+
292
+ * Minor Enhancement
293
+ * For HTTPS connections, SSL sessions are now reused avoiding the extra
294
+ round trips and computations of extra SSL handshakes. If you have
295
+ problems with SSL session reuse it can be disabled by
296
+ Net::HTTP::Persistent#reuse_ssl_sessions
297
+
298
+ * Bug Fixes
299
+ * The default certificate store is now used even if #verify_mode was not
300
+ set. Issue #7, Pull Request #8 by Matthew M. Boedicker
301
+
302
+ === 2.0 / 2011-08-26
303
+
304
+ * Incompatibility
305
+ * Net::HTTP::Persistent#verify_mode now defaults to
306
+ OpenSSL::SSL::VERIFY_PEER. This may cause HTTPS request failures if your
307
+ default certificate store lacks the correct certificates.
308
+
309
+ === 1.9 / 2011-08-26
310
+
311
+ * Minor Enhancement
312
+ * Added Net::HTTP::Persistent#cert_store to set an SSL certificate store
313
+ which defaults to the OpenSSL default certificate store.
314
+
315
+ HTTPS server certificates will be validated when this option is combined
316
+ with setting Net::HTTP::Persistent#verify_mode to
317
+ OpenSSL::SSL::VERIFY_PEER.
318
+
319
+ === 1.8.1 / 2011-08-08
320
+
321
+ * Bug Fix
322
+ * Requests with OpenSSL errors are retried now. Pull Request #5 by James
323
+ Tucker.
324
+
325
+ === 1.8 / 2011-06-27
326
+
327
+ * Minor Enhancement
328
+ * Added Net::HTTP::Persistent#retry_change_requests which allows POST and
329
+ other non-idempotent requests to be retried automatically. Take care when
330
+ enabling this option to ensure the server will handle multiple POSTs with
331
+ the same data in a sane manner.
332
+
333
+ === 1.7 / 2011-04-17
334
+
335
+ * Minor Enhancement
336
+ * Added Net::HTTP::Persistent#pipeline which integrates with
337
+ net-http-pipeline when it is present.
338
+ * Bug Fix
339
+ * Perform a case-insensitive check of the URI scheme for HTTPS URIs
340
+
341
+ === 1.6.1 / 2011-03-08
342
+
343
+ * Bug Fix
344
+ * Net::HTTP::Persistent#request now handles Errno::EINVAL as a connection
345
+ reset and will be retried for idempotent requests. Reported by Aaron
346
+ Qian.
347
+
348
+ === 1.6 / 2011-03-01
349
+
350
+ * Minor Enhancement
351
+ * Added Net::HTTP::Persistent#socket_options to set multiple socket options
352
+ at socket startup.
353
+
354
+ === 1.5.2 / 2011-02-24
355
+
356
+ * Bug Fix
357
+ * Only set TCP_NODELAY if the connection has an @socket. Allows
358
+ net-http-persistent to be used with fake_web. Reported by Sathish
359
+ Pasupunuri.
360
+
361
+ === 1.5.1 / 2011-02-10
362
+
363
+ * Bug fix
364
+ * Only set TCP_NODELAY at connection start. Reported by Brian Henderson.
365
+
366
+ === 1.5 / 2011-01-25
367
+
368
+ * Minor Enhancements
369
+ * Set TCP_NODELAY on created socket if possible. (This will only help for
370
+ requests that send bodies.)
371
+
372
+ === 1.4.1 / 2010-10-13
373
+
374
+ * Bug Fixes
375
+ * Don't finish the connection when we're retrying, reset it. Patch by James
376
+ Tucker.
377
+
378
+ === 1.4 / 2010-09-29
379
+
380
+ * Minor Enhancements
381
+ * Added the very dangerous #shutdown_in_all_threads. IT IS DANGEROUS!.
382
+ Patch by Torsten Schönebaum.
383
+
384
+ === 1.3.1 / 2010-09-13
385
+
386
+ * Bug Fixes
387
+ * #connection_for no longer tries to ssl-enable an existing connection.
388
+ Patch by Joseph West.
389
+
390
+ === 1.3 / 2010-09-08
391
+
392
+ * Minor Enhancements
393
+ * HTTP versions are now recorded. This information is not currently used.
394
+
395
+ * Bug Fixes
396
+ * #shutdown no longer fails when an unstarted HTTP connection is shut down.
397
+
398
+ === 1.2.5 / 2010-07-27
399
+
400
+ * Bug Fixes
401
+ * Fix duplicated test name. Noted by Peter Higgins.
402
+ * #shutdown now works even when no connections were made.
403
+
404
+ === 1.2.4 / 2010-07-26
405
+
406
+ * Bug Fixes
407
+ * Actually have #request only finish a connection. Somehow this got
408
+ missed.
409
+
410
+ === 1.2.3 / 2010-06-29
411
+
412
+ * Bug Fixes
413
+ * Fix example code (pointed out by Alex Stahl)
414
+
415
+ === 1.2.2 / 2010-06-22
416
+
417
+ * Bug Fixes
418
+ * #request only finishes a connection instead of restarting it. This helps
419
+ prevents errors on non-idempotent HTTP requests after errors.
420
+ * #connection_for handles EHOSTDOWN like #reset
421
+
422
+ === 1.2.1 / 2010-05-25
423
+
424
+ * Bug Fixes
425
+ * Don't alter Net::BufferedIO#rbuf_fill on 1.9+
426
+
427
+ === 1.2 / 2010-05-20
428
+
429
+ * Minor Enhancements
430
+ * Net::HTTP#read_timeout is now supported
431
+ * Net::HTTP#open_timeout is now supported
432
+ * Net::HTTP::Persistent#request now supports a block like Net::HTTP#request
433
+
434
+ === 1.1 / 2010-05-18
435
+
436
+ * Minor Enhancements
437
+ * Proxy support, see Net::HTTP::Persistent::new,
438
+ Net::HTTP::Persistent#proxy_from_env
439
+ * Added +name+ parameter to Net::HTTP::Persistent::new for separation of
440
+ connection pools.
441
+ * Added Net::HTTP::Persistent#shutdown so you can clean up after yourself
442
+ * Net::HTTP::Persistent now suppresses "peer certificate won't be verified
443
+ in this SSL session" warning.
444
+
445
+ * Bug Fixes
446
+ * Net::HTTP::Persistent retries requests in accordance with RFC 2616.
447
+
448
+ === 1.0.1 / 2010-05-05
449
+
450
+ * Minor Enhancements
451
+ * Added #debug_output
452
+ * Now uses Hoe minitest plugin
453
+ * Bug Fixes
454
+ * Tests pass on 1.9
455
+
456
+ === 1.0.0 / 2010-05-04
457
+
458
+ * Major Enhancements
459
+ * Birthday!
460
+
@@ -0,0 +1,13 @@
1
+ .autotest
2
+ .gemtest
3
+ Gemfile
4
+ History.txt
5
+ Manifest.txt
6
+ README.rdoc
7
+ Rakefile
8
+ lib/net/http/persistent.rb
9
+ lib/net/http/persistent/connection.rb
10
+ lib/net/http/persistent/pool.rb
11
+ lib/net/http/persistent/timed_stack_multi.rb
12
+ test/test_net_http_persistent.rb
13
+ test/test_net_http_persistent_timed_stack_multi.rb
@@ -0,0 +1,82 @@
1
+ = net-http-persistent
2
+
3
+ home :: https://github.com/drbrain/net-http-persistent
4
+ rdoc :: https://rdoc.info/gems/net-http-persistent
5
+
6
+ == DESCRIPTION:
7
+
8
+ Manages persistent connections using Net::HTTP including a thread pool for
9
+ connecting to multiple hosts.
10
+
11
+ Using persistent HTTP connections can dramatically increase the speed of HTTP.
12
+ Creating a new HTTP connection for every request involves an extra TCP
13
+ round-trip and causes TCP congestion avoidance negotiation to start over.
14
+
15
+ Net::HTTP supports persistent connections with some API methods but does not
16
+ make setting up a single persistent connection or managing multiple
17
+ connections easy. Net::HTTP::Persistent wraps Net::HTTP and allows you to
18
+ focus on how to make HTTP requests.
19
+
20
+ == FEATURES/PROBLEMS:
21
+
22
+ * Supports TLS with secure defaults
23
+ * Thread-safe
24
+ * Pure ruby
25
+
26
+ == SYNOPSIS
27
+
28
+ The following example will make two requests to the same server. The
29
+ connection is kept alive between requests:
30
+
31
+ require 'net/http/persistent'
32
+
33
+ uri = URI 'http://example.com/awesome/web/service'
34
+
35
+ http = Net::HTTP::Persistent.new name: 'my_app_name'
36
+
37
+ # perform a GET
38
+ response = http.request uri
39
+
40
+ # create a POST
41
+ post_uri = uri + 'create'
42
+ post = Net::HTTP::Post.new post_uri.path
43
+ post.set_form_data 'some' => 'cool data'
44
+
45
+ # perform the POST, the URI is always required
46
+ response = http.request post_uri, post
47
+
48
+ # if you are done making http requests, or won't make requests for several
49
+ # minutes
50
+ http.shutdown
51
+
52
+ Please see the documentation on Net::HTTP::Persistent for more information,
53
+ including SSL connection verification, header handling and tunable options.
54
+
55
+ == INSTALL:
56
+
57
+ gem install net-http-persistent
58
+
59
+ == LICENSE:
60
+
61
+ (The MIT License)
62
+
63
+ Copyright (c) Eric Hodel, Aaron Patterson
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining
66
+ a copy of this software and associated documentation files (the
67
+ 'Software'), to deal in the Software without restriction, including
68
+ without limitation the rights to use, copy, modify, merge, publish,
69
+ distribute, sublicense, and/or sell copies of the Software, and to
70
+ permit persons to whom the Software is furnished to do so, subject to
71
+ the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be
74
+ included in all copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
77
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
79
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
80
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
81
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
82
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,25 @@
1
+ # -*- ruby -*-
2
+
3
+ require "bundler/gem_tasks"
4
+
5
+ require "rake/testtask"
6
+
7
+ Rake::TestTask.new
8
+
9
+ require "rake/manifest"
10
+
11
+ Rake::Manifest::Task.new do |t|
12
+ t.patterns = [
13
+ ".autotest",
14
+ ".gemtest",
15
+ ".travis.yml",
16
+ "Gemfile",
17
+ "History.txt",
18
+ "Manifest.txt",
19
+ "README.rdoc",
20
+ "Rakefile",
21
+ "{test,lib}/**/*"
22
+ ]
23
+ end
24
+
25
+ # vim: syntax=Ruby
@@ -0,0 +1,41 @@
1
+ ##
2
+ # A Net::HTTP connection wrapper that holds extra information for managing the
3
+ # connection's lifetime.
4
+
5
+ class Net::HTTP::Persistent::Connection # :nodoc:
6
+
7
+ attr_accessor :http
8
+
9
+ attr_accessor :last_use
10
+
11
+ attr_accessor :requests
12
+
13
+ attr_accessor :ssl_generation
14
+
15
+ def initialize http_class, http_args, ssl_generation
16
+ @http = http_class.new(*http_args)
17
+ @ssl_generation = ssl_generation
18
+
19
+ reset
20
+ end
21
+
22
+ def finish
23
+ @http.finish
24
+ rescue IOError
25
+ ensure
26
+ reset
27
+ end
28
+ alias_method :close, :finish
29
+
30
+ def reset
31
+ @last_use = Net::HTTP::Persistent::EPOCH
32
+ @requests = 0
33
+ end
34
+
35
+ def ressl ssl_generation
36
+ @ssl_generation = ssl_generation
37
+
38
+ finish
39
+ end
40
+
41
+ end
@@ -0,0 +1,65 @@
1
+ class Net::HTTP::Persistent::Pool < ConnectionPool # :nodoc:
2
+
3
+ attr_reader :available # :nodoc:
4
+ attr_reader :key # :nodoc:
5
+
6
+ def initialize(options = {}, &block)
7
+ super
8
+
9
+ @available = Net::HTTP::Persistent::TimedStackMulti.new(@size, &block)
10
+ @key = "current-#{@available.object_id}"
11
+ end
12
+
13
+ def checkin net_http_args
14
+ if net_http_args.is_a?(Hash) && net_http_args.size == 1 && net_http_args[:force]
15
+ # ConnectionPool 2.4+ calls `checkin(force: true)` after fork.
16
+ # When this happens, we should remove all connections from Thread.current
17
+ if stacks = Thread.current[@key]
18
+ stacks.each do |http_args, connections|
19
+ connections.each do |conn|
20
+ @available.push conn, connection_args: http_args
21
+ end
22
+ connections.clear
23
+ end
24
+ end
25
+ else
26
+ stack = Thread.current[@key][net_http_args] ||= []
27
+
28
+ raise ConnectionPool::Error, 'no connections are checked out' if
29
+ stack.empty?
30
+
31
+ conn = stack.pop
32
+
33
+ if stack.empty?
34
+ @available.push conn, connection_args: net_http_args
35
+
36
+ Thread.current[@key].delete(net_http_args)
37
+ Thread.current[@key] = nil if Thread.current[@key].empty?
38
+ end
39
+ end
40
+ nil
41
+ end
42
+
43
+ def checkout net_http_args
44
+ stacks = Thread.current[@key] ||= {}
45
+ stack = stacks[net_http_args] ||= []
46
+
47
+ if stack.empty? then
48
+ conn = @available.pop connection_args: net_http_args
49
+ else
50
+ conn = stack.last
51
+ end
52
+
53
+ stack.push conn
54
+
55
+ conn
56
+ end
57
+
58
+ def shutdown
59
+ Thread.current[@key] = nil
60
+ super
61
+ end
62
+ end
63
+
64
+ require_relative 'timed_stack_multi'
65
+