propel_authentication 0.1.3 → 0.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 +4 -4
- data/CHANGELOG.md +128 -0
- data/README.md +254 -116
- data/lib/generators/{propel_auth → propel_authentication}/install_generator.rb +152 -170
- data/lib/generators/propel_authentication/templates/application_mailer.rb +6 -0
- data/lib/generators/propel_authentication/templates/auth/passwords_controller.rb.tt +132 -0
- data/lib/generators/propel_authentication/templates/auth/signup_controller.rb.tt +242 -0
- data/lib/generators/{propel_auth/templates → propel_authentication/templates/auth}/tokens_controller.rb.tt +39 -22
- data/lib/generators/{propel_auth → propel_authentication}/templates/auth_mailer.rb +3 -1
- data/lib/generators/{propel_auth → propel_authentication}/templates/authenticatable.rb +10 -4
- data/lib/generators/{propel_auth → propel_authentication}/templates/concerns/confirmable.rb +3 -3
- data/lib/generators/{propel_auth → propel_authentication}/templates/concerns/lockable.rb +10 -8
- data/lib/generators/{propel_auth/templates/concerns/propel_authentication.rb → propel_authentication/templates/concerns/propel_authentication_concern.rb} +33 -3
- data/lib/generators/{propel_auth → propel_authentication}/templates/concerns/recoverable.rb +21 -11
- data/lib/generators/propel_authentication/templates/core/configuration_methods.rb +191 -0
- data/lib/generators/propel_authentication/templates/db/seeds.rb +75 -0
- data/lib/generators/propel_authentication/templates/doc/signup_flow.md +315 -0
- data/lib/generators/propel_authentication/templates/models/agency.rb.tt +13 -0
- data/lib/generators/propel_authentication/templates/models/agent.rb.tt +13 -0
- data/lib/generators/{propel_auth/templates/invitation.rb → propel_authentication/templates/models/invitation.rb.tt} +8 -2
- data/lib/generators/propel_authentication/templates/models/organization.rb.tt +12 -0
- data/lib/generators/{propel_auth/templates/user.rb → propel_authentication/templates/models/user.rb.tt} +5 -0
- data/lib/generators/propel_authentication/templates/propel_authentication.rb.tt +218 -0
- data/lib/generators/propel_authentication/templates/routes/auth_routes.rb.tt +55 -0
- data/lib/generators/{propel_auth → propel_authentication}/templates/services/auth_notification_service.rb +3 -3
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/concerns/confirmable_test.rb.tt +34 -10
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/concerns/lockable_test.rb.tt +12 -12
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/concerns/propel_authentication_test.rb.tt +2 -2
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/concerns/recoverable_test.rb.tt +11 -11
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/controllers/auth/lockable_integration_test.rb.tt +18 -15
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/controllers/auth/password_reset_integration_test.rb.tt +38 -40
- data/lib/generators/propel_authentication/templates/test/controllers/auth/signup_controller_test.rb.tt +201 -0
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/controllers/auth/tokens_controller_test.rb.tt +33 -25
- data/lib/generators/{propel_auth → propel_authentication}/templates/test/mailers/auth_mailer_test.rb.tt +51 -36
- data/lib/generators/{propel_auth → propel_authentication}/templates/user_test.rb.tt +1 -1
- data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/email_confirmation.html.erb +2 -2
- data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/email_confirmation.text.erb +1 -1
- data/lib/generators/{propel_auth → propel_authentication}/test/generators/authentication/install_generator_test.rb +4 -4
- data/lib/generators/{propel_auth → propel_authentication}/test/generators/authentication/uninstall_generator_test.rb +1 -1
- data/lib/generators/{propel_auth → propel_authentication}/test/integration/generator_integration_test.rb +1 -1
- data/lib/generators/{propel_auth → propel_authentication}/test/integration/multi_version_generator_test.rb +13 -12
- data/lib/generators/{propel_auth → propel_authentication}/unpack_generator.rb +55 -38
- data/lib/propel_authentication.rb +3 -0
- metadata +101 -98
- data/lib/generators/propel_auth/core/configuration_methods.rb +0 -134
- data/lib/generators/propel_auth/pack_generator.rb +0 -277
- data/lib/generators/propel_auth/templates/agency.rb +0 -7
- data/lib/generators/propel_auth/templates/agent.rb +0 -7
- data/lib/generators/propel_auth/templates/auth/base_passwords_controller.rb.tt +0 -99
- data/lib/generators/propel_auth/templates/auth/base_tokens_controller.rb.tt +0 -90
- data/lib/generators/propel_auth/templates/auth/passwords_controller.rb.tt +0 -126
- data/lib/generators/propel_auth/templates/db/seeds.rb +0 -29
- data/lib/generators/propel_auth/templates/organization.rb +0 -7
- data/lib/generators/propel_auth/templates/propel_auth.rb.tt +0 -141
- data/lib/propel_auth.rb +0 -3
- /data/lib/generators/{propel_auth → propel_authentication}/templates/concerns/rack_session_disable.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/config/environments/development_email.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/db/migrate/create_agencies.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/db/migrate/create_agents.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/db/migrate/create_invitations.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/db/migrate/create_organizations.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/db/migrate/create_users.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/test/mailers/previews/auth_mailer_preview.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/account_unlock.html.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/account_unlock.text.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/password_reset.html.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/password_reset.text.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/user_invitation.html.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/templates/views/auth_mailer/user_invitation.text.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/Dockerfile +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/Gemfile +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/README.md +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/Rakefile +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/assets/stylesheets/application.css +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/controllers/application_controller.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/helpers/application_helper.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/jobs/application_job.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/mailers/application_mailer.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/models/application_record.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/views/layouts/application.html.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/views/layouts/mailer.html.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/views/layouts/mailer.text.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/views/pwa/manifest.json.erb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/app/views/pwa/service-worker.js +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/brakeman +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/dev +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/docker-entrypoint +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/rails +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/rake +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/rubocop +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/setup +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/bin/thrust +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/application.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/boot.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/cable.yml +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/credentials.yml.enc +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/database.yml +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/environment.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/environments/development.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/environments/production.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/environments/test.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/initializers/assets.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/initializers/content_security_policy.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/initializers/filter_parameter_logging.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/initializers/inflections.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/locales/en.yml +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/master.key +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/puma.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/routes.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config/storage.yml +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/config.ru +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/dummy/db/schema.rb +0 -0
- /data/lib/generators/{propel_auth → propel_authentication}/test/generators/authentication/controllers/tokens_controller_test.rb +0 -0
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
# PropelAuth unpacker that extracts the authentication GENERATOR into the host application
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# rails generate
|
|
8
|
-
# rails generate
|
|
9
|
-
# rails generate
|
|
10
|
-
# rails generate
|
|
11
|
-
# rails generate
|
|
7
|
+
# rails generate propel_authentication:unpack # Unpack entire generator (code + templates)
|
|
8
|
+
# rails generate propel_authentication:unpack --force # Overwrite existing generator files
|
|
9
|
+
# rails generate propel_authentication:unpack --templates-only # Only copy templates, not generator logic
|
|
10
|
+
# rails generate propel_authentication:unpack --models-only # Only copy model templates
|
|
11
|
+
# rails generate propel_authentication:unpack --controllers-only # Only copy controller templates
|
|
12
12
|
#
|
|
13
|
-
# This extracts the
|
|
13
|
+
# This extracts the PropelAuthentication generator from the gem into lib/generators/propel_authentication/
|
|
14
14
|
# so you can customize the generator logic and templates for your specific needs.
|
|
15
15
|
#
|
|
16
|
-
class
|
|
16
|
+
class PropelAuthentication::UnpackGenerator < Rails::Generators::Base
|
|
17
17
|
source_root File.expand_path("templates", __dir__)
|
|
18
18
|
|
|
19
|
-
desc "Extract
|
|
19
|
+
desc "Extract PropelAuthentication generator code from gem to lib/generators/propel_authentication/ for full customization"
|
|
20
20
|
|
|
21
21
|
class_option :force,
|
|
22
22
|
type: :boolean,
|
|
@@ -47,7 +47,7 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
47
47
|
show_welcome_message
|
|
48
48
|
|
|
49
49
|
components_to_unpack = determine_components
|
|
50
|
-
destination_path = "lib/generators/
|
|
50
|
+
destination_path = "lib/generators/propel_authentication"
|
|
51
51
|
|
|
52
52
|
if File.exist?(destination_path) && !options[:force]
|
|
53
53
|
say "⚠️ #{destination_path} already exists (use --force to overwrite)", :yellow
|
|
@@ -69,11 +69,11 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
69
69
|
say "║ UNPACK PROPEL AUTH GENERATOR ║", :cyan
|
|
70
70
|
say "╚══════════════════════════════════════╝", :cyan
|
|
71
71
|
say ""
|
|
72
|
-
say "This extracts the
|
|
73
|
-
say "at lib/generators/
|
|
72
|
+
say "This extracts the PropelAuthentication generator from the gem into your app", :blue
|
|
73
|
+
say "at lib/generators/propel_authentication/ so you can customize generator logic and templates.", :blue
|
|
74
74
|
say ""
|
|
75
75
|
say "📦 FROM: Gem-based generator (black box)", :yellow
|
|
76
|
-
say "📁 TO: Local generator in lib/generators/
|
|
76
|
+
say "📁 TO: Local generator in lib/generators/propel_authentication/ (fully customizable)", :green
|
|
77
77
|
say ""
|
|
78
78
|
end
|
|
79
79
|
|
|
@@ -85,10 +85,10 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
85
85
|
elsif options[:tests_only]
|
|
86
86
|
return %w[tests]
|
|
87
87
|
elsif options[:templates_only]
|
|
88
|
-
return %w[models controllers tests views concerns services config db]
|
|
88
|
+
return %w[models controllers tests views concerns services config db core doc]
|
|
89
89
|
else
|
|
90
90
|
# Default: everything including generator logic
|
|
91
|
-
return %w[models controllers tests views concerns services config db generator]
|
|
91
|
+
return %w[models controllers tests views concerns services config db core doc generator]
|
|
92
92
|
end
|
|
93
93
|
end
|
|
94
94
|
|
|
@@ -118,6 +118,10 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
118
118
|
copy_config_templates(destination_path)
|
|
119
119
|
when 'db'
|
|
120
120
|
copy_db_templates(destination_path)
|
|
121
|
+
when 'core'
|
|
122
|
+
copy_core_templates(destination_path)
|
|
123
|
+
when 'doc'
|
|
124
|
+
copy_doc_templates(destination_path)
|
|
121
125
|
when 'generator'
|
|
122
126
|
copy_generator_logic(destination_path)
|
|
123
127
|
else
|
|
@@ -128,26 +132,27 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
128
132
|
def copy_model_templates(destination_path)
|
|
129
133
|
say "📂 Extracting model generator templates...", :blue
|
|
130
134
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
invitation.rb
|
|
137
|
-
authenticatable.rb
|
|
138
|
-
]
|
|
139
|
-
|
|
140
|
-
model_files.each do |file|
|
|
141
|
-
copy_template_file(file, destination_path)
|
|
142
|
-
end
|
|
135
|
+
# Copy the models directory with all .rb.tt templates
|
|
136
|
+
copy_directory_templates("models", destination_path)
|
|
137
|
+
|
|
138
|
+
# Also copy the authenticatable concern from root
|
|
139
|
+
copy_template_file("authenticatable.rb", destination_path)
|
|
143
140
|
|
|
144
141
|
say " ✅ Model generator templates extracted", :green
|
|
145
142
|
end
|
|
146
143
|
|
|
144
|
+
def copy_core_templates(destination_path)
|
|
145
|
+
say "📂 Extracting core generator templates...", :blue
|
|
146
|
+
|
|
147
|
+
copy_template_file("core/configuration_methods.rb", destination_path)
|
|
148
|
+
|
|
149
|
+
say " ✅ Core generator templates extracted", :green
|
|
150
|
+
end
|
|
151
|
+
|
|
147
152
|
def copy_controller_templates(destination_path)
|
|
148
153
|
say "📂 Extracting controller generator templates...", :blue
|
|
149
154
|
|
|
150
|
-
|
|
155
|
+
# All controller templates are now in the auth directory for better organization
|
|
151
156
|
copy_directory_templates("auth", destination_path)
|
|
152
157
|
|
|
153
158
|
say " ✅ Controller generator templates extracted", :green
|
|
@@ -190,8 +195,7 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
190
195
|
def copy_config_templates(destination_path)
|
|
191
196
|
say "📂 Extracting config generator templates...", :blue
|
|
192
197
|
|
|
193
|
-
copy_template_file("
|
|
194
|
-
copy_template_file("propel_auth_configuration.rb.tt", destination_path)
|
|
198
|
+
copy_template_file("propel_authentication.rb.tt", destination_path)
|
|
195
199
|
copy_directory_templates("config", destination_path)
|
|
196
200
|
|
|
197
201
|
say " ✅ Config generator templates extracted", :green
|
|
@@ -205,6 +209,14 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
205
209
|
say " ✅ Database generator templates extracted", :green
|
|
206
210
|
end
|
|
207
211
|
|
|
212
|
+
def copy_doc_templates(destination_path)
|
|
213
|
+
say "📂 Extracting documentation generator templates...", :blue
|
|
214
|
+
|
|
215
|
+
copy_directory_templates("doc", destination_path)
|
|
216
|
+
|
|
217
|
+
say " ✅ Documentation generator templates extracted", :green
|
|
218
|
+
end
|
|
219
|
+
|
|
208
220
|
def copy_generator_logic(destination_path)
|
|
209
221
|
say "📂 Extracting generator logic code...", :blue
|
|
210
222
|
|
|
@@ -217,12 +229,16 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
217
229
|
source_content = File.read(source_generator)
|
|
218
230
|
|
|
219
231
|
# Update module declaration to be properly namespaced in host app
|
|
232
|
+
# AND fix the require_relative path to point to templates/core
|
|
220
233
|
modified_content = source_content.gsub(
|
|
221
|
-
/^module
|
|
222
|
-
"module
|
|
234
|
+
/^module PropelAuthentication$/,
|
|
235
|
+
"module PropelAuthentication"
|
|
223
236
|
).gsub(
|
|
224
237
|
/^ class InstallGenerator/,
|
|
225
238
|
" class InstallGenerator"
|
|
239
|
+
).gsub(
|
|
240
|
+
/require_relative 'core\/configuration_methods'/,
|
|
241
|
+
"require_relative 'templates/core/configuration_methods'"
|
|
226
242
|
)
|
|
227
243
|
|
|
228
244
|
# Create the directory and write the modified generator
|
|
@@ -252,17 +268,17 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
252
268
|
end
|
|
253
269
|
|
|
254
270
|
def copy_lib_runtime(destination_path)
|
|
255
|
-
say "📂 Extracting
|
|
271
|
+
say "📂 Extracting PropelAuthentication runtime code...", :blue
|
|
256
272
|
|
|
257
|
-
lib_source = File.join(self.class.source_root, "lib", "
|
|
258
|
-
lib_dest = File.join(destination_path, "templates", "lib", "
|
|
273
|
+
lib_source = File.join(self.class.source_root, "lib", "propel_authentication.rb.tt")
|
|
274
|
+
lib_dest = File.join(destination_path, "templates", "lib", "propel_authentication.rb.tt")
|
|
259
275
|
|
|
260
276
|
if File.exist?(lib_source)
|
|
261
277
|
FileUtils.mkdir_p(File.dirname(lib_dest))
|
|
262
278
|
FileUtils.cp(lib_source, lib_dest)
|
|
263
|
-
say " ✅
|
|
279
|
+
say " ✅ PropelAuthentication runtime code extracted", :green
|
|
264
280
|
else
|
|
265
|
-
say " ⚠️
|
|
281
|
+
say " ⚠️ PropelAuthentication runtime template not found", :yellow
|
|
266
282
|
end
|
|
267
283
|
end
|
|
268
284
|
|
|
@@ -305,7 +321,7 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
305
321
|
|
|
306
322
|
def show_completion_message(destination_path)
|
|
307
323
|
say ""
|
|
308
|
-
say "🎉
|
|
324
|
+
say "🎉 PropelAuthentication GENERATOR unpacked successfully!", :green
|
|
309
325
|
say ""
|
|
310
326
|
say "📁 Generator extracted to: #{destination_path}/", :bold
|
|
311
327
|
say "📂 Templates available at: #{destination_path}/templates/", :bold
|
|
@@ -318,6 +334,7 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
318
334
|
say " 🧪 Test templates: #{destination_path}/templates/test/"
|
|
319
335
|
say " 📧 Email templates: #{destination_path}/templates/views/auth_mailer/"
|
|
320
336
|
say " ⚙️ Config templates: #{destination_path}/templates/config/"
|
|
337
|
+
say " 📚 Documentation templates: #{destination_path}/templates/doc/"
|
|
321
338
|
say ""
|
|
322
339
|
|
|
323
340
|
say "⚠️ Important: You now have a LOCAL GENERATOR, not gem generator:", :yellow
|
|
@@ -329,7 +346,7 @@ class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
|
|
329
346
|
|
|
330
347
|
say "💡 Test your customized generator:", :blue
|
|
331
348
|
say " # Your local generator will be used instead of the gem:"
|
|
332
|
-
say " rails generate
|
|
349
|
+
say " rails generate propel_authentication:install"
|
|
333
350
|
say ""
|
|
334
351
|
|
|
335
352
|
say "🔄 To use gem generator again:", :cyan
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: propel_authentication
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Propel Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -67,105 +67,108 @@ executables: []
|
|
|
67
67
|
extensions: []
|
|
68
68
|
extra_rdoc_files: []
|
|
69
69
|
files:
|
|
70
|
+
- CHANGELOG.md
|
|
70
71
|
- LICENSE
|
|
71
72
|
- README.md
|
|
72
73
|
- Rakefile
|
|
73
|
-
- lib/generators/
|
|
74
|
-
- lib/generators/
|
|
75
|
-
- lib/generators/
|
|
76
|
-
- lib/generators/
|
|
77
|
-
- lib/generators/
|
|
78
|
-
- lib/generators/
|
|
79
|
-
- lib/generators/
|
|
80
|
-
- lib/generators/
|
|
81
|
-
- lib/generators/
|
|
82
|
-
- lib/generators/
|
|
83
|
-
- lib/generators/
|
|
84
|
-
- lib/generators/
|
|
85
|
-
- lib/generators/
|
|
86
|
-
- lib/generators/
|
|
87
|
-
- lib/generators/
|
|
88
|
-
- lib/generators/
|
|
89
|
-
- lib/generators/
|
|
90
|
-
- lib/generators/
|
|
91
|
-
- lib/generators/
|
|
92
|
-
- lib/generators/
|
|
93
|
-
- lib/generators/
|
|
94
|
-
- lib/generators/
|
|
95
|
-
- lib/generators/
|
|
96
|
-
- lib/generators/
|
|
97
|
-
- lib/generators/
|
|
98
|
-
- lib/generators/
|
|
99
|
-
- lib/generators/
|
|
100
|
-
- lib/generators/
|
|
101
|
-
- lib/generators/
|
|
102
|
-
- lib/generators/
|
|
103
|
-
- lib/generators/
|
|
104
|
-
- lib/generators/
|
|
105
|
-
- lib/generators/
|
|
106
|
-
- lib/generators/
|
|
107
|
-
- lib/generators/
|
|
108
|
-
- lib/generators/
|
|
109
|
-
- lib/generators/
|
|
110
|
-
- lib/generators/
|
|
111
|
-
- lib/generators/
|
|
112
|
-
- lib/generators/
|
|
113
|
-
- lib/generators/
|
|
114
|
-
- lib/generators/
|
|
115
|
-
- lib/generators/
|
|
116
|
-
- lib/generators/
|
|
117
|
-
- lib/generators/
|
|
118
|
-
- lib/generators/
|
|
119
|
-
- lib/generators/
|
|
120
|
-
- lib/generators/
|
|
121
|
-
- lib/generators/
|
|
122
|
-
- lib/generators/
|
|
123
|
-
- lib/generators/
|
|
124
|
-
- lib/generators/
|
|
125
|
-
- lib/generators/
|
|
126
|
-
- lib/generators/
|
|
127
|
-
- lib/generators/
|
|
128
|
-
- lib/generators/
|
|
129
|
-
- lib/generators/
|
|
130
|
-
- lib/generators/
|
|
131
|
-
- lib/generators/
|
|
132
|
-
- lib/generators/
|
|
133
|
-
- lib/generators/
|
|
134
|
-
- lib/generators/
|
|
135
|
-
- lib/generators/
|
|
136
|
-
- lib/generators/
|
|
137
|
-
- lib/generators/
|
|
138
|
-
- lib/generators/
|
|
139
|
-
- lib/generators/
|
|
140
|
-
- lib/generators/
|
|
141
|
-
- lib/generators/
|
|
142
|
-
- lib/generators/
|
|
143
|
-
- lib/generators/
|
|
144
|
-
- lib/generators/
|
|
145
|
-
- lib/generators/
|
|
146
|
-
- lib/generators/
|
|
147
|
-
- lib/generators/
|
|
148
|
-
- lib/generators/
|
|
149
|
-
- lib/generators/
|
|
150
|
-
- lib/generators/
|
|
151
|
-
- lib/generators/
|
|
152
|
-
- lib/generators/
|
|
153
|
-
- lib/generators/
|
|
154
|
-
- lib/generators/
|
|
155
|
-
- lib/generators/
|
|
156
|
-
- lib/generators/
|
|
157
|
-
- lib/generators/
|
|
158
|
-
- lib/generators/
|
|
159
|
-
- lib/generators/
|
|
160
|
-
- lib/generators/
|
|
161
|
-
- lib/generators/
|
|
162
|
-
- lib/generators/
|
|
163
|
-
- lib/generators/
|
|
164
|
-
- lib/generators/
|
|
165
|
-
- lib/generators/
|
|
166
|
-
- lib/generators/
|
|
167
|
-
- lib/generators/
|
|
168
|
-
- lib/
|
|
74
|
+
- lib/generators/propel_authentication/install_generator.rb
|
|
75
|
+
- lib/generators/propel_authentication/templates/application_mailer.rb
|
|
76
|
+
- lib/generators/propel_authentication/templates/auth/passwords_controller.rb.tt
|
|
77
|
+
- lib/generators/propel_authentication/templates/auth/signup_controller.rb.tt
|
|
78
|
+
- lib/generators/propel_authentication/templates/auth/tokens_controller.rb.tt
|
|
79
|
+
- lib/generators/propel_authentication/templates/auth_mailer.rb
|
|
80
|
+
- lib/generators/propel_authentication/templates/authenticatable.rb
|
|
81
|
+
- lib/generators/propel_authentication/templates/concerns/confirmable.rb
|
|
82
|
+
- lib/generators/propel_authentication/templates/concerns/lockable.rb
|
|
83
|
+
- lib/generators/propel_authentication/templates/concerns/propel_authentication_concern.rb
|
|
84
|
+
- lib/generators/propel_authentication/templates/concerns/rack_session_disable.rb
|
|
85
|
+
- lib/generators/propel_authentication/templates/concerns/recoverable.rb
|
|
86
|
+
- lib/generators/propel_authentication/templates/config/environments/development_email.rb
|
|
87
|
+
- lib/generators/propel_authentication/templates/core/configuration_methods.rb
|
|
88
|
+
- lib/generators/propel_authentication/templates/db/migrate/create_agencies.rb
|
|
89
|
+
- lib/generators/propel_authentication/templates/db/migrate/create_agents.rb
|
|
90
|
+
- lib/generators/propel_authentication/templates/db/migrate/create_invitations.rb
|
|
91
|
+
- lib/generators/propel_authentication/templates/db/migrate/create_organizations.rb
|
|
92
|
+
- lib/generators/propel_authentication/templates/db/migrate/create_users.rb
|
|
93
|
+
- lib/generators/propel_authentication/templates/db/seeds.rb
|
|
94
|
+
- lib/generators/propel_authentication/templates/doc/signup_flow.md
|
|
95
|
+
- lib/generators/propel_authentication/templates/models/agency.rb.tt
|
|
96
|
+
- lib/generators/propel_authentication/templates/models/agent.rb.tt
|
|
97
|
+
- lib/generators/propel_authentication/templates/models/invitation.rb.tt
|
|
98
|
+
- lib/generators/propel_authentication/templates/models/organization.rb.tt
|
|
99
|
+
- lib/generators/propel_authentication/templates/models/user.rb.tt
|
|
100
|
+
- lib/generators/propel_authentication/templates/propel_authentication.rb.tt
|
|
101
|
+
- lib/generators/propel_authentication/templates/routes/auth_routes.rb.tt
|
|
102
|
+
- lib/generators/propel_authentication/templates/services/auth_notification_service.rb
|
|
103
|
+
- lib/generators/propel_authentication/templates/test/concerns/confirmable_test.rb.tt
|
|
104
|
+
- lib/generators/propel_authentication/templates/test/concerns/lockable_test.rb.tt
|
|
105
|
+
- lib/generators/propel_authentication/templates/test/concerns/propel_authentication_test.rb.tt
|
|
106
|
+
- lib/generators/propel_authentication/templates/test/concerns/recoverable_test.rb.tt
|
|
107
|
+
- lib/generators/propel_authentication/templates/test/controllers/auth/lockable_integration_test.rb.tt
|
|
108
|
+
- lib/generators/propel_authentication/templates/test/controllers/auth/password_reset_integration_test.rb.tt
|
|
109
|
+
- lib/generators/propel_authentication/templates/test/controllers/auth/signup_controller_test.rb.tt
|
|
110
|
+
- lib/generators/propel_authentication/templates/test/controllers/auth/tokens_controller_test.rb.tt
|
|
111
|
+
- lib/generators/propel_authentication/templates/test/mailers/auth_mailer_test.rb.tt
|
|
112
|
+
- lib/generators/propel_authentication/templates/test/mailers/previews/auth_mailer_preview.rb
|
|
113
|
+
- lib/generators/propel_authentication/templates/user_test.rb.tt
|
|
114
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/account_unlock.html.erb
|
|
115
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/account_unlock.text.erb
|
|
116
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/email_confirmation.html.erb
|
|
117
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/email_confirmation.text.erb
|
|
118
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/password_reset.html.erb
|
|
119
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/password_reset.text.erb
|
|
120
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/user_invitation.html.erb
|
|
121
|
+
- lib/generators/propel_authentication/templates/views/auth_mailer/user_invitation.text.erb
|
|
122
|
+
- lib/generators/propel_authentication/test/dummy/Dockerfile
|
|
123
|
+
- lib/generators/propel_authentication/test/dummy/Gemfile
|
|
124
|
+
- lib/generators/propel_authentication/test/dummy/README.md
|
|
125
|
+
- lib/generators/propel_authentication/test/dummy/Rakefile
|
|
126
|
+
- lib/generators/propel_authentication/test/dummy/app/assets/stylesheets/application.css
|
|
127
|
+
- lib/generators/propel_authentication/test/dummy/app/controllers/application_controller.rb
|
|
128
|
+
- lib/generators/propel_authentication/test/dummy/app/helpers/application_helper.rb
|
|
129
|
+
- lib/generators/propel_authentication/test/dummy/app/jobs/application_job.rb
|
|
130
|
+
- lib/generators/propel_authentication/test/dummy/app/mailers/application_mailer.rb
|
|
131
|
+
- lib/generators/propel_authentication/test/dummy/app/models/application_record.rb
|
|
132
|
+
- lib/generators/propel_authentication/test/dummy/app/views/layouts/application.html.erb
|
|
133
|
+
- lib/generators/propel_authentication/test/dummy/app/views/layouts/mailer.html.erb
|
|
134
|
+
- lib/generators/propel_authentication/test/dummy/app/views/layouts/mailer.text.erb
|
|
135
|
+
- lib/generators/propel_authentication/test/dummy/app/views/pwa/manifest.json.erb
|
|
136
|
+
- lib/generators/propel_authentication/test/dummy/app/views/pwa/service-worker.js
|
|
137
|
+
- lib/generators/propel_authentication/test/dummy/bin/brakeman
|
|
138
|
+
- lib/generators/propel_authentication/test/dummy/bin/dev
|
|
139
|
+
- lib/generators/propel_authentication/test/dummy/bin/docker-entrypoint
|
|
140
|
+
- lib/generators/propel_authentication/test/dummy/bin/rails
|
|
141
|
+
- lib/generators/propel_authentication/test/dummy/bin/rake
|
|
142
|
+
- lib/generators/propel_authentication/test/dummy/bin/rubocop
|
|
143
|
+
- lib/generators/propel_authentication/test/dummy/bin/setup
|
|
144
|
+
- lib/generators/propel_authentication/test/dummy/bin/thrust
|
|
145
|
+
- lib/generators/propel_authentication/test/dummy/config.ru
|
|
146
|
+
- lib/generators/propel_authentication/test/dummy/config/application.rb
|
|
147
|
+
- lib/generators/propel_authentication/test/dummy/config/boot.rb
|
|
148
|
+
- lib/generators/propel_authentication/test/dummy/config/cable.yml
|
|
149
|
+
- lib/generators/propel_authentication/test/dummy/config/credentials.yml.enc
|
|
150
|
+
- lib/generators/propel_authentication/test/dummy/config/database.yml
|
|
151
|
+
- lib/generators/propel_authentication/test/dummy/config/environment.rb
|
|
152
|
+
- lib/generators/propel_authentication/test/dummy/config/environments/development.rb
|
|
153
|
+
- lib/generators/propel_authentication/test/dummy/config/environments/production.rb
|
|
154
|
+
- lib/generators/propel_authentication/test/dummy/config/environments/test.rb
|
|
155
|
+
- lib/generators/propel_authentication/test/dummy/config/initializers/assets.rb
|
|
156
|
+
- lib/generators/propel_authentication/test/dummy/config/initializers/content_security_policy.rb
|
|
157
|
+
- lib/generators/propel_authentication/test/dummy/config/initializers/filter_parameter_logging.rb
|
|
158
|
+
- lib/generators/propel_authentication/test/dummy/config/initializers/inflections.rb
|
|
159
|
+
- lib/generators/propel_authentication/test/dummy/config/locales/en.yml
|
|
160
|
+
- lib/generators/propel_authentication/test/dummy/config/master.key
|
|
161
|
+
- lib/generators/propel_authentication/test/dummy/config/puma.rb
|
|
162
|
+
- lib/generators/propel_authentication/test/dummy/config/routes.rb
|
|
163
|
+
- lib/generators/propel_authentication/test/dummy/config/storage.yml
|
|
164
|
+
- lib/generators/propel_authentication/test/dummy/db/schema.rb
|
|
165
|
+
- lib/generators/propel_authentication/test/generators/authentication/controllers/tokens_controller_test.rb
|
|
166
|
+
- lib/generators/propel_authentication/test/generators/authentication/install_generator_test.rb
|
|
167
|
+
- lib/generators/propel_authentication/test/generators/authentication/uninstall_generator_test.rb
|
|
168
|
+
- lib/generators/propel_authentication/test/integration/generator_integration_test.rb
|
|
169
|
+
- lib/generators/propel_authentication/test/integration/multi_version_generator_test.rb
|
|
170
|
+
- lib/generators/propel_authentication/unpack_generator.rb
|
|
171
|
+
- lib/propel_authentication.rb
|
|
169
172
|
homepage: https://github.com/propel-hq/propel_rails.git
|
|
170
173
|
licenses:
|
|
171
174
|
- MIT
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
# Module providing configuration detection and validation for PropelAuth generators
|
|
5
|
-
#
|
|
6
|
-
module PropelAuth
|
|
7
|
-
module ConfigurationMethods
|
|
8
|
-
|
|
9
|
-
# Shared class options across all PropelAuth generators
|
|
10
|
-
def self.included(base)
|
|
11
|
-
base.class_option :namespace,
|
|
12
|
-
type: :string,
|
|
13
|
-
default: nil,
|
|
14
|
-
desc: "Authentication namespace (e.g., 'api', 'admin_api'). Use 'none' for no namespace. Defaults to PropelAuth configuration."
|
|
15
|
-
|
|
16
|
-
base.class_option :version,
|
|
17
|
-
type: :string,
|
|
18
|
-
default: nil,
|
|
19
|
-
desc: "Authentication version (e.g., 'v1', 'v2'). Use 'none' for no versioning. Defaults to PropelAuth configuration."
|
|
20
|
-
|
|
21
|
-
# Legacy support for existing --api-version option
|
|
22
|
-
base.class_option :api_version,
|
|
23
|
-
type: :string,
|
|
24
|
-
default: nil,
|
|
25
|
-
desc: "Legacy: Use --version instead. Authentication version (e.g., 'v1', 'v2')."
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
protected
|
|
29
|
-
|
|
30
|
-
# Initialize shared PropelAuth settings used across all generators
|
|
31
|
-
def initialize_propel_auth_settings
|
|
32
|
-
@auth_namespace = determine_auth_namespace
|
|
33
|
-
@auth_version = determine_auth_version
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Determine the authentication namespace to use
|
|
37
|
-
# Priority order:
|
|
38
|
-
# 1. Command line option (--namespace)
|
|
39
|
-
# 2. PropelAuth configuration (if exists)
|
|
40
|
-
# 3. Default fallback (nil for clean URLs like /login)
|
|
41
|
-
def determine_auth_namespace
|
|
42
|
-
if options[:namespace] == 'none'
|
|
43
|
-
return nil
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
if options[:namespace].present?
|
|
47
|
-
return options[:namespace]
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Try to read from PropelAuth configuration
|
|
51
|
-
begin
|
|
52
|
-
if defined?(PropelAuth) && PropelAuth.configuration.respond_to?(:namespace)
|
|
53
|
-
config_namespace = PropelAuth.configuration.namespace
|
|
54
|
-
return config_namespace if config_namespace.present? && config_namespace != 'none'
|
|
55
|
-
end
|
|
56
|
-
rescue => e
|
|
57
|
-
# Configuration not available, continue to default
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# Default fallback - no namespace for clean URLs
|
|
61
|
-
nil
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Determine the authentication version to use
|
|
65
|
-
# Priority order:
|
|
66
|
-
# 1. Command line option (--version or legacy --api-version)
|
|
67
|
-
# 2. PropelAuth configuration (if exists)
|
|
68
|
-
# 3. Default fallback (nil for clean URLs like /login)
|
|
69
|
-
def determine_auth_version
|
|
70
|
-
# Check for 'none' in either option
|
|
71
|
-
if options[:version] == 'none' || options[:api_version] == 'none'
|
|
72
|
-
return nil
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# Check explicit version option first
|
|
76
|
-
if options[:version].present?
|
|
77
|
-
return options[:version]
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# Check legacy api_version option
|
|
81
|
-
if options[:api_version].present?
|
|
82
|
-
return options[:api_version]
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# Try to read from PropelAuth configuration
|
|
86
|
-
begin
|
|
87
|
-
if defined?(PropelAuth) && PropelAuth.configuration.respond_to?(:version)
|
|
88
|
-
config_version = PropelAuth.configuration.version
|
|
89
|
-
return config_version if config_version.present? && config_version != 'none'
|
|
90
|
-
end
|
|
91
|
-
rescue => e
|
|
92
|
-
# Configuration not available, continue to default
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
# Default fallback - no version for clean URLs
|
|
96
|
-
nil
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# Display helpers for logging
|
|
100
|
-
def namespace_display
|
|
101
|
-
@auth_namespace.present? ? @auth_namespace : 'none'
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
def version_display
|
|
105
|
-
@auth_version.present? ? @auth_version : 'none'
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
# Authentication route path generation
|
|
109
|
-
def auth_route_prefix
|
|
110
|
-
path_parts = []
|
|
111
|
-
path_parts << @auth_namespace if @auth_namespace.present?
|
|
112
|
-
path_parts << @auth_version if @auth_version.present?
|
|
113
|
-
return '/' if path_parts.empty?
|
|
114
|
-
'/' + path_parts.join('/')
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
# Authentication controller namespace generation
|
|
118
|
-
def auth_controller_namespace
|
|
119
|
-
class_parts = []
|
|
120
|
-
class_parts << @auth_namespace.camelize if @auth_namespace.present?
|
|
121
|
-
class_parts << @auth_version.upcase if @auth_version.present?
|
|
122
|
-
class_parts.empty? ? 'Auth' : class_parts.join('::') + '::Auth'
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
# Authentication controller directory path
|
|
126
|
-
def auth_controller_directory
|
|
127
|
-
path_parts = ['app', 'controllers']
|
|
128
|
-
path_parts << @auth_namespace if @auth_namespace.present?
|
|
129
|
-
path_parts << @auth_version if @auth_version.present?
|
|
130
|
-
path_parts << 'auth'
|
|
131
|
-
path_parts.join('/')
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
end
|