diff --git a/config/application.yml.default b/config/application.yml.default index ddf2b9a2b37..6d561995292 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -104,6 +104,8 @@ doc_auth_client_sharpness_threshold: 50 doc_auth_error_dpi_threshold: 290 doc_auth_error_glare_threshold: 40 doc_auth_error_sharpness_threshold: 40 +doc_auth_manual_upload_disabled_a_b_testing_enabled: false +doc_auth_manual_upload_disabled_a_b_testing_percent: 0 doc_auth_max_attempts: 5 doc_auth_max_capture_attempts_before_native_camera: 3 doc_auth_max_submission_attempts_before_native_camera: 3 diff --git a/config/initializers/ab_tests.rb b/config/initializers/ab_tests.rb index dfba4cc0605..2a91282c308 100644 --- a/config/initializers/ab_tests.rb +++ b/config/initializers/ab_tests.rb @@ -127,4 +127,19 @@ def self.all ) do |service_provider:, session:, user:, user_session:, **| user&.uuid end.freeze + + DOC_AUTH_MANUAL_UPLOAD_DISABLED = AbTest.new( + experiment_name: 'Doc Auth Manual Upload Disabled', + should_log: [ + 'Idv: doc auth hybrid handoff visited', + 'IdV: doc auth document_capture visited', + ], + buckets: { + manual_upload_disabled: + IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing_enabled ? + IdentityConfig.store.doc_auth_manual_upload_disabled_a_b_testing_percent : 0, + }, + ) do |service_provider:, session:, user:, user_session:, **| + user&.uuid + end.freeze end diff --git a/lib/identity_config.rb b/lib/identity_config.rb index eef21146616..d9f92391885 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -124,6 +124,8 @@ def self.store config.add(:doc_auth_error_glare_threshold, type: :integer) config.add(:doc_auth_error_sharpness_threshold, type: :integer) config.add(:doc_auth_max_attempts, type: :integer) + config.add(:doc_auth_manual_upload_disabled_a_b_testing_enabled, type: :boolean) + config.add(:doc_auth_manual_upload_disabled_a_b_testing_percent, type: :integer) config.add(:doc_auth_max_capture_attempts_before_native_camera, type: :integer) config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer) config.add(:doc_auth_passports_enabled, type: :boolean) diff --git a/spec/config/initializers/ab_tests_spec.rb b/spec/config/initializers/ab_tests_spec.rb index d83e16d9589..8b4e4385402 100644 --- a/spec/config/initializers/ab_tests_spec.rb +++ b/spec/config/initializers/ab_tests_spec.rb @@ -433,4 +433,28 @@ it_behaves_like 'an A/B test that uses user_uuid as a discriminator' end + + describe 'DOC_AUTH_MANUAL_UPLOAD_DISABLED' do + let(:ab_test) { :DOC_AUTH_MANUAL_UPLOAD_DISABLED } + + let(:enable_ab_test) do + -> { + allow(IdentityConfig.store) + .to receive(:doc_auth_manual_upload_disabled_a_b_testing_enabled) + .and_return(true) + allow(IdentityConfig.store) + .to receive(:doc_auth_manual_upload_disabled_a_b_testing_percent) + .and_return(50) + } + end + + let(:disable_ab_test) do + -> { + allow(IdentityConfig.store).to receive(:doc_auth_manual_upload_disabled_a_b_testing_enabled) + .and_return(false) + } + end + + it_behaves_like 'an A/B test that uses user_uuid as a discriminator' + end end