authentication-zero 2.8.1 → 2.8.2

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: '09e4e9fd6a0cb245624984f07b574c17264d6df4cdedd508372153d1d40a860e'
4
- data.tar.gz: 1f86f6ffc7590ec45d3b3e9d64cb4fe8042e763b73024adb396c492a92ba7578
3
+ metadata.gz: 8ea407810dad8ddf7ac7366ebf6fe46c7d3558b2376fc33981ecb5ee32d968f0
4
+ data.tar.gz: 9be562630186a350cb34df5d395692b99219f5627568a19715d3c826b706cffa
5
5
  SHA512:
6
- metadata.gz: 30975f47ce22d6d2ff68cfa17f79831295adfb0938eea4af111fa7d3bef0e7a1c2e35ca3918b8feb5ce874267ac8aae9e231fbcb5ca520b8c51f57da72a8ee30
7
- data.tar.gz: 8aee14ca37ef8bdc460ddce3c15f4b785f587625655940752ec23844ee44492ca3026f0eb3769a1468d28af9af653eaf1d2754870a54d45a22d6310e9e89ea0e
6
+ metadata.gz: 1e08a25cda16b7e975057159b8cafac1a9e20a94730c5a28a10f9b5d26a66d448895e2b726141a1f6091042e2ffc31c730bcae0ca9d7609b0b5cde5b3bb5ae7d
7
+ data.tar.gz: 4c00dd86cea638d791c1306114405cac87c7703aa615e730be5fb6719293b0c76fd83ec905cc7043af0e282605240ccab85225167db7e2aa6cba6a2d576ff570
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.8.1)
4
+ authentication-zero (2.8.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -11,7 +11,7 @@ The purpose of authentication zero is to generate a pre-built authentication sys
11
11
  - Checks if a password has been found in any data breach (--pwned)
12
12
  - Authentication by cookie
13
13
  - Authentication by token (--api)
14
- - Social Login with OmniAuth (--omniauth)
14
+ - Social Login with OmniAuth (--omniauthable)
15
15
  - Ask password before sensitive data changes, aka: sudo
16
16
  - Reset the user password and send reset instructions
17
17
  - Reset the user password only from verified emails
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.8.1"
2
+ VERSION = "2.8.2"
3
3
  end
@@ -3,11 +3,11 @@ require "rails/generators/active_record"
3
3
  class AuthenticationGenerator < Rails::Generators::NamedBase
4
4
  include ActiveRecord::Generators::Migration
5
5
 
6
- class_option :api, type: :boolean, desc: "Generates API authentication"
7
- class_option :pwned, type: :boolean, desc: "Add pwned password validation"
8
- class_option :lockable, type: :boolean, desc: "Add password reset locking"
9
- class_option :ratelimit, type: :boolean, desc: "Add request rate limiting"
10
- class_option :omniauth, type: :boolean, desc: "Add social login support"
6
+ class_option :api, type: :boolean, desc: "Generates API authentication"
7
+ class_option :pwned, type: :boolean, desc: "Add pwned password validation"
8
+ class_option :lockable, type: :boolean, desc: "Add password reset locking"
9
+ class_option :ratelimit, type: :boolean, desc: "Add request rate limiting"
10
+ class_option :omniauthable, type: :boolean, desc: "Add social login support"
11
11
 
12
12
  source_root File.expand_path("templates", __dir__)
13
13
 
@@ -24,7 +24,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
24
24
  gem "rack-ratelimit", group: :production, comment: "Use Rack::Ratelimit to rate limit requests [https://github.com/jeremy/rack-ratelimit]"
25
25
  end
26
26
 
27
- if omniauth?
27
+ if omniauthable?
28
28
  gem "omniauth", comment: "Use OmniAuth to support multi-provider authentication [https://github.com/omniauth/omniauth]"
29
29
  gem "omniauth-rails_csrf_protection", comment: "Provides a mitigation against CVE-2015-9284 [https://github.com/cookpad/omniauth-rails_csrf_protection]"
30
30
  end
@@ -32,7 +32,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
32
32
 
33
33
  def create_configuration_files
34
34
  copy_file "config/redis/shared.yml", "config/redis/shared.yml" if options.lockable?
35
- copy_file "config/initializers/omniauth.rb", "config/initializers/omniauth.rb" if omniauth?
35
+ copy_file "config/initializers/omniauth.rb", "config/initializers/omniauth.rb" if omniauthable?
36
36
  end
37
37
 
38
38
  def add_environment_configurations
@@ -47,7 +47,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
47
47
  def create_migrations
48
48
  migration_template "migrations/create_table_migration.rb", "#{db_migrate_path}/create_#{table_name}.rb"
49
49
  migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
50
- migration_template "migrations/add_omniauth_migration.rb", "#{db_migrate_path}/add_omniauth_to_#{table_name}.rb" if omniauth?
50
+ migration_template "migrations/add_omniauth_migration.rb", "#{db_migrate_path}/add_omniauth_to_#{table_name}.rb" if omniauthable?
51
51
  end
52
52
 
53
53
  def create_models
@@ -106,7 +106,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
106
106
 
107
107
  def create_controllers
108
108
  directory "controllers/#{format_folder}", "app/controllers"
109
- template "controllers/omniauth_controller.rb", "app/controllers/sessions/omniauth_controller.rb" if omniauth?
109
+ template "controllers/omniauth_controller.rb", "app/controllers/sessions/omniauth_controller.rb" if omniauthable?
110
110
  end
111
111
 
112
112
  def create_views
@@ -123,7 +123,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
123
123
  end
124
124
 
125
125
  def add_routes
126
- if omniauth?
126
+ if omniauthable?
127
127
  route "post '/auth/:provider/callback', to: 'sessions/omniauth#create'"
128
128
  route "get '/auth/:provider/callback', to: 'sessions/omniauth#create'"
129
129
  route "get '/auth/failure', to: 'sessions/omniauth#failure'"
@@ -151,7 +151,7 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
151
151
  options.api? ? "api" : "html"
152
152
  end
153
153
 
154
- def omniauth?
155
- options.omniauth? && !options.api?
154
+ def omniauthable?
155
+ options.omniauthable? && !options.api?
156
156
  end
157
157
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon