authlogic 4.3.0 → 4.4.0
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 +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +2 -1
- data/lib/authlogic/acts_as_authentic/email.rb +7 -0
- data/lib/authlogic/acts_as_authentic/login.rb +7 -0
- data/lib/authlogic/acts_as_authentic/password.rb +17 -0
- data/lib/authlogic/acts_as_authentic/validations_scope.rb +1 -0
- data/lib/authlogic/authenticates_many/base.rb +8 -0
- data/lib/authlogic/config.rb +16 -0
- data/lib/authlogic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aff376d83dfc9c82fc0da8cf663c0da3a57d3773
|
4
|
+
data.tar.gz: c010cbc52a5c7311e82a24f5c8200be9e13ddc7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c98cc836da6a832ae6511026123eb5d6704176da7eaecaa8edb5dd04665c45ac2e671bbda68c7be7978f1dada2b97a95c74ffd7a1759bbe234a69533c210d8
|
7
|
+
data.tar.gz: efd33a8b26b53d23f9709e5b00d89faec6d7003b5cd65a21162622282b98b2c8cfd632e5ab4172a11e1bebcd3643f5d1ad3584bf3fb9c112c6023784d327d01c
|
data/CHANGELOG.md
CHANGED
@@ -16,6 +16,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
16
16
|
* Fixed
|
17
17
|
* None
|
18
18
|
|
19
|
+
## 4.4.0 (2018-09-21)
|
20
|
+
|
21
|
+
* Breaking Changes
|
22
|
+
* None
|
23
|
+
* Added
|
24
|
+
* None
|
25
|
+
* Fixed
|
26
|
+
* None
|
27
|
+
* Deprecation
|
28
|
+
* [#627](https://github.com/binarylogic/authlogic/pull/627) -
|
29
|
+
Deprecate `authenticates_many` without replacement
|
30
|
+
* [#623](https://github.com/binarylogic/authlogic/pull/623) -
|
31
|
+
Deprecate unnecessary validation features, use normal rails validation
|
32
|
+
instead
|
33
|
+
|
19
34
|
## 4.3.0 (2018-08-12)
|
20
35
|
|
21
36
|
* Breaking Changes
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ A clean, simple, and unobtrusive ruby authentication solution.
|
|
15
15
|
| Version | Documentation |
|
16
16
|
| ----------- | ------------- |
|
17
17
|
| Unreleased | https://github.com/binarylogic/authlogic/blob/master/README.md |
|
18
|
-
| 4.
|
18
|
+
| 4.4.0 | https://github.com/binarylogic/authlogic/blob/v4.4.0/README.md |
|
19
19
|
| 3.7.0 | https://github.com/binarylogic/authlogic/blob/v3.7.0/README.md |
|
20
20
|
| 2.1.11 | https://github.com/binarylogic/authlogic/blob/v2.1.11/README.rdoc |
|
21
21
|
| 1.4.3 | https://github.com/binarylogic/authlogic/blob/v1.4.3/README.rdoc |
|
@@ -42,6 +42,7 @@ A clean, simple, and unobtrusive ruby authentication solution.
|
|
42
42
|
|
43
43
|
| Version | branch | ruby | activerecord |
|
44
44
|
| ------- | ------------ | -------- | ------------- |
|
45
|
+
| 4.4 | 4-4-stable | >= 2.3.0 | >= 4.2, < 5.3 |
|
45
46
|
| 4.3 | 4-3-stable | >= 2.3.0 | >= 4.2, < 5.3 |
|
46
47
|
| 4.2 | 4-2-stable | >= 2.2.0 | >= 4.2, < 5.3 |
|
47
48
|
| 3 | 3-stable | >= 1.9.3 | >= 3.2, < 5.2 |
|
@@ -29,6 +29,7 @@ module Authlogic
|
|
29
29
|
# * <tt>Default:</tt> true
|
30
30
|
# * <tt>Accepts:</tt> Boolean
|
31
31
|
def validate_email_field(value = nil)
|
32
|
+
deprecate_authlogic_config("validate_email_field")
|
32
33
|
rw_config(:validate_email_field, value, true)
|
33
34
|
end
|
34
35
|
alias_method :validate_email_field=, :validate_email_field
|
@@ -44,6 +45,7 @@ module Authlogic
|
|
44
45
|
# * <tt>Default:</tt> {:maximum => 100}
|
45
46
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_length_of
|
46
47
|
def validates_length_of_email_field_options(value = nil)
|
48
|
+
deprecate_authlogic_config("validates_length_of_email_field_options")
|
47
49
|
rw_config(:validates_length_of_email_field_options, value, maximum: 100)
|
48
50
|
end
|
49
51
|
alias_method(
|
@@ -61,6 +63,7 @@ module Authlogic
|
|
61
63
|
#
|
62
64
|
# merge_validates_length_of_email_field_options :my_option => my_value
|
63
65
|
def merge_validates_length_of_email_field_options(options = {})
|
66
|
+
deprecate_authlogic_config("merge_validates_length_of_email_field_options")
|
64
67
|
self.validates_length_of_email_field_options =
|
65
68
|
validates_length_of_email_field_options.merge(options)
|
66
69
|
end
|
@@ -96,6 +99,7 @@ module Authlogic
|
|
96
99
|
#
|
97
100
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_format_of
|
98
101
|
def validates_format_of_email_field_options(value = nil)
|
102
|
+
deprecate_authlogic_config("validates_format_of_email_field_options")
|
99
103
|
rw_config(
|
100
104
|
:validates_format_of_email_field_options,
|
101
105
|
value,
|
@@ -116,6 +120,7 @@ module Authlogic
|
|
116
120
|
# See merge_validates_length_of_email_field_options. The same thing
|
117
121
|
# except for validates_format_of_email_field_options.
|
118
122
|
def merge_validates_format_of_email_field_options(options = {})
|
123
|
+
deprecate_authlogic_config("merge_validates_format_of_email_field_options")
|
119
124
|
self.validates_format_of_email_field_options =
|
120
125
|
validates_format_of_email_field_options.merge(options)
|
121
126
|
end
|
@@ -139,6 +144,7 @@ module Authlogic
|
|
139
144
|
#
|
140
145
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_uniqueness_of
|
141
146
|
def validates_uniqueness_of_email_field_options(value = nil)
|
147
|
+
deprecate_authlogic_config("validates_uniqueness_of_email_field_options")
|
142
148
|
rw_config(
|
143
149
|
:validates_uniqueness_of_email_field_options,
|
144
150
|
value,
|
@@ -155,6 +161,7 @@ module Authlogic
|
|
155
161
|
# See merge_validates_length_of_email_field_options. The same thing
|
156
162
|
# except for validates_uniqueness_of_email_field_options.
|
157
163
|
def merge_validates_uniqueness_of_email_field_options(options = {})
|
164
|
+
deprecate_authlogic_config("merge_validates_uniqueness_of_email_field_options")
|
158
165
|
self.validates_uniqueness_of_email_field_options =
|
159
166
|
validates_uniqueness_of_email_field_options.merge(options)
|
160
167
|
end
|
@@ -27,6 +27,7 @@ module Authlogic
|
|
27
27
|
# * <tt>Default:</tt> true
|
28
28
|
# * <tt>Accepts:</tt> Boolean
|
29
29
|
def validate_login_field(value = nil)
|
30
|
+
deprecate_authlogic_config("validate_login_field")
|
30
31
|
rw_config(:validate_login_field, value, true)
|
31
32
|
end
|
32
33
|
alias_method :validate_login_field=, :validate_login_field
|
@@ -42,6 +43,7 @@ module Authlogic
|
|
42
43
|
# * <tt>Default:</tt> {:within => 3..100}
|
43
44
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_length_of
|
44
45
|
def validates_length_of_login_field_options(value = nil)
|
46
|
+
deprecate_authlogic_config("validates_length_of_login_field_options")
|
45
47
|
rw_config(:validates_length_of_login_field_options, value, within: 3..100)
|
46
48
|
end
|
47
49
|
alias_method(
|
@@ -59,6 +61,7 @@ module Authlogic
|
|
59
61
|
#
|
60
62
|
# merge_validates_length_of_login_field_options :my_option => my_value
|
61
63
|
def merge_validates_length_of_login_field_options(options = {})
|
64
|
+
deprecate_authlogic_config("merge_validates_length_of_login_field_options")
|
62
65
|
self.validates_length_of_login_field_options =
|
63
66
|
validates_length_of_login_field_options.merge(options)
|
64
67
|
end
|
@@ -85,6 +88,7 @@ module Authlogic
|
|
85
88
|
#
|
86
89
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_format_of
|
87
90
|
def validates_format_of_login_field_options(value = nil)
|
91
|
+
deprecate_authlogic_config("validates_format_of_login_field_options")
|
88
92
|
rw_config(
|
89
93
|
:validates_format_of_login_field_options,
|
90
94
|
value,
|
@@ -105,6 +109,7 @@ module Authlogic
|
|
105
109
|
# See merge_validates_length_of_login_field_options. The same thing,
|
106
110
|
# except for validates_format_of_login_field_options
|
107
111
|
def merge_validates_format_of_login_field_options(options = {})
|
112
|
+
deprecate_authlogic_config("merge_validates_format_of_login_field_options")
|
108
113
|
self.validates_format_of_login_field_options =
|
109
114
|
validates_format_of_login_field_options.merge(options)
|
110
115
|
end
|
@@ -127,6 +132,7 @@ module Authlogic
|
|
127
132
|
#
|
128
133
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_uniqueness_of
|
129
134
|
def validates_uniqueness_of_login_field_options(value = nil)
|
135
|
+
deprecate_authlogic_config("validates_uniqueness_of_login_field_options")
|
130
136
|
rw_config(
|
131
137
|
:validates_uniqueness_of_login_field_options,
|
132
138
|
value,
|
@@ -143,6 +149,7 @@ module Authlogic
|
|
143
149
|
# See merge_validates_length_of_login_field_options. The same thing,
|
144
150
|
# except for validates_uniqueness_of_login_field_options
|
145
151
|
def merge_validates_uniqueness_of_login_field_options(options = {})
|
152
|
+
deprecate_authlogic_config("merge_validates_uniqueness_of_login_field_options")
|
146
153
|
self.validates_uniqueness_of_login_field_options =
|
147
154
|
validates_uniqueness_of_login_field_options.merge(options)
|
148
155
|
end
|
@@ -98,6 +98,7 @@ module Authlogic
|
|
98
98
|
# * <tt>Default:</tt> true
|
99
99
|
# * <tt>Accepts:</tt> Boolean
|
100
100
|
def validate_password_field(value = nil)
|
101
|
+
deprecate_authlogic_config("validate_password_field")
|
101
102
|
rw_config(:validate_password_field, value, true)
|
102
103
|
end
|
103
104
|
alias_method :validate_password_field=, :validate_password_field
|
@@ -113,6 +114,7 @@ module Authlogic
|
|
113
114
|
# * <tt>Default:</tt> {:minimum => 8, :if => :require_password?}
|
114
115
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_length_of
|
115
116
|
def validates_length_of_password_field_options(value = nil)
|
117
|
+
deprecate_authlogic_config("validates_length_of_password_field_options")
|
116
118
|
rw_config(
|
117
119
|
:validates_length_of_password_field_options,
|
118
120
|
value,
|
@@ -135,6 +137,9 @@ module Authlogic
|
|
135
137
|
#
|
136
138
|
# merge_validates_length_of_password_field_options :my_option => my_value
|
137
139
|
def merge_validates_length_of_password_field_options(options = {})
|
140
|
+
deprecate_authlogic_config(
|
141
|
+
"merge_validates_length_of_password_field_options"
|
142
|
+
)
|
138
143
|
self.validates_length_of_password_field_options =
|
139
144
|
validates_length_of_password_field_options.merge(options)
|
140
145
|
end
|
@@ -150,6 +155,9 @@ module Authlogic
|
|
150
155
|
# * <tt>Default:</tt> {:if => :require_password?}
|
151
156
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_confirmation_of
|
152
157
|
def validates_confirmation_of_password_field_options(value = nil)
|
158
|
+
deprecate_authlogic_config(
|
159
|
+
"validates_confirmation_of_password_field_options"
|
160
|
+
)
|
153
161
|
rw_config(
|
154
162
|
:validates_confirmation_of_password_field_options,
|
155
163
|
value,
|
@@ -162,6 +170,9 @@ module Authlogic
|
|
162
170
|
# See merge_validates_length_of_password_field_options. The same thing, except for
|
163
171
|
# validates_confirmation_of_password_field_options
|
164
172
|
def merge_validates_confirmation_of_password_field_options(options = {})
|
173
|
+
deprecate_authlogic_config(
|
174
|
+
"merge_validates_confirmation_of_password_field_options"
|
175
|
+
)
|
165
176
|
self.validates_confirmation_of_password_field_options =
|
166
177
|
validates_confirmation_of_password_field_options.merge(options)
|
167
178
|
end
|
@@ -177,6 +188,9 @@ module Authlogic
|
|
177
188
|
# * <tt>Default:</tt> validates_length_of_password_field_options
|
178
189
|
# * <tt>Accepts:</tt> Hash of options accepted by validates_length_of
|
179
190
|
def validates_length_of_password_confirmation_field_options(value = nil)
|
191
|
+
deprecate_authlogic_config(
|
192
|
+
"validates_length_of_password_confirmation_field_options"
|
193
|
+
)
|
180
194
|
rw_config(
|
181
195
|
:validates_length_of_password_confirmation_field_options,
|
182
196
|
value,
|
@@ -191,6 +205,9 @@ module Authlogic
|
|
191
205
|
# See merge_validates_length_of_password_field_options. The same thing, except for
|
192
206
|
# validates_length_of_password_confirmation_field_options
|
193
207
|
def merge_validates_length_of_password_confirmation_field_options(options = {})
|
208
|
+
deprecate_authlogic_config(
|
209
|
+
"merge_validates_length_of_password_confirmation_field_options"
|
210
|
+
)
|
194
211
|
self.validates_length_of_password_confirmation_field_options =
|
195
212
|
validates_length_of_password_confirmation_field_options.merge(options)
|
196
213
|
end
|
@@ -23,6 +23,7 @@ module Authlogic
|
|
23
23
|
# * <tt>Default:</tt> nil
|
24
24
|
# * <tt>Accepts:</tt> Symbol or Array of symbols
|
25
25
|
def validations_scope(value = nil)
|
26
|
+
deprecate_authlogic_config("validations_scope")
|
26
27
|
rw_config(:validations_scope, value)
|
27
28
|
end
|
28
29
|
alias_method :validations_scope=, :validations_scope
|
@@ -19,6 +19,13 @@ module Authlogic
|
|
19
19
|
module AuthenticatesMany
|
20
20
|
# These methods become class methods of ::ActiveRecord::Base.
|
21
21
|
module Base
|
22
|
+
DPR_AUTH_MANY = <<~EOS.freeze
|
23
|
+
authenticates_many is deprecated without replacement. Let us know
|
24
|
+
if you would like to take over maintenance of this feature as a separate
|
25
|
+
gem. If no one volunteers to extract and maintain a new gem, then this
|
26
|
+
feature will simply be deleted.
|
27
|
+
EOS
|
28
|
+
|
22
29
|
# Allows you to set up a relationship with your sessions. See module
|
23
30
|
# definition above for more details.
|
24
31
|
#
|
@@ -53,6 +60,7 @@ module Authlogic
|
|
53
60
|
# `scope_cookies` is misleading. Perhaps simply `scope` or `scoped`
|
54
61
|
# would have been better.
|
55
62
|
def authenticates_many(name, options = {})
|
63
|
+
::ActiveSupport::Deprecation.warn(DPR_AUTH_MANY)
|
56
64
|
options[:session_class] ||= name.to_s.classify.constantize
|
57
65
|
options[:relationship_name] ||= options[:session_class].klass_name.underscore.pluralize
|
58
66
|
class_eval <<-EOS, __FILE__, __LINE__ + 1
|
data/lib/authlogic/config.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
module Authlogic
|
2
2
|
module Config
|
3
|
+
E_USE_NORMAL_RAILS_VALIDATION = <<~EOS.freeze
|
4
|
+
This Authlogic configuration option (%s) is deprecated. Use normal
|
5
|
+
ActiveRecord validations instead. For example, instead of the Authlogic
|
6
|
+
method validates_length_of_email_field_options, you can use
|
7
|
+
|
8
|
+
validates :email, length: { ... }
|
9
|
+
|
10
|
+
These deprecated Authlogic methods will be removed in the next major version.
|
11
|
+
EOS
|
12
|
+
|
3
13
|
def self.extended(klass)
|
4
14
|
klass.class_eval do
|
5
15
|
class_attribute :acts_as_authentic_config
|
@@ -9,6 +19,12 @@ module Authlogic
|
|
9
19
|
|
10
20
|
private
|
11
21
|
|
22
|
+
def deprecate_authlogic_config(method_name)
|
23
|
+
::ActiveSupport::Deprecation.warn(
|
24
|
+
format(E_USE_NORMAL_RAILS_VALIDATION, method_name)
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
12
28
|
# This is a one-liner method to write a config setting, read the config
|
13
29
|
# setting, and also set a default value for the setting.
|
14
30
|
def rw_config(key, value, default_value = nil)
|
data/lib/authlogic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-09-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|