keratin-authn 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bc3dc3a5993e496aa7d4a27460d799b4e3ea600
4
- data.tar.gz: 30266ffdffaa188785ce930f0f470a5cde684746
3
+ metadata.gz: 2f45b125d67113d0774cbad89d9267547e3b7e31
4
+ data.tar.gz: de9f914409394e534f6fe8d9240fe0f4edb0c441
5
5
  SHA512:
6
- metadata.gz: 77ac60816689bd685f7ba0e6de2122bcd6e372bccee8b6bb1e1ef6bf660278fd3617ca7e5fe57debbe792db44baa030fc55d721681b535bb2e0de6ad435604ad
7
- data.tar.gz: 0814a5099a9b4d7c246c9a9b3dabe05e8d234c6fc86f6022cfd3ba54a3f76df521dad46a1130ef4e422a1e1125c523543d2d22efca6d6067dba15f39589db889
6
+ metadata.gz: 164fd93bf93e7ccad0f9d005ea81fcc09e78bdb79bccb8a8b55f4776101631bdbc14d0b2a0d4f9347c0f0e322a1e45fad3c88d3f243b2bb9c561995380b17859
7
+ data.tar.gz: a45bbfebe1d9bad1c0a5538cc8d679e5a7ee4ec3be78897a2c740c070bfae0ff89efdf8e1518d7b5c786d4940db6589aff7604f1b416474d068922616fbc43e3
@@ -37,4 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "rake", "~> 10.0"
38
38
  spec.add_development_dependency "minitest", "~> 5.0"
39
39
  spec.add_development_dependency "timecop"
40
+ spec.add_development_dependency "byebug"
40
41
  end
@@ -35,7 +35,7 @@ module Keratin::AuthN
35
35
  end
36
36
 
37
37
  def token_intact?
38
- jwt.verify!(@keychain.getset(jwt['iss']){ Issuer.new(jwt['iss']).signing_key })
38
+ jwt.verify!(@keychain.getset(jwt.kid){ Issuer.new(jwt['iss']).signing_key(jwt.kid) })
39
39
  rescue JSON::JWT::VerificationFailed, JSON::JWT::UnexpectedAlgorithm
40
40
  false
41
41
  end
@@ -15,8 +15,8 @@ module Keratin::AuthN
15
15
  delete(path: "/accounts/:account_id").result
16
16
  end
17
17
 
18
- def signing_key
19
- keys.find{|k| k['use'] == 'sig' }
18
+ def signing_key(kid)
19
+ keys.find{|k| k['use'] == 'sig' && (kid.blank? || kid == k['kid']) }
20
20
  end
21
21
 
22
22
  def configuration
@@ -13,7 +13,7 @@ module Keratin::AuthN
13
13
  sub: subject,
14
14
  iat: 10.seconds.ago,
15
15
  exp: 1.hour.from_now
16
- ).sign(jws_keypair, JWS_ALGORITHM).to_s
16
+ ).sign(jws_keypair.to_jwk, JWS_ALGORITHM).to_s
17
17
  end
18
18
 
19
19
  # a temporary RSA key for our test suite.
@@ -1,5 +1,5 @@
1
1
  module Keratin
2
2
  module AuthN
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
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.2.0
4
+ version: 0.3.0
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-12-10 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-jwt
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: byebug
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description:
112
126
  email:
113
127
  - lance@cainlevy.net