castle-rb 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/castle/configuration.rb +3 -1
- data/lib/castle/extractors/ip.rb +2 -0
- data/lib/castle/version.rb +1 -1
- data/spec/lib/castle/configuration_spec.rb +2 -2
- data/spec/lib/castle/extractors/ip_spec.rb +16 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d0999873fc06348f78e4663a5bf653fe64f62f8432af21a7596dca3ed935ee3
|
4
|
+
data.tar.gz: a3e523ef2862b8f2928c180d70242aac5afda8594f5d48f0fc2647186a107fb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 876a90d7bf0ceebefbd0ee2243f533cd520a91b8415fbbcb9b85eb2df5aa58dcc52717d267bb9edf89debd5a9e7f94f793b3564b34aaf6502a81885025ad6c08
|
7
|
+
data.tar.gz: 97f910519f2e67c9737219e4f7fe5c91f08bb817942bccc14dc534d67ec0a71db0d408d75454e4c67d148ca9aa60c30f3f9252a279321783d79ea07fd5cc43f6
|
data/lib/castle/configuration.rb
CHANGED
data/lib/castle/extractors/ip.rb
CHANGED
data/lib/castle/version.rb
CHANGED
@@ -77,7 +77,7 @@ describe Castle::Configuration do
|
|
77
77
|
|
78
78
|
describe 'whitelisted' do
|
79
79
|
it do
|
80
|
-
expect(config.whitelisted.size).to be_eql(
|
80
|
+
expect(config.whitelisted.size).to be_eql(13)
|
81
81
|
end
|
82
82
|
|
83
83
|
context 'setter' do
|
@@ -94,7 +94,7 @@ describe Castle::Configuration do
|
|
94
94
|
config.whitelisted += ['header']
|
95
95
|
end
|
96
96
|
it { expect(config.whitelisted).to be_include('Header') }
|
97
|
-
it { expect(config.whitelisted.size).to be_eql(
|
97
|
+
it { expect(config.whitelisted.size).to be_eql(14) }
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -6,8 +6,22 @@ describe Castle::Extractors::IP do
|
|
6
6
|
let(:request) { Rack::Request.new(env) }
|
7
7
|
|
8
8
|
describe 'ip' do
|
9
|
-
|
9
|
+
context 'when regular ip' do
|
10
|
+
let(:env) { Rack::MockRequest.env_for('/', 'HTTP_X_FORWARDED_FOR' => '1.2.3.5') }
|
10
11
|
|
11
|
-
|
12
|
+
it { expect(extractor.call).to eql('1.2.3.5') }
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when cf remote_ip' do
|
16
|
+
let(:env) do
|
17
|
+
Rack::MockRequest.env_for(
|
18
|
+
'/',
|
19
|
+
'HTTP_CF_CONNECTING_IP' => '1.2.3.4',
|
20
|
+
'HTTP_X_FORWARDED_FOR' => '1.2.3.5'
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
it { expect(extractor.call).to eql('1.2.3.4') }
|
25
|
+
end
|
12
26
|
end
|
13
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: castle-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Brissmyr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Castle protects your users from account compromise
|
14
14
|
email: johan@castle.io
|