devise-secure_password 2.1.0 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2e80099b8c322cd261f7a0fbd90084067f7dddfdd54f3dae8fcddb5332f8699
4
- data.tar.gz: d2d48b58dc422ff894eec4d13628059fb41dcbbd80adc7e7a3a5062c7bb78ae3
3
+ metadata.gz: 6b497afcb9228f9d31d65d09e83e1b59f0ad3a0babb2d52fb12daf44d9ea0691
4
+ data.tar.gz: f404ea921f3638b33a9f5df2ec0970d8b8729922dce7038997bca8308a1e9a46
5
5
  SHA512:
6
- metadata.gz: c4bd7731fedbef2c0fcc378e7b99a1f062b219158d111474d9610b66ae65f57810f4919fe2041b9834afde0aa80b81ffeff449d83c29d4790c1dbcc686e659f3
7
- data.tar.gz: ba5e45d193293c1e3e76899fea8b1689772bf8cfd19f54f5a61659f1a4e2868df7cca5e297de504dc73809bb99000b6217fcfe60c477281c77aa22621fba06d1
6
+ metadata.gz: 688fc04a757c27c38a4ad6c2ac720e207eef54fc8fc07e1ca9671010a074174fe2b93f578d8fbd00d7658c798d2506fdacb84e52b8b0a77b6697951aee1c55b9
7
+ data.tar.gz: 496f831d18bca6195c7bb76870f8495bc9f6441a3dae2ca0947e71a3394ca25569c31cc9b558f39fdf3352c41944451185e2997e54c1d8f7829425d0a53ea5e3
data/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog: devise-secure_password
2
2
 
3
+ ## 2.2.0 / 2025-08-19
4
+ * Adds support to Rails 8.0 and ruby 3.4
5
+ * Drop support Rails 6.1 and ruby 3.1
6
+
3
7
  ## 2.1.0 / 2024-06-02
4
8
 
5
9
  * Various CircleCI updates.
