3scale_client 2.4.2 → 2.5.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/3scale_client.gemspec +3 -1
- data/CHANGELOG.md +11 -0
- data/Gemfile +5 -0
- data/README.md +13 -5
- data/lib/3scale/client/http_client.rb +73 -10
- data/lib/3scale/client/version.rb +1 -1
- data/lib/3scale/middleware.rb +88 -0
- data/test/client_test.rb +18 -9
- data/test/middleware_test.rb +45 -0
- data/test/persistence_test.rb +15 -3
- data/test/remote_test.rb +2 -2
- metadata +56 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab7fb31122fd7138a87cb410914466949e6f7034
|
4
|
+
data.tar.gz: 077f77ad68034e85e57a32d529aaaffb0078b9fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a987bb2bdc1cfcfa1472ca5c5180fa6211ac781bf8a264afbb01083a83ef7cfb1f64ab45e7753928790967f86144dd076a84fcb64c336bedff7c5a72ce30deb
|
7
|
+
data.tar.gz: ae03b5bac34c9da2b53d11445ecf795ead9ff875f6840e44234f3a09029405ee1cf6b00fae2c92883158d41db60e6e709b8f6d703e6a0b3de6f04f95d96d4515
|
data/.travis.yml
CHANGED
data/3scale_client.gemspec
CHANGED
@@ -18,11 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rdoc"
|
24
24
|
spec.add_development_dependency "fakeweb"
|
25
25
|
spec.add_development_dependency "mocha"
|
26
26
|
spec.add_development_dependency "net-http-persistent"
|
27
|
+
spec.add_development_dependency 'minitest'
|
28
|
+
spec.add_development_dependency 'rack'
|
27
29
|
spec.add_dependency 'nokogiri'
|
28
30
|
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
## [Unreleased][unreleased]
|
5
|
+
### Fixed
|
6
|
+
### Added
|
7
|
+
|
8
|
+
## [2.5.0.pre1] - 2015-01-29
|
9
|
+
### Added
|
10
|
+
- Native support for persistent connections (without net-http-persistent gem)
|
11
|
+
- `ThreeScale::Middleware` for Rack
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
3scale is an API Infrastructure service which handles API Keys, Rate Limiting, Analytics, Billing Payments and Developer Management. Includes a configurable API dashboard and developer portal CMS. More product stuff at http://www.3scale.net/, support information at http://support.3scale.net/.
|
7
7
|
|
8
8
|
### Tutorials
|
9
|
-
Plugin Setup: https://support.3scale.net/howtos/api-configuration/plugin-setup
|
10
|
-
Rate Limiting: https://support.3scale.net/howtos/basics/provision-rate-limits
|
11
|
-
Analytics Setup: https://support.3scale.net/quickstarts/3scale-api-analytics
|
9
|
+
Plugin Setup: https://support.3scale.net/howtos/api-configuration/plugin-setup
|
10
|
+
Rate Limiting: https://support.3scale.net/howtos/basics/provision-rate-limits
|
11
|
+
Analytics Setup: https://support.3scale.net/quickstarts/3scale-api-analytics
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
@@ -252,5 +252,13 @@ human readable error description:
|
|
252
252
|
```ruby
|
253
253
|
response.error_code # "provider_key_invalid"
|
254
254
|
response.error_message # "provider key \"foo\" is invalid"
|
255
|
-
```
|
256
|
-
|
255
|
+
```
|
256
|
+
|
257
|
+
|
258
|
+
## Rack Middleware
|
259
|
+
|
260
|
+
You can use our Rack middleware to automatically authenticate your Rack applications.
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
use ThreeScale::Middleware, provider_key, :user_key # or :app_id
|
264
|
+
```
|
@@ -8,31 +8,43 @@ module ThreeScale
|
|
8
8
|
def_delegators :@http, :get, :post, :use_ssl?, :active?
|
9
9
|
USER_CLIENT_HEADER = ['X-3scale-User-Agent', "plugin-ruby-v#{VERSION}"]
|
10
10
|
|
11
|
-
|
11
|
+
class PersistenceNotAvailable < LoadError
|
12
|
+
def initialize(*)
|
13
|
+
super 'persistence is available only on Ruby 2.0 or with net-http-persistent gem'.freeze
|
14
|
+
end
|
15
|
+
end
|
12
16
|
|
17
|
+
def initialize(options)
|
13
18
|
@secure = !!options[:secure]
|
14
19
|
@host = options.fetch(:host)
|
15
20
|
@persistent = options[:persistent]
|
16
21
|
|
17
|
-
backend_class = @persistent ?
|
22
|
+
backend_class = @persistent ? self.class.persistent_backend : NetHttp or raise PersistenceNotAvailable
|
23
|
+
backend_class.prepare
|
18
24
|
|
19
25
|
@http = backend_class.new(@host)
|
20
26
|
@http.ssl! if @secure
|
21
27
|
end
|
22
28
|
|
23
29
|
class BaseClient
|
30
|
+
def self.available?
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.prepare
|
34
|
+
end
|
35
|
+
|
24
36
|
def initialize(host)
|
25
37
|
@host = host
|
26
38
|
end
|
27
39
|
|
28
|
-
def
|
40
|
+
def get_request(path)
|
29
41
|
get = Net::HTTP::Get.new(path)
|
30
42
|
get.add_field(*USER_CLIENT_HEADER)
|
31
43
|
get.add_field('Host', @host)
|
32
44
|
get
|
33
45
|
end
|
34
46
|
|
35
|
-
def
|
47
|
+
def post_request(path, payload)
|
36
48
|
post = Net::HTTP::Post.new(path)
|
37
49
|
post.add_field(*USER_CLIENT_HEADER)
|
38
50
|
post.add_field('Host', @host)
|
@@ -41,10 +53,20 @@ module ThreeScale
|
|
41
53
|
end
|
42
54
|
end
|
43
55
|
|
44
|
-
class
|
56
|
+
class NetHttpPersistent < BaseClient
|
57
|
+
def self.available?
|
58
|
+
prepare
|
59
|
+
true
|
60
|
+
rescue LoadError
|
61
|
+
false
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.prepare
|
65
|
+
require 'net/http/persistent'
|
66
|
+
end
|
67
|
+
|
45
68
|
def initialize(host)
|
46
69
|
super
|
47
|
-
require 'net/http/persistent'
|
48
70
|
@http = ::Net::HTTP::Persistent.new
|
49
71
|
@protocol = 'http'
|
50
72
|
end
|
@@ -55,13 +77,13 @@ module ThreeScale
|
|
55
77
|
|
56
78
|
def get(path)
|
57
79
|
uri = full_uri(path)
|
58
|
-
@http.request(uri,
|
80
|
+
@http.request(uri, get_request(path))
|
59
81
|
end
|
60
82
|
|
61
83
|
|
62
84
|
def post(path, payload)
|
63
85
|
uri = full_uri(path)
|
64
|
-
@http.request(uri,
|
86
|
+
@http.request(uri, post_request(path, payload))
|
65
87
|
end
|
66
88
|
|
67
89
|
def full_uri(path)
|
@@ -84,13 +106,54 @@ module ThreeScale
|
|
84
106
|
end
|
85
107
|
|
86
108
|
def get(path)
|
87
|
-
@http.request(
|
109
|
+
@http.request get_request(path)
|
88
110
|
end
|
89
111
|
|
90
112
|
def post(path, payload)
|
91
|
-
@http.request(
|
113
|
+
@http.request post_request(path, payload)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
class NetHttpKeepAlive < NetHttp
|
118
|
+
HTTP_CONNECTION = 'connection'.freeze
|
119
|
+
HTTP_KEEPALIVE = 'keep-alive'.freeze
|
120
|
+
|
121
|
+
MARK_KEEPALIVE = ->(req) { req[HTTP_CONNECTION] ||= HTTP_KEEPALIVE }
|
122
|
+
|
123
|
+
private_constant :MARK_KEEPALIVE
|
124
|
+
private_constant :HTTP_CONNECTION
|
125
|
+
private_constant :HTTP_KEEPALIVE
|
126
|
+
|
127
|
+
def self.available?
|
128
|
+
Net::HTTP.instance_method(:keep_alive_timeout)
|
129
|
+
rescue NameError
|
130
|
+
false
|
131
|
+
end
|
132
|
+
|
133
|
+
def initialize(*)
|
134
|
+
super
|
135
|
+
@http.start
|
136
|
+
end
|
137
|
+
|
138
|
+
def ssl!
|
139
|
+
super
|
140
|
+
@http.start
|
92
141
|
end
|
142
|
+
|
143
|
+
def get_request(*)
|
144
|
+
super.tap(&MARK_KEEPALIVE)
|
145
|
+
end
|
146
|
+
|
147
|
+
def post_request(*)
|
148
|
+
super.tap(&MARK_KEEPALIVE)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
class << self
|
153
|
+
attr_accessor :persistent_backend
|
93
154
|
end
|
155
|
+
|
156
|
+
self.persistent_backend = [NetHttpKeepAlive, NetHttpPersistent].find(&:available?)
|
94
157
|
end
|
95
158
|
end
|
96
159
|
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require '3scale_client'
|
2
|
+
|
3
|
+
require 'rack/utils'
|
4
|
+
require 'rack/auth/basic'
|
5
|
+
|
6
|
+
module ThreeScale
|
7
|
+
class Middleware < Rack::Auth::Basic
|
8
|
+
attr_reader :client, :authenticator
|
9
|
+
|
10
|
+
DEFAULT_OPTIONS = { secure: true, persistent: true }
|
11
|
+
|
12
|
+
def initialize(app, provider_key, mode, options = {})
|
13
|
+
options = DEFAULT_OPTIONS.merge(options).merge(provider_key: provider_key)
|
14
|
+
@client = ThreeScale::Client.new(options)
|
15
|
+
|
16
|
+
super(app, '3scale Authentication', &authenticator_for(mode))
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def authenticator_for(mode)
|
22
|
+
klass = case mode
|
23
|
+
when :user_key then UserKeyAuthenticator
|
24
|
+
when :app_id then AppIdAuthenticator
|
25
|
+
when nil then NilAuthenticator
|
26
|
+
else raise "Unknown auth mode #{mode}"
|
27
|
+
end
|
28
|
+
|
29
|
+
klass.new(@client)
|
30
|
+
end
|
31
|
+
|
32
|
+
class BaseAuthenticator
|
33
|
+
attr_accessor :client
|
34
|
+
|
35
|
+
def initialize(client)
|
36
|
+
@client = client
|
37
|
+
end
|
38
|
+
|
39
|
+
def provided?(username, password)
|
40
|
+
username && !username.empty? && password && !password.empty?
|
41
|
+
end
|
42
|
+
|
43
|
+
def credentials(*)
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_proc
|
48
|
+
lambda { |username, password|
|
49
|
+
return false unless provided?(username, password)
|
50
|
+
|
51
|
+
auth = credentials(username, password)
|
52
|
+
# Do not do authrep for now, as rate limitin requires more work:
|
53
|
+
# we would need to send headers with remaining limits & proper codes
|
54
|
+
response = @client.authorize(auth)
|
55
|
+
response.success?
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
private_constant :BaseAuthenticator
|
61
|
+
|
62
|
+
class UserKeyAuthenticator < BaseAuthenticator
|
63
|
+
def provided?(username, *)
|
64
|
+
username && !username.empty?
|
65
|
+
end
|
66
|
+
|
67
|
+
def credentials(username, *)
|
68
|
+
{ user_key: username }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
class AppIdAuthenticator < BaseAuthenticator
|
73
|
+
def credentials(username, password)
|
74
|
+
{ app_id: username, app_key: password }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class NilAuthenticator < BaseAuthenticator
|
79
|
+
def provided?(*)
|
80
|
+
true
|
81
|
+
end
|
82
|
+
|
83
|
+
def to_proc
|
84
|
+
proc { true }
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/test/client_test.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require '
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
2
3
|
require 'fakeweb'
|
3
4
|
require 'mocha/setup'
|
4
5
|
|
5
6
|
require '3scale/client'
|
6
7
|
|
7
|
-
class ThreeScale::ClientTest <
|
8
|
+
class ThreeScale::ClientTest < MiniTest::Unit::TestCase
|
8
9
|
|
9
10
|
def client(options = {})
|
10
11
|
ThreeScale::Client.new({:provider_key => '1234abcd'}.merge(options))
|
@@ -19,7 +20,7 @@ class ThreeScale::ClientTest < Test::Unit::TestCase
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def test_raises_exception_if_provider_key_is_missing
|
22
|
-
|
23
|
+
assert_raises ArgumentError do
|
23
24
|
ThreeScale::Client.new({})
|
24
25
|
end
|
25
26
|
end
|
@@ -206,7 +207,7 @@ class ThreeScale::ClientTest < Test::Unit::TestCase
|
|
206
207
|
def test_authorize_with_server_error
|
207
208
|
FakeWeb.register_uri(:get, "http://#{@host}/transactions/authorize.xml?provider_key=1234abcd&app_id=foo", :status => ['500', 'Internal Server Error'], :body => 'OMG! WTF!')
|
208
209
|
|
209
|
-
|
210
|
+
assert_raises ThreeScale::ServerError do
|
210
211
|
@client.authorize(:app_id => 'foo')
|
211
212
|
end
|
212
213
|
end
|
@@ -311,13 +312,13 @@ class ThreeScale::ClientTest < Test::Unit::TestCase
|
|
311
312
|
def test_oauth_authorize_with_server_error
|
312
313
|
FakeWeb.register_uri(:get, "http://#{@host}/transactions/oauth_authorize.xml?provider_key=1234abcd&app_id=foo", :status => ['500', 'Internal Server Error'], :body => 'OMG! WTF!')
|
313
314
|
|
314
|
-
|
315
|
+
assert_raises ThreeScale::ServerError do
|
315
316
|
@client.oauth_authorize(:app_id => 'foo')
|
316
317
|
end
|
317
318
|
end
|
318
319
|
|
319
320
|
def test_report_raises_an_exception_if_no_transactions_given
|
320
|
-
|
321
|
+
assert_raises ArgumentError do
|
321
322
|
@client.report
|
322
323
|
end
|
323
324
|
end
|
@@ -380,7 +381,7 @@ class ThreeScale::ClientTest < Test::Unit::TestCase
|
|
380
381
|
:status => ['500', 'Internal Server Error'],
|
381
382
|
:body => 'OMG! WTF!')
|
382
383
|
|
383
|
-
|
384
|
+
assert_raises ThreeScale::ServerError do
|
384
385
|
@client.report({:app_id => 'foo', :usage => {'hits' => 1}})
|
385
386
|
end
|
386
387
|
end
|
@@ -457,8 +458,16 @@ class ThreeScale::ClientTest < Test::Unit::TestCase
|
|
457
458
|
end
|
458
459
|
end
|
459
460
|
|
460
|
-
class ThreeScale::
|
461
|
+
class ThreeScale::NetHttpPersistentClientTest < ThreeScale::ClientTest
|
461
462
|
def client(options = {})
|
463
|
+
ThreeScale::Client::HTTPClient.persistent_backend = ThreeScale::Client::HTTPClient::NetHttpPersistent
|
462
464
|
ThreeScale::Client.new({:provider_key => '1234abcd', :persistent => true}.merge(options))
|
463
465
|
end
|
464
|
-
end
|
466
|
+
end
|
467
|
+
|
468
|
+
class ThreeScale::NetHttpKeepAliveClientTest < ThreeScale::NetHttpPersistentClientTest
|
469
|
+
def client(options = {})
|
470
|
+
ThreeScale::Client::HTTPClient.persistent_backend = ThreeScale::Client::HTTPClient::NetHttpKeepAlive
|
471
|
+
super
|
472
|
+
end
|
473
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require '3scale/middleware'
|
3
|
+
require 'mocha/setup'
|
4
|
+
|
5
|
+
class ThreeScale::MiddlewareTest < MiniTest::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@app = ->(_env) { [ 200, {}, ['']] }
|
9
|
+
@provider_key = 'fake-provider-key'
|
10
|
+
end
|
11
|
+
|
12
|
+
def client(credentials, response = success)
|
13
|
+
mock('client') do
|
14
|
+
expects(:authorize).with(credentials).returns(response)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def success
|
19
|
+
mock('response', success?: true)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_user_key_authenticator
|
23
|
+
credentials = { user_key: 'user' }
|
24
|
+
authenticator = ThreeScale::Middleware::UserKeyAuthenticator.new(client(credentials))
|
25
|
+
assert authenticator.provided?('user', nil)
|
26
|
+
assert_equal credentials, authenticator.credentials('user')
|
27
|
+
assert authenticator.to_proc.call('user', nil)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_app_id_authenticator
|
31
|
+
credentials = { app_id: 'app', app_key: 'key' }
|
32
|
+
authenticator = ThreeScale::Middleware::AppIdAuthenticator.new(client(credentials))
|
33
|
+
|
34
|
+
assert authenticator.provided?('app', 'key')
|
35
|
+
assert_equal credentials, authenticator.credentials('app', 'key')
|
36
|
+
assert authenticator.to_proc.call('app', 'key')
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_nil_authenticator
|
40
|
+
authenticator = ThreeScale::Middleware::NilAuthenticator.new(mock)
|
41
|
+
assert authenticator.provided?
|
42
|
+
assert_equal(nil, authenticator.credentials)
|
43
|
+
assert authenticator.to_proc.call(nil, nil)
|
44
|
+
end
|
45
|
+
end
|
data/test/persistence_test.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
1
3
|
require '3scale/client'
|
2
|
-
require '
|
4
|
+
require 'mocha/setup'
|
3
5
|
|
4
6
|
if ENV['TEST_3SCALE_PROVIDER_KEY'] && ENV['TEST_3SCALE_APP_IDS'] && ENV['TEST_3SCALE_APP_KEYS']
|
5
|
-
class ThreeScale::
|
7
|
+
class ThreeScale::NetHttpPersistenceTest < MiniTest::Unit::TestCase
|
6
8
|
def setup
|
9
|
+
ThreeScale::Client::HTTPClient.persistent_backend = ThreeScale::Client::HTTPClient::NetHttpPersistent
|
10
|
+
|
7
11
|
provider_key = ENV['TEST_3SCALE_PROVIDER_KEY']
|
8
12
|
|
9
13
|
@app_id = ENV['TEST_3SCALE_APP_IDS']
|
10
14
|
@app_key = ENV['TEST_3SCALE_APP_KEYS']
|
11
15
|
|
12
|
-
@client = ThreeScale::Client.new(:
|
16
|
+
@client = ThreeScale::Client.new(provider_key: provider_key, persistence: true)
|
13
17
|
|
14
18
|
if defined?(FakeWeb)
|
15
19
|
FakeWeb.allow_net_connect = true
|
@@ -26,5 +30,13 @@ if ENV['TEST_3SCALE_PROVIDER_KEY'] && ENV['TEST_3SCALE_APP_IDS'] && ENV['TEST_3S
|
|
26
30
|
assert @client.authorize(:app_id => @app_id, :app_key => @app_key).success?
|
27
31
|
end
|
28
32
|
end
|
33
|
+
|
34
|
+
|
35
|
+
class ThreeScale::NetHttpKeepaliveTest < ThreeScale::NetHttpPersistenceTest
|
36
|
+
def setup
|
37
|
+
ThreeScale::Client::HTTPClient.persistent_backend = ThreeScale::Client::HTTPClient::NetHttpKeepAlive
|
38
|
+
super
|
39
|
+
end
|
40
|
+
end
|
29
41
|
end
|
30
42
|
|
data/test/remote_test.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require '
|
1
|
+
require 'minitest/autorun'
|
2
2
|
require '3scale/client'
|
3
3
|
|
4
4
|
if ENV['TEST_3SCALE_PROVIDER_KEY'] &&
|
5
5
|
ENV['TEST_3SCALE_APP_IDS'] &&
|
6
6
|
ENV['TEST_3SCALE_APP_KEYS']
|
7
|
-
class ThreeScale::RemoteTest <
|
7
|
+
class ThreeScale::RemoteTest < MiniTest::Unit::TestCase
|
8
8
|
def setup
|
9
9
|
@provider_key = ENV['TEST_3SCALE_PROVIDER_KEY']
|
10
10
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3scale_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
@@ -12,104 +12,132 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - ~>
|
21
|
+
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '1.
|
23
|
+
version: '1.7'
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - ~>
|
28
|
+
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: '1.
|
30
|
+
version: '1.7'
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: rake
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ">="
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: rdoc
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- -
|
49
|
+
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: '0'
|
52
52
|
type: :development
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
|
-
- -
|
56
|
+
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: fakeweb
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- -
|
63
|
+
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- -
|
70
|
+
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: mocha
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: net-http-persistent
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
type: :development
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- -
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: minitest
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
type: :development
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: rack
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
99
127
|
- !ruby/object:Gem::Version
|
100
128
|
version: '0'
|
101
129
|
- !ruby/object:Gem::Dependency
|
102
130
|
name: nokogiri
|
103
131
|
requirement: !ruby/object:Gem::Requirement
|
104
132
|
requirements:
|
105
|
-
- -
|
133
|
+
- - ">="
|
106
134
|
- !ruby/object:Gem::Version
|
107
135
|
version: '0'
|
108
136
|
type: :runtime
|
109
137
|
prerelease: false
|
110
138
|
version_requirements: !ruby/object:Gem::Requirement
|
111
139
|
requirements:
|
112
|
-
- -
|
140
|
+
- - ">="
|
113
141
|
- !ruby/object:Gem::Version
|
114
142
|
version: '0'
|
115
143
|
description: This gem allows to easily connect an application that provides a Web
|
@@ -121,9 +149,10 @@ executables: []
|
|
121
149
|
extensions: []
|
122
150
|
extra_rdoc_files: []
|
123
151
|
files:
|
124
|
-
- .gitignore
|
125
|
-
- .travis.yml
|
152
|
+
- ".gitignore"
|
153
|
+
- ".travis.yml"
|
126
154
|
- 3scale_client.gemspec
|
155
|
+
- CHANGELOG.md
|
127
156
|
- Gemfile
|
128
157
|
- LICENCE
|
129
158
|
- README.md
|
@@ -133,10 +162,12 @@ files:
|
|
133
162
|
- lib/3scale/client.rb
|
134
163
|
- lib/3scale/client/http_client.rb
|
135
164
|
- lib/3scale/client/version.rb
|
165
|
+
- lib/3scale/middleware.rb
|
136
166
|
- lib/3scale/response.rb
|
137
167
|
- lib/3scale_client.rb
|
138
168
|
- test/benchmark.rb
|
139
169
|
- test/client_test.rb
|
170
|
+
- test/middleware_test.rb
|
140
171
|
- test/persistence_test.rb
|
141
172
|
- test/remote_test.rb
|
142
173
|
homepage: http://www.3scale.net
|
@@ -149,22 +180,23 @@ require_paths:
|
|
149
180
|
- lib
|
150
181
|
required_ruby_version: !ruby/object:Gem::Requirement
|
151
182
|
requirements:
|
152
|
-
- -
|
183
|
+
- - ">="
|
153
184
|
- !ruby/object:Gem::Version
|
154
185
|
version: '0'
|
155
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
187
|
requirements:
|
157
|
-
- -
|
188
|
+
- - ">"
|
158
189
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
190
|
+
version: 1.3.1
|
160
191
|
requirements: []
|
161
192
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.
|
193
|
+
rubygems_version: 2.4.5
|
163
194
|
signing_key:
|
164
195
|
specification_version: 4
|
165
196
|
summary: Client for 3scale Web Service Management System API
|
166
197
|
test_files:
|
167
198
|
- test/benchmark.rb
|
168
199
|
- test/client_test.rb
|
200
|
+
- test/middleware_test.rb
|
169
201
|
- test/persistence_test.rb
|
170
202
|
- test/remote_test.rb
|