authentication-zero 2.16.26 → 2.16.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31829b8815a7d6b7720997ea3cc1e85d602b43c3a2a4da30c346638617adfdb2
4
- data.tar.gz: 1869578bdefc46e75910a53c3d6a65326255ec63ed0f7b5ceb11612e8b748b35
3
+ metadata.gz: 195bf86bdef228aa0ad627d9fc82850b6b9fd4dca4ce08dec69b860f5fbd03fd
4
+ data.tar.gz: 65501f9800f6c3f7116a94926404c481bcfe213dce0c507dfc05a0098f65f62a
5
5
  SHA512:
6
- metadata.gz: 9134009142fed3d0f971887a21755c85369dd81f3896bb9aa6141b14a600c095ad7a16a45fd2efa69c83a10d3239450bde10300b21ac38fbfa396ae73e0cd5aa
7
- data.tar.gz: c6647adbf7164587702ca53b4bda230c835ed53112172551c7f3f5555224f722c5f69e8511d37a5b59983a78a4d5bc778d6fbe2a556f73460b0f900893081441
6
+ metadata.gz: 3135d5d608a9d99a649b86a0ad476f61967a1ad06bafdce20af390412afdc73b5ff14706a8be282f927cb38a992d70e4d2d3ca23e2d9e5dd5f552441c0552d5b
7
+ data.tar.gz: f5e7499825798498e31fe995b1a8dd4813308f0d8773d25bcacd4d3cd78d201a3b9f293c8e4cfa2619f61adad78e3e2f18c41856c537f913ff3787cd87f5448d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.16.26)
4
+ authentication-zero (2.16.28)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -20,19 +20,15 @@ Since Authentication Zero generates this code into your application instead of b
20
20
 
21
21
  ## Features
22
22
 
23
- - **Simple code**
24
- - **Inspired by hey.com**
23
+ ### Essential
24
+
25
25
  - Sign up
26
26
  - Email and password validations
27
27
  - Checks if a password has been found in any data breach (--pwned)
28
28
  - Authentication by cookie
29
29
  - Authentication by token (--api)
30
- - Passwordless authentication (--passwordless)
31
30
  - Two factor authentication + recovery codes (--two-factor)
32
31
  - Two factor authentication using a hardware security key (--webauthn)
33
- - Social Login with OmniAuth (--omniauthable)
34
- - Send invitations (--invitable)
35
- - Sign-in as button functionallity (--masqueradable)
36
32
  - Verify email using a link with token
37
33
  - Ask password before sensitive data changes, aka: sudo (--sudoable)
38
34
  - Reset the user password and send reset instructions
@@ -44,6 +40,14 @@ Since Authentication Zero generates this code into your application instead of b
44
40
  - Activity log (--trackable)
45
41
  - Log out
46
42
 
43
+ ### More
44
+
45
+ - Social login with omni auth (--omniauthable)
46
+ - Passwordless authentication (--passwordless)
47
+ - Send invitations (--invitable)
48
+ - "Sign-in as" button functionallity (--masqueradable)
49
+
50
+
47
51
  ## Generated code
48
52
 