data/README.md CHANGED
@@ -26,28 +26,28 @@ The goal of this project is to provide compatibility for officially supported st
26
26
  and [Ruby on Rails](http://guides.rubyonrails.org/maintenance_policy.html). More specifically, the following releases
27
27
  are currently supported by the __Devise Secure Password Extension__:
28
28
 
29
- - Ruby on Rails: __6.1.x__, __7.0.x__
30
- - Ruby: __3.1.x__, __3.2.x__, __3.3.x__
29
+ - Ruby on Rails: __7.0.x__, __8.0.x__
30
+ - Ruby: __3.2.x__, __3.3.x__, __3.4.x__
31
31
 
32
32
  ### Updating to a New Rails Version
33
33
 
34
34
  This gem uses so-called "dummy" apps in the specs to verify compatibility with a major/minor version of Rails. Adding a new major/minor version of Rails requires us to add a new "dummy" app in the spec folder, and a corresponding Gemfile in the gemfiles directory. While manual, this process is relatively straightforward:
35
35
 
36
- 1. Create a new Rails app in the directory `spec/rails_<major>_<minor>` by using the Rails generator for that version, ensuring you skip Git setup. (e.g. `cd spec; rails _6.0.3.6_ new rails-app-6_0 --skip-git`)
37
- 2. Move the Gemfile from the newly created app to the `gemfiles` directory and rename it with the major/minor version (e.g. `mv spec/rails_6_1/Gemfile gemfiles/rails_6_1.gemfile`)
36
+ 1. Create a new Rails app in the directory `spec/rails_<major>_<minor>` by using the Rails generator for that version, ensuring you skip Git setup. (e.g. `cd spec; rails _7.2.2.2_ new rails-app-7_0 --skip-git`)
37
+ 2. Move the Gemfile from the newly created app to the `gemfiles` directory and rename it with the major/minor version (e.g. `mv spec/rails_7_0/Gemfile gemfiles/rails_7_0.gemfile`)
38
38
  3. Update the Gemfile to include the Rails target and gemspec immediately beneath the source declarations, like this:
39
39
 
40
40
  ```ruby
41
41
  source 'https://rubygems.org'
42
42
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
43
43
 
44
- ENV['RAILS_TARGET'] ||= '6.1'
44
+ ENV['RAILS_TARGET'] ||= '7.0'
45
45
 
46
46
  gemspec path: '../'
47
47
  ```
48
48
 
49
49
  4. Add `gem 'shoulda-matchers'` under the test group in the new Gemfile
50
- 5. Ensure you can bundle by running `bundle` with the `BUNDLE_GEMFILE` variable set to the new Gemfile (i.e. `BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle`). This should run successfully - fix as needed.
50
+ 5. Ensure you can bundle by running `bundle` with the `BUNDLE_GEMFILE` variable set to the new Gemfile (i.e. `BUNDLE_GEMFILE=gemfiles/rails_7_0.gemfile bundle`). This should run successfully - fix as needed.
51
51
  6. Copy the file `config/initializers/devise.rb` from an existing "dummy" app to the same location in the new app.
52
52
  7. Copy the file `config/routes.rb` from an existing "dummy" app to the same location in the new app.
53
53
  8. Copy the contents of the `db/migrate` directory from an existing "dummy" app to the same location in the new app. Copy the `db/schema.rb` and `db/test.sqlite3` as well
@@ -56,7 +56,7 @@ gemspec path: '../'
56
56
  11. Copy the `app/views/static_pages` directory from an existing "dummy" app to the same location in the new app.
57
57
  12. Update the `app/views/layouts/application.html.erb` in the new app to have the same `<body>` content and `<title>` as the same file in an existing "dummy" app.
58
58
  13. At this point you should be able to run specs. (i.e. `BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake`). Run specs and fix version specific issues, taking care to maintain backwards compatibility with supported versions.
59
- 14. You should also run Rubocop (i.e. `BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rubocop`) and fix whatever issues are reported (again, maintaining backwards compatibility)
59
+ 14. You should also run Rubocop (i.e. `BUNDLE_GEMFILE=gemfiles/rails_7_0.gemfile bundle exec rubocop`) and fix whatever issues are reported (again, maintaining backwards compatibility)
60
60
  15. In the `.circleci/config.yml` file update the `current_rails_gemfile` and `previous_rails_gemfile` to reference the new version and the previous version of Rails to be supported
61
61
  16. Delete any files for old Rails versions that are no longer supported - "dummy" apps and the corresponding `gemfiles` Gemfile.
62
62
  17. Update the Circle CI badge label in this README to reflect the newly supported Rails version.
@@ -183,7 +183,7 @@ Edit the resulting file to disallow null values for the hash,add indexes for bot
183
183
  add the timestamp (created_at, updated_at) fields:
184
184
 
185
185
  ```ruby
186
- class CreatePreviousPasswords < ActiveRecord::Migration[5.1]
186
+ class CreatePreviousPasswords < ActiveRecord::Migration[7.0]
187
187
  def change
188
188
  create_table :previous_passwords do |t|
189
189
  t.string :salt, null: false
@@ -255,7 +255,7 @@ To determine the Ruby on Rails versions supported by this release, run the follo
255
255
  prompt> gem install flay ruby2ruby rubocop rspec
256
256
  prompt> rake test:spec:targets
257
257
 
258
- Available Rails targets: 7.0, 6.1
258
+ Available Rails targets: 7.0, 8.0
259
259
  ```
260
260
 
261
261
  Reconfigure the project by specifying the correct Gemfile when running bundler, followed by running tests:
@@ -63,7 +63,7 @@ module Devise
63
63
 
64
64
  # do what devise would do under normal circumstances but also be aware of
65
65
  # secure_password or other validators that would be ignored by devise.
66
- result = if resource.errors.count.zero?
66
+ result = if resource.errors.none?
67
67
  resource.update(params)
68
68
  else
69
69
  false
@@ -32,8 +32,8 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
33
33
  spec.require_paths = ['lib']
34
34
 
35
- spec.add_runtime_dependency 'devise', '>= 4.0.0', '< 5.0.0'
36
- spec.add_runtime_dependency 'railties', '>= 5.0.0', '< 8.0.0'
35
+ spec.add_dependency 'devise', '>= 4.0.0', '< 5.0.0'
36
+ spec.add_dependency 'railties', '>= 5.0.0', '< 9.0.0'
37
37
 
38
38
  spec.add_development_dependency 'bundler', '>= 2.2.14'
39
39
  spec.add_development_dependency 'capybara', '>= 3.35.3'
@@ -42,7 +42,7 @@ Gem::Specification.new do |spec|
42
42
  spec.add_development_dependency 'devise', '~> 4.0'
43
43
  spec.add_development_dependency 'flay', '>= 2.10.0'
44
44
  spec.add_development_dependency 'launchy', '>= 2.4.3'
45
- spec.add_development_dependency 'rails', '>= 6.1.0'
45
+ spec.add_development_dependency 'rails', '>= 7.0'
46
46
  spec.add_development_dependency 'rake', '>= 12.3'
47
47
  spec.add_development_dependency 'rspec', '>= 3.7'
48
48
  spec.add_development_dependency 'rspec_junit_formatter', '>= 0.3'
@@ -56,5 +56,5 @@ Gem::Specification.new do |spec|
56
56
  spec.add_development_dependency 'simplecov-console', '>= 0.4.2'
57
57
  spec.add_development_dependency 'sqlite3', '>= 1.7.0'
58
58
 
59
- spec.required_ruby_version = '>= 2.7'
59
+ spec.required_ruby_version = '>= 3.2'
60
60
  end
@@ -15,7 +15,7 @@ gem 'sprockets-rails'
15
15
  gem 'sqlite3', '~> 1.4'
16
16
 
17
17
  # Use the Puma web server [https://github.com/puma/puma]
18
- gem 'puma', '>= 5.0'
18
+ gem 'puma', '~> 6.0'
19
19
 
20
20
  # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
21
21
  gem 'importmap-rails'
@@ -63,4 +63,5 @@ group :test do
63
63
  gem 'shoulda-matchers'
64
64
  # Easy installation and use of web drivers to run system tests with browsers
65
65
  gem 'webdrivers'
66
+ gem 'webrick'
66
67
  end
@@ -0,0 +1,71 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ ENV['RAILS_TARGET'] ||= '8.0'
5
+
6
+ gemspec path: '../'
7
+
8
+ # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
9
+ gem 'rails', '~> 8.0.2', '>= 8.0.2.1'
10
+ # The modern asset pipeline for Rails [https://github.com/rails/propshaft]
11
+ gem 'propshaft'
12
+ # Use sqlite3 as the database for Active Record
13
+ gem 'sqlite3', '>= 2.1'
14
+ # Use the Puma web server [https://github.com/puma/puma]
15
+ gem 'puma', '~> 6.0'
16
+ # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
17
+ gem 'importmap-rails'
18
+ # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
19
+ gem 'turbo-rails'
20
+ # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
21
+ gem 'stimulus-rails'
22
+ # Build JSON APIs with ease [https://github.com/rails/jbuilder]
23
+ gem 'jbuilder'
24
+
25
+ # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
26
+ # gem "bcrypt", "~> 3.1.7"
27
+
28
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
29
+ gem 'tzinfo-data', platforms: %i(windows jruby)
30
+
31
+ # Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
32
+ gem 'solid_cable'
33
+ gem 'solid_cache'
34
+ gem 'solid_queue'
35
+
36
+ # Reduces boot times through caching; required in config/boot.rb
37
+ gem 'bootsnap', require: false
38
+
39
+ # Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
40
+ gem 'kamal', require: false
41
+
42
+ # Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
43
+ gem 'thruster', require: false
44
+
45
+ # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
46
+ # gem "image_processing", "~> 1.2"
47
+
48
+ group :development, :test do
49
+ # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
50
+ gem 'debug', platforms: %i(mri windows), require: 'debug/prelude'
51
+
52
+ # Static analysis for security vulnerabilities [https://brakemanscanner.org/]
53
+ gem 'brakeman', require: false
54
+
55
+ # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
56
+ gem 'rubocop-rails-omakase', require: false
57
+ end
58
+
59
+ group :development do
60
+ # Use console on exceptions pages [https://github.com/rails/web-console]
61
+ gem 'web-console'
62
+ end
63
+
64
+ group :test do
65
+ # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
66
+ gem 'capybara'
67
+ gem 'codecov', require: false
68
+ gem 'selenium-webdriver'
69
+ gem 'shoulda-matchers'
70
+ gem 'webrick'
71
+ end
@@ -24,7 +24,7 @@ module Devise
24
24
  errors.add(:base, error_string)
25
25
  end
26
26
 
27
- errors.count.zero?
27
+ errors.none?
28
28
  end
29
29
 
30
30
  def password_recent?
@@ -27,7 +27,7 @@ module Devise
27
27
  errors.add(:base, error_string)
28
28
  end
29
29
 
30
- errors.count.zero?
30
+ errors.none?
31
31
  end
32
32
 
33
33
  protected
@@ -17,7 +17,7 @@ module Devise
17
17
  self.password ||= ''
18
18
  errors.delete(:password)
19
19
  validate_password_content_for(:password)
20
- errors[:password].count.zero?
20
+ errors[:password].none?
21
21
  end
22
22
 
23
23
  def validate_password_confirmation_content
@@ -25,7 +25,7 @@ module Devise
25
25
 
26
26
  errors.delete(:password_confirmation)
27
27
  validate_password_content_for(:password_confirmation)
28
- errors[:password_confirmation].count.zero?
28
+ errors[:password_confirmation].none?
29
29
  end
30
30
 
31
31
  def validate_password_confirmation
@@ -35,7 +35,7 @@ module Devise
35
35
  human_attribute_name = self.class.human_attribute_name(:password)
36
36
  errors.add(:password_confirmation, :confirmation, attribute: human_attribute_name)
37
37
  end
38
- errors[:password_confirmation].count.zero?
38
+ errors[:password_confirmation].none?
39
39
  end
40
40
 
41
41
  def validate_password_content_for(attr)
@@ -3,7 +3,7 @@ module Devise
3
3
  class PreviousPassword < ::ActiveRecord::Base
4
4
  self.table_name = 'previous_passwords'
5
5
  belongs_to :user
6
- default_scope -> { order(id: :desc) }
6
+ default_scope -> { order(created_at: :desc) }
7
7
  validates :user_id, presence: true
8
8
  validates :salt, presence: true
9
9
  validates :encrypted_password, presence: true
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module SecurePassword
3
- VERSION = '2.1.0'.freeze
3
+ VERSION = '2.2.0'.freeze
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-secure_password
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Eissler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-12 00:00:00.000000000 Z
11
+ date: 2025-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 5.0.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: 8.0.0
42
+ version: 9.0.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 5.0.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: 8.0.0
52
+ version: 9.0.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: bundler
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -154,14 +154,14 @@ dependencies:
154
154
  requirements:
155
155
  - - ">="
156
156
  - !ruby/object:Gem::Version
157
- version: 6.1.0
157
+ version: '7.0'
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: 6.1.0
164
+ version: '7.0'
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: rake
167
167
  requirement: !ruby/object:Gem::Requirement
@@ -353,8 +353,8 @@ files:
353
353
  - "./config/locales/en.yml"
354
354
  - "./devise-secure_password.gemspec"
355
355
  - "./docker-entrypoint.sh"
356
- - "./gemfiles/rails_6_1.gemfile"
357
356
  - "./gemfiles/rails_7_0.gemfile"
357
+ - "./gemfiles/rails_8_0.gemfile"
358
358
  - "./lib/devise/secure_password.rb"
359
359
  - "./lib/devise/secure_password/controllers/devise_helpers.rb"
360
360
  - "./lib/devise/secure_password/controllers/helpers.rb"
@@ -385,14 +385,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
385
385
  requirements:
386
386
  - - ">="
387
387
  - !ruby/object:Gem::Version
388
- version: '2.7'
388
+ version: '3.2'
389
389
  required_rubygems_version: !ruby/object:Gem::Requirement
390
390
  requirements:
391
391
  - - ">="
392
392
  - !ruby/object:Gem::Version
393
393
  version: '0'
394
394
  requirements: []
395
- rubygems_version: 3.5.9
395
+ rubygems_version: 3.5.11
396
396
  signing_key:
397
397
  specification_version: 4
398
398
  summary: A devise password policy enforcement extension.
@@ -1,57 +0,0 @@
1
- source 'https://rubygems.org'
2
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
-
4
- ENV['RAILS_TARGET'] ||= '6.1'
5
-
6
- gemspec path: '../'
7
-
8
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
9
- gem 'rails', '~> 6.1.3', '>= 6.1.3.1'
10
- # Use sqlite3 as the database for Active Record
11
- gem 'sqlite3', '~> 1.7.0'
12
- # Use Puma as the app server
13
- gem 'puma', '~> 5.0'
14
- # Use SCSS for stylesheets
15
- gem 'sass-rails', '>= 6'
16
- # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
17
- gem 'webpacker', '~> 5.0'
18
- # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
19
- gem 'turbolinks', '~> 5'
20
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
21
- gem 'jbuilder', '~> 2.7'
22
- # Use Redis adapter to run Action Cable in production
23
- # gem 'redis', '~> 4.0'
24
- # Use Active Model has_secure_password
25
- # gem 'bcrypt', '~> 3.1.7'
26
-
27
- # Use Active Storage variant
28
- # gem 'image_processing', '~> 1.2'
29
-
30
- # Reduces boot times through caching; required in config/boot.rb
31
- gem 'bootsnap', '>= 1.4.4', require: false
32
-
33
- group :development, :test do
34
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
35
- gem 'byebug', platforms: %i(mri mingw x64_mingw)
36
- end
37
-
38
- group :development do
39
- # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
40
- gem 'listen', '~> 3.3'
41
- gem 'web-console', '>= 4.1.0'
42
- end
43
-
44
- group :test do
45
- # Adds support for Capybara system testing and selenium driver
46
- gem 'capybara', '>= 3.26'
47
- gem 'codecov', require: false
48
- gem 'selenium-webdriver'
49
- gem 'shoulda-matchers'
50
- # Easy installation and use of web drivers to run system tests with browsers
51
- gem 'webdrivers'
52
- end
53
-
54
- # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
55
- gem 'tzinfo-data', platforms: %i(mingw mswin x64_mingw jruby)
56
-
57
- gem 'webrick', '~> 1.7'