rack-prx_auth 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/prx_auth.rb +2 -0
- data/lib/rack/prx_auth/version.rb +1 -1
- data/test/rack/prx_auth_test.rb +19 -0
- 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: 0e57bda2725fe363d27b499e084653515fba6fdd2dd90af5ea42edce47fa2918
|
4
|
+
data.tar.gz: 594cf56ce3d05aa865400dc092a166c4ef1cefb27018c1012116430018045373
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62c7e985124f8809cd0b8afcece43a0107d5f8027740b319dad1a95c7760ea4ff3913c4e0b337beab1dbb5506a45e5ba6d9fbe41ca871b3cdcf3841a9f777a18
|
7
|
+
data.tar.gz: 3d5f9d6a398fec46149e1413ad89d8990a9bc16b335f2aed1b3918f4e5ffdaa1545b9ecab89392a795dad48d267d0d464c2393be3a9f0639ac42c5f62a49640c
|
data/lib/rack/prx_auth.rb
CHANGED
data/test/rack/prx_auth_test.rb
CHANGED
@@ -26,6 +26,11 @@ describe Rack::PrxAuth do
|
|
26
26
|
prxauth.call(env.clone).must_equal env
|
27
27
|
end
|
28
28
|
|
29
|
+
it 'does nothing if the token is nil' do
|
30
|
+
env = {"HTTP_AUTHORIZATION"=>"Bearer "}
|
31
|
+
prxauth.call(env).must_equal env
|
32
|
+
end
|
33
|
+
|
29
34
|
it 'returns 401 if verification fails' do
|
30
35
|
JSON::JWT.stub(:decode, claims) do
|
31
36
|
prxauth.stub(:valid?, false) do
|
@@ -76,4 +81,18 @@ describe Rack::PrxAuth do
|
|
76
81
|
end
|
77
82
|
end
|
78
83
|
end
|
84
|
+
|
85
|
+
describe '#decode_token' do
|
86
|
+
it 'should return an empty result for a nil token' do
|
87
|
+
prxauth.send(:decode_token, nil).must_equal({})
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should return an empty result for an empty token' do
|
91
|
+
prxauth.send(:decode_token, {}).must_equal({})
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'should return an empty result for a malformed token' do
|
95
|
+
prxauth.send(:decode_token, 'asdfsadfsad').must_equal({})
|
96
|
+
end
|
97
|
+
end
|
79
98
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-prx_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eve Asher
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|