openid_connect 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openid_connect (0.2.3)
4
+ openid_connect (0.2.4)
5
5
  activemodel (>= 3)
6
6
  attr_required (>= 0.0.5)
7
7
  json (>= 1.4.3)
@@ -38,6 +38,7 @@ GEM
38
38
  jruby-openssl (0.7.7)
39
39
  bouncy-castle-java (>= 1.5.0146.1)
40
40
  json (1.7.3)
41
+ json (1.7.3-java)
41
42
  json-jwt (0.0.7)
42
43
  activesupport (>= 2.3)
43
44
  i18n
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.3.0
@@ -21,7 +21,7 @@ module OpenIDConnect
21
21
  res = yield
22
22
  case res.status
23
23
  when 200
24
- JSON.parse(res.body).with_indifferent_access
24
+ JSON.parse(res.body, :symbolize_names => true)
25
25
  when 400
26
26
  raise BadRequest.new('API Access Faild', res)
27
27
  when 401
@@ -26,7 +26,7 @@ module OpenIDConnect
26
26
  end
27
27
 
28
28
  def handle_success_response(response)
29
- token_hash = JSON.parse(response.body).with_indifferent_access
29
+ token_hash = JSON.parse(response.body, :symbolize_names => true)
30
30
  case token_type = token_hash[:token_type].try(:downcase)
31
31
  when 'bearer'
32
32
  AccessToken.new token_hash.merge(:client => self)
@@ -225,7 +225,7 @@ module OpenIDConnect
225
225
  end
226
226
 
227
227
  def handle_success_response(response)
228
- credentials = JSON.parse(response.body).with_indifferent_access
228
+ credentials = JSON.parse(response.body, :symbolize_names => true)
229
229
  Client.new(
230
230
  :identifier => credentials[:client_id],
231
231
  :secret => credentials[:client_secret],
@@ -12,12 +12,12 @@ module OpenIDConnect
12
12
  if claims.present?
13
13
  _claims_ = {}
14
14
  claims.each do |key, value|
15
- _claims_[key] = case value.to_s
16
- when 'optional', 'voluntary'
15
+ _claims_[key] = case value
16
+ when :optional, :voluntary
17
17
  {
18
18
  :essential => false
19
19
  }
20
- when 'required', 'essential'
20
+ when :required, :essential
21
21
  {
22
22
  :essential => true
23
23
  }
@@ -16,7 +16,7 @@ module OpenIDConnect
16
16
  end
17
17
 
18
18
  def verify!(expected = {})
19
- exp.to_i >= Time.now.to_i &&
19
+ exp.to_i > Time.now.to_i &&
20
20
  iss == expected[:issuer] &&
21
21
  aud == expected[:client_id] &&
22
22
  nonce == expected[:nonce] or
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openid_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: