fortifier 0.1.4 → 0.2.0

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: b6ed6a9fcd00d6437c0c38ce81f6f96efcbfbf7c
4
- data.tar.gz: f60fd7efc29b5417730fa253689a86ca4b621156
3
+ metadata.gz: 627acec90ae1d790dd438438de615d1ea3dfada8
4
+ data.tar.gz: 84be89b1d08e92ce0d38901526490c6b9925b4e4
5
5
  SHA512:
6
- metadata.gz: 8c1b60d42998963ee270b24a23f984c04cddc7ea73ee339f76b591e8ccc6ca77bc80a53b347effe550a5591dc7cf29dd909ee7880d758aa13512920efca40c84
7
- data.tar.gz: 47f5af0a072b921c33fbd5aba58894d40f17c8a7f4ff3798aadb33baebb92e3827c9267574885d81878904e68114ffd1c3acd5071457ffe162204f497a4b1914
6
+ metadata.gz: d298350e78d00abf9c6370762e8054b2f0f99133ef76ee8e72f53d93ea80bb426d92813de7b63060cd5a48f36106730c7f6387aadb9d4e04ff83b874805070db
7
+ data.tar.gz: 87c21c4ddf36eb364a76f08bed5c7d0efd464ccc161bdc78a228695e16948c94d457d178447ff4bfcfa5e07f84e001d3e0c8c7b646358c5cb5271f97ce2d5b6f
@@ -26,7 +26,7 @@ module Fortifier
26
26
 
27
27
  # NOTE: These custom validations are used so that symbols/codes
28
28
  # can be returned to applications, rather than explicit text.
29
- # Fortifier provides the symbols and the apps are responsible
29
+ # Fortifier provides the symbols and the apps are responsible
30
30
  # for handling error messaging.
31
31
  def login_is_present
32
32
  return if login.present?
@@ -118,9 +118,9 @@ module Fortifier
118
118
  return nil if token.blank?
119
119
  AuthUser.
120
120
  joins(:secrets).
121
- where("find_in_set(? , account_uuids_csv)
121
+ where("find_in_set(? , account_uuids_csv)
122
122
  AND (expired IS NULL OR expired = false)
123
- AND enc_type = '#{Secret::SSO_TOKEN}'
123
+ AND enc_type = '#{Secret::SSO_TOKEN}'
124
124
  AND secret_value = ?", account_uuid, token).
125
125
  first
126
126
  end
@@ -129,9 +129,9 @@ module Fortifier
129
129
  return nil if token.blank?
130
130
  AuthUser.
131
131
  joins(:secrets).
132
- where("find_in_set(? , account_uuids_csv)
132
+ where("find_in_set(? , account_uuids_csv)
133
133
  AND (expired IS NULL OR expired = false)
134
- AND enc_type = '#{Secret::SSO_TOKEN}'
134
+ AND enc_type = '#{Secret::SSO_TOKEN}'
135
135
  AND secret_value = ?", account_uuid, token).
136
136
  first
137
137
  end
@@ -165,12 +165,12 @@ module Fortifier
165
165
 
166
166
  def public_attribute_hash
167
167
  auth_log = self.auth_logs.last
168
- {
169
- uuid: self.uuid,
170
- email: self.email,
171
- login: self.login,
172
- name: self.name,
173
- note: self.note,
168
+ {
169
+ uuid: self.uuid,
170
+ email: self.email,
171
+ login: self.login,
172
+ name: self.name,
173
+ note: self.note,
174
174
  disabled: self.disabled?,
175
175
  last_auth_log: ({user_agent: auth_log.user_agent, status: auth_log.status, created_at: auth_log.created_at.to_time} if auth_log)
176
176
  }
@@ -209,12 +209,12 @@ module Fortifier
209
209
  # joined with their most recent AuthLog,
210
210
  # sort by the AuthLog created_at date (according to user preference),
211
211
  # then paginate with WillPaginate. Capisce?
212
- Fortifier::AuthUser.find_by_sql("SELECT * FROM fortifier_auth_users fau
213
- LEFT OUTER JOIN ( select auth_user_id, max(created_at)
214
- AS last_login_at
215
- FROM fortifier_auth_logs fal
216
- GROUP BY auth_user_id)
217
- AS last_seen
212
+ Fortifier::AuthUser.find_by_sql("SELECT * FROM fortifier_auth_users fau
213
+ LEFT OUTER JOIN ( select auth_user_id, max(created_at)
214
+ AS last_login_at
215
+ FROM fortifier_auth_logs fal
216
+ GROUP BY auth_user_id)
217
+ AS last_seen
218
218
  ON fau.id = last_seen.auth_user_id
219
219
  #{'WHERE ' + aggregate_query}
220
220
  #{'AND ' + user_search_query if user_search_query.present?}
@@ -229,7 +229,7 @@ module Fortifier
229
229
  end
230
230
 
231
231
  private
232
-
232
+
233
233
  def create_unique_uuid
234
234
  self.uuid = loop do
235
235
  uuid = SecureRandom.uuid
@@ -1,5 +1,5 @@
1
1
  module Fortifier
2
- class MaxMind
2
+ class MaxMind
3
3
 
4
4
  def self.valid_ip?(auth_log)
5
5
  return true unless Rails.env=="production"
@@ -47,7 +47,7 @@ module Fortifier
47
47
 
48
48
  def self.local_ip?(ip)
49
49
  ip_regex = /(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1)|(^0:0:0:0:0:0:0:1)$/
50
- return true if ip_regex.match(ip)
50
+ return ip_regex.match(ip).present?
51
51
  end
52
52
 
53
53
  def self.previously_validated_ip?(ip)
@@ -1,3 +1,3 @@
1
1
  module Fortifier
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Koloditch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-17 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 4.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0
26
+ version: 4.1.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: bcrypt
28
+ name: bcrypt-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.7
33
+ version: 3.1.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.7
40
+ version: 3.1.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: attr-csv
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.1.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.1.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: will_paginate
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: foreigner
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.6.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.6.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mysql2
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Different stuff.
@@ -159,17 +159,17 @@ require_paths:
159
159
  - lib
160
160
  required_ruby_version: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - '>='
162
+ - - ">="
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - '>='
167
+ - - ">="
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.3.0
172
+ rubygems_version: 2.2.2
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: It does stuff.