nm-gigya 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/gigya/controller_utils.rb +23 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c2b5242f9ed96fc93e63d3eddc3bb57786524114
|
4
|
+
data.tar.gz: 5d82fa2119be452727889c98056d64c3f2442ed0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52bf9784b6bd608ef8035096678fe33c347a4528eeb4a4dd2ba587e7f82cba471a83e67736fb3d451b3a55a46f427f6242b507ed4cf8cfe874cb0afbf41ab85b
|
7
|
+
data.tar.gz: 4f3ecb8835fe79447b0890318fca0036abbb56429edc8be715ab1ad00e9d74b3db26defe423402602c1daf088f714843c78884cee4d29eba7497fe2d611b4920
|
@@ -13,8 +13,9 @@ module Gigya
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
# Obtain the token from the standard places
|
17
|
+
def gigya_jwt_token
|
18
|
+
@gigya_jwt_token ||= begin
|
18
19
|
tmp_token = nil
|
19
20
|
|
20
21
|
begin
|
@@ -26,26 +27,37 @@ module Gigya
|
|
26
27
|
# Additionally, we probably can't even use the HTTP Authorization header anyway
|
27
28
|
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
tmp_token
|
30
|
+
begin
|
31
|
+
tmp_token = params[GIGYA_QUERY_PARAM] unless params[GIGYA_QUERY_PARAM].blank?
|
32
|
+
if tmp_token.blank?
|
33
|
+
tmp_token = cookies[GIGYA_COOKIE_PARAM]
|
34
|
+
end
|
35
|
+
rescue
|
36
|
+
# Some lightweight controllers don't do cookies
|
32
37
|
end
|
33
38
|
|
34
|
-
|
35
|
-
tmp_token
|
39
|
+
begin
|
40
|
+
if tmp_token.blank?
|
41
|
+
tmp_token = session[GIGYA_SESSION_PARAM]
|
42
|
+
end
|
43
|
+
rescue
|
44
|
+
# Some lightweight controllers don't do sessions
|
36
45
|
end
|
37
|
-
|
46
|
+
|
38
47
|
tmp_token
|
39
48
|
end
|
40
|
-
|
49
|
+
end
|
50
|
+
|
51
|
+
def interpret_jwt_token
|
52
|
+
@gigya_jwt_info ||= Gigya::Connection.shared_connection.validate_jwt(gigya_jwt_token)
|
41
53
|
end
|
42
54
|
|
43
55
|
def gigya_save_jwt(destination = :cookie)
|
44
56
|
interpret_jwt_token
|
45
57
|
if destination == :cookie
|
46
|
-
cookies[GIGYA_COOKIE_PARAM] =
|
58
|
+
cookies[GIGYA_COOKIE_PARAM] = gigya_jwt_token
|
47
59
|
elsif destination == :session
|
48
|
-
cookies[GIGYA_SESSION_PARAM] =
|
60
|
+
cookies[GIGYA_SESSION_PARAM] = gigya_jwt_token
|
49
61
|
else
|
50
62
|
raise "Invalid Gigya JWT destination"
|
51
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nm-gigya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Bartlett
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-06-
|
12
|
+
date: 2018-06-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
71
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.
|
72
|
+
rubygems_version: 2.5.2.1
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Gigya API Utility Package
|