authlogic 3.7.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,10 +31,14 @@ matrix:
31
31
  gemfile: test/gemfiles/Gemfile.rails-5.0.x
32
32
  - rvm: 1.9.3
33
33
  gemfile: test/gemfiles/Gemfile.rails-5.1.x
34
+ - rvm: 1.9.3
35
+ gemfile: test/gemfiles/Gemfile.rails-5.2.x
34
36
  - rvm: 2.1.10
35
37
  gemfile: test/gemfiles/Gemfile.rails-5.0.x
36
38
  - rvm: 2.1.10
37
39
  gemfile: test/gemfiles/Gemfile.rails-5.1.x
40
+ - rvm: 2.1.10
41
+ gemfile: test/gemfiles/Gemfile.rails-5.2.x
38
42
  - rvm: 2.2.6
39
43
  gemfile: test/gemfiles/Gemfile.rails-3.2.x
40
44
  - rvm: 2.3.3
@@ -1,165 +1,5 @@
1
1
  # Changelog
2
2
 
3
- ## 3.7.0 2018-02-07
3
+ The authlogic changelog is maintained on the master branch only.
4
4
 
5
- * Breaking Changes
6
- * None
7
-
8
- * Added
9
- * Deprecated ActionController::Parameters as arguments to credentials=(), will be removed in 4.0. (https://github.com/binarylogic/authlogic/pull/558)
10
-
11
- * Fixed
12
- * None
13
-
14
- ## 3.6.1 2017-09-30
15
-
16
- * Breaking Changes
17
- * None
18
-
19
- * Added
20
- * None
21
-
22
- * Fixed
23
- * Allow tld up to 24 characters per https://data.iana.org/TLD/tlds-alpha-by-domain.txt
24
- * [#561](https://github.com/binarylogic/authlogic/issues/561)
25
- authenticates_many now works with scope_cookies:true
26
-
27
- ## 3.6.0 2017-04-28
28
-
29
- * Added
30
- * rails 5.1 support
31
-
32
- * Fixed
33
- * ensure that login field validation uses correct locale (@sskirby)
34
-
35
- ## 3.5.0 2016-08-29
36
-
37
- * new
38
- * Rails 5.0 support! Thanks to all reporters and contributors.
39
-
40
- * changes
41
- * increased default minimum password length to 8 (@iainbeeston)
42
- * bind parameters in where statement for rails 5 support
43
- * change callback for rails 5 support
44
- * converts the ActionController::Parameters to a Hash for rails 5 support
45
- * check last_request_at_threshold even if last_request_at_update_allowed returns true (@rofreg)
46
-
47
- ## 3.4.6 2015
48
-
49
- * changes
50
- * add Regex.email_nonascii for validation of emails w/unicode (@rchekaluk)
51
- * allow scrypt 2.x (@jaredbeck)
52
-
53
- ## 3.4.5 2015-03-01
54
-
55
- * changes
56
- * security-hardening fix and cleanup in persistence_token lookup
57
- * security-hardening fix in perishable_token lookup (thx @tomekr)
58
-
59
- ## 3.4.4 2014-12-23
60
-
61
- * changes
62
- * extract rw_config into an Authlogic::Config module
63
- * improved the way config changes are made in tests
64
- * fix for Rails 4.2 by extending ActiveModel
65
-
66
- ## 3.4.3 2014-10-08
67
-
68
- * changes
69
- * backfill CHANGELOG
70
- * better compatibility with jruby (thx @petergoldstein)
71
- * added scrypt as a dependency
72
- * cleanup some code (thx @roryokane)
73
- * reference 'bcrypt' gem instead of 'bcrypt-ruby' (thx @roryokane)
74
- * fixed typo (thx @chamini2)
75
- * fixed magic column validations for Rails 4.2 (thx @tom-kuca)
76
-
77
- ## 3.4.2 2014-04-28
78
-
79
- * changes
80
- * fixed the missing scrypt/bcrypt gem errors introduced in 3.4.1
81
- * implemented autoloading for providers
82
- * added longer subdomain support in email regex
83
-
84
- ## 3.4.1 2014-04-04
85
-
86
- * changes
87
- * undid an accidental revert of some code
88
-
89
- ## 3.4.0 2014-03-03
90
-
91
- * new
92
- * added cookie signing
93
- * added request store for better concurency for threaded environments
94
-
95
- * changes
96
- * BREAKING CHANGE: made scrypt the default crypto provider from SHA512 (https://github.com/binarylogic/authlogic#upgrading-to-authlogic-340)
97
- * ditched appraisal
98
- * officially support rails 4 (still supporting rails 3)
99
- * improved find_with_case default performance
100
- * added a rack adapter for Rack middleware support
101
- * added travis ci support
102
-
103
- ## 3.3.0 2014-04-04
104
-
105
- * changes
106
- * added safeguard against a sqli that was also fixed in rails 3.2.10/3.1.9/3.0.18
107
- * imposed the bcrypt gem's mincost
108
- * removed shoulda macros
109
-
110
- ## 3.2.0 2012-12-07
111
-
112
- * new
113
- * scrypt support
114
-
115
- * changes
116
- * moved back to LOWER for find_with_case ci lookups
117
-
118
- ## 3.1.3 2012-06-13
119
-
120
- * changes
121
- * removed jeweler
122
-
123
- ## 3.1.2 2012-06-01
124
-
125
- * changes
126
- * mostly test fixes
127
-
128
- ## 3.1.1 2012-06-01
129
-
130
- * changes
131
- * mostly doc fixes
132
-
133
- ## 3.1.0 2011-10-19
134
-
135
- * changes
136
- * mostly small bug fixes
137
-
138
- ## 3.0.3 2011-05-17
139
-
140
- * changes
141
- * rails 3.1 support
142
-
143
- * new
144
- * http auth support
145
-
146
- ## 3.0.2 2011-04-30
147
-
148
- * changes
149
- * doc fixes
150
-
151
- ## 3.0.1 2011-04-30
152
-
153
- * changes
154
- * switch from LOWER to LIKE for find_with_case ci lookups
155
-
156
- ## 3.0.0 2011-04-30
157
-
158
- * new
159
- * ssl cookie support
160
- * httponly cookie support
161
- * added a session generator
162
-
163
- * changes
164
- * rails 3 support
165
- * ruby 1.9.2 support
5
+ https://github.com/binarylogic/authlogic/blob/master/CHANGELOG.md
@@ -3,18 +3,17 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "authlogic"
6
- s.version = "3.7.0"
6
+ s.version = "3.8.0"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Ben Johnson"]
9
9
  s.email = ["bjohnson@binarylogic.com"]
10
10
  s.homepage = "http://github.com/binarylogic/authlogic"
11
11
  s.summary = 'A clean, simple, and unobtrusive ruby authentication solution.'
12
- s.description = 'A clean, simple, and unobtrusive ruby authentication solution.'
13
12
 
14
13
  s.license = 'MIT'
15
14
 
16
- s.add_dependency 'activerecord', ['>= 3.2', '< 5.2']
17
- s.add_dependency 'activesupport', ['>= 3.2', '< 5.2']
15
+ s.add_dependency 'activerecord', ['>= 3.2', '< 5.3']
16
+ s.add_dependency 'activesupport', ['>= 3.2', '< 5.3']
18
17
  s.add_dependency 'request_store', '~> 1.0'
19
18
  s.add_dependency 'scrypt', '>= 1.2', '< 4.0'
20
19
  s.add_development_dependency 'bcrypt', '~> 3.1'
@@ -1,3 +1,9 @@
1
+ # Authlogic uses ActiveSupport's core extensions like `strip_heredoc`, which
2
+ # ActiveRecord does not `require`. It's possible that we could save a few
3
+ # milliseconds by loading only the specific core extensions we need, but
4
+ # `all.rb` is simpler. We can revisit this decision if it becomes a problem.
5
+ require "active_support/all"
6
+
1
7
  require "active_record"
2
8
 
3
9
  path = File.dirname(__FILE__) + "/authlogic/"
@@ -38,8 +38,27 @@ module Authlogic
38
38
  private
39
39
 
40
40
  def aes
41
- raise ArgumentError.new("You must provide a key like #{name}.key = my_key before using the #{name}") if @key.blank?
42
- @aes ||= OpenSSL::Cipher::Cipher.new("AES-256-ECB")
41
+ if @key.blank?
42
+ raise ArgumentError.new(
43
+ "You must provide a key like #{name}.key = my_key before using the #{name}"
44
+ )
45
+ end
46
+
47
+ @aes ||= openssl_cipher_class.new("AES-256-ECB")
48
+ end
49
+
50
+ # `::OpenSSL::Cipher::Cipher` has been deprecated since at least 2014,
51
+ # in favor of `::OpenSSL::Cipher`, but a deprecation warning was not
52
+ # printed until 2016
53
+ # (https://github.com/ruby/openssl/commit/5c20a4c014) when openssl
54
+ # became a gem. Its first release as a gem was 2.0.0, in ruby 2.4.
55
+ # (See https://github.com/ruby/ruby/blob/v2_4_0/NEWS)
56
+ def openssl_cipher_class
57
+ if ::Gem::Version.new(::OpenSSL::VERSION) < ::Gem::Version.new("2.0.0")
58
+ ::OpenSSL::Cipher::Cipher
59
+ else
60
+ ::OpenSSL::Cipher
61
+ end
43
62
  end
44
63
  end
45
64
  end
@@ -127,8 +127,40 @@ module Authlogic
127
127
  alias_method :verify_password_method=, :verify_password_method
128
128
  end
129
129
 
130
- # Password related instance methods
130
+ # Password-related instance methods
131
131
  module InstanceMethods
132
+ E_AC_PARAMETERS = <<-STR.strip_heredoc.freeze
133
+ You have passed an ActionController::Parameters to Authlogic 3. That's
134
+ OK for now, but in Authlogic 4, it will raise an error. Please
135
+ replace:
136
+
137
+ UserSession.new(user_session_params)
138
+ UserSession.create(user_session_params)
139
+
140
+ with
141
+
142
+ UserSession.new(user_session_params.to_h)
143
+ UserSession.create(user_session_params.to_h)
144
+
145
+ And don't forget to `permit`!
146
+
147
+ During the transition of rails to Strong Parameters, it has been
148
+ common for Authlogic users to forget to `permit` their params. They
149
+ would pass their params into Authlogic, we'd call `to_h`, and they'd
150
+ be surprised when authentication failed.
151
+
152
+ In 2018, people are still making this mistake. We'd like to help them
153
+ and make authlogic a little simpler at the same time, so in Authlogic
154
+ 3.7.0, we deprecated the use of ActionController::Parameters.
155
+
156
+ We discussed this issue thoroughly between late 2016 and early
157
+ 2018. Notable discussions include:
158
+
159
+ - https://github.com/binarylogic/authlogic/issues/512
160
+ - https://github.com/binarylogic/authlogic/pull/558
161
+ - https://github.com/binarylogic/authlogic/pull/577
162
+ STR
163
+
132
164
  def initialize(*args)
133
165
  if !self.class.configured_password_methods
134
166
  configure_password_methods
@@ -264,25 +296,7 @@ module Authlogic
264
296
  # This method converts the ActionController::Parameters to a Hash
265
297
  def parse_param_val(value)
266
298
  if value.first.class.name == "ActionController::Parameters"
267
- ActiveSupport::Deprecation.warn(
268
- <<-STR.strip_heredoc
269
- You have passed an ActionController::Parameters to Authlogic 3.
270
- That's OK for now, but in Authlogic 4, anything other than a
271
- plain Hash will raise an error. Please replace:
272
-
273
- UserSession.new(user_session_params)
274
- UserSession.create(user_session_params)
275
-
276
- with
277
-
278
- UserSession.new(user_session_params.to_h)
279
- UserSession.create(user_session_params.to_h)
280
-
281
- Why this change? Well, ActionController is not a dependency of
282
- Authlogic. Therefore, Authlogic should not have special code
283
- that knows how to deal with ActionController.
284
- STR
285
- )
299
+ ActiveSupport::Deprecation.warn(E_AC_PARAMETERS)
286
300
  [value.first.to_h]
287
301
  else
288
302
  value.is_a?(Array) ? value : [value]
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ gemspec :path => "./../.."
3
+
4
+ gem "activerecord", "~> 5.2.x"
5
+ gem "activesupport", "~> 5.2.x"
6
+ gem 'sqlite3', :platforms => :ruby
@@ -114,7 +114,11 @@ require_relative 'libs/user'
114
114
  require_relative 'libs/user_session'
115
115
  require_relative 'libs/company'
116
116
 
117
- Authlogic::CryptoProviders::AES256.key = "myafdsfddddddddddddddddddddddddddddddddddddddddddddddd"
117
+ # Recent change, 2017-10-23: We had used a 54-letter string here. In the default
118
+ # encoding, UTF-8, that's 54 bytes, which is clearly incorrect for an algorithm
119
+ # with a 256-bit key, but I guess it worked. With the release of ruby 2.4 (and
120
+ # thus openssl gem 2.0), it is more strict, and must be exactly 32 bytes.
121
+ Authlogic::CryptoProviders::AES256.key = ::OpenSSL::Random.random_bytes(32)
118
122
 
119
123
  class ActiveSupport::TestCase
120
124
  include ActiveRecord::TestFixtures
metadata CHANGED
@@ -1,143 +1,158 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authlogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.8.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Ben Johnson
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2018-02-07 00:00:00.000000000 Z
12
+ date: 2018-02-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activerecord
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ">="
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '3.2'
20
- - - "<"
22
+ - - <
21
23
  - !ruby/object:Gem::Version
22
- version: '5.2'
24
+ version: '5.3'
23
25
  type: :runtime
24
26
  prerelease: false
25
27
  version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
26
29
  requirements:
27
- - - ">="
30
+ - - ! '>='
28
31
  - !ruby/object:Gem::Version
29
32
  version: '3.2'
30
- - - "<"
33
+ - - <
31
34
  - !ruby/object:Gem::Version
32
- version: '5.2'
35
+ version: '5.3'
33
36
  - !ruby/object:Gem::Dependency
34
37
  name: activesupport
35
38
  requirement: !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
- - - ">="
41
+ - - ! '>='
38
42
  - !ruby/object:Gem::Version
39
43
  version: '3.2'
40
- - - "<"
44
+ - - <
41
45
  - !ruby/object:Gem::Version
42
- version: '5.2'
46
+ version: '5.3'
43
47
  type: :runtime
44
48
  prerelease: false
45
49
  version_requirements: !ruby/object:Gem::Requirement
50
+ none: false
46
51
  requirements:
47
- - - ">="
52
+ - - ! '>='
48
53
  - !ruby/object:Gem::Version
49
54
  version: '3.2'
50
- - - "<"
55
+ - - <
51
56
  - !ruby/object:Gem::Version
52
- version: '5.2'
57
+ version: '5.3'
53
58
  - !ruby/object:Gem::Dependency
54
59
  name: request_store
55
60
  requirement: !ruby/object:Gem::Requirement
61
+ none: false
56
62
  requirements:
57
- - - "~>"
63
+ - - ~>
58
64
  - !ruby/object:Gem::Version
59
65
  version: '1.0'
60
66
  type: :runtime
61
67
  prerelease: false
62
68
  version_requirements: !ruby/object:Gem::Requirement
69
+ none: false
63
70
  requirements:
64
- - - "~>"
71
+ - - ~>
65
72
  - !ruby/object:Gem::Version
66
73
  version: '1.0'
67
74
  - !ruby/object:Gem::Dependency
68
75
  name: scrypt
69
76
  requirement: !ruby/object:Gem::Requirement
77
+ none: false
70
78
  requirements:
71
- - - ">="
79
+ - - ! '>='
72
80
  - !ruby/object:Gem::Version
73
81
  version: '1.2'
74
- - - "<"
82
+ - - <
75
83
  - !ruby/object:Gem::Version
76
84
  version: '4.0'
77
85
  type: :runtime
78
86
  prerelease: false
79
87
  version_requirements: !ruby/object:Gem::Requirement
88
+ none: false
80
89
  requirements:
81
- - - ">="
90
+ - - ! '>='
82
91
  - !ruby/object:Gem::Version
83
92
  version: '1.2'
84
- - - "<"
93
+ - - <
85
94
  - !ruby/object:Gem::Version
86
95
  version: '4.0'
87
96
  - !ruby/object:Gem::Dependency
88
97
  name: bcrypt
89
98
  requirement: !ruby/object:Gem::Requirement
99
+ none: false
90
100
  requirements:
91
- - - "~>"
101
+ - - ~>
92
102
  - !ruby/object:Gem::Version
93
103
  version: '3.1'
94
104
  type: :development
95
105
  prerelease: false
96
106
  version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
97
108
  requirements:
98
- - - "~>"
109
+ - - ~>
99
110
  - !ruby/object:Gem::Version
100
111
  version: '3.1'
101
112
  - !ruby/object:Gem::Dependency
102
113
  name: timecop
103
114
  requirement: !ruby/object:Gem::Requirement
115
+ none: false
104
116
  requirements:
105
- - - "~>"
117
+ - - ~>
106
118
  - !ruby/object:Gem::Version
107
119
  version: '0.7'
108
120
  type: :development
109
121
  prerelease: false
110
122
  version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
111
124
  requirements:
112
- - - "~>"
125
+ - - ~>
113
126
  - !ruby/object:Gem::Version
114
127
  version: '0.7'
115
128
  - !ruby/object:Gem::Dependency
116
129
  name: rubocop
117
130
  requirement: !ruby/object:Gem::Requirement
131
+ none: false
118
132
  requirements:
119
- - - "~>"
133
+ - - ~>
120
134
  - !ruby/object:Gem::Version
121
135
  version: 0.41.2
122
136
  type: :development
123
137
  prerelease: false
124
138
  version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
125
140
  requirements:
126
- - - "~>"
141
+ - - ~>
127
142
  - !ruby/object:Gem::Version
128
143
  version: 0.41.2
129
- description: A clean, simple, and unobtrusive ruby authentication solution.
144
+ description:
130
145
  email:
131
146
  - bjohnson@binarylogic.com
132
147
  executables: []
133
148
  extensions: []
134
149
  extra_rdoc_files: []
135
150
  files:
136
- - ".github/ISSUE_TEMPLATE.md"
137
- - ".gitignore"
138
- - ".rubocop.yml"
139
- - ".rubocop_todo.yml"
140
- - ".travis.yml"
151
+ - .github/ISSUE_TEMPLATE.md
152
+ - .gitignore
153
+ - .rubocop.yml
154
+ - .rubocop_todo.yml
155
+ - .travis.yml
141
156
  - CHANGELOG.md
142
157
  - CONTRIBUTING.md
143
158
  - Gemfile
@@ -236,6 +251,7 @@ files:
236
251
  - test/gemfiles/Gemfile.rails-4.2.x
237
252
  - test/gemfiles/Gemfile.rails-5.0.x
238
253
  - test/gemfiles/Gemfile.rails-5.1.x
254
+ - test/gemfiles/Gemfile.rails-5.2.x
239
255
  - test/i18n/lol.yml
240
256
  - test/i18n_test.rb
241
257
  - test/libs/affiliate.rb
@@ -273,26 +289,27 @@ files:
273
289
  homepage: http://github.com/binarylogic/authlogic
274
290
  licenses:
275
291
  - MIT
276
- metadata: {}
277
292
  post_install_message:
278
293
  rdoc_options: []
279
294
  require_paths:
280
295
  - lib
281
296
  required_ruby_version: !ruby/object:Gem::Requirement
297
+ none: false
282
298
  requirements:
283
- - - ">="
299
+ - - ! '>='
284
300
  - !ruby/object:Gem::Version
285
301
  version: '0'
286
302
  required_rubygems_version: !ruby/object:Gem::Requirement
303
+ none: false
287
304
  requirements:
288
- - - ">="
305
+ - - ! '>='
289
306
  - !ruby/object:Gem::Version
290
307
  version: '0'
291
308
  requirements: []
292
309
  rubyforge_project:
293
- rubygems_version: 2.4.5.1
310
+ rubygems_version: 1.8.23.2
294
311
  signing_key:
295
- specification_version: 4
312
+ specification_version: 3
296
313
  summary: A clean, simple, and unobtrusive ruby authentication solution.
297
314
  test_files:
298
315
  - test/acts_as_authentic_test/base_test.rb
@@ -324,6 +341,7 @@ test_files:
324
341
  - test/gemfiles/Gemfile.rails-4.2.x
325
342
  - test/gemfiles/Gemfile.rails-5.0.x
326
343
  - test/gemfiles/Gemfile.rails-5.1.x
344
+ - test/gemfiles/Gemfile.rails-5.2.x
327
345
  - test/i18n/lol.yml
328
346
  - test/i18n_test.rb
329
347
  - test/libs/affiliate.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 8dadada58ca458ceab9c98ba5f65e2101537cf98
4
- data.tar.gz: f4f3ddeba32aedb4270aacfafb209c7ae5a9c1f9
5
- SHA512:
6
- metadata.gz: 0cfb2248649b20f491f9c76ef75963f54903091d2e7c2407baa4489450d1f3785a73a060aa94e3559cb06b3cc49536c0641eb4b8ebabb4aca048493286a617c6
7
- data.tar.gz: 9d2cbf631385ecc85a887bf23676acbeeac2f7c65336ea9290c23de60a3bd0aaaab284281f6e5a439f287ea871180eb67bea29bc7a4e8cf996293decf852b634