diff --git a/ee/app/helpers/ee/application_settings_helper.rb b/ee/app/helpers/ee/application_settings_helper.rb index c208470f8c09642e7b983ecb380bfbd00c3df8cf..455ee1792a7b8f90030dae68c1a93c97c038a931 100644 --- a/ee/app/helpers/ee/application_settings_helper.rb +++ b/ee/app/helpers/ee/application_settings_helper.rb @@ -317,6 +317,7 @@ def identity_verification_attributes %i[ arkose_labs_client_secret arkose_labs_client_xid + arkose_labs_enabled arkose_labs_namespace arkose_labs_private_api_key arkose_labs_public_api_key diff --git a/ee/app/models/ee/application_setting.rb b/ee/app/models/ee/application_setting.rb index 7830c7267f5d4b26da05b58c9142c487d51a364d..3b1ebeb0ce39a3b9fc7a8e6c2a9aa9524a002ed8 100644 --- a/ee/app/models/ee/application_setting.rb +++ b/ee/app/models/ee/application_setting.rb @@ -54,7 +54,8 @@ module ApplicationSetting phone_verification_enabled: [:boolean, { default: true }], ci_requires_identity_verification_on_free_plan: [:boolean, { default: true }], telesign_intelligence_enabled: [:boolean, { default: true }], - credit_card_verification_enabled: [:boolean, { default: true }] + credit_card_verification_enabled: [:boolean, { default: true }], + arkose_labs_enabled: [:boolean, { default: true }] validates :identity_verification_settings, json_schema: { filename: "identity_verification_settings" } diff --git a/ee/app/validators/json_schemas/identity_verification_settings.json b/ee/app/validators/json_schemas/identity_verification_settings.json index 548868596203620a864f3e1cd2a4ad0852f5bcd0..eb15b797a6c5a6ab3252e4b484bcb46730a6641d 100644 --- a/ee/app/validators/json_schemas/identity_verification_settings.json +++ b/ee/app/validators/json_schemas/identity_verification_settings.json @@ -31,6 +31,10 @@ "credit_card_verification_enabled": { "type": "boolean", "description": "Whether credit card verification is an available identity verification method" + }, + "arkose_labs_enabled": { + "type": "boolean", + "description": "Whether Arkose checks are required for identity verification" } } } diff --git a/ee/config/feature_flags/ops/arkose_labs.yml b/ee/config/feature_flags/ops/arkose_labs.yml deleted file mode 100644 index 926c394e3c559091fc4388b610f94c083130e130..0000000000000000000000000000000000000000 --- a/ee/config/feature_flags/ops/arkose_labs.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: arkose_labs -feature_issue_url: https://gitlab.com/gitlab-com/gl-infra/production-engineering/-/issues/25655 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161395 -rollout_issue_url: -milestone: '17.3' -group: group::anti-abuse -type: ops -default_enabled: true diff --git a/ee/lib/anti_abuse/identity_verification/settings.rb b/ee/lib/anti_abuse/identity_verification/settings.rb index b56f6776d44fe7d87f262dc7c9493481567424e6..c9cb5e1faf81d9454d7dcba87a011311d720cbe5 100644 --- a/ee/lib/anti_abuse/identity_verification/settings.rb +++ b/ee/lib/anti_abuse/identity_verification/settings.rb @@ -29,7 +29,7 @@ def arkose_data_exchange_key end def arkose_enabled?(user:, user_agent:) - return false unless ::Feature.enabled?(:arkose_labs, user, type: :ops) + return false unless ::Gitlab::CurrentSettings.arkose_labs_enabled arkose_public_api_key.present? && arkose_private_api_key.present? && diff --git a/ee/spec/features/registrations/identity_verification_spec.rb b/ee/spec/features/registrations/identity_verification_spec.rb index e083a395e9247890b5005f775882f099a55fd8aa..6bbc07b6fe098e482901ea87a1177cbabfd2af94 100644 --- a/ee/spec/features/registrations/identity_verification_spec.rb +++ b/ee/spec/features/registrations/identity_verification_spec.rb @@ -291,9 +291,9 @@ def send_request(session, method, path, headers:) end shared_examples 'allows the user to complete registration when Arkose is unavailable' do |flow: :standard| - context 'when Arkose is disabled via feature flag' do + context 'when Arkose is disabled via application setting' do before do - stub_feature_flags(arkose_labs: false) + stub_application_setting(arkose_labs_enabled: false) sign_up(flow: flow, arkose: { disable: true }) end diff --git a/ee/spec/helpers/ee/application_settings_helper_spec.rb b/ee/spec/helpers/ee/application_settings_helper_spec.rb index adce77614a1c8dbad4640ebd4bf10027f42d944f..e43627813f1a1886f6cebfba7b7c5f465993032c 100644 --- a/ee/spec/helpers/ee/application_settings_helper_spec.rb +++ b/ee/spec/helpers/ee/application_settings_helper_spec.rb @@ -34,6 +34,7 @@ expect(visible_attributes).to include(*%i[ arkose_labs_client_secret arkose_labs_client_xid + arkose_labs_enabled arkose_labs_namespace arkose_labs_private_api_key arkose_labs_public_api_key @@ -51,6 +52,7 @@ expect(visible_attributes).not_to include(*%i[ arkose_labs_client_secret arkose_labs_client_xid + arkose_labs_enabled arkose_labs_namespace arkose_labs_private_api_key arkose_labs_public_api_key diff --git a/ee/spec/lib/anti_abuse/identity_verification/settings_spec.rb b/ee/spec/lib/anti_abuse/identity_verification/settings_spec.rb index ce8a003cc2f0a9b1083af4b246d0b31892f326ad..3a08f64b21c4d0d64dff1b601982b743208e718a 100644 --- a/ee/spec/lib/anti_abuse/identity_verification/settings_spec.rb +++ b/ee/spec/lib/anti_abuse/identity_verification/settings_spec.rb @@ -110,12 +110,16 @@ end context 'when arkose labs is enabled' do + before do + stub_application_setting(arkose_labs_enabled: true) + end + it { is_expected.to eq result } end context 'when arkose labs is disabled' do before do - stub_feature_flags(arkose_labs: false) + stub_application_setting(arkose_labs_enabled: false) end it { is_expected.to be false } diff --git a/ee/spec/models/application_setting_spec.rb b/ee/spec/models/application_setting_spec.rb index 29db1fcf1100be126faeb02ae4395740d1a86627..325c25952c90a46beca84dba02c28f3d89377d4b 100644 --- a/ee/spec/models/application_setting_spec.rb +++ b/ee/spec/models/application_setting_spec.rb @@ -37,6 +37,7 @@ it { expect(setting.soft_phone_verification_transactions_daily_limit).to eq(16000) } it { expect(setting.phone_verification_enabled).to eq(true) } it { expect(setting.credit_card_verification_enabled).to eq(true) } + it { expect(setting.arkose_labs_enabled).to eq(true) } it { expect(setting.ci_requires_identity_verification_on_free_plan).to eq(true) } it { expect(setting.secret_detection_service_url).to eq('') } it { expect(setting.secret_detection_service_auth_token).to eq(nil) }