nm-gigya 0.1.23 → 0.1.24

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 +4 -4
  2. data/lib/gigya/controller_utils.rb +21 -1
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8e15740efa701141cdd538da4839d5ce5286c02aaceff82e990022e3578bb10
4
- data.tar.gz: 7495fa6f7cf0cd1f761e410652fb5bb1f69cb6dd48b22787042b7f855ee924e3
3
+ metadata.gz: 54da79569c7861797f22204107d2cc001dbb777df250f622123fcb21edf3310a
4
+ data.tar.gz: 55602a7160d4189029e993d82d9c1bbaeeda100f2ba26c28bc78652801ac5dbb
5
5
  SHA512:
6
- metadata.gz: 128ac6258b41c8b5e8de224a6d98587ce7130e49b010f511e8ff47ec92ce67ebff03c300772db51d9c8b87f531924970b642bf448b4633265ce20cc5c86da681
7
- data.tar.gz: 013ea387ae6850a00a1c255ee3d95f0b72e7d954f84a2a815eb8ba897dc18f7d5beedb35093950798c93e12c12b80269daf97b44586bd8aebf158d120ebe7665
6
+ metadata.gz: ac671574e315d01ce33a9d08c92eff30af86bba8b98a2dd0f90936ac990717107617ef39a858fade4e4b7da13cea2305c1909bba5ca12b167dd0506a4aa9be0d
7
+ data.tar.gz: e7d9027175d69dca62093a65a91b21f494be4be4216db6dc7a3feb4864db36114059ee2b6e23e9b0656afe35d706d62f51c99f7b40de0439fd362395900a71de
@@ -23,10 +23,30 @@ module Gigya
23
23
  @@gigya_refresh_time_decay
24
24
  end
25
25
 
26
+ @@max_logged_tokens = 20
27
+ @@logged_tokens = {}
28
+
29
+ def log_token_error(tok, msg = nil)
30
+ if @@max_logged_tokens > 0
31
+ if @logged_tokens[tok]
32
+ # already logged
33
+ else
34
+ @@logged_tokens[tok] = true
35
+ @@max_logged_tokens = @@max_logged_tokens - 1
36
+ end
37
+ Rails.logger.warn("Token Issue: #{tok}") if tok.present?
38
+ Rails.logger.warn("Token message: #{msg}") if msg.present?
39
+ end
40
+ end
41
+
26
42
  def gigya_user_required
27
43
  begin
28
- render(:json => {:error => "Invalid login"}, :status => 401) if gigya_user_identifier.blank?
44
+ if gigya_user_identifier.blank?
45
+ log_token_error(request.headers["Authorization"])
46
+ render(:json => {:error => "Invalid login"}, :status => 401)
47
+ end
29
48
  rescue
49
+ log_token_error(request.headers["Authorization"], $!.message)
30
50
  render(:json => {:error => "#{$!.message}"}, :status => 401)
31
51
  end
32
52
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nm-gigya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Bartlett
8
8
  - Tyler Jackson
9
9
  - Clark Ritchie
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
  date: 2020-04-22 00:00:00.000000000 Z
@@ -40,7 +40,7 @@ dependencies:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '2.1'
43
- description:
43
+ description:
44
44
  email: jonathan.bartlett@specialized.com
45
45
  executables: []
46
46
  extensions: []
@@ -56,7 +56,7 @@ homepage: http://www.newmedio.com/
56
56
  licenses:
57
57
  - MIT
58
58
  metadata: {}
59
- post_install_message:
59
+ post_install_message:
60
60
  rdoc_options: []
61
61
  require_paths:
62
62
  - lib
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  requirements: []
74
74
  rubygems_version: 3.1.2
75
- signing_key:
75
+ signing_key:
76
76
  specification_version: 4
77
77
  summary: Gigya API Utility Package
78
78
  test_files: []