nm-gigya 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/gigya/controller_utils.rb +23 -11
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: c494a0c871fa468bd4ac12d1336d0e78ea741e34be184720b13e0061eb6e7d4f
4
- data.tar.gz: 7645acd1290b34202846d9ee0254060e33d16af2a0409e7caaaee0b982a05987
2
+ SHA1:
3
+ metadata.gz: c2b5242f9ed96fc93e63d3eddc3bb57786524114
4
+ data.tar.gz: 5d82fa2119be452727889c98056d64c3f2442ed0
5
5
  SHA512:
6
- metadata.gz: 5a45caebb2bd2942c0183205177de232bfba065a9d60dcb874f1f025746986b7c4dc4754a58c8ce3581a9697e23c750d93ece8fa4e9b0666f2c0357a6c6dba03
7
- data.tar.gz: 78a349122307dfadf15d6fb26621d21f660b49d2f2b200e0c22e397b955296b1461778a59b77c8c094b1d1692f00af5b0375ff145eda6805c982ffb4e00b5f68
6
+ metadata.gz: 52bf9784b6bd608ef8035096678fe33c347a4528eeb4a4dd2ba587e7f82cba471a83e67736fb3d451b3a55a46f427f6242b507ed4cf8cfe874cb0afbf41ab85b
7
+ data.tar.gz: 4f3ecb8835fe79447b0890318fca0036abbb56429edc8be715ab1ad00e9d74b3db26defe423402602c1daf088f714843c78884cee4d29eba7497fe2d611b4920
@@ -13,8 +13,9 @@ module Gigya
13
13
  end
14
14
  end
15
15
 
16
- def interpret_jwt_token
17
- @gigya_token ||= begin
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
- tmp_token = params[GIGYA_QUERY_PARAM] unless params[GIGYA_QUERY_PARAM].blank?
30
- if tmp_token.blank?
31
- tmp_token = cookies[GIGYA_COOKIE_PARAM]
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
- if tmp_token.blank?
35
- tmp_token = session[GIGYA_SESSION_PARAM]
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
- @gigya_jwt_info ||= Gigya::Connection.shared_connection.validate_jwt(@gigya_token)
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] = @gigya_token
58
+ cookies[GIGYA_COOKIE_PARAM] = gigya_jwt_token
47
59
  elsif destination == :session
48
- cookies[GIGYA_SESSION_PARAM] = @gigya_token
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.14
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-15 00:00:00.000000000 Z
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.7.6
72
+ rubygems_version: 2.5.2.1
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Gigya API Utility Package