identity-gateway 1.1.1 → 1.1.2

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: 8a472a877c9f41b3452ce62134871ead4bafba3b
4
- data.tar.gz: 1ebe4c7eb1c3b8745dfd734d76837c48486dab1e
3
+ metadata.gz: 07d02983cb60514775eb44ba094f7098641e7d34
4
+ data.tar.gz: 643f687fd8b54a1bb1614d4bcc5608c4edae5670
5
5
  SHA512:
6
- metadata.gz: d5ae5c137a7dbe728b5482f7c4ed7a40396b1663cfe302bce1212d403972d5081ceb41f1cc8a2c0b0c492e46081737cc0046a7d73f7d6000cde8e4c3015760a1
7
- data.tar.gz: 5cd96de33a0d261670061e200a0a4ae738bdb525713334e895f40fa1ae401dd520f25f0ed243acba2ff01c74fe25c8e1e90a3dce6282a9535223a7a015d66b03
6
+ metadata.gz: 5df55696048b11a7e63280ab189284294174bba901c7a603a5fa89591095b6767d1aedcfd8fff87b82e2c3b55100afd41ad0bb92e6956a72a149f4f944fd2073
7
+ data.tar.gz: 1530bd59609dddca227deac63ec9bc4134ec998ddcc262c8beee6e96027ef13227457a81a1a1712ff0309c805a6c735a2252d27d0b2cfec3d94609429fd2baf3
@@ -65,7 +65,7 @@ module Identity
65
65
  headers: api_headers
66
66
  )
67
67
 
68
- raise Unauthorized if @response.code == 401 || @response.parsed_response.nil?
68
+ raise Unauthorized if invalid_response?(@response)
69
69
  @subject = @model.from_oauth_provider(@response.parsed_response)
70
70
  end
71
71
 
@@ -74,7 +74,7 @@ module Identity
74
74
  # ==== Returns
75
75
  # * <tt>String</tt> - token.
76
76
  def request_token
77
- (@request.headers['Authorization'] || '').gsub('Bearer ', '')
77
+ (@request.headers['Authorization'] || @request.params['access_token'] || '').gsub('Bearer ', '')
78
78
  end
79
79
 
80
80
  # Required headers.
@@ -88,6 +88,17 @@ module Identity
88
88
  'Authorization' => @request.headers['Authorization'] || ''
89
89
  }
90
90
  end
91
+
92
+ # Invalid Response.
93
+ #
94
+ # ==== Returns
95
+ # * <tt>Boolean</tt> - True if is an invalid response.
96
+ def invalid_response?(response)
97
+ parsed_response = response.parsed_response
98
+ return true if response.code == 401 || parsed_response.nil? || parsed_response['id'].nil?
99
+
100
+ false
101
+ end
91
102
  end
92
103
  end
93
104
  end
@@ -1,5 +1,5 @@
1
1
  module Identity
2
2
  module Gateway
3
- VERSION = '1.1.1'.freeze
3
+ VERSION = '1.1.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: identity-gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Kartono
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-22 00:00:00.000000000 Z
11
+ date: 2022-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty