rack-prx_auth 0.0.1 → 0.0.2
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/token_data.rb +4 -0
- data/lib/rack/prx_auth/version.rb +1 -1
- data/test/rack-prx_auth_test.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 335167c8922061c767796b85563f9f7b5378a6e9
|
4
|
+
data.tar.gz: 523fd6da97985c6e2e9f78aa20a51d570411dc37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f28ac978ac7e87da00f7495da26ff391a2794aecb5c8915052516b414964f800fc6779fe5c087ffce9ecc7612f58ab1caf6f1007a7a4a139a23cc80abbdcafcd
|
7
|
+
data.tar.gz: a3a3055cfc30a9ececdf51bcb8dd91e2c468e0f10902bd242150dda3a8560878d89fd4f981f256a8b8f882086a26ca102f4d44b23720ca3d2320fccae66ee596
|
data/test/rack-prx_auth_test.rb
CHANGED
@@ -8,7 +8,7 @@ describe Rack::PrxAuth do
|
|
8
8
|
let(:prxauth) { Rack::PrxAuth.new(app) }
|
9
9
|
let(:fake_token) { 'afawefawefawefawegstgnsrtiohnlijblublwjnvrtoign'}
|
10
10
|
let(:env) { {'HTTP_AUTHORIZATION' => 'Bearer ' + fake_token } }
|
11
|
-
let(:claims) { {'sub'=>
|
11
|
+
let(:claims) { {'sub'=>3, 'exp'=>3600, 'iat'=>Time.now.to_i, 'token_type'=>'bearer', 'scope'=>nil, 'iss'=>'auth.prx.org'} }
|
12
12
|
|
13
13
|
describe '#call' do
|
14
14
|
it 'does nothing if there is no authorization header' do
|
@@ -57,6 +57,7 @@ describe Rack::PrxAuth do
|
|
57
57
|
JSON::JWT.stub(:decode, claims) do
|
58
58
|
prxauth.call(env)['prx.auth'].must_be_instance_of Rack::PrxAuth::TokenData
|
59
59
|
prxauth.call(env)['prx.auth'].attributes.must_equal claims
|
60
|
+
prxauth.call(env)['prx.auth'].user_id.must_equal claims['sub']
|
60
61
|
end
|
61
62
|
end
|
62
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-prx_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eve Asher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|