keratin-authn 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/keratin/authn/id_token_verifier.rb +5 -0
- data/lib/keratin/authn/test/helpers.rb +5 -5
- data/lib/keratin/authn/version.rb +1 -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: 847208e3ba358b73e2d6cee499b41646493527b2
|
4
|
+
data.tar.gz: f1c1b9b89095596627089c2a2daa603c0b951195
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7c25eb47b0d5ae1b0a9cde426c9472c8731a8ede1a8bfb02ab8689f409e0f37ff7267d9fad88e9d91d5e53a05ac0d1ba705861403bd8ee8d77643aec4317674
|
7
|
+
data.tar.gz: 7ca65c1c66b67ce50e785b6e06b0c61fb7a47b2d8b9cdc0c52e95d617e982dfa0f5483b2a014c539cca3e6254b6c28977935283d20055af3560f870aac60a0ff
|
@@ -12,11 +12,16 @@ module Keratin::AuthN
|
|
12
12
|
|
13
13
|
def verified?
|
14
14
|
jwt.present? &&
|
15
|
+
token_from_us? &&
|
15
16
|
token_for_us? &&
|
16
17
|
!token_expired? &&
|
17
18
|
token_intact?
|
18
19
|
end
|
19
20
|
|
21
|
+
def token_from_us?
|
22
|
+
jwt[:iss] == Keratin::AuthN.config.issuer
|
23
|
+
end
|
24
|
+
|
20
25
|
def token_for_us?
|
21
26
|
jwt[:aud] == Keratin::AuthN.config.audience
|
22
27
|
end
|
@@ -24,17 +24,17 @@ module Keratin::AuthN
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# stubs the endpoints necessary to validate a signed JWT
|
27
|
-
private def stub_auth_server
|
27
|
+
private def stub_auth_server(issuer: Keratin::AuthN.config.issuer, keypair: jws_keypair)
|
28
28
|
Keratin::AuthN.keychain.clear
|
29
|
-
stub_request(:get, "#{
|
29
|
+
stub_request(:get, "#{issuer}#{Keratin::AuthN.config.configuration_path}").to_return(
|
30
30
|
status: 200,
|
31
|
-
body: {'jwks_uri' => "#{
|
31
|
+
body: {'jwks_uri' => "#{issuer}/jwks"}.to_json
|
32
32
|
)
|
33
|
-
stub_request(:get, "#{
|
33
|
+
stub_request(:get, "#{issuer}/jwks").to_return(
|
34
34
|
status: 200,
|
35
35
|
body: {
|
36
36
|
keys: [
|
37
|
-
|
37
|
+
keypair.public_key.to_jwk.slice(:kty, :kid, :e, :n).merge(
|
38
38
|
use: 'sig',
|
39
39
|
alg: JWS_ALGORITHM
|
40
40
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keratin-authn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lance Ivy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-jwt
|