devise-security 0.14.3 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +114 -58
  3. data/app/controllers/devise/password_expired_controller.rb +10 -1
  4. data/app/views/devise/paranoid_verification_code/show.html.erb +3 -3
  5. data/app/views/devise/password_expired/show.html.erb +5 -5
  6. data/config/locales/by.yml +48 -0
  7. data/config/locales/cs.yml +40 -0
  8. data/config/locales/de.yml +12 -2
  9. data/config/locales/en.yml +12 -1
  10. data/config/locales/es.yml +9 -9
  11. data/config/locales/fa.yml +40 -0
  12. data/config/locales/hi.yml +41 -0
  13. data/config/locales/it.yml +34 -4
  14. data/config/locales/ja.yml +1 -1
  15. data/config/locales/nl.yml +40 -0
  16. data/config/locales/pt.yml +40 -0
  17. data/config/locales/ru.yml +48 -0
  18. data/config/locales/uk.yml +48 -0
  19. data/config/locales/zh_CN.yml +40 -0
  20. data/config/locales/zh_TW.yml +40 -0
  21. data/lib/devise-security/controllers/helpers.rb +59 -50
  22. data/lib/devise-security/hooks/password_expirable.rb +2 -0
  23. data/lib/devise-security/hooks/session_limitable.rb +13 -7
  24. data/lib/devise-security/models/password_expirable.rb +5 -1
  25. data/lib/devise-security/models/session_limitable.rb +8 -1
  26. data/lib/devise-security/validators/password_complexity_validator.rb +4 -2
  27. data/lib/devise-security/version.rb +1 -1
  28. data/lib/generators/devise_security/install_generator.rb +2 -2
  29. data/test/controllers/test_password_expired_controller.rb +111 -16
  30. data/test/dummy/app/assets/config/manifest.js +3 -0
  31. data/test/dummy/config/routes.rb +3 -3
  32. data/test/dummy/log/test.log +1799 -0
  33. data/test/integration/test_password_expirable_workflow.rb +57 -0
  34. data/test/orm/active_record.rb +4 -1
  35. data/test/support/integration_helpers.rb +1 -1
  36. data/test/test_complexity_validator.rb +12 -0
  37. data/test/test_helper.rb +10 -3
  38. data/test/test_install_generator.rb +10 -0
  39. data/test/test_session_limitable.rb +17 -0
  40. data/test/tmp/config/initializers/devise-security.rb +44 -0
  41. data/test/tmp/config/locales/devise.security_extension.de.yml +38 -0
  42. data/test/tmp/config/locales/devise.security_extension.en.yml +40 -0
  43. data/test/tmp/config/locales/devise.security_extension.es.yml +29 -0
  44. data/test/tmp/config/locales/devise.security_extension.fa.yml +40 -0
  45. data/test/tmp/config/locales/devise.security_extension.fr.yml +29 -0
  46. data/test/tmp/config/locales/devise.security_extension.it.yml +40 -0
  47. data/test/tmp/config/locales/devise.security_extension.ja.yml +29 -0
  48. data/test/tmp/config/locales/devise.security_extension.nl.yml +40 -0
  49. data/test/tmp/config/locales/devise.security_extension.pt.yml +40 -0
  50. data/test/tmp/config/locales/devise.security_extension.ru.yml +48 -0
  51. data/test/tmp/config/locales/devise.security_extension.tr.yml +17 -0
  52. data/test/tmp/config/locales/devise.security_extension.uk.yml +48 -0
  53. data/test/tmp/config/locales/devise.security_extension.zh_CN.yml +40 -0
  54. metadata +152 -118
  55. data/.codeclimate.yml +0 -63
  56. data/.document +0 -5
  57. data/.gitignore +0 -43
  58. data/.mdlrc +0 -1
  59. data/.rubocop.yml +0 -64
  60. data/.ruby-version +0 -1
  61. data/.travis.yml +0 -39
  62. data/Appraisals +0 -35
  63. data/Gemfile +0 -10
  64. data/Rakefile +0 -27
  65. data/devise-security.gemspec +0 -50
  66. data/gemfiles/rails_4.2_stable.gemfile +0 -16
  67. data/gemfiles/rails_5.0_stable.gemfile +0 -15
  68. data/gemfiles/rails_5.1_stable.gemfile +0 -15
  69. data/gemfiles/rails_5.2_stable.gemfile +0 -15
  70. data/gemfiles/rails_6.0_beta.gemfile +0 -15
  71. data/test/dummy/app/models/.gitkeep +0 -0
@@ -1,63 +0,0 @@
1
- version: "2"
2
- checks:
3
- argument-count:
4
- enabled: true
5
- config:
6
- threshold: 4
7
- complex-logic:
8
- enabled: true
9
- config:
10
- threshold: 4
11
- file-lines:
12
- enabled: true
13
- config:
14
- threshold: 250
15
- method-complexity:
16
- enabled: true
17
- config:
18
- threshold: 5
19
- method-count:
20
- enabled: true
21
- config:
22
- threshold: 20
23
- method-lines:
24
- enabled: true
25
- config:
26
- threshold: 25
27
- nested-control-flow:
28
- enabled: true
29
- config:
30
- threshold: 4
31
- return-statements:
32
- enabled: true
33
- config:
34
- threshold: 4
35
- similar-code:
36
- enabled: true
37
- config:
38
- threshold: #language-specific defaults. overrides affect all languages.
39
- identical-code:
40
- enabled: true
41
- config:
42
- threshold: #language-specific defaults. overrides affect all languages.
43
- plugins:
44
- rubocop:
45
- enabled: true
46
- channel: rubocop-0-66
47
- markdownlint:
48
- enabled: true
49
- brakeman:
50
- enabled: true
51
- exclude_patterns:
52
- - "config/"
53
- - "db/"
54
- - "dist/"
55
- - "features/"
56
- - "**/node_modules/"
57
- - "script/"
58
- - "**/spec/"
59
- - "**/test/"
60
- - "**/tests/"
61
- - "**/vendor/"
62
- - "**/*.d.ts"
63
- - "gemfiles/"
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.gitignore DELETED
@@ -1,43 +0,0 @@
1
- test/rails_app/log/*
2
- test/rails_app/tmp/*
3
- *~
4
- coverage/*
5
- *.sqlite3
6
- .bundle
7
- rdoc/*
8
- pkg
9
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
10
- #
11
- # * Create a file at ~/.gitignore
12
- # * Include files you want ignored
13
- # * Run: git config --global core.excludesfile ~/.gitignore
14
- #
15
- # After doing this, these files will be ignored in all your git projects,
16
- # saving you from having to 'pollute' every project you touch with them
17
- #
18
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
19
- #
20
- # For MacOS:
21
- #
22
- #.DS_Store
23
- #
24
- # For TextMate
25
- #*.tmproj
26
- #tmtags
27
- #
28
- # For emacs:
29
- #*~
30
- #\#*
31
- #.\#*
32
- #
33
- # For vim:
34
- #*.swp
35
-
36
- log
37
- test/tmp/*
38
- *.gem
39
- Gemfile.lock
40
- *.lock
41
- bin/*
42
- .yardoc
43
- .idea
data/.mdlrc DELETED
@@ -1 +0,0 @@
1
- rules "~MD013"
@@ -1,64 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
- Include:
4
- - '**/Rakefile'
5
- - '**/config.ru'
6
- - 'lib/tasks/**/*'
7
- Exclude:
8
- - Gemfile*
9
- - README
10
- - 'db/**/*'
11
- - 'config/**/*'
12
- - 'bin/**/*'
13
- - 'vendor/bundle/**/*'
14
- - 'spec/support/**/*' # rspec support helpers have a strange api
15
-
16
- Rails:
17
- Enabled: true
18
-
19
- # We don't care about method length, since we check method cyclomatic
20
- # complexity.
21
- Metrics/MethodLength:
22
- Enabled: false
23
-
24
- Metrics/LineLength:
25
- Enabled: false
26
-
27
- Naming/FileName:
28
- Exclude: ["devise-security.gemspec"]
29
-
30
- Style/ClassAndModuleChildren:
31
- EnforcedStyle: compact
32
- SupportedStyles:
33
- - nested
34
- - compact
35
-
36
- Style/HashSyntax:
37
- EnforcedStyle: ruby19
38
-
39
- Style/SymbolArray:
40
- EnforcedStyle: brackets
41
-
42
- # Trailing commas make for clearer diffs because the last line won't appear
43
- # to have been changed, as it would if it lacked a comma and had one added.
44
- Style/TrailingCommaInArrayLiteral:
45
- EnforcedStyleForMultiline: comma
46
- Style/TrailingCommaInHashLiteral:
47
- EnforcedStyleForMultiline: comma
48
- Style/TrailingCommaInArguments:
49
- EnforcedStyleForMultiline: comma
50
-
51
- # Cop supports --auto-correct.
52
- # Configuration parameters: PreferredDelimiters.
53
- Style/PercentLiteralDelimiters:
54
- PreferredDelimiters:
55
- # Using `[]` for string arrays instead of `()`, since normal arrays are
56
- # indicated with `[]` not `()`.
57
- '%w': '[]'
58
- '%W': '[]'
59
-
60
- Style/AndOr:
61
- # Whether `and` and `or` are banned only in conditionals (conditionals)
62
- # or completely (always).
63
- # They read better, more like normal English.
64
- Enabled: false
@@ -1 +0,0 @@
1
- 2.4.6
@@ -1,39 +0,0 @@
1
- language: ruby
2
- dist: xenial
3
- before_install:
4
- # install bundler < 2 because Rails 4.2 is incompatible with bundler >= 2
5
- - gem install bundler -v '1.17.3'
6
- install: bundle _1.17.3_ install --jobs=2 --retry=2 --path=${BUNDLE_PATH:-vendor/bundle}
7
- cache: bundler
8
- script: bundle exec rake
9
- rvm:
10
- - 2.4
11
- - 2.5
12
- - 2.6
13
- - ruby-head
14
- env:
15
- matrix:
16
- - DEVISE_ORM=active_record
17
- - DEVISE_ORM=mongoid
18
- services:
19
- - mongodb
20
- matrix:
21
- exclude:
22
- # Skip these combinations because they have incompatible dependencies
23
- # and will always fail.
24
- - rvm: 2.6
25
- gemfile: gemfiles/rails_4.2_stable.gemfile
26
- - rvm: ruby-head
27
- gemfile: gemfiles/rails_4.2_stable.gemfile
28
- - rvm: 2.4
29
- gemfile: gemfiles/rails_6.0_beta.gemfile
30
- allow_failures:
31
- # edge, not expected to pass
32
- - rvm: ruby-head
33
- - gemfile: gemfiles/rails_6.0_beta.gemfile
34
- gemfile:
35
- - gemfiles/rails_4.2_stable.gemfile
36
- - gemfiles/rails_5.0_stable.gemfile
37
- - gemfiles/rails_5.1_stable.gemfile
38
- - gemfiles/rails_5.2_stable.gemfile
39
- - gemfiles/rails_6.0_beta.gemfile
data/Appraisals DELETED
@@ -1,35 +0,0 @@
1
- appraise 'rails-4.2-stable' do
2
- gem 'rails', '~> 4.2.0'
3
- gem 'bundler', '< 2'
4
- group :mongoid do
5
- gem "mongoid", "~> 4.0"
6
- end
7
- end
8
-
9
- appraise 'rails-5.0-stable' do
10
- gem 'rails', '~> 5.0.0'
11
- group :mongoid do
12
- gem "mongoid", "~> 6.0"
13
- end
14
- end
15
-
16
- appraise 'rails-5.1-stable' do
17
- gem 'rails', '~> 5.1.0'
18
- group :mongoid do
19
- gem "mongoid", "~> 6.0"
20
- end
21
- end
22
-
23
- appraise 'rails-5.2-stable' do
24
- gem 'rails', '~> 5.2.0'
25
- group :mongoid do
26
- gem "mongoid", "~> 6.0"
27
- end
28
- end
29
-
30
- appraise 'rails-6.0-beta' do
31
- gem 'rails', '~> 6.0.0.beta3'
32
- group :mongoid do
33
- gem "mongoid", "~> 6.0"
34
- end
35
- end
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- source "https://rubygems.org"
2
- gemspec
3
-
4
- group :active_record do
5
- gem 'sqlite3', '~> 1.3.0'
6
- end
7
-
8
- group :mongoid do
9
- gem 'mongoid'
10
- end
data/Rakefile DELETED
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), 'lib')
4
- require 'bundler/gem_tasks'
5
- require 'rake/testtask'
6
- require 'rdoc/task'
7
- require 'devise-security/version'
8
-
9
- desc 'Default: Run DeviseSecurity unit tests'
10
- task default: :test
11
-
12
- Rake::TestTask.new(:test) do |t|
13
- t.libs << 'lib'
14
- t.libs << 'test'
15
- t.test_files = FileList['test/*test*.rb', 'test/**/*test*.rb']
16
- t.verbose = true
17
- t.warning = false
18
- end
19
-
20
- Rake::RDocTask.new do |rdoc|
21
- version = DeviseSecurity::VERSION.dup
22
-
23
- rdoc.rdoc_dir = 'rdoc'
24
- rdoc.title = "devise-security #{version}"
25
- rdoc.rdoc_files.include('README*')
26
- rdoc.rdoc_files.include('lib/**/*.rb')
27
- end
@@ -1,50 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- # frozen_string_literal: true
3
-
4
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
5
- require 'devise-security/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'devise-security'
9
- s.version = DeviseSecurity::VERSION.dup
10
- s.platform = Gem::Platform::RUBY
11
- s.licenses = ['MIT']
12
- s.summary = 'Security extension for devise'
13
- s.email = 'natebird@gmail.com'
14
- s.homepage = 'https://github.com/devise-security/devise-security'
15
- s.description = 'An enterprise security extension for devise.'
16
- s.authors = [
17
- 'Marco Scholl',
18
- 'Alexander Dreher',
19
- 'Nate Bird',
20
- 'Dillon Welch',
21
- 'Kevin Olbrich'
22
- ]
23
-
24
- s.files = `git ls-files`.split("\n")
25
- s.test_files = `git ls-files -- test/*`.split("\n")
26
- s.require_paths = ['lib']
27
- s.required_ruby_version = '>= 2.3.0'
28
-
29
- if RUBY_VERSION >= '2.4'
30
- s.add_runtime_dependency 'rails', '>= 4.2.0', '< 7.0'
31
- else
32
- s.add_runtime_dependency 'railties', '>= 4.2.0', '< 6.0'
33
- end
34
- s.add_runtime_dependency 'devise', '>= 4.3.0', '< 5.0'
35
-
36
- s.add_development_dependency 'appraisal'
37
- s.add_development_dependency 'bundler'
38
- s.add_development_dependency 'coveralls'
39
- s.add_development_dependency 'database_cleaner'
40
- s.add_development_dependency 'easy_captcha'
41
- s.add_development_dependency 'm'
42
- s.add_development_dependency 'minitest'
43
- s.add_development_dependency 'omniauth'
44
- s.add_development_dependency 'pry-byebug'
45
- s.add_development_dependency 'pry-rescue'
46
- s.add_development_dependency 'rails_email_validator'
47
- s.add_development_dependency 'rubocop', '~> 0.66.0'
48
- s.add_development_dependency 'sqlite3'
49
- s.add_development_dependency 'wwtd'
50
- end
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.2.0"
6
- gem "bundler", "< 2"
7
-
8
- group :active_record do
9
- gem "sqlite3", "~> 1.3.0"
10
- end
11
-
12
- group :mongoid do
13
- gem "mongoid", "~> 4.0"
14
- end
15
-
16
- gemspec path: "../"
@@ -1,15 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.0.0"
6
-
7
- group :active_record do
8
- gem "sqlite3", "~> 1.3.0"
9
- end
10
-
11
- group :mongoid do
12
- gem "mongoid", "~> 6.0"
13
- end
14
-
15
- gemspec path: "../"
@@ -1,15 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.1.0"
6
-
7
- group :active_record do
8
- gem "sqlite3", "~> 1.3.0"
9
- end
10
-
11
- group :mongoid do
12
- gem "mongoid", "~> 6.0"
13
- end
14
-
15
- gemspec path: "../"
@@ -1,15 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.2.0"
6
-
7
- group :active_record do
8
- gem "sqlite3", "~> 1.3.0"
9
- end
10
-
11
- group :mongoid do
12
- gem "mongoid", "~> 6.0"
13
- end
14
-
15
- gemspec path: "../"
@@ -1,15 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 6.0.0.rc1"
6
-
7
- group :active_record do
8
- gem "sqlite3", "~> 1.3.0"
9
- end
10
-
11
- group :mongoid do
12
- gem "mongoid", "~> 6.0"
13
- end
14
-
15
- gemspec path: "../"
File without changes