challah 1.6.0 → 1.6.1
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/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/challah/concerns/user/attributeable.rb +7 -1
- data/lib/challah/concerns/user/authenticateable.rb +2 -2
- data/lib/generators/templates/migration.rb +0 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 52c23a580c2dfe4d78653d75a44f1a1f5f0c54b3d62c7091ce0089621e35add4
|
4
|
+
data.tar.gz: 839e41cf3038d7e8319d476268abad5004a8adbbedcf5eba2fbb1119ddef9b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91ad595ae383d6775e533f1cc60053be1221d824ff351b6ea6f24a22eed1e9ea6ff3172f82f6930a7aa522e6e910d0bb3b0e3a86a457a5e5d79368196c86938
|
7
|
+
data.tar.gz: c5b43537d21543b4d9d3eb2aa3791b669c9d91c26050f4211a07c5bf7bea5f5b9f5081e0de239fb8519cef8c61fdba3e9a05bbf18ec2c5a2a3341b86011af93a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## Challah 1.6.1
|
2
|
+
|
3
|
+
* Prevent an email address that is blank from saving the `User#email_hash` attribute
|
4
|
+
* Removes default column for `last_session_ip` that unnecessarily stores user IP addresses by default and could be considered a privacy concern. This column can be manually included in the migration to still track the user IP.
|
5
|
+
|
1
6
|
## Challah 1.6.0
|
2
7
|
|
3
8
|
* For token technique, don't bother checking the database for an empty token query param
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Challah
|
2
2
|
|
3
|
-
[](https://travis-ci.org/jdtornow/challah) [](https://codeclimate.com/github/jdtornow/challah) [](https://travis-ci.org/jdtornow/challah) [](https://codeclimate.com/github/jdtornow/challah) [](https://badge.fury.io/rb/challah)
|
4
4
|
|
5
5
|
Challah (pronounced HAH-lah) is a simple Rails authentication gem that provides users a way to authenticate with your app. Most of the functionality within the gem lives within a Rails engine and tries to stay out of the way of your app.
|
6
6
|
|
@@ -10,7 +10,7 @@ Challah doesn't provide any fancy controllers or views that clutter your app or
|
|
10
10
|
|
11
11
|
* Ruby 2.2.2+
|
12
12
|
* Bundler
|
13
|
-
* Rails 5.0+
|
13
|
+
* Rails 5.0+
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.1
|
@@ -50,7 +50,7 @@ module Challah
|
|
50
50
|
def ensure_email_hash_presence
|
51
51
|
if respond_to?("email_hash=")
|
52
52
|
if email_changed?
|
53
|
-
self.email_hash =
|
53
|
+
self.email_hash = generate_email_hash
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -64,6 +64,12 @@ module Challah
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
def generate_email_hash
|
68
|
+
if self.email.present?
|
69
|
+
Encrypter.md5(email.to_s.downcase.strip)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
67
73
|
# Downcase email and strip if of whitespace
|
68
74
|
# Ex: " HELLO@example.com " => "hello@example.com"
|
69
75
|
def normalize_user_email
|
@@ -35,9 +35,9 @@ module Challah
|
|
35
35
|
# been authenticated.
|
36
36
|
def successful_authentication!(ip_address = nil)
|
37
37
|
self.last_session_at = Time.now
|
38
|
-
self.last_session_ip = ip_address
|
38
|
+
self.last_session_ip = ip_address if respond_to?(:last_session_ip=)
|
39
39
|
self.save
|
40
40
|
self.increment!(:session_count, 1)
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|
@@ -8,7 +8,6 @@ class ChallahCreateUsers < ActiveRecord::Migration<%= migration_version %>
|
|
8
8
|
t.string :persistence_token
|
9
9
|
t.string :api_key
|
10
10
|
t.datetime :last_session_at
|
11
|
-
t.string :last_session_ip
|
12
11
|
t.integer :session_count, default: 0
|
13
12
|
t.integer :failed_auth_count, default: 0
|
14
13
|
t.integer :created_by, default: 0
|
@@ -31,7 +30,6 @@ class ChallahCreateUsers < ActiveRecord::Migration<%= migration_version %>
|
|
31
30
|
t.string :token, limit: 500
|
32
31
|
t.datetime :expires_at
|
33
32
|
t.datetime :last_session_at
|
34
|
-
t.string :last_session_ip
|
35
33
|
t.integer :session_count, default: 0
|
36
34
|
t.timestamps null: true
|
37
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: challah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Tornow
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-08-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|
@@ -116,6 +116,20 @@ dependencies:
|
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '1.3'
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: rspec_junit_formatter
|
121
|
+
requirement: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0.2'
|
126
|
+
type: :development
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0.2'
|
119
133
|
description: A simple gem for authorization and session management in Rails.
|
120
134
|
email:
|
121
135
|
- john@johntornow.com
|
@@ -194,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
208
|
version: 1.8.11
|
195
209
|
requirements: []
|
196
210
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.7.6
|
198
212
|
signing_key:
|
199
213
|
specification_version: 4
|
200
214
|
summary: Rails authentication and sessions
|