authentication-zero 2.16.26 → 2.16.27
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 396a7e8c26e49c9b91d5b349155eb5d2cb4dbbd2012bb2a89977cb66c7446e39
|
4
|
+
data.tar.gz: 11cdeee70ab80f387208315d585ed0dd0f9cee431b5405e67f77d009bdbfe80d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2be5682d873fdbc960630bc19f5210242813584f1af36667d8737944633436de50c1d72875a493a902dea041c062978805878cf4b4ef5d88b4dd20665d1ad393
|
7
|
+
data.tar.gz: 78d17cb5827821a1a30dff4133325d1fd46eab620c6785dfcae0e58c6ac815ff8d21fd3bfecf9b069ecf70f90e8146d6755d58b59863ad6e01d3f1208eafb5a8
|
data/Gemfile.lock
CHANGED
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
|
-
|
24
|
-
|
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.
|
@@ -26,7 +26,7 @@ class AuthenticationGenerator < Rails::Generators::Base
|
|
26
26
|
end
|
27
27
|
|
28
28
|
if redis?
|
29
|
-
gem "redis", "
|
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
|
|
@@ -62,57 +62,58 @@ class AuthenticationGenerator < Rails::Generators::Base
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def create_migrations
|
65
|
-
migration_template "migrations/create_users_migration.rb", "#{db_migrate_path}/create_users.rb"
|
66
|
-
migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
|
67
65
|
migration_template "migrations/create_email_verification_tokens_migration.rb", "#{db_migrate_path}/create_email_verification_tokens.rb"
|
68
|
-
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?
|
70
66
|
migration_template "migrations/create_events_migration.rb", "#{db_migrate_path}/create_events.rb" if options.trackable?
|
67
|
+
migration_template "migrations/create_password_reset_tokens_migration.rb", "#{db_migrate_path}/create_password_reset_tokens.rb"
|
71
68
|
migration_template "migrations/create_recovery_codes_migration.rb", "#{db_migrate_path}/create_recovery_codes.rb" if two_factor?
|
72
69
|
migration_template "migrations/create_security_keys_migration.rb", "#{db_migrate_path}/create_security_keys.rb" if webauthn?
|
70
|
+
migration_template "migrations/create_sessions_migration.rb", "#{db_migrate_path}/create_sessions.rb"
|
71
|
+
migration_template "migrations/create_sign_in_tokens_migration.rb", "#{db_migrate_path}/create_sign_in_tokens_migration.rb" if passwordless?
|
72
|
+
migration_template "migrations/create_users_migration.rb", "#{db_migrate_path}/create_users.rb"
|
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
|
-
|
88
|
+
copy_file "test_unit/users.yml", "test/fixtures/users.yml"
|
89
89
|
end
|
90
90
|
|
91
91
|
def create_controllers
|
92
|
-
template
|
92
|
+
template "controllers/#{format}/authentications/events_controller.rb", "app/controllers/authentications/events_controller.rb" if options.trackable?
|
93
93
|
|
94
|
-
directory "controllers/#{
|
94
|
+
directory "controllers/#{format}/identity", "app/controllers/identity"
|
95
95
|
|
96
|
-
if
|
97
|
-
|
98
|
-
|
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
|
-
|
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
|
107
|
-
template
|
108
|
-
template
|
109
|
-
template
|
110
|
-
template
|
111
|
-
template
|
112
|
-
template
|
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
|
-
|
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
|
-
|
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/#{
|
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
|
226
|
+
def format
|
231
227
|
options.api? ? "api" : "html"
|
232
228
|
end
|
233
229
|
|
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.
|
4
|
+
version: 2.16.27
|
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-
|
11
|
+
date: 2023-04-19 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
|
136
|
+
- lib/generators/authentication/templates/test_unit/users.yml
|
137
137
|
homepage: https://github.com/lazaronixon/authentication-zero
|
138
138
|
licenses:
|
139
139
|
- MIT
|