propel_authentication 0.1.1
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +290 -0
- data/Rakefile +12 -0
- data/lib/generators/propel_auth/install_generator.rb +486 -0
- data/lib/generators/propel_auth/pack_generator.rb +277 -0
- data/lib/generators/propel_auth/templates/agency.rb +7 -0
- data/lib/generators/propel_auth/templates/agent.rb +7 -0
- data/lib/generators/propel_auth/templates/auth/base_passwords_controller.rb.tt +99 -0
- data/lib/generators/propel_auth/templates/auth/base_tokens_controller.rb.tt +90 -0
- data/lib/generators/propel_auth/templates/auth/passwords_controller.rb.tt +126 -0
- data/lib/generators/propel_auth/templates/auth_mailer.rb +180 -0
- data/lib/generators/propel_auth/templates/authenticatable.rb +38 -0
- data/lib/generators/propel_auth/templates/concerns/confirmable.rb +145 -0
- data/lib/generators/propel_auth/templates/concerns/lockable.rb +123 -0
- data/lib/generators/propel_auth/templates/concerns/propel_authentication.rb +44 -0
- data/lib/generators/propel_auth/templates/concerns/rack_session_disable.rb +19 -0
- data/lib/generators/propel_auth/templates/concerns/recoverable.rb +124 -0
- data/lib/generators/propel_auth/templates/config/environments/development_email.rb +43 -0
- data/lib/generators/propel_auth/templates/db/migrate/create_agencies.rb +20 -0
- data/lib/generators/propel_auth/templates/db/migrate/create_agents.rb +11 -0
- data/lib/generators/propel_auth/templates/db/migrate/create_invitations.rb +28 -0
- data/lib/generators/propel_auth/templates/db/migrate/create_organizations.rb +18 -0
- data/lib/generators/propel_auth/templates/db/migrate/create_users.rb +43 -0
- data/lib/generators/propel_auth/templates/db/seeds.rb +29 -0
- data/lib/generators/propel_auth/templates/invitation.rb +133 -0
- data/lib/generators/propel_auth/templates/lib/propel_auth.rb +84 -0
- data/lib/generators/propel_auth/templates/organization.rb +7 -0
- data/lib/generators/propel_auth/templates/propel_auth.rb +132 -0
- data/lib/generators/propel_auth/templates/services/auth_notification_service.rb +89 -0
- data/lib/generators/propel_auth/templates/test/concerns/confirmable_test.rb.tt +247 -0
- data/lib/generators/propel_auth/templates/test/concerns/lockable_test.rb.tt +282 -0
- data/lib/generators/propel_auth/templates/test/concerns/propel_authentication_test.rb.tt +75 -0
- data/lib/generators/propel_auth/templates/test/concerns/recoverable_test.rb.tt +327 -0
- data/lib/generators/propel_auth/templates/test/controllers/auth/lockable_integration_test.rb.tt +196 -0
- data/lib/generators/propel_auth/templates/test/controllers/auth/password_reset_integration_test.rb.tt +471 -0
- data/lib/generators/propel_auth/templates/test/controllers/auth/tokens_controller_test.rb.tt +265 -0
- data/lib/generators/propel_auth/templates/test/mailers/auth_mailer_test.rb.tt +216 -0
- data/lib/generators/propel_auth/templates/test/mailers/previews/auth_mailer_preview.rb +161 -0
- data/lib/generators/propel_auth/templates/tokens_controller.rb.tt +96 -0
- data/lib/generators/propel_auth/templates/user.rb +21 -0
- data/lib/generators/propel_auth/templates/user_test.rb.tt +81 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/account_unlock.html.erb +213 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/account_unlock.text.erb +56 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/email_confirmation.html.erb +213 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/email_confirmation.text.erb +32 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/password_reset.html.erb +166 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/password_reset.text.erb +32 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/user_invitation.html.erb +194 -0
- data/lib/generators/propel_auth/templates/views/auth_mailer/user_invitation.text.erb +51 -0
- data/lib/generators/propel_auth/test/dummy/Dockerfile +72 -0
- data/lib/generators/propel_auth/test/dummy/Gemfile +63 -0
- data/lib/generators/propel_auth/test/dummy/Gemfile.lock +394 -0
- data/lib/generators/propel_auth/test/dummy/README.md +24 -0
- data/lib/generators/propel_auth/test/dummy/Rakefile +6 -0
- data/lib/generators/propel_auth/test/dummy/app/assets/stylesheets/application.css +10 -0
- data/lib/generators/propel_auth/test/dummy/app/controllers/application_controller.rb +4 -0
- data/lib/generators/propel_auth/test/dummy/app/helpers/application_helper.rb +2 -0
- data/lib/generators/propel_auth/test/dummy/app/jobs/application_job.rb +7 -0
- data/lib/generators/propel_auth/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/lib/generators/propel_auth/test/dummy/app/models/application_record.rb +3 -0
- data/lib/generators/propel_auth/test/dummy/app/views/layouts/application.html.erb +27 -0
- data/lib/generators/propel_auth/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/lib/generators/propel_auth/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/lib/generators/propel_auth/test/dummy/app/views/pwa/manifest.json.erb +22 -0
- data/lib/generators/propel_auth/test/dummy/app/views/pwa/service-worker.js +26 -0
- data/lib/generators/propel_auth/test/dummy/bin/brakeman +7 -0
- data/lib/generators/propel_auth/test/dummy/bin/dev +2 -0
- data/lib/generators/propel_auth/test/dummy/bin/docker-entrypoint +14 -0
- data/lib/generators/propel_auth/test/dummy/bin/rails +4 -0
- data/lib/generators/propel_auth/test/dummy/bin/rake +4 -0
- data/lib/generators/propel_auth/test/dummy/bin/rubocop +8 -0
- data/lib/generators/propel_auth/test/dummy/bin/setup +34 -0
- data/lib/generators/propel_auth/test/dummy/bin/thrust +5 -0
- data/lib/generators/propel_auth/test/dummy/config/application.rb +42 -0
- data/lib/generators/propel_auth/test/dummy/config/boot.rb +4 -0
- data/lib/generators/propel_auth/test/dummy/config/cable.yml +10 -0
- data/lib/generators/propel_auth/test/dummy/config/credentials.yml.enc +1 -0
- data/lib/generators/propel_auth/test/dummy/config/database.yml +41 -0
- data/lib/generators/propel_auth/test/dummy/config/environment.rb +5 -0
- data/lib/generators/propel_auth/test/dummy/config/environments/development.rb +72 -0
- data/lib/generators/propel_auth/test/dummy/config/environments/production.rb +89 -0
- data/lib/generators/propel_auth/test/dummy/config/environments/test.rb +53 -0
- data/lib/generators/propel_auth/test/dummy/config/initializers/assets.rb +10 -0
- data/lib/generators/propel_auth/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/lib/generators/propel_auth/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/lib/generators/propel_auth/test/dummy/config/initializers/inflections.rb +16 -0
- data/lib/generators/propel_auth/test/dummy/config/locales/en.yml +31 -0
- data/lib/generators/propel_auth/test/dummy/config/master.key +1 -0
- data/lib/generators/propel_auth/test/dummy/config/puma.rb +41 -0
- data/lib/generators/propel_auth/test/dummy/config/routes.rb +2 -0
- data/lib/generators/propel_auth/test/dummy/config/storage.yml +34 -0
- data/lib/generators/propel_auth/test/dummy/config.ru +6 -0
- data/lib/generators/propel_auth/test/dummy/db/schema.rb +14 -0
- data/lib/generators/propel_auth/test/generators/authentication/controllers/tokens_controller_test.rb +230 -0
- data/lib/generators/propel_auth/test/generators/authentication/install_generator_test.rb +490 -0
- data/lib/generators/propel_auth/test/generators/authentication/uninstall_generator_test.rb +408 -0
- data/lib/generators/propel_auth/test/integration/generator_integration_test.rb +158 -0
- data/lib/generators/propel_auth/test/integration/multi_version_generator_test.rb +125 -0
- data/lib/generators/propel_auth/unpack_generator.rb +345 -0
- data/lib/propel_auth.rb +3 -0
- metadata +195 -0
@@ -0,0 +1,345 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
# PropelAuth unpacker that extracts the authentication GENERATOR into the host application
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
# rails generate propel_auth:unpack # Unpack entire generator (code + templates)
|
8
|
+
# rails generate propel_auth:unpack --force # Overwrite existing generator files
|
9
|
+
# rails generate propel_auth:unpack --templates-only # Only copy templates, not generator logic
|
10
|
+
# rails generate propel_auth:unpack --models-only # Only copy model templates
|
11
|
+
# rails generate propel_auth:unpack --controllers-only # Only copy controller templates
|
12
|
+
#
|
13
|
+
# This extracts the PropelAuth generator from the gem into lib/generators/propel_auth/
|
14
|
+
# so you can customize the generator logic and templates for your specific needs.
|
15
|
+
#
|
16
|
+
class PropelAuth::UnpackGenerator < Rails::Generators::Base
|
17
|
+
source_root File.expand_path("templates", __dir__)
|
18
|
+
|
19
|
+
desc "Extract PropelAuth generator code from gem to lib/generators/propel_auth/ for full customization"
|
20
|
+
|
21
|
+
class_option :force,
|
22
|
+
type: :boolean,
|
23
|
+
default: false,
|
24
|
+
desc: "Overwrite existing generator files"
|
25
|
+
|
26
|
+
class_option :templates_only,
|
27
|
+
type: :boolean,
|
28
|
+
default: false,
|
29
|
+
desc: "Extract only generator templates, not generator logic"
|
30
|
+
|
31
|
+
class_option :models_only,
|
32
|
+
type: :boolean,
|
33
|
+
default: false,
|
34
|
+
desc: "Extract only model generator templates"
|
35
|
+
|
36
|
+
class_option :controllers_only,
|
37
|
+
type: :boolean,
|
38
|
+
default: false,
|
39
|
+
desc: "Extract only controller generator templates"
|
40
|
+
|
41
|
+
class_option :tests_only,
|
42
|
+
type: :boolean,
|
43
|
+
default: false,
|
44
|
+
desc: "Extract only test generator templates"
|
45
|
+
|
46
|
+
def unpack_propel_auth_generator
|
47
|
+
show_welcome_message
|
48
|
+
|
49
|
+
components_to_unpack = determine_components
|
50
|
+
destination_path = "lib/generators/propel_auth"
|
51
|
+
|
52
|
+
if File.exist?(destination_path) && !options[:force]
|
53
|
+
say "⚠️ #{destination_path} already exists (use --force to overwrite)", :yellow
|
54
|
+
return
|
55
|
+
end
|
56
|
+
|
57
|
+
say "📦 Extracting PropelAuth generator components: #{components_to_unpack.join(', ')}", :green
|
58
|
+
say ""
|
59
|
+
|
60
|
+
unpack_components(components_to_unpack, destination_path)
|
61
|
+
show_completion_message(destination_path)
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def show_welcome_message
|
67
|
+
say ""
|
68
|
+
say "╔══════════════════════════════════════╗", :cyan
|
69
|
+
say "║ UNPACK PROPEL AUTH GENERATOR ║", :cyan
|
70
|
+
say "╚══════════════════════════════════════╝", :cyan
|
71
|
+
say ""
|
72
|
+
say "This extracts the PropelAuth generator from the gem into your app", :blue
|
73
|
+
say "at lib/generators/propel_auth/ so you can customize generator logic and templates.", :blue
|
74
|
+
say ""
|
75
|
+
say "📦 FROM: Gem-based generator (black box)", :yellow
|
76
|
+
say "📁 TO: Local generator in lib/generators/propel_auth/ (fully customizable)", :green
|
77
|
+
say ""
|
78
|
+
end
|
79
|
+
|
80
|
+
def determine_components
|
81
|
+
if options[:models_only]
|
82
|
+
return %w[models]
|
83
|
+
elsif options[:controllers_only]
|
84
|
+
return %w[controllers]
|
85
|
+
elsif options[:tests_only]
|
86
|
+
return %w[tests]
|
87
|
+
elsif options[:templates_only]
|
88
|
+
return %w[models controllers tests views concerns services config db]
|
89
|
+
else
|
90
|
+
# Default: everything including generator logic
|
91
|
+
return %w[models controllers tests views concerns services config db generator]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def unpack_components(components, destination_path)
|
96
|
+
FileUtils.mkdir_p(destination_path)
|
97
|
+
|
98
|
+
components.each do |component|
|
99
|
+
unpack_component(component, destination_path)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def unpack_component(component, destination_path)
|
104
|
+
case component
|
105
|
+
when 'models'
|
106
|
+
copy_model_templates(destination_path)
|
107
|
+
when 'controllers'
|
108
|
+
copy_controller_templates(destination_path)
|
109
|
+
when 'tests'
|
110
|
+
copy_test_templates(destination_path)
|
111
|
+
when 'views'
|
112
|
+
copy_view_templates(destination_path)
|
113
|
+
when 'concerns'
|
114
|
+
copy_concern_templates(destination_path)
|
115
|
+
when 'services'
|
116
|
+
copy_service_templates(destination_path)
|
117
|
+
when 'config'
|
118
|
+
copy_config_templates(destination_path)
|
119
|
+
when 'db'
|
120
|
+
copy_db_templates(destination_path)
|
121
|
+
when 'generator'
|
122
|
+
copy_generator_logic(destination_path)
|
123
|
+
else
|
124
|
+
say " ⚠️ Unknown component: #{component}", :red
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def copy_model_templates(destination_path)
|
129
|
+
say "📂 Extracting model generator templates...", :blue
|
130
|
+
|
131
|
+
model_files = %w[
|
132
|
+
user.rb
|
133
|
+
organization.rb
|
134
|
+
agency.rb
|
135
|
+
agent.rb
|
136
|
+
invitation.rb
|
137
|
+
authenticatable.rb
|
138
|
+
]
|
139
|
+
|
140
|
+
model_files.each do |file|
|
141
|
+
copy_template_file(file, destination_path)
|
142
|
+
end
|
143
|
+
|
144
|
+
say " ✅ Model generator templates extracted", :green
|
145
|
+
end
|
146
|
+
|
147
|
+
def copy_controller_templates(destination_path)
|
148
|
+
say "📂 Extracting controller generator templates...", :blue
|
149
|
+
|
150
|
+
copy_template_file("tokens_controller.rb.tt", destination_path)
|
151
|
+
copy_directory_templates("auth", destination_path)
|
152
|
+
|
153
|
+
say " ✅ Controller generator templates extracted", :green
|
154
|
+
end
|
155
|
+
|
156
|
+
def copy_test_templates(destination_path)
|
157
|
+
say "📂 Extracting test generator templates...", :blue
|
158
|
+
|
159
|
+
copy_template_file("user_test.rb.tt", destination_path)
|
160
|
+
copy_directory_templates("test", destination_path)
|
161
|
+
|
162
|
+
say " ✅ Test generator templates extracted", :green
|
163
|
+
end
|
164
|
+
|
165
|
+
def copy_view_templates(destination_path)
|
166
|
+
say "📂 Extracting view generator templates...", :blue
|
167
|
+
|
168
|
+
copy_template_file("auth_mailer.rb", destination_path)
|
169
|
+
copy_directory_templates("views", destination_path)
|
170
|
+
|
171
|
+
say " ✅ View generator templates extracted", :green
|
172
|
+
end
|
173
|
+
|
174
|
+
def copy_concern_templates(destination_path)
|
175
|
+
say "📂 Extracting concern generator templates...", :blue
|
176
|
+
|
177
|
+
copy_directory_templates("concerns", destination_path)
|
178
|
+
|
179
|
+
say " ✅ Concern generator templates extracted", :green
|
180
|
+
end
|
181
|
+
|
182
|
+
def copy_service_templates(destination_path)
|
183
|
+
say "📂 Extracting service generator templates...", :blue
|
184
|
+
|
185
|
+
copy_directory_templates("services", destination_path)
|
186
|
+
|
187
|
+
say " ✅ Service generator templates extracted", :green
|
188
|
+
end
|
189
|
+
|
190
|
+
def copy_config_templates(destination_path)
|
191
|
+
say "📂 Extracting config generator templates...", :blue
|
192
|
+
|
193
|
+
copy_template_file("propel_auth.rb", destination_path)
|
194
|
+
copy_template_file("propel_auth_configuration.rb.tt", destination_path)
|
195
|
+
copy_directory_templates("config", destination_path)
|
196
|
+
|
197
|
+
say " ✅ Config generator templates extracted", :green
|
198
|
+
end
|
199
|
+
|
200
|
+
def copy_db_templates(destination_path)
|
201
|
+
say "📂 Extracting database generator templates...", :blue
|
202
|
+
|
203
|
+
copy_directory_templates("db", destination_path)
|
204
|
+
|
205
|
+
say " ✅ Database generator templates extracted", :green
|
206
|
+
end
|
207
|
+
|
208
|
+
def copy_generator_logic(destination_path)
|
209
|
+
say "📂 Extracting generator logic code...", :blue
|
210
|
+
|
211
|
+
# Copy install generator with proper Rails namespace
|
212
|
+
source_generator = File.join(__dir__, "install_generator.rb")
|
213
|
+
dest_generator = File.join(destination_path, "install_generator.rb")
|
214
|
+
|
215
|
+
if File.exist?(source_generator)
|
216
|
+
# Read the source and modify the module declaration for proper registration
|
217
|
+
source_content = File.read(source_generator)
|
218
|
+
|
219
|
+
# Update module declaration to be properly namespaced in host app
|
220
|
+
modified_content = source_content.gsub(
|
221
|
+
/^module PropelAuth$/,
|
222
|
+
"module PropelAuth"
|
223
|
+
).gsub(
|
224
|
+
/^ class InstallGenerator/,
|
225
|
+
" class InstallGenerator"
|
226
|
+
)
|
227
|
+
|
228
|
+
# Create the directory and write the modified generator
|
229
|
+
FileUtils.mkdir_p(File.dirname(dest_generator))
|
230
|
+
File.write(dest_generator, modified_content)
|
231
|
+
|
232
|
+
say " ✅ Install generator extracted", :green
|
233
|
+
else
|
234
|
+
say " ⚠️ Install generator not found", :yellow
|
235
|
+
end
|
236
|
+
|
237
|
+
# Also copy the unpack and pack generators
|
238
|
+
%w[unpack_generator.rb pack_generator.rb].each do |gen_file|
|
239
|
+
source_file = File.join(__dir__, gen_file)
|
240
|
+
dest_file = File.join(destination_path, gen_file)
|
241
|
+
|
242
|
+
if File.exist?(source_file)
|
243
|
+
FileUtils.cp(source_file, dest_file)
|
244
|
+
say " ✅ #{gen_file} extracted", :green
|
245
|
+
else
|
246
|
+
say " ⚠️ #{gen_file} not found", :yellow
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# Also copy the lib runtime file
|
251
|
+
copy_lib_runtime(destination_path)
|
252
|
+
end
|
253
|
+
|
254
|
+
def copy_lib_runtime(destination_path)
|
255
|
+
say "📂 Extracting PropelAuth runtime code...", :blue
|
256
|
+
|
257
|
+
lib_source = File.join(self.class.source_root, "lib", "propel_auth.rb")
|
258
|
+
lib_dest = File.join(destination_path, "templates", "lib", "propel_auth.rb")
|
259
|
+
|
260
|
+
if File.exist?(lib_source)
|
261
|
+
FileUtils.mkdir_p(File.dirname(lib_dest))
|
262
|
+
FileUtils.cp(lib_source, lib_dest)
|
263
|
+
say " ✅ PropelAuth runtime code extracted", :green
|
264
|
+
else
|
265
|
+
say " ⚠️ PropelAuth runtime template not found", :yellow
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
def copy_template_file(filename, destination_path)
|
270
|
+
source_file = File.join(self.class.source_root, filename)
|
271
|
+
dest_file = File.join(destination_path, "templates", filename)
|
272
|
+
|
273
|
+
if File.exist?(source_file)
|
274
|
+
FileUtils.mkdir_p(File.dirname(dest_file))
|
275
|
+
FileUtils.cp(source_file, dest_file)
|
276
|
+
else
|
277
|
+
say " ⚠️ Template not found: #{filename}", :yellow
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
def copy_directory_templates(directory, destination_path)
|
282
|
+
source_dir = File.join(self.class.source_root, directory)
|
283
|
+
dest_dir = File.join(destination_path, "templates", directory)
|
284
|
+
|
285
|
+
if Dir.exist?(source_dir)
|
286
|
+
FileUtils.mkdir_p(dest_dir)
|
287
|
+
copy_directory_recursively(source_dir, dest_dir)
|
288
|
+
else
|
289
|
+
say " ⚠️ Directory not found: #{directory}", :yellow
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
def copy_directory_recursively(source, destination)
|
294
|
+
Dir.glob("#{source}/**/*", File::FNM_DOTMATCH).each do |source_file|
|
295
|
+
next if File.directory?(source_file)
|
296
|
+
next if File.basename(source_file).start_with?('.')
|
297
|
+
|
298
|
+
relative_path = source_file.sub("#{source}/", '')
|
299
|
+
dest_file = File.join(destination, relative_path)
|
300
|
+
|
301
|
+
FileUtils.mkdir_p(File.dirname(dest_file))
|
302
|
+
FileUtils.cp(source_file, dest_file)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
def show_completion_message(destination_path)
|
307
|
+
say ""
|
308
|
+
say "🎉 PropelAuth GENERATOR unpacked successfully!", :green
|
309
|
+
say ""
|
310
|
+
say "📁 Generator extracted to: #{destination_path}/", :bold
|
311
|
+
say "📂 Templates available at: #{destination_path}/templates/", :bold
|
312
|
+
say ""
|
313
|
+
|
314
|
+
say "🔧 GENERATOR customization guide:", :bold
|
315
|
+
say " ⚙️ Generator logic: #{destination_path}/install_generator.rb"
|
316
|
+
say " 📝 Model templates: #{destination_path}/templates/user.rb, organization.rb, etc."
|
317
|
+
say " 🎮 Controller templates: #{destination_path}/templates/tokens_controller.rb.tt"
|
318
|
+
say " 🧪 Test templates: #{destination_path}/templates/test/"
|
319
|
+
say " 📧 Email templates: #{destination_path}/templates/views/auth_mailer/"
|
320
|
+
say " ⚙️ Config templates: #{destination_path}/templates/config/"
|
321
|
+
say ""
|
322
|
+
|
323
|
+
say "⚠️ Important: You now have a LOCAL GENERATOR, not gem generator:", :yellow
|
324
|
+
say " • Your local generator overrides the gem version completely"
|
325
|
+
say " • Customize any part: logic, templates, options, behavior"
|
326
|
+
say " • Commit generator code to version control"
|
327
|
+
say " • Update manually when PropelAuth gem is updated"
|
328
|
+
say ""
|
329
|
+
|
330
|
+
say "💡 Test your customized generator:", :blue
|
331
|
+
say " # Your local generator will be used instead of the gem:"
|
332
|
+
say " rails generate propel_auth:install"
|
333
|
+
say ""
|
334
|
+
|
335
|
+
say "🔄 To use gem generator again:", :cyan
|
336
|
+
say " rm -rf #{destination_path} # Removes local generator, falls back to gem"
|
337
|
+
say ""
|
338
|
+
|
339
|
+
say "🚀 Now you can:", :green
|
340
|
+
say " • Modify generator options and behavior in install_generator.rb"
|
341
|
+
say " • Customize any template for your organization's needs"
|
342
|
+
say " • Add new generator methods or change existing logic"
|
343
|
+
say " • Create company-specific authentication patterns"
|
344
|
+
end
|
345
|
+
end
|
data/lib/propel_auth.rb
ADDED
metadata
ADDED
@@ -0,0 +1,195 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: propel_authentication
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Propel Team
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-07-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '7.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '9.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '7.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '9.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: bcrypt
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 3.1.20
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 3.1.20
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jwt
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.7'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.7'
|
61
|
+
description: A self-extracting generator that creates a JWT-based authentication system
|
62
|
+
with agencies, agents, password resets, email confirmation, and account locking
|
63
|
+
for Rails applications.
|
64
|
+
email:
|
65
|
+
- admin@propel-hq.dev
|
66
|
+
executables: []
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- LICENSE
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- lib/generators/propel_auth/install_generator.rb
|
74
|
+
- lib/generators/propel_auth/pack_generator.rb
|
75
|
+
- lib/generators/propel_auth/templates/agency.rb
|
76
|
+
- lib/generators/propel_auth/templates/agent.rb
|
77
|
+
- lib/generators/propel_auth/templates/auth/base_passwords_controller.rb.tt
|
78
|
+
- lib/generators/propel_auth/templates/auth/base_tokens_controller.rb.tt
|
79
|
+
- lib/generators/propel_auth/templates/auth/passwords_controller.rb.tt
|
80
|
+
- lib/generators/propel_auth/templates/auth_mailer.rb
|
81
|
+
- lib/generators/propel_auth/templates/authenticatable.rb
|
82
|
+
- lib/generators/propel_auth/templates/concerns/confirmable.rb
|
83
|
+
- lib/generators/propel_auth/templates/concerns/lockable.rb
|
84
|
+
- lib/generators/propel_auth/templates/concerns/propel_authentication.rb
|
85
|
+
- lib/generators/propel_auth/templates/concerns/rack_session_disable.rb
|
86
|
+
- lib/generators/propel_auth/templates/concerns/recoverable.rb
|
87
|
+
- lib/generators/propel_auth/templates/config/environments/development_email.rb
|
88
|
+
- lib/generators/propel_auth/templates/db/migrate/create_agencies.rb
|
89
|
+
- lib/generators/propel_auth/templates/db/migrate/create_agents.rb
|
90
|
+
- lib/generators/propel_auth/templates/db/migrate/create_invitations.rb
|
91
|
+
- lib/generators/propel_auth/templates/db/migrate/create_organizations.rb
|
92
|
+
- lib/generators/propel_auth/templates/db/migrate/create_users.rb
|
93
|
+
- lib/generators/propel_auth/templates/db/seeds.rb
|
94
|
+
- lib/generators/propel_auth/templates/invitation.rb
|
95
|
+
- lib/generators/propel_auth/templates/lib/propel_auth.rb
|
96
|
+
- lib/generators/propel_auth/templates/organization.rb
|
97
|
+
- lib/generators/propel_auth/templates/propel_auth.rb
|
98
|
+
- lib/generators/propel_auth/templates/services/auth_notification_service.rb
|
99
|
+
- lib/generators/propel_auth/templates/test/concerns/confirmable_test.rb.tt
|
100
|
+
- lib/generators/propel_auth/templates/test/concerns/lockable_test.rb.tt
|
101
|
+
- lib/generators/propel_auth/templates/test/concerns/propel_authentication_test.rb.tt
|
102
|
+
- lib/generators/propel_auth/templates/test/concerns/recoverable_test.rb.tt
|
103
|
+
- lib/generators/propel_auth/templates/test/controllers/auth/lockable_integration_test.rb.tt
|
104
|
+
- lib/generators/propel_auth/templates/test/controllers/auth/password_reset_integration_test.rb.tt
|
105
|
+
- lib/generators/propel_auth/templates/test/controllers/auth/tokens_controller_test.rb.tt
|
106
|
+
- lib/generators/propel_auth/templates/test/mailers/auth_mailer_test.rb.tt
|
107
|
+
- lib/generators/propel_auth/templates/test/mailers/previews/auth_mailer_preview.rb
|
108
|
+
- lib/generators/propel_auth/templates/tokens_controller.rb.tt
|
109
|
+
- lib/generators/propel_auth/templates/user.rb
|
110
|
+
- lib/generators/propel_auth/templates/user_test.rb.tt
|
111
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/account_unlock.html.erb
|
112
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/account_unlock.text.erb
|
113
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/email_confirmation.html.erb
|
114
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/email_confirmation.text.erb
|
115
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/password_reset.html.erb
|
116
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/password_reset.text.erb
|
117
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/user_invitation.html.erb
|
118
|
+
- lib/generators/propel_auth/templates/views/auth_mailer/user_invitation.text.erb
|
119
|
+
- lib/generators/propel_auth/test/dummy/Dockerfile
|
120
|
+
- lib/generators/propel_auth/test/dummy/Gemfile
|
121
|
+
- lib/generators/propel_auth/test/dummy/Gemfile.lock
|
122
|
+
- lib/generators/propel_auth/test/dummy/README.md
|
123
|
+
- lib/generators/propel_auth/test/dummy/Rakefile
|
124
|
+
- lib/generators/propel_auth/test/dummy/app/assets/stylesheets/application.css
|
125
|
+
- lib/generators/propel_auth/test/dummy/app/controllers/application_controller.rb
|
126
|
+
- lib/generators/propel_auth/test/dummy/app/helpers/application_helper.rb
|
127
|
+
- lib/generators/propel_auth/test/dummy/app/jobs/application_job.rb
|
128
|
+
- lib/generators/propel_auth/test/dummy/app/mailers/application_mailer.rb
|
129
|
+
- lib/generators/propel_auth/test/dummy/app/models/application_record.rb
|
130
|
+
- lib/generators/propel_auth/test/dummy/app/views/layouts/application.html.erb
|
131
|
+
- lib/generators/propel_auth/test/dummy/app/views/layouts/mailer.html.erb
|
132
|
+
- lib/generators/propel_auth/test/dummy/app/views/layouts/mailer.text.erb
|
133
|
+
- lib/generators/propel_auth/test/dummy/app/views/pwa/manifest.json.erb
|
134
|
+
- lib/generators/propel_auth/test/dummy/app/views/pwa/service-worker.js
|
135
|
+
- lib/generators/propel_auth/test/dummy/bin/brakeman
|
136
|
+
- lib/generators/propel_auth/test/dummy/bin/dev
|
137
|
+
- lib/generators/propel_auth/test/dummy/bin/docker-entrypoint
|
138
|
+
- lib/generators/propel_auth/test/dummy/bin/rails
|
139
|
+
- lib/generators/propel_auth/test/dummy/bin/rake
|
140
|
+
- lib/generators/propel_auth/test/dummy/bin/rubocop
|
141
|
+
- lib/generators/propel_auth/test/dummy/bin/setup
|
142
|
+
- lib/generators/propel_auth/test/dummy/bin/thrust
|
143
|
+
- lib/generators/propel_auth/test/dummy/config.ru
|
144
|
+
- lib/generators/propel_auth/test/dummy/config/application.rb
|
145
|
+
- lib/generators/propel_auth/test/dummy/config/boot.rb
|
146
|
+
- lib/generators/propel_auth/test/dummy/config/cable.yml
|
147
|
+
- lib/generators/propel_auth/test/dummy/config/credentials.yml.enc
|
148
|
+
- lib/generators/propel_auth/test/dummy/config/database.yml
|
149
|
+
- lib/generators/propel_auth/test/dummy/config/environment.rb
|
150
|
+
- lib/generators/propel_auth/test/dummy/config/environments/development.rb
|
151
|
+
- lib/generators/propel_auth/test/dummy/config/environments/production.rb
|
152
|
+
- lib/generators/propel_auth/test/dummy/config/environments/test.rb
|
153
|
+
- lib/generators/propel_auth/test/dummy/config/initializers/assets.rb
|
154
|
+
- lib/generators/propel_auth/test/dummy/config/initializers/content_security_policy.rb
|
155
|
+
- lib/generators/propel_auth/test/dummy/config/initializers/filter_parameter_logging.rb
|
156
|
+
- lib/generators/propel_auth/test/dummy/config/initializers/inflections.rb
|
157
|
+
- lib/generators/propel_auth/test/dummy/config/locales/en.yml
|
158
|
+
- lib/generators/propel_auth/test/dummy/config/master.key
|
159
|
+
- lib/generators/propel_auth/test/dummy/config/puma.rb
|
160
|
+
- lib/generators/propel_auth/test/dummy/config/routes.rb
|
161
|
+
- lib/generators/propel_auth/test/dummy/config/storage.yml
|
162
|
+
- lib/generators/propel_auth/test/dummy/db/schema.rb
|
163
|
+
- lib/generators/propel_auth/test/generators/authentication/controllers/tokens_controller_test.rb
|
164
|
+
- lib/generators/propel_auth/test/generators/authentication/install_generator_test.rb
|
165
|
+
- lib/generators/propel_auth/test/generators/authentication/uninstall_generator_test.rb
|
166
|
+
- lib/generators/propel_auth/test/integration/generator_integration_test.rb
|
167
|
+
- lib/generators/propel_auth/test/integration/multi_version_generator_test.rb
|
168
|
+
- lib/generators/propel_auth/unpack_generator.rb
|
169
|
+
- lib/propel_auth.rb
|
170
|
+
homepage: https://github.com/propel-hq/propel_rails.git
|
171
|
+
licenses:
|
172
|
+
- MIT
|
173
|
+
metadata:
|
174
|
+
homepage_uri: https://github.com/propel-hq/propel_rails.git
|
175
|
+
source_code_uri: https://github.com/propel-hq/propel_rails.git
|
176
|
+
post_install_message:
|
177
|
+
rdoc_options: []
|
178
|
+
require_paths:
|
179
|
+
- lib
|
180
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - ">="
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
190
|
+
requirements: []
|
191
|
+
rubygems_version: 3.4.19
|
192
|
+
signing_key:
|
193
|
+
specification_version: 4
|
194
|
+
summary: PropelAuth - JWT authentication system generator for Rails
|
195
|
+
test_files: []
|