routemaster-drain 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +4 -4
- data/gemfiles/rails_3.gemfile.lock +4 -4
- data/gemfiles/rails_4.gemfile.lock +4 -4
- data/gemfiles/rails_5.gemfile.lock +4 -4
- data/lib/routemaster/api_client.rb +1 -1
- data/lib/routemaster/config.rb +5 -2
- data/lib/routemaster/drain.rb +1 -1
- data/spec/routemaster/config_spec.rb +22 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 193d7dd526f02d0397233f0c2868e74aedb41a23
|
4
|
+
data.tar.gz: 9a3c37a909a17321b305cd9c5d0bf916b71b722b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9dfc1c8da243ee0e56a30f77f5af28ddc374200c94de8341b77cf5f69a4a8a892426b310b59c0b5dfa8fe2763aa2bb59435e229201319a6dff94319d4de7737
|
7
|
+
data.tar.gz: a09d4315e6d6b9d0993aa8c35c93a5a5e2790339180159bc5346b497dc64b38b9617abe3ab8e0d2d4d771c0a4cd96e127df3ae961feb2140e35cd22a88067b13
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
routemaster-drain (3.0.
|
4
|
+
routemaster-drain (3.0.1)
|
5
5
|
addressable
|
6
6
|
concurrent-ruby
|
7
7
|
faraday (>= 0.9.0)
|
@@ -39,7 +39,7 @@ GEM
|
|
39
39
|
ffi (>= 1.3.0)
|
40
40
|
faraday (0.12.1)
|
41
41
|
multipart-post (>= 1.2, < 3)
|
42
|
-
faraday_middleware (0.
|
42
|
+
faraday_middleware (0.12.2)
|
43
43
|
faraday (>= 0.7.4, < 1.0)
|
44
44
|
ffi (1.9.17)
|
45
45
|
fork (1.0.1)
|
@@ -61,7 +61,7 @@ GEM
|
|
61
61
|
guard-compat (~> 1.1)
|
62
62
|
rspec (>= 2.99.0, < 4.0)
|
63
63
|
hashdiff (0.3.2)
|
64
|
-
hashie (3.5.
|
64
|
+
hashie (3.5.6)
|
65
65
|
json (2.0.3)
|
66
66
|
listen (3.1.5)
|
67
67
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
@@ -168,4 +168,4 @@ DEPENDENCIES
|
|
168
168
|
webmock
|
169
169
|
|
170
170
|
BUNDLED WITH
|
171
|
-
1.
|
171
|
+
1.15.3
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
routemaster-drain (3.0.
|
4
|
+
routemaster-drain (3.0.1)
|
5
5
|
addressable
|
6
6
|
concurrent-ruby
|
7
7
|
faraday (>= 0.9.0)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
ffi (>= 1.3.0)
|
70
70
|
faraday (0.12.1)
|
71
71
|
multipart-post (>= 1.2, < 3)
|
72
|
-
faraday_middleware (0.
|
72
|
+
faraday_middleware (0.12.2)
|
73
73
|
faraday (>= 0.7.4, < 1.0)
|
74
74
|
ffi (1.9.18)
|
75
75
|
fork (1.0.1)
|
@@ -91,7 +91,7 @@ GEM
|
|
91
91
|
guard-compat (~> 1.1)
|
92
92
|
rspec (>= 2.99.0, < 4.0)
|
93
93
|
hashdiff (0.3.2)
|
94
|
-
hashie (3.5.
|
94
|
+
hashie (3.5.6)
|
95
95
|
hike (1.2.3)
|
96
96
|
i18n (0.8.1)
|
97
97
|
journey (1.0.4)
|
@@ -237,4 +237,4 @@ DEPENDENCIES
|
|
237
237
|
webmock
|
238
238
|
|
239
239
|
BUNDLED WITH
|
240
|
-
1.
|
240
|
+
1.15.3
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
routemaster-drain (3.0.
|
4
|
+
routemaster-drain (3.0.1)
|
5
5
|
addressable
|
6
6
|
concurrent-ruby
|
7
7
|
faraday (>= 0.9.0)
|
@@ -76,7 +76,7 @@ GEM
|
|
76
76
|
ffi (>= 1.3.0)
|
77
77
|
faraday (0.12.1)
|
78
78
|
multipart-post (>= 1.2, < 3)
|
79
|
-
faraday_middleware (0.
|
79
|
+
faraday_middleware (0.12.2)
|
80
80
|
faraday (>= 0.7.4, < 1.0)
|
81
81
|
ffi (1.9.18)
|
82
82
|
fork (1.0.1)
|
@@ -100,7 +100,7 @@ GEM
|
|
100
100
|
guard-compat (~> 1.1)
|
101
101
|
rspec (>= 2.99.0, < 4.0)
|
102
102
|
hashdiff (0.3.2)
|
103
|
-
hashie (3.5.
|
103
|
+
hashie (3.5.6)
|
104
104
|
i18n (0.8.1)
|
105
105
|
json (2.0.3)
|
106
106
|
listen (3.1.5)
|
@@ -254,4 +254,4 @@ DEPENDENCIES
|
|
254
254
|
webmock
|
255
255
|
|
256
256
|
BUNDLED WITH
|
257
|
-
1.
|
257
|
+
1.15.3
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
routemaster-drain (3.0.
|
4
|
+
routemaster-drain (3.0.1)
|
5
5
|
addressable
|
6
6
|
concurrent-ruby
|
7
7
|
faraday (>= 0.9.0)
|
@@ -79,7 +79,7 @@ GEM
|
|
79
79
|
ffi (>= 1.3.0)
|
80
80
|
faraday (0.12.1)
|
81
81
|
multipart-post (>= 1.2, < 3)
|
82
|
-
faraday_middleware (0.
|
82
|
+
faraday_middleware (0.12.2)
|
83
83
|
faraday (>= 0.7.4, < 1.0)
|
84
84
|
ffi (1.9.18)
|
85
85
|
fork (1.0.1)
|
@@ -103,7 +103,7 @@ GEM
|
|
103
103
|
guard-compat (~> 1.1)
|
104
104
|
rspec (>= 2.99.0, < 4.0)
|
105
105
|
hashdiff (0.3.2)
|
106
|
-
hashie (3.5.
|
106
|
+
hashie (3.5.6)
|
107
107
|
i18n (0.8.1)
|
108
108
|
json (2.0.3)
|
109
109
|
listen (3.1.5)
|
@@ -257,4 +257,4 @@ DEPENDENCIES
|
|
257
257
|
webmock
|
258
258
|
|
259
259
|
BUNDLED WITH
|
260
|
-
1.
|
260
|
+
1.15.3
|
@@ -128,8 +128,8 @@ module Routemaster
|
|
128
128
|
f.response :json, content_type: /\bjson/
|
129
129
|
f.use Routemaster::Middleware::ResponseCaching, listener: @listener
|
130
130
|
f.use Routemaster::Middleware::Metrics, client: @metrics_client, source_peer: @source_peer
|
131
|
-
f.adapter :typhoeus
|
132
131
|
f.use Routemaster::Middleware::ErrorHandling
|
132
|
+
f.adapter :typhoeus
|
133
133
|
|
134
134
|
@middlewares.each do |middleware|
|
135
135
|
f.use(*middleware)
|
data/lib/routemaster/config.rb
CHANGED
@@ -47,11 +47,14 @@ module Routemaster
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def cache_expiry
|
50
|
-
|
50
|
+
# Do not increase this default value. It's likely that cached data will include PII
|
51
|
+
# and 90 days is the maximum permitted retention period at Deliveroo. A higher value
|
52
|
+
# means we would need to worry about purging caches at the end of the period.
|
53
|
+
Integer(ENV.fetch('ROUTEMASTER_CACHE_EXPIRY', 86_400 * 90))
|
51
54
|
end
|
52
55
|
|
53
56
|
def cache_auth
|
54
|
-
Hashie::Rash.new.tap do |result|
|
57
|
+
@cache_auth ||= Hashie::Rash.new.tap do |result|
|
55
58
|
ENV.fetch('ROUTEMASTER_CACHE_AUTH', '').split(',').each do |entry|
|
56
59
|
host, username, password = entry.split(':')
|
57
60
|
result[Regexp.new(host)] = [username, password]
|
data/lib/routemaster/drain.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'routemaster/config'
|
2
|
+
|
3
|
+
RSpec.describe Routemaster::Config do
|
4
|
+
describe '.cache_expiry' do
|
5
|
+
subject { described_class.cache_expiry }
|
6
|
+
|
7
|
+
context 'when using the default' do
|
8
|
+
it 'should be 90 days' do
|
9
|
+
should eq 86_400 * 90
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'when overridden with ROUTEMASTER_CACHE_EXPIRY' do
|
14
|
+
before { ENV['ROUTEMASTER_CACHE_EXPIRY'] = '123456' }
|
15
|
+
after { ENV['ROUTEMASTER_CACHE_EXPIRY'] = nil }
|
16
|
+
|
17
|
+
it 'should be the configured value' do
|
18
|
+
should eq 123456
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: routemaster-drain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -212,6 +212,7 @@ files:
|
|
212
212
|
- routemaster-drain.gemspec
|
213
213
|
- spec/routemaster/api_client_spec.rb
|
214
214
|
- spec/routemaster/cache_spec.rb
|
215
|
+
- spec/routemaster/config_spec.rb
|
215
216
|
- spec/routemaster/dirty/filter_spec.rb
|
216
217
|
- spec/routemaster/dirty/map_spec.rb
|
217
218
|
- spec/routemaster/dirty/state_spec.rb
|
@@ -268,13 +269,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
269
|
version: '0'
|
269
270
|
requirements: []
|
270
271
|
rubyforge_project:
|
271
|
-
rubygems_version: 2.6.
|
272
|
+
rubygems_version: 2.6.8
|
272
273
|
signing_key:
|
273
274
|
specification_version: 4
|
274
275
|
summary: Event receiver for the Routemaster bus
|
275
276
|
test_files:
|
276
277
|
- spec/routemaster/api_client_spec.rb
|
277
278
|
- spec/routemaster/cache_spec.rb
|
279
|
+
- spec/routemaster/config_spec.rb
|
278
280
|
- spec/routemaster/dirty/filter_spec.rb
|
279
281
|
- spec/routemaster/dirty/map_spec.rb
|
280
282
|
- spec/routemaster/dirty/state_spec.rb
|