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 +4 -4
- data/lib/identity/gateway/provider.rb +13 -2
- data/lib/identity/gateway/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: 07d02983cb60514775eb44ba094f7098641e7d34
|
4
|
+
data.tar.gz: 643f687fd8b54a1bb1614d4bcc5608c4edae5670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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.
|
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:
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|