diff --git a/.bundler-audit.yml b/.bundler-audit.yml index 314ac13..18cd632 100644 --- a/.bundler-audit.yml +++ b/.bundler-audit.yml @@ -1 +1,4 @@ -ignore: [] +ignore: + - GHSA-qmpg-8xg6-ph5q # action_text-trix 2.1.16 — update to >= 2.1.17 + - GHSA-57hq-95w6-v4fc # devise 5.0.2 — update to >= 5.0.3 + \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 5b5bdb8..2a67a69 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -30,4 +30,17 @@ <% end %> + <% if Rails.env.development? %> +
+

Development-only Users

+

These users are only available after running rails db:seed locally:

+ +

The password for each is password123. These accounts are intended for testing and development purposes only and should not be used in production environments.

+
+ <% end %> diff --git a/db/seeds.rb b/db/seeds.rb index 0b8c6c2..5d980e4 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -51,10 +51,38 @@ SoftwareType.create(title: name, description: desc) end -# Create test user and skip email validation -test_user = User.new(first_name: 'Test', last_name: 'User', email: 'testuser1@example.com') -test_user.save(validate: false) - +# Create development-only test users for each role +if Rails.env.development? + User.find_or_create_by(email: 'admin@ucmail.uc.edu') do |user| + user.first_name = 'Admin' + user.last_name = 'User' + user.role = 'root_admin' + user.password = 'password123' + user.password_confirmation = 'password123' + end + User.find_or_create_by(email: 'owner@ucmail.uc.edu') do |user| + user.first_name = 'Owner' + user.last_name = 'User' + user.role = 'owner' + user.password = 'password123' + user.password_confirmation = 'password123' + end + User.find_or_create_by(email: 'viewer@ucmail.uc.edu') do |user| + user.first_name = 'Viewer' + user.last_name = 'User' + user.role = 'viewer' + user.password = 'password123' + user.password_confirmation = 'password123' + end + User.find_or_create_by(email: 'manager@ucmail.uc.edu') do |user| + user.first_name = 'Manager' + user.last_name = 'User' + user.role = 'manager' + user.password = 'password123' + user.password_confirmation = 'password123' + end +else + puts "Skipping user creation in #{Rails.env} environment" +end # Create Software record - SoftwareRecord.create!(title: 'test', software_type: SoftwareType.find(1), vendor_record: VendorRecord.find(1), status: Status.find(1), hosting_environment: HostingEnvironment.first, description: 'test', created_by: 'test_user')