Skip to content

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

Remove EE checks from 2FA

Oliver Güntheree87ce1613c0
diff --git a/docs/system-admin-guide/authentication/two-factor-authentication/README.md b/docs/system-admin-guide/authentication/two-factor-authentication/README.md
index e623fa64fc6..cb99b4e2f49 100644
--- a/docs/system-admin-guide/authentication/two-factor-authentication/README.md
+++ b/docs/system-admin-guide/authentication/two-factor-authentication/README.md
@@ -7,8 +7,6 @@ keywords: two-factor authentication
---
# Two-factor authentication (2FA)
-Note: This feature is available for the Enterprise on-premises only. For more information and differences to Community Edition, [see this page](https://www.openproject.org/pricing/).
-
## Basic 2FA using TOTP
To activate and **configure two-factor authentication** for OpenProject, navigate to -> *Administration* -> *Authentication* and choose -> *two-factor authentication*.
diff --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.rb
index 701b9504490..c1e74978c7d 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
@@ -3,7 +3,6 @@ module ::TwoFactorAuthentication
include EnterpriseTrialHelper
before_action :require_admin
before_action :check_enabled
- before_action :check_ee
layout 'admin'
menu_item :two_factor_authentication
@@ -49,12 +48,6 @@ module ::TwoFactorAuthentication
render_403 unless manager.configurable_by_ui?
end
- def check_ee
- unless EnterpriseToken.allows_to?(:two_factor_authentication)
- render template: 'two_factor_authentication/upsale'
- end
- end
-
def manager
::OpenProject::TwoFactorAuthentication::TokenStrategyManager
end
diff --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.rb
index 1a00c114524..c1c20e274e6 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
@@ -39,7 +39,7 @@ module OpenProject::TwoFactorAuthentication
##
# Whether any active strategy exists
def enabled?
- !active_strategies.empty? && EnterpriseToken.allows_to?(:two_factor_authentication)
+ !active_strategies.empty?
end
##
diff --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.rb
index 131e4cbce77..7aff2701905 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,7 +1,7 @@
require_relative '../../spec_helper'
require_relative './authentication_controller_shared_examples'
-describe ::TwoFactorAuthentication::AuthenticationController, with_2fa_ee: true, with_settings: { login_required?: true } do
+describe ::TwoFactorAuthentication::AuthenticationController, with_settings: { login_required?: true } do
let(:valid_credentials) do
{ username: 'foobar', password: 'AAA1111!!!!' }
end
@@ -27,7 +27,7 @@ describe ::TwoFactorAuthentication::AuthenticationController, with_2fa_ee: true,
before do
allow(OpenProject::TwoFactorAuthentication::TokenStrategyManager)
.to receive(:add_default_strategy?)
- .and_return false
+ .and_return false
session[:authenticated_user_id] = user.id
get :request_otp
end
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.rb
index 189aa535a3b..15119e05622 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,7 +1,7 @@
require_relative '../../../spec_helper'
require_relative './../authentication_controller_shared_examples'
-describe ::TwoFactorAuthentication::ForcedRegistration::TwoFactorDevicesController, with_2fa_ee: true do
+describe ::TwoFactorAuthentication::ForcedRegistration::TwoFactorDevicesController do
let(:user) { create(:user, login: 'foobar') }
let(:logged_in_user) { User.anonymous }
let(:active_strategies) { [] }
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.rb
index 0ce5763a16f..3f4e1f8e9c3 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,7 +1,7 @@
require_relative '../../../spec_helper'
require_relative './../authentication_controller_shared_examples'
-describe ::TwoFactorAuthentication::My::TwoFactorDevicesController, with_2fa_ee: true do
+describe ::TwoFactorAuthentication::My::TwoFactorDevicesController do
let(:user) { create(:user, login: 'foobar') }
let(:other_user) { create(:user) }
let(:logged_in_user) { user }
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.rb
index 8deed157752..0f9c430f898 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,7 +1,7 @@
require_relative '../../../spec_helper'
require_relative './../authentication_controller_shared_examples'
-describe ::TwoFactorAuthentication::Users::TwoFactorDevicesController, with_2fa_ee: true do
+describe ::TwoFactorAuthentication::Users::TwoFactorDevicesController do
let(:admin) { create :admin }
let(:user) { create(:user, login: 'foobar') }
let(:other_user) { create(:user) }
diff --git a/modules/two_factor_authentication/spec/features/account_activation_spec.rb b/modules/two_factor_authentication/spec/features/account_activation_spec.rb
index bdb0b2f81c9..4e0cd4fbe21 100644
--- a/modules/two_factor_authentication/spec/features/account_activation_spec.rb
+++ b/modules/two_factor_authentication/spec/features/account_activation_spec.rb
@@ -2,7 +2,6 @@ require_relative '../spec_helper'
require_relative './shared_2fa_examples'
describe 'activating an invited account',
- with_2fa_ee: true,
type: :feature,
js: true,
with_settings: {
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.rb
index bcdc9be5436..b482f55f5b1 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,7 +1,6 @@
require_relative '../spec_helper'
describe 'Admin 2FA management',
- with_2fa_ee: true,
type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: { 'active_strategies' => %i[developer totp] }
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.rb
index 8e308979e9b..9ec1fac372e 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,7 +1,7 @@
require_relative '../../spec_helper'
require_relative '../shared_2fa_examples'
-describe 'Generate 2FA backup codes', with_2fa_ee: true, type: :feature,
+describe 'Generate 2FA backup codes', type: :feature,
with_config: { '2fa': { active_strategies: [:developer] } },
js: true do
let(:user_password) { 'bob!' * 4 }
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.rb
index dd1c20852b2..4c39298256e 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,7 +1,7 @@
require_relative '../../spec_helper'
require_relative '../shared_2fa_examples'
-describe 'Login with 2FA backup code', with_2fa_ee: true, type: :feature,
+describe 'Login with 2FA backup code', type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: { 'active_strategies' => [:developer] }
},
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.rb
index 87e229cb220..ac3084455e8 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
@@ -2,7 +2,6 @@ require_relative '../../spec_helper'
require_relative '../shared_2fa_examples'
describe 'Login with enforced 2FA',
- with_2fa_ee: true,
type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: {
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.rb
index df5c43b0fd1..9196d89cdce 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
@@ -2,7 +2,6 @@ require_relative '../../spec_helper'
require_relative '../shared_2fa_examples'
describe 'Login with 2FA device',
- with_2fa_ee: true,
type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: {
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.rb
index 1f78a114b8e..e08e54beb0c 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,7 +1,7 @@
require_relative '../../spec_helper'
require_relative '../shared_2fa_examples'
-describe 'Login with no required OTP', with_2fa_ee: true, type: :feature,
+describe 'Login with no required OTP', type: :feature,
with_config: { '2fa': { active_strategies: [:developer] } },
js: true do
let(:user_password) { 'bob!' * 4 }
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.rb
index 886512652be..18d7bd13bed 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
@@ -2,7 +2,6 @@ require_relative '../../spec_helper'
require_relative '../shared_2fa_examples'
describe 'Login by switching 2FA device',
- with_2fa_ee: true,
type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: { 'active_strategies' => %i[developer totp] }
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.rb
index 56ac07f9bd6..1aae048d614 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,7 +1,6 @@
require_relative '../spec_helper'
describe 'My Account 2FA configuration',
- with_2fa_ee: true,
type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: { 'active_strategies' => %i[developer totp] }
diff --git a/modules/two_factor_authentication/spec/features/password_change_spec.rb b/modules/two_factor_authentication/spec/features/password_change_spec.rb
index e04a5d0c1e0..b4fd95270db 100644
--- a/modules/two_factor_authentication/spec/features/password_change_spec.rb
+++ b/modules/two_factor_authentication/spec/features/password_change_spec.rb
@@ -1,7 +1,6 @@
require_relative '../spec_helper'
describe 'Password change with OTP',
- with_2fa_ee: true,
type: :feature,
with_settings: {
plugin_openproject_two_factor_authentication: {
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.rb
index 16cb13d0ad7..30f7c8a2bb3 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
@@ -3,7 +3,6 @@ require_relative '../shared_2fa_examples'
describe 'Login with 2FA remember cookie',
type: :feature,
- with_2fa_ee: true,
with_settings: {
plugin_openproject_two_factor_authentication: {
active_strategies: [:developer],
diff --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.rb
index 867a3534a64..beb9ecc3d44 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,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require 'messagebird'
-describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::MessageBird, with_2fa_ee: true do
+describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::MessageBird do
let(:channel) { :sms }
let(:locale) { 'en' }
let(:user) { create :user, language: locale }
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.rb
index 5d8c655ffdc..4f33c0005b1 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,6 +1,5 @@
require_relative '../spec_helper'
-# rubocop:disable RSpec/NestedGroups
describe ::OpenProject::TwoFactorAuthentication::TokenStrategyManager do
let(:dev_strategy) { ::OpenProject::TwoFactorAuthentication::TokenStrategy::Developer }
let(:totp_strategy) { ::OpenProject::TwoFactorAuthentication::TokenStrategy::Totp }
@@ -12,129 +11,110 @@ describe ::OpenProject::TwoFactorAuthentication::TokenStrategyManager do
end
let(:enforced) { false }
- context 'without EE' do
- include_context 'with settings' do
- let(:settings) do
- {
- plugin_openproject_two_factor_authentication: {
- 'active_strategies' => %i[developer]
- }
- }
- end
- end
-
- it 'is not enabled' do
- expect(described_class).not_to be_enabled
+ include_context 'with settings' do
+ let(:settings) do
+ {
+ plugin_openproject_two_factor_authentication: configuration
+ }
end
end
- context 'with EE', with_2fa_ee: true do
- include_context 'with settings' do
- let(:settings) do
- {
- plugin_openproject_two_factor_authentication: configuration
- }
- end
- end
-
- describe '#find_matching_strategy' do
- subject { described_class.find_matching_strategy(:sms) }
+ describe '#find_matching_strategy' do
+ subject { described_class.find_matching_strategy(:sms) }
- context 'when no strategy is set' do
- let(:active_strategies) { [] }
+ context 'when no strategy is set' do
+ let(:active_strategies) { [] }
- it 'returns nil' do
- expect(subject).to be_nil
- end
+ it 'returns nil' do
+ expect(subject).to be_nil
end
+ end
- context 'when matching strategy exists' do
- let(:active_strategies) { [:developer] }
+ context 'when matching strategy exists' do
+ let(:active_strategies) { [:developer] }
- it 'returns the strategy' do
- expect(subject).to eq(dev_strategy)
- end
+ it 'returns the strategy' do
+ expect(subject).to eq(dev_strategy)
end
+ end
- context 'when non-matching strategy exists' do
- let(:active_strategies) { [:totp] }
+ context 'when non-matching strategy exists' do
+ let(:active_strategies) { [:totp] }
- it 'returns the strategy' do
- expect(subject).to be_nil
- end
+ it 'returns the strategy' do
+ expect(subject).to be_nil
end
end
+ end
- describe '#active_strategies' do
- context 'with bogus strategy' do
- let(:active_strategies) { [:doesnotexist] }
+ describe '#active_strategies' do
+ context 'with bogus strategy' do
+ let(:active_strategies) { [:doesnotexist] }
- it 'raises when accessing' do
- expect { described_class.active_strategies }.to raise_error(ArgumentError)
- end
+ it 'raises when accessing' do
+ expect { described_class.active_strategies }.to raise_error(ArgumentError)
+ end
- it 'raises when validating' do
- expect { described_class.validate_active_strategies! }.to raise_error(ArgumentError)
- end
+ it 'raises when validating' do
+ expect { described_class.validate_active_strategies! }.to raise_error(ArgumentError)
end
end
+ end
- describe '#validate_active_strategies!' do
- subject { described_class.validate_active_strategies! }
+ describe '#validate_active_strategies!' do
+ subject { described_class.validate_active_strategies! }
- context 'when no strategy is set' do
- let(:active_strategies) { [] }
+ context 'when no strategy is set' do
+ let(:active_strategies) { [] }
- before do
- allow(OpenProject::TwoFactorAuthentication::TokenStrategyManager)
- .to receive(:add_default_strategy?)
- .and_return false
- end
+ before do
+ allow(OpenProject::TwoFactorAuthentication::TokenStrategyManager)
+ .to receive(:add_default_strategy?)
+ .and_return false
+ end
- context 'when enforced is false' do
- let(:enforced) { false }
+ context 'when enforced is false' do
+ let(:enforced) { false }
- it 'accepts that' do
- expect { subject }.not_to raise_error
- expect(described_class).not_to be_enabled
- expect(described_class).not_to be_enforced
- end
+ it 'accepts that' do
+ expect { subject }.not_to raise_error
+ expect(described_class).not_to be_enabled
+ expect(described_class).not_to be_enforced
end
+ end
- context 'when enforced is true' do
- let(:enforced) { true }
+ context 'when enforced is true' do
+ let(:enforced) { true }
- it 'raises and error that a strategy is needed' do
- expect { subject }.to raise_error(ArgumentError)
- expect(described_class).not_to be_enabled
- expect(described_class).to be_enforced
- end
+ it 'raises and error that a strategy is needed' do
+ expect { subject }.to raise_error(ArgumentError)
+ expect(described_class).not_to be_enabled
+ expect(described_class).to be_enforced
end
end
+ end
- context 'when a strategy is set' do
- let(:active_strategies) { [:developer] }
+ context 'when a strategy is set' do
+ let(:active_strategies) { [:developer] }
- context 'when it is valid' do
- it 'returns that' do
- expect { subject }.not_to raise_error
- expect(described_class.active_strategies).to eq([dev_strategy])
- expect(described_class).to be_enabled
- expect(described_class).not_to be_enforced
- end
+ context 'when it is valid' do
+ it 'returns that' do
+ expect { subject }.not_to raise_error
+ expect(described_class.active_strategies).to eq([dev_strategy])
+ expect(described_class).to be_enabled
+ expect(described_class).not_to be_enforced
end
+ end
- context 'when it is invalid' do
- it 'raises' do
- allow(dev_strategy).to receive(:validate!).and_raise 'Error!'
+ context 'when it is invalid' do
+ it 'raises' do
+ allow(dev_strategy).to receive(:validate!).and_raise 'Error!'
- expect { subject }.to raise_error 'Error!'
- expect(described_class).to be_enabled
- expect(described_class).not_to be_enforced
- end
+ expect { subject }.to raise_error 'Error!'
+ expect(described_class).to be_enabled
+ expect(described_class).not_to be_enforced
end
end
end
end
end
-# rubocop:enable RSpec/NestedGroups
diff --git a/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb b/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb
index b3c4ad81519..6ea6b4bc870 100644
--- a/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb
+++ b/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe 'Default device', with_2fa_ee: true, type: :model do
+describe 'Default device', type: :model do
let(:user) { create :user }
let(:subject) { build :two_factor_authentication_device_totp, user:, default: true }
let(:other_otp) { build :two_factor_authentication_device_totp, user:, default: true }
diff --git a/modules/two_factor_authentication/spec/models/devices/totp_spec.rb b/modules/two_factor_authentication/spec/models/devices/totp_spec.rb
index 2665a91fe04..d5ad2a279a9 100644
--- a/modules/two_factor_authentication/spec/models/devices/totp_spec.rb
+++ b/modules/two_factor_authentication/spec/models/devices/totp_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
require 'timecop'
-describe ::TwoFactorAuthentication::Device::Totp, with_2fa_ee: true, type: :model do
+describe ::TwoFactorAuthentication::Device::Totp, type: :model do
let(:user) { create :user }
let(:channel) { :totp }
diff --git a/modules/two_factor_authentication/spec/models/login_token_spec.rb b/modules/two_factor_authentication/spec/models/login_token_spec.rb
index 9465c2e30a7..ff0565999f1 100644
--- a/modules/two_factor_authentication/spec/models/login_token_spec.rb
+++ b/modules/two_factor_authentication/spec/models/login_token_spec.rb
@@ -1,6 +1,6 @@
require_relative '../spec_helper'
-describe TwoFactorAuthentication::LoginToken, with_2fa_ee: true do
+describe TwoFactorAuthentication::LoginToken do
before do
@user = build_stubbed(:user, login: "john", password: "doe")
allow(@user).to receive(:new_record?).and_return(false)
diff --git a/modules/two_factor_authentication/spec/models/user_spec.rb b/modules/two_factor_authentication/spec/models/user_spec.rb
index e949a77aa73..70d7ff0dbd6 100644
--- a/modules/two_factor_authentication/spec/models/user_spec.rb
+++ b/modules/two_factor_authentication/spec/models/user_spec.rb
@@ -2,7 +2,7 @@ require_relative '../spec_helper'
module OpenProject::TwoFactorAuthentication::Patches
module UserSpec
- describe User, with_2fa_ee: true do
+ describe User do
def create_user(auth_source_id = nil)
@user = build(:user)
@username = @user.login
diff --git a/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb b/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb
index ef39bec22e3..e2b5b07e119 100644
--- a/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb
@@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require 'messagebird'
-describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::MessageBird, with_2fa_ee: true do
+describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::MessageBird do
describe 'sending messages' do
let!(:user) { create :user, language: locale }
let!(:locale) { 'en' }
diff --git a/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb b/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb
index bab02046b5f..e982700e470 100644
--- a/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::Sns, with_2fa_ee: true do
+describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::Sns do
describe 'sending messages' do
let(:phone) { '+49 123456789' }
let!(:user) { create :user }
diff --git a/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb b/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb
index 31d9aed32a8..ddb0ce734bd 100644
--- a/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
-describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::Totp, with_2fa_ee: true do
+describe ::OpenProject::TwoFactorAuthentication::TokenStrategy::Totp do
describe 'sending messages' do
let!(:user) { create :user }
let!(:device) { create :two_factor_authentication_device_totp, user:, default: true }
diff --git a/modules/two_factor_authentication/spec/services/token_service_spec.rb b/modules/two_factor_authentication/spec/services/token_service_spec.rb
index 5e8c95a874c..88a75e2fa39 100644
--- a/modules/two_factor_authentication/spec/services/token_service_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_service_spec.rb
@@ -1,6 +1,6 @@
require_relative '../spec_helper'
-describe ::TwoFactorAuthentication::TokenService, with_2fa_ee: true do
+describe ::TwoFactorAuthentication::TokenService do
describe 'sending messages' do
let(:user) { create(:user) }
let(:dev_strategy) { ::OpenProject::TwoFactorAuthentication::TokenStrategy::Developer }
diff --git a/modules/two_factor_authentication/spec/spec_helper.rb b/modules/two_factor_authentication/spec/spec_helper.rb
index a4925939eca..4351818bd68 100644
--- a/modules/two_factor_authentication/spec/spec_helper.rb
+++ b/modules/two_factor_authentication/spec/spec_helper.rb
@@ -1,17 +1,2 @@
# -- load spec_helper from OpenProject core
require "spec_helper"
-
-RSpec.configure do |config|
- config.before do |example|
- next unless example.metadata[:with_2fa_ee]
-
- allow(EnterpriseToken)
- .to receive(:allows_to?)
- .and_call_original
-
- allow(EnterpriseToken)
- .to receive(:allows_to?)
- .with(:two_factor_authentication)
- .and_return true
- end
-end