OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Freeze string literals in the 2FA module
Jan Sandbrinka53f4a25d501
diff --git a/modules/two_factor_authentication/Gemfile b/modules/two_factor_authentication/Gemfileindex 3be9c3cd812..bb94df82938 100644--- a/modules/two_factor_authentication/Gemfile+++ b/modules/two_factor_authentication/Gemfile@@ -1,2 +1,4 @@+# frozen_string_literal: true+source "https://rubygems.org"gemspecdiff --git a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rbindex df46c05bfd9..cd842f6b0f6 100644--- a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb+++ b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/row_component.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule Devicesclass RowComponent < ::RowComponentdiff --git a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rbindex a9d2165f14d..d5e9d9eaf68 100644--- a/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb+++ b/modules/two_factor_authentication/app/components/two_factor_authentication/devices/table_component.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule Devicesclass TableComponent < ::TableComponentdiff --git a/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/backup_codes.rb b/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/backup_codes.rbindex c5d1eace098..cfa5caf401d 100644--- a/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/backup_codes.rb+++ b/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/backup_codes.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule BackupCodesextend ActiveSupport::Concerndiff --git a/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/remember_token.rb b/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/remember_token.rbindex 212c48218b0..6cbdcec4915 100644--- a/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/remember_token.rb+++ b/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/remember_token.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule RememberTokenextend ActiveSupport::Concerndiff --git a/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/webauthn_relying_party.rb b/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/webauthn_relying_party.rbindex 8fcde41b375..7339236ffd5 100644--- a/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/webauthn_relying_party.rb+++ b/modules/two_factor_authentication/app/controllers/concerns/two_factor_authentication/webauthn_relying_party.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule WebauthnRelyingPartyextend ActiveSupport::Concerndiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rbindex d224bbbde88..d5d923b45d3 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/authentication_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationclass AuthenticationController < ApplicationController# Remember token functionalitydiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rbindex 70ca7017fe2..d0e9141dfa4 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/base_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationclass BaseController < ApplicationControllerinclude ::TwoFactorAuthentication::WebauthnRelyingPartydiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller.rbindex 5f1667d4a28..35cad0df34d 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule ForcedRegistrationclass TwoFactorDevicesController < ::TwoFactorAuthentication::BaseControllerdiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/backup_codes_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/backup_codes_controller.rbindex 0f46af2e804..56595e5e5b2 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/backup_codes_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/backup_codes_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule Myclass BackupCodesController < ::ApplicationControllerdiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rbindex e3d5ac206ee..be25b85f90a 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/remember_cookie_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule Myclass RememberCookieController < ::ApplicationControllerdiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rbindex 5276fe1bb8e..e418ba6ce60 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/my/two_factor_devices_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule Myclass TwoFactorDevicesController < ::TwoFactorAuthentication::BaseControllerdiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rbindex 15f90b972ef..5faeec1d584 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationclass TwoFactorSettingsController < ApplicationControllerinclude EnterpriseTrialHelperdiff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rbindex f839e48c522..4966f0e0435 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/users/two_factor_devices_controller.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module ::TwoFactorAuthenticationmodule Usersclass TwoFactorDevicesController < ::TwoFactorAuthentication::BaseControllerdiff --git a/modules/two_factor_authentication/app/models/two_factor_authentication.rb b/modules/two_factor_authentication/app/models/two_factor_authentication.rbindex b56bf137a29..ef66d8af681 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationdef self.table_name_prefix"two_factor_authentication_"diff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/backup_code.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/backup_code.rbindex eac1fb01e63..0a80afb6065 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/backup_code.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/backup_code.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass BackupCode < ::Token::HashedTokenclass << selfdiff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/device.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/device.rbindex 9c47b969f39..4f4563ae2e5 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/device.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/device.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass Device < ApplicationRecorddefault_scope { order("id ASC") }diff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/device/sms.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/device/sms.rbindex b8640ef04dc..8ec3676810d 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/device/sms.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/device/sms.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass Device::Sms < Devicevalidates_presence_of :phone_numberdiff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rbindex cfee774b991..00525ef427c 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/device/totp.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "rotp"module TwoFactorAuthenticationdiff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/device/webauthn.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/device/webauthn.rbindex d36848dbac0..897ed822884 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/device/webauthn.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/device/webauthn.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass Device::Webauthn < Devicevalidates :webauthn_external_id, presence: true, uniqueness: { scope: :user_id }diff --git a/modules/two_factor_authentication/app/models/two_factor_authentication/remembered_auth_token.rb b/modules/two_factor_authentication/app/models/two_factor_authentication/remembered_auth_token.rbindex 730d7a69b71..730a02715a7 100644--- a/modules/two_factor_authentication/app/models/two_factor_authentication/remembered_auth_token.rb+++ b/modules/two_factor_authentication/app/models/two_factor_authentication/remembered_auth_token.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass RememberedAuthToken < ::Token::HashedTokeninclude ::Token::ExpirableTokendiff --git a/modules/two_factor_authentication/app/services/two_factor_authentication/token_service.rb b/modules/two_factor_authentication/app/services/two_factor_authentication/token_service.rbindex 94fc4563cc4..0fb714a9b96 100644--- a/modules/two_factor_authentication/app/services/two_factor_authentication/token_service.rb+++ b/modules/two_factor_authentication/app/services/two_factor_authentication/token_service.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass TokenServiceattr_reader :user, :device, :strategy, :channeldiff --git a/modules/two_factor_authentication/app/services/two_factor_authentication/use_backup_code_service.rb b/modules/two_factor_authentication/app/services/two_factor_authentication/use_backup_code_service.rbindex 19d9d160adb..150a6614340 100644--- a/modules/two_factor_authentication/app/services/two_factor_authentication/use_backup_code_service.rb+++ b/modules/two_factor_authentication/app/services/two_factor_authentication/use_backup_code_service.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module TwoFactorAuthenticationclass UseBackupCodeServiceattr_reader :userdiff --git a/modules/two_factor_authentication/config/routes.rb b/modules/two_factor_authentication/config/routes.rbindex 27fbab7b143..40e8e03759a 100644--- a/modules/two_factor_authentication/config/routes.rb+++ b/modules/two_factor_authentication/config/routes.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+Rails.application.routes.draw donamespace "two_factor_authentication" doget :request, to: "authentication#request_otp"diff --git a/modules/two_factor_authentication/db/migrate/20120214103300_aggregated_mobile_otp_migrations.rb b/modules/two_factor_authentication/db/migrate/20120214103300_aggregated_mobile_otp_migrations.rbindex ab2733c2c35..2736d783971 100644--- a/modules/two_factor_authentication/db/migrate/20120214103300_aggregated_mobile_otp_migrations.rb+++ b/modules/two_factor_authentication/db/migrate/20120214103300_aggregated_mobile_otp_migrations.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -32,14 +34,14 @@ require "open_project/plugins/migration_mapping"# This migration aggregates the migrations detailed in MIGRATION_FILESclass AggregatedMobileOtpMigrations < ActiveRecord::Migration[5.0]- MIGRATION_FILES = <<-MIGRATIONS.freeze+ MIGRATION_FILES = <<-MIGRATIONS001_add_user_phone.rb002_create_extended_tokens.rb003_remove_user_phone.rb004_add_user_verified_phone_unverified_phone.rbMIGRATIONS- OLD_PLUGIN_NAME = "redmine_two_factor_authentication_authentication".freeze+ OLD_PLUGIN_NAME = "redmine_two_factor_authentication_authentication"def upmigration_names = OpenProject::Plugins::MigrationMapping.migration_files_to_migration_names(MIGRATION_FILES, OLD_PLUGIN_NAME)diff --git a/modules/two_factor_authentication/db/migrate/20130214130336_add_default_otp_channel_to_user.rb b/modules/two_factor_authentication/db/migrate/20130214130336_add_default_otp_channel_to_user.rbindex 13aa04cb1b8..27c85e7325a 100644--- a/modules/two_factor_authentication/db/migrate/20130214130336_add_default_otp_channel_to_user.rb+++ b/modules/two_factor_authentication/db/migrate/20130214130336_add_default_otp_channel_to_user.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/two_factor_authentication/db/migrate/20160331190036_change_default_channel.rb b/modules/two_factor_authentication/db/migrate/20160331190036_change_default_channel.rbindex a2eab34dbbb..8108e213903 100644--- a/modules/two_factor_authentication/db/migrate/20160331190036_change_default_channel.rb+++ b/modules/two_factor_authentication/db/migrate/20160331190036_change_default_channel.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/two_factor_authentication/db/migrate/20171023190036_model_reorganization.rb b/modules/two_factor_authentication/db/migrate/20171023190036_model_reorganization.rbindex dee341deab5..e440d7c7ec1 100644--- a/modules/two_factor_authentication/db/migrate/20171023190036_model_reorganization.rb+++ b/modules/two_factor_authentication/db/migrate/20171023190036_model_reorganization.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/two_factor_authentication/db/migrate/20230627133534_add_webauthn_fields_to_two_factor_table.rb b/modules/two_factor_authentication/db/migrate/20230627133534_add_webauthn_fields_to_two_factor_table.rbindex 219b266ed19..a9226166542 100644--- a/modules/two_factor_authentication/db/migrate/20230627133534_add_webauthn_fields_to_two_factor_table.rb+++ b/modules/two_factor_authentication/db/migrate/20230627133534_add_webauthn_fields_to_two_factor_table.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+class AddWebauthnFieldsToTwoFactorTable < ActiveRecord::Migration[7.0]def changeadd_column :two_factor_authentication_devices, :webauthn_external_id, :string, null: truediff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication.rbindex 2891863acfa..441e029cadc 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module OpenProjectmodule TwoFactorAuthenticationrequire "open_project/two_factor_authentication/engine"diff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/engine.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/engine.rbindex ec64abd58a9..aad5c2e382c 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/engine.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/engine.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "open_project/plugins"require "webauthn"diff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches.rbindex 0354c6c5e4f..a4985b20d11 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module OpenProject::TwoFactorAuthenticationmodule Patchesenddiff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches/user_patch.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches/user_patch.rbindex 6c4f8d00195..f0c43263d8e 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches/user_patch.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/patches/user_patch.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module OpenProject::TwoFactorAuthentication::Patchesmodule UserPatchdef self.included(base)diff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/base.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/base.rbindex d2db4909003..2e9d5fb86fb 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/base.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/base.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module OpenProject::TwoFactorAuthenticationmodule TokenStrategyclass Basediff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/developer.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/developer.rbindex 0c8915314f7..c292084bc39 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/developer.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/developer.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module OpenProject::TwoFactorAuthenticationmodule TokenStrategyclass Developer < Basediff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/message_bird.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/message_bird.rbindex 33636064419..b3591592014 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/message_bird.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/message_bird.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "messagebird"module OpenProject::TwoFactorAuthenticationdiff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/sns.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/sns.rbindex bf75a9ce96d..f383f164ef7 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/sns.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/sns.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "net/http"require "aws-sdk-sns"diff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/totp.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/totp.rbindex d1431aad5fb..2bd7b7a2d51 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/totp.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/totp.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "rotp"module OpenProject::TwoFactorAuthenticationdiff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/webauthn.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/webauthn.rbindex 6a511ee7813..e39a887aa3f 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/webauthn.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy/webauthn.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "webauthn"module OpenProject::TwoFactorAuthenticationdiff --git a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy_manager.rb b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy_manager.rbindex a212beced7e..c4ea44909dc 100644--- a/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy_manager.rb+++ b/modules/two_factor_authentication/lib/open_project/two_factor_authentication/token_strategy_manager.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module OpenProject::TwoFactorAuthenticationmodule TokenStrategyManagerclass << selfdiff --git a/modules/two_factor_authentication/lib/openproject-two_factor_authentication.rb b/modules/two_factor_authentication/lib/openproject-two_factor_authentication.rbindex e5913b2cef8..bfb79a8f354 100644--- a/modules/two_factor_authentication/lib/openproject-two_factor_authentication.rb+++ b/modules/two_factor_authentication/lib/openproject-two_factor_authentication.rb@@ -1 +1,3 @@+# frozen_string_literal: true+require "open_project/two_factor_authentication"diff --git a/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec b/modules/two_factor_authentication/openproject-two_factor_authentication.gemspecindex a458dfdea44..5672ec012a5 100644--- a/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec+++ b/modules/two_factor_authentication/openproject-two_factor_authentication.gemspec@@ -1,3 +1,5 @@+# frozen_string_literal: true+Gem::Specification.new do |s|s.name = "openproject-two_factor_authentication"s.version = "1.0.0"diff --git a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_shared_examples.rb b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_shared_examples.rbindex 4224071927c..f8cc51f3190 100644--- a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_shared_examples.rb+++ b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_shared_examples.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"RSpec.shared_examples "immediate success login" dodiff --git a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_spec.rb b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_spec.rbindex 403abd3d869..ec8026c9629 100644--- a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_spec.rb+++ b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/authentication_controller_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "authentication_controller_shared_examples"diff --git a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller_spec.rb b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller_spec.rbindex 0cf89ac791e..ee13d095160 100644--- a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller_spec.rb+++ b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/forced_registration/two_factor_devices_controller_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../../spec_helper"require_relative "../authentication_controller_shared_examples"diff --git a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/remember_cookie_controller_spec.rb b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/remember_cookie_controller_spec.rbindex 8a8ff06ef27..43d4274d5cc 100644--- a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/remember_cookie_controller_spec.rb+++ b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/remember_cookie_controller_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../../spec_helper"require_relative "../authentication_controller_shared_examples"diff --git a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/two_factor_devices_controller_spec.rb b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/two_factor_devices_controller_spec.rbindex 24b4d4200fc..11b01bdc693 100644--- a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/two_factor_devices_controller_spec.rb+++ b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/my/two_factor_devices_controller_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../../spec_helper"require_relative "../authentication_controller_shared_examples"diff --git a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/users/two_factor_devices_controller_spec.rb b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/users/two_factor_devices_controller_spec.rbindex ee7f4cdee9e..831b1d3ba95 100644--- a/modules/two_factor_authentication/spec/controllers/two_factor_authentication/users/two_factor_devices_controller_spec.rb+++ b/modules/two_factor_authentication/spec/controllers/two_factor_authentication/users/two_factor_devices_controller_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../../spec_helper"require_relative "../authentication_controller_shared_examples"diff --git a/modules/two_factor_authentication/spec/factories/two_factor_authentication_device_factory.rb b/modules/two_factor_authentication/spec/factories/two_factor_authentication_device_factory.rbindex f4ab1f841e4..ae3d4763bfa 100644--- a/modules/two_factor_authentication/spec/factories/two_factor_authentication_device_factory.rb+++ b/modules/two_factor_authentication/spec/factories/two_factor_authentication_device_factory.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+FactoryBot.define dofactory :two_factor_authentication_device_sms, class: "::TwoFactorAuthentication::Device::Sms" douserdiff --git a/modules/two_factor_authentication/spec/features/account_activation_spec.rb b/modules/two_factor_authentication/spec/features/account_activation_spec.rbindex 5f48bd39710..8721b9abc2b 100644--- a/modules/two_factor_authentication/spec/features/account_activation_spec.rb+++ b/modules/two_factor_authentication/spec/features/account_activation_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"require_relative "shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/admin_edit_two_factor_devices_spec.rb b/modules/two_factor_authentication/spec/features/admin_edit_two_factor_devices_spec.rbindex 5fe4bad5d5f..069013ef20b 100644--- a/modules/two_factor_authentication/spec/features/admin_edit_two_factor_devices_spec.rb+++ b/modules/two_factor_authentication/spec/features/admin_edit_two_factor_devices_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"RSpec.describe "Admin 2FA management", :js, :selenium, with_settings: {diff --git a/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes_spec.rb b/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes_spec.rbindex 674aebd2ee2..7d9b4fe5dd0 100644--- a/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes_spec.rb+++ b/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rb b/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rbindex 49f20c26e90..b47c2ea38ce 100644--- a/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rb+++ b/modules/two_factor_authentication/spec/features/backup_codes/login_with_backup_code_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rbindex 01cb543d525..c1c20f1f2a5 100644--- a/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_enforced_2fa_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rbindex 0e0b099067f..379f65ad9de 100644--- a/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_with_2fa_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/login/login_with_deleted_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_with_deleted_2fa_spec.rbindex 56a3b748739..7bce301f54d 100644--- a/modules/two_factor_authentication/spec/features/login/login_with_deleted_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_with_deleted_2fa_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb b/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rbindex 6ae5091bce3..a9342ff89ea 100644--- a/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/login_without_2fa_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rb b/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rbindex 070f751864e..630e068ecbb 100644--- a/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rb+++ b/modules/two_factor_authentication/spec/features/login/switch_available_devices_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb b/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rbindex e14e3c8e7b4..995e095642b 100644--- a/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb+++ b/modules/two_factor_authentication/spec/features/my_two_factor_devices_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"RSpec.describe "My Account 2FA configuration",diff --git a/modules/two_factor_authentication/spec/features/password_change_spec.rb b/modules/two_factor_authentication/spec/features/password_change_spec.rbindex 877fdec02cd..d5c2215efc0 100644--- a/modules/two_factor_authentication/spec/features/password_change_spec.rb+++ b/modules/two_factor_authentication/spec/features/password_change_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"RSpec.describe "Password change with OTP", :js, with_settings: {diff --git a/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb b/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rbindex 60a0a7c928e..b0c37dfd7e9 100644--- a/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb+++ b/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require_relative "../shared_two_factor_examples"diff --git a/modules/two_factor_authentication/spec/features/shared_two_factor_examples.rb b/modules/two_factor_authentication/spec/features/shared_two_factor_examples.rbindex 4e9d97989b2..bcdc510f050 100644--- a/modules/two_factor_authentication/spec/features/shared_two_factor_examples.rb+++ b/modules/two_factor_authentication/spec/features/shared_two_factor_examples.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+module SharedTwoFactorExamplesdef first_login_stepvisit signin_pathdiff --git a/modules/two_factor_authentication/spec/lib/token_strategies/message_bird_spec.rb b/modules/two_factor_authentication/spec/lib/token_strategies/message_bird_spec.rbindex 4134dc85c17..7aafd319045 100644--- a/modules/two_factor_authentication/spec/lib/token_strategies/message_bird_spec.rb+++ b/modules/two_factor_authentication/spec/lib/token_strategies/message_bird_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../../spec_helper"require "messagebird"diff --git a/modules/two_factor_authentication/spec/lib/token_strategy_manager_spec.rb b/modules/two_factor_authentication/spec/lib/token_strategy_manager_spec.rbindex 103e3a36558..84872b658e8 100644--- a/modules/two_factor_authentication/spec/lib/token_strategy_manager_spec.rb+++ b/modules/two_factor_authentication/spec/lib/token_strategy_manager_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"RSpec.describe OpenProject::TwoFactorAuthentication::TokenStrategyManager dodiff --git a/modules/two_factor_authentication/spec/models/device/default_device_spec.rb b/modules/two_factor_authentication/spec/models/device/default_device_spec.rbindex a4735a54070..5ab5aa65934 100644--- a/modules/two_factor_authentication/spec/models/device/default_device_spec.rb+++ b/modules/two_factor_authentication/spec/models/device/default_device_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "spec_helper"RSpec.describe "Default device" dodiff --git a/modules/two_factor_authentication/spec/models/device/totp_spec.rb b/modules/two_factor_authentication/spec/models/device/totp_spec.rbindex aad1993cdc4..0a8ebb3462c 100644--- a/modules/two_factor_authentication/spec/models/device/totp_spec.rb+++ b/modules/two_factor_authentication/spec/models/device/totp_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "spec_helper"require "timecop"diff --git a/modules/two_factor_authentication/spec/models/device/webauthn_spec.rb b/modules/two_factor_authentication/spec/models/device/webauthn_spec.rbindex bbe39d92765..eda80eeb533 100644--- a/modules/two_factor_authentication/spec/models/device/webauthn_spec.rb+++ b/modules/two_factor_authentication/spec/models/device/webauthn_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require "spec_helper"RSpec.describe TwoFactorAuthentication::Device::Webauthn dodiff --git a/modules/two_factor_authentication/spec/models/login_token_spec.rb b/modules/two_factor_authentication/spec/models/login_token_spec.rbindex 0993139166b..ab5ed54c8d8 100644--- a/modules/two_factor_authentication/spec/models/login_token_spec.rb+++ b/modules/two_factor_authentication/spec/models/login_token_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"RSpec.describe TwoFactorAuthentication::LoginToken, :with_2fa_ee dodiff --git a/modules/two_factor_authentication/spec/models/user_spec.rb b/modules/two_factor_authentication/spec/models/user_spec.rbindex 32ef36ec6eb..39da5bbbf6c 100644--- a/modules/two_factor_authentication/spec/models/user_spec.rb+++ b/modules/two_factor_authentication/spec/models/user_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"module OpenProject::TwoFactorAuthentication::Patchesdiff --git a/modules/two_factor_authentication/spec/routing/two_factor_authentication/my/two_factor_devices_spec.rb b/modules/two_factor_authentication/spec/routing/two_factor_authentication/my/two_factor_devices_spec.rbindex fba344252df..b5894e3de6c 100644--- a/modules/two_factor_authentication/spec/routing/two_factor_authentication/my/two_factor_devices_spec.rb+++ b/modules/two_factor_authentication/spec/routing/two_factor_authentication/my/two_factor_devices_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/two_factor_authentication/spec/routing/two_factor_authentication/users/two_factor_devices_spec.rb b/modules/two_factor_authentication/spec/routing/two_factor_authentication/users/two_factor_devices_spec.rbindex 3f37bd3884b..6323feaacb7 100644--- a/modules/two_factor_authentication/spec/routing/two_factor_authentication/users/two_factor_devices_spec.rb+++ b/modules/two_factor_authentication/spec/routing/two_factor_authentication/users/two_factor_devices_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/two_factor_authentication/spec/services/token_service_spec.rb b/modules/two_factor_authentication/spec/services/token_service_spec.rbindex f9e0f525c8d..fdda1e185e9 100644--- a/modules/two_factor_authentication/spec/services/token_service_spec.rb+++ b/modules/two_factor_authentication/spec/services/token_service_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+require_relative "../spec_helper"RSpec.describe TwoFactorAuthentication::TokenService dodiff --git a/modules/two_factor_authentication/spec/spec_helper.rb b/modules/two_factor_authentication/spec/spec_helper.rbindex f74661bbe40..2630ec8ea75 100644--- a/modules/two_factor_authentication/spec/spec_helper.rb+++ b/modules/two_factor_authentication/spec/spec_helper.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+# -- load spec_helper from OpenProject corerequire "spec_helper"require "webauthn/fake_client"