49
53
  - [has_secure_password](https://api.rubyonrails.org/classes/ActiveModel/SecurePassword/ClassMethods.html#method-i-has_secure_password): Adds methods to set and authenticate against a bcrypt password.
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.16.26"
2
+ VERSION = "2.16.28"
3
3
  end
@@ -26,7 +26,7 @@ class AuthenticationGenerator < Rails::Generators::Base
26
26
  end
27
27
 
28
28
  if redis?
29
- gem "redis", ">= 4.0.1", comment: "Use Redis adapter to run additional authentication features"
29
+ gem "redis", "~> 4.0", comment: "Use Redis adapter to run additional authentication features"
30
30
  gem "kredis", comment: "Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]"
31
31
  end
32
32
 
@@ -64,55 +64,56 @@ class AuthenticationGenerator < Rails::Generators::Base
64
64
  def create_migrations
65
65
  migration_template "migrations/create_users_migration.rb", "#{db_migrate_path}/create_users.rb"
66
66
  migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
67
- migration_template "migrations/create_email_verification_tokens_migration.rb", "#{db_migrate_path}/create_email_verification_tokens.rb"
68
67
  migration_template "migrations/create_password_reset_tokens_migration.rb", "#{db_migrate_path}/create_password_reset_tokens.rb"
69
- migration_template "migrations/create_sign_in_tokens_migration.rb", "#{db_migrate_path}/create_sign_in_tokens_migration.rb" if passwordless?
68
+ migration_template "migrations/create_email_verification_tokens_migration.rb", "#{db_migrate_path}/create_email_verification_tokens.rb"
70
69
  migration_template "migrations/create_events_migration.rb", "#{db_migrate_path}/create_events.rb" if options.trackable?
71
70
  migration_template "migrations/create_recovery_codes_migration.rb", "#{db_migrate_path}/create_recovery_codes.rb" if two_factor?
72
71
  migration_template "migrations/create_security_keys_migration.rb", "#{db_migrate_path}/create_security_keys.rb" if webauthn?
72
+ migration_template "migrations/create_sign_in_tokens_migration.rb", "#{db_migrate_path}/create_sign_in_tokens_migration.rb" if passwordless?
73
73
  end
74
74
 
75
75
  def create_models
76
- template "models/user.rb", "app/models/user.rb"
77
- template "models/session.rb", "app/models/session.rb"
78
- template "models/email_verification_token.rb", "app/models/email_verification_token.rb"
79
- template "models/password_reset_token.rb", "app/models/password_reset_token.rb"
80
- template "models/sign_in_token.rb", "app/models/sign_in_token.rb" if passwordless?
81
76
  template "models/current.rb", "app/models/current.rb"
77
+ template "models/email_verification_token.rb", "app/models/email_verification_token.rb"
82
78
  template "models/event.rb", "app/models/event.rb" if options.trackable?
79
+ template "models/password_reset_token.rb", "app/models/password_reset_token.rb"
83
80
  template "models/recovery_code.rb", "app/models/recovery_code.rb" if two_factor?
84
81
  template "models/security_key.rb", "app/models/security_key.rb" if webauthn?
82
+ template "models/session.rb", "app/models/session.rb"
83
+ template "models/sign_in_token.rb", "app/models/sign_in_token.rb" if passwordless?
84
+ template "models/user.rb", "app/models/user.rb"
85
85
  end
86
86
 
87
87
  def create_fixture_file
88
- template "test_unit/users.yml", "test/fixtures/users.yml"
88
+ copy_file "test_unit/users.yml", "test/fixtures/users.yml"
89
89
  end
90
90
 
91
91
  def create_controllers
92
- template "controllers/#{format_folder}/application_controller.rb", "app/controllers/application_controller.rb", force: true
92
+ template "controllers/#{format}/authentications/events_controller.rb", "app/controllers/authentications/events_controller.rb" if options.trackable?
93
93
 
94
- directory "controllers/#{format_folder}/identity", "app/controllers/identity"
94
+ directory "controllers/#{format}/identity", "app/controllers/identity"
95
95
 
96
- if two_factor?
97
- template "controllers/html/two_factor_authentication/profile/totps_controller.rb", "app/controllers/two_factor_authentication/profile/totps_controller.rb"
98
- template "controllers/html/two_factor_authentication/profile/recovery_codes_controller.rb", "app/controllers/two_factor_authentication/profile/recovery_codes_controller.rb"
99
- template "controllers/html/two_factor_authentication/profile/security_keys_controller.rb", "app/controllers/two_factor_authentication/profile/security_keys_controller.rb" if webauthn?
96
+ template "controllers/#{format}/sessions/omniauth_controller.rb", "app/controllers/sessions/omniauth_controller.rb" if omniauthable?
97
+ template "controllers/#{format}/sessions/passwordlesses_controller.rb", "app/controllers/sessions/passwordlesses_controller.rb" if passwordless?
98
+ template "controllers/#{format}/sessions/sudos_controller.rb", "app/controllers/sessions/sudos_controller.rb" if sudoable?
100
99
 
101
- template "controllers/html/two_factor_authentication/challenge/totps_controller.rb", "app/controllers/two_factor_authentication/challenge/totps_controller.rb"
100
+ if two_factor?
102
101
  template "controllers/html/two_factor_authentication/challenge/recovery_codes_controller.rb", "app/controllers/two_factor_authentication/challenge/recovery_codes_controller.rb"
103
102
  template "controllers/html/two_factor_authentication/challenge/security_keys_controller.rb", "app/controllers/two_factor_authentication/challenge/security_keys_controller.rb" if webauthn?
103
+ template "controllers/html/two_factor_authentication/challenge/totps_controller.rb", "app/controllers/two_factor_authentication/challenge/totps_controller.rb"
104
+
105
+ template "controllers/html/two_factor_authentication/profile/recovery_codes_controller.rb", "app/controllers/two_factor_authentication/profile/recovery_codes_controller.rb"
106
+ template "controllers/html/two_factor_authentication/profile/security_keys_controller.rb", "app/controllers/two_factor_authentication/profile/security_keys_controller.rb" if webauthn?
107
+ template "controllers/html/two_factor_authentication/profile/totps_controller.rb", "app/controllers/two_factor_authentication/profile/totps_controller.rb"
104
108
  end
105
109
 
106
- template "controllers/#{format_folder}/sessions_controller.rb", "app/controllers/sessions_controller.rb"
107
- template "controllers/#{format_folder}/passwords_controller.rb", "app/controllers/passwords_controller.rb"
108
- template "controllers/#{format_folder}/invitations_controller.rb", "app/controllers/invitations_controller.rb" if invitable?
109
- template "controllers/#{format_folder}/masquerades_controller.rb", "app/controllers/masquerades_controller.rb" if masqueradable?
110
- template "controllers/#{format_folder}/registrations_controller.rb", "app/controllers/registrations_controller.rb"
111
- template "controllers/#{format_folder}/home_controller.rb", "app/controllers/home_controller.rb" unless options.api?
112
- template "controllers/#{format_folder}/sessions/sudos_controller.rb", "app/controllers/sessions/sudos_controller.rb" if sudoable?
113
- template "controllers/#{format_folder}/sessions/omniauth_controller.rb", "app/controllers/sessions/omniauth_controller.rb" if omniauthable?
114
- template "controllers/#{format_folder}/sessions/passwordlesses_controller.rb", "app/controllers/sessions/passwordlesses_controller.rb" if passwordless?
115
- template "controllers/#{format_folder}/authentications/events_controller.rb", "app/controllers/authentications/events_controller.rb" if options.trackable?
110
+ template "controllers/#{format}/application_controller.rb", "app/controllers/application_controller.rb", force: true
111
+ template "controllers/#{format}/home_controller.rb", "app/controllers/home_controller.rb" unless options.api?
112
+ template "controllers/#{format}/invitations_controller.rb", "app/controllers/invitations_controller.rb" if invitable?
113
+ template "controllers/#{format}/masquerades_controller.rb", "app/controllers/masquerades_controller.rb" if masqueradable?
114
+ template "controllers/#{format}/passwords_controller.rb", "app/controllers/passwords_controller.rb"
115
+ template "controllers/#{format}/registrations_controller.rb", "app/controllers/registrations_controller.rb"
116
+ template "controllers/#{format}/sessions_controller.rb", "app/controllers/sessions_controller.rb"
116
117
  end
117
118
 
118
119
  def install_javascript
@@ -127,37 +128,32 @@ class AuthenticationGenerator < Rails::Generators::Base
127
128
  template "erb/user_mailer/email_verification.html.erb", "app/views/user_mailer/email_verification.html.erb"
128
129
  template "erb/user_mailer/password_reset.html.erb", "app/views/user_mailer/password_reset.html.erb"
129
130
  else
130
- template "erb/user_mailer/email_verification.html.erb", "app/views/user_mailer/email_verification.html.erb"
131
- template "erb/user_mailer/password_reset.html.erb", "app/views/user_mailer/password_reset.html.erb"
132
- template "erb/user_mailer/invitation_instructions.html.erb", "app/views/user_mailer/invitation_instructions.html.erb" if invitable?
133
- template "erb/user_mailer/passwordless.html.erb", "app/views/user_mailer/passwordless.html.erb" if passwordless?
134
-
131
+ directory "erb/authentications/events", "app/views/authentications/events" if options.trackable?
135
132
  directory "erb/home", "app/views/home"
136
-
137
133
  directory "erb/identity", "app/views/identity"
134
+ directory "erb/invitations", "app/views/invitations" if invitable?
138
135
  directory "erb/passwords", "app/views/passwords"
139
136
  directory "erb/registrations", "app/views/registrations"
140
137
 
141
- directory "erb/invitations", "app/views/invitations" if invitable?
142
-
143
- template "erb/sessions/index.html.erb", "app/views/sessions/index.html.erb"
144
- template "erb/sessions/new.html.erb", "app/views/sessions/new.html.erb"
145
-
146
- directory "erb/sessions/sudos", "app/views/sessions/sudos" if sudoable?
147
-
148
138
  directory "erb/sessions/passwordlesses", "app/views/sessions/passwordlesses" if passwordless?
149
-
150
- directory "erb/authentications/events", "app/views/authentications/events" if options.trackable?
139
+ directory "erb/sessions/sudos", "app/views/sessions/sudos" if sudoable?
140
+ template "erb/sessions/index.html.erb", "app/views/sessions/index.html.erb"
141
+ template "erb/sessions/new.html.erb", "app/views/sessions/new.html.erb"
151
142
 
152
143
  if two_factor?
153
- directory "erb/two_factor_authentication/profile/totps", "app/views/two_factor_authentication/profile/totps"
154
- directory "erb/two_factor_authentication/profile/recovery_codes", "app/views/two_factor_authentication/profile/recovery_codes"
155
- directory "erb/two_factor_authentication/profile/security_keys", "app/views/two_factor_authentication/profile/security_keys" if webauthn?
156
-
157
- directory "erb/two_factor_authentication/challenge/totps", "app/views/two_factor_authentication/challenge/totps"
158
144
  directory "erb/two_factor_authentication/challenge/recovery_codes", "app/views/two_factor_authentication/challenge/recovery_codes"
159
145
  directory "erb/two_factor_authentication/challenge/security_keys", "app/views/two_factor_authentication/challenge/security_keys" if webauthn?
146
+ directory "erb/two_factor_authentication/challenge/totps", "app/views/two_factor_authentication/challenge/totps"
147
+
148
+ directory "erb/two_factor_authentication/profile/recovery_codes", "app/views/two_factor_authentication/profile/recovery_codes"
149
+ directory "erb/two_factor_authentication/profile/security_keys", "app/views/two_factor_authentication/profile/security_keys" if webauthn?
150
+ directory "erb/two_factor_authentication/profile/totps", "app/views/two_factor_authentication/profile/totps"
160
151
  end
152
+
153
+ template "erb/user_mailer/email_verification.html.erb", "app/views/user_mailer/email_verification.html.erb"
154
+ template "erb/user_mailer/invitation_instructions.html.erb", "app/views/user_mailer/invitation_instructions.html.erb" if invitable?
155
+ template "erb/user_mailer/password_reset.html.erb", "app/views/user_mailer/password_reset.html.erb"
156
+ template "erb/user_mailer/passwordless.html.erb", "app/views/user_mailer/passwordless.html.erb" if passwordless?
161
157
  end
162
158
  end
163
159
 
@@ -219,7 +215,7 @@ class AuthenticationGenerator < Rails::Generators::Base
219
215
  end
220
216
 
221
217
  def create_test_files
222
- directory "test_unit/controllers/#{format_folder}", "test/controllers"
218
+ directory "test_unit/controllers/#{format}", "test/controllers"
223
219
  directory "test_unit/mailers/", "test/mailers"
224
220
  directory "test_unit/system", "test/system" unless options.api?
225
221
  template "test_unit/test_helper.rb", "test/test_helper.rb", force: true
@@ -227,7 +223,7 @@ class AuthenticationGenerator < Rails::Generators::Base
227
223
  end
228
224
 
229
225
  private
230
- def format_folder
226
+ def format
231
227
  options.api? ? "api" : "html"
232
228
  end
233
229
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  lazaro_nixon:
4
4
  email: lazaronixon@hotmail.com
5
- password_digest: <%%= BCrypt::Password.create("Secret1*3*5*") %>
5
+ password_digest: <%= BCrypt::Password.create("Secret1*3*5*") %>
6
6
  verified: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.26
4
+ version: 2.16.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-15 00:00:00.000000000 Z
11
+ date: 2023-04-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -133,7 +133,7 @@ files:
133
133
  - lib/generators/authentication/templates/test_unit/system/registrations_test.rb.tt
134
134
  - lib/generators/authentication/templates/test_unit/system/sessions_test.rb.tt
135
135
  - lib/generators/authentication/templates/test_unit/test_helper.rb.tt
136
- - lib/generators/authentication/templates/test_unit/users.yml.tt
136
+ - lib/generators/authentication/templates/test_unit/users.yml
137
137
  homepage: https://github.com/lazaronixon/authentication-zero
138
138
  licenses:
139
139
  - MIT