diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 5d5ca2f8a2f..ce83c4af51b 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -1323,14 +1323,6 @@ def idv_doc_auth_link_sent_visited(**extra) track_event('IdV: doc auth link_sent visited', **extra) end - def idv_doc_auth_randomizer_defaulted(**extra) - track_event( - 'IdV: doc_auth random vendor error', - error: 'document_capture_session_uuid_key missing', - **extra, - ) - end - def idv_doc_auth_redo_ssn_submitted(**extra) track_event('IdV: doc auth redo_ssn submitted', **extra) end diff --git a/app/services/doc_auth_router.rb b/app/services/doc_auth_router.rb index 650c403b95c..a4c43f1d75f 100644 --- a/app/services/doc_auth_router.rb +++ b/app/services/doc_auth_router.rb @@ -196,9 +196,14 @@ def self.client(vendor:, warn_notifier: nil) # rubocop:enable Layout/LineLength def self.doc_auth_vendor_for_bucket(bucket) - bucket == :alternate_vendor ? - IdentityConfig.store.doc_auth_vendor_randomize_alternate_vendor : - IdentityConfig.store.doc_auth_vendor + case bucket + when :socure + Idp::Constants::Vendors::SOCURE + when :lexis_nexis + Idp::Constants::Vendors::LEXIS_NEXIS + else # e.g., nil + IdentityConfig.store.doc_auth_vendor_default + end end def self.doc_auth_vendor( diff --git a/app/services/idv/analytics_events_enhancer.rb b/app/services/idv/analytics_events_enhancer.rb index ab470910044..11163c5f185 100644 --- a/app/services/idv/analytics_events_enhancer.rb +++ b/app/services/idv/analytics_events_enhancer.rb @@ -25,7 +25,6 @@ module AnalyticsEventsEnhancer idv_doc_auth_hybrid_handoff_visited idv_doc_auth_link_sent_submitted idv_doc_auth_link_sent_visited - idv_doc_auth_randomizer_defaulted idv_doc_auth_redo_ssn_submitted idv_doc_auth_ssn_submitted idv_doc_auth_ssn_visited diff --git a/config/application.yml.default b/config/application.yml.default index a294ce55604..9bd4324aedc 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -97,9 +97,9 @@ doc_auth_max_submission_attempts_before_native_camera: 3 doc_auth_selfie_desktop_test_mode: false doc_auth_separate_pages_enabled: false doc_auth_supported_country_codes: '["US", "GU", "VI", "AS", "MP", "PR", "USA" ,"GUM", "VIR", "ASM", "MNP", "PRI"]' -doc_auth_vendor_randomize: false -doc_auth_vendor_randomize_alternate_vendor: '' -doc_auth_vendor_randomize_percent: 0 +doc_auth_vendor_lexis_nexis_percent: 100 # note, LN is currently the default vendor +doc_auth_vendor_socure_percent: 0 +doc_auth_vendor_switching_enabled: false doc_capture_polling_enabled: true doc_capture_request_valid_for_minutes: 15 drop_off_report_config: '[{"emails":["ursula@example.com"],"issuers": ["urn:gov:gsa:openidconnect.profiles:sp:sso:agency_name:app_name"]}]' @@ -396,6 +396,7 @@ development: dashboard_url: http://localhost:3001/api/service_providers doc_auth_selfie_desktop_test_mode: true doc_auth_vendor: 'mock' + doc_auth_vendor_default: 'mock' domain_name: localhost:3000 enable_rate_limiting: false hmac_fingerprinter_key: a2c813d4dca919340866ba58063e4072adc459b767a74cf2666d5c1eef3861db26708e7437abde1755eb24f4034386b0fea1850a1cb7e56bff8fae3cc6ade96c @@ -452,7 +453,8 @@ production: dashboard_url: https://dashboard.demo.login.gov disable_email_sending: false disable_logout_get_request: false - doc_auth_vendor: 'acuant' + doc_auth_vendor: 'lexisnexis' + doc_auth_vendor_default: 'lexisnexis' domain_name: login.gov email_registrations_per_ip_track_only_mode: true enable_test_routes: false @@ -507,6 +509,7 @@ test: doc_auth_max_attempts: 4 doc_auth_selfie_desktop_test_mode: true doc_auth_vendor: 'mock' + doc_auth_vendor_default: 'mock' doc_capture_polling_enabled: false domain_name: www.example.com email_registrations_per_ip_limit: 3 diff --git a/config/initializers/ab_tests.rb b/config/initializers/ab_tests.rb index 38b69641eed..70fdddd95c2 100644 --- a/config/initializers/ab_tests.rb +++ b/config/initializers/ab_tests.rb @@ -35,13 +35,17 @@ def self.all constants.index_with { |test_name| const_get(test_name) } end + # This "test" will permanently be in place to allow a graceful transition from TrueID being the + # sole vendor to a multi-vendor configuration. DOC_AUTH_VENDOR = AbTest.new( experiment_name: 'Doc Auth Vendor', should_log: /^idv/i, + default_bucket: :lexis_nexis, buckets: { - alternate_vendor: IdentityConfig.store.doc_auth_vendor_randomize ? - IdentityConfig.store.doc_auth_vendor_randomize_percent : - 0, + socure: IdentityConfig.store.doc_auth_vendor_switching_enabled ? + IdentityConfig.store.doc_auth_vendor_socure_percent : 0, + lexis_nexis: IdentityConfig.store.doc_auth_vendor_switching_enabled ? + IdentityConfig.store.doc_auth_vendor_lexis_nexis_percent : 0, }.compact, ) do |service_provider:, session:, user:, user_session:, **| document_capture_session_uuid_discriminator(service_provider:, session:, user:, user_session:) diff --git a/lib/ab_test.rb b/lib/ab_test.rb index ef090aabe43..840cd1cc828 100644 --- a/lib/ab_test.rb +++ b/lib/ab_test.rb @@ -5,7 +5,7 @@ class AbTest MAX_SHA = (16 ** 64) - 1 - # @param [Proc,RegExp,string,Boolean,nil] should_log Controls whether bucket data for this + # @param [Proc,Regexp,string,Boolean,nil] should_log Controls whether bucket data for this # A/B test is logged with specific # events. # @yieldparam [ActionDispatch::Request] request diff --git a/lib/identity_config.rb b/lib/identity_config.rb index 79d29a1d847..a4a6b515755 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -117,9 +117,10 @@ def self.store config.add(:doc_auth_separate_pages_enabled, type: :boolean) config.add(:doc_auth_supported_country_codes, type: :json) config.add(:doc_auth_vendor, type: :string) - config.add(:doc_auth_vendor_randomize, type: :boolean) - config.add(:doc_auth_vendor_randomize_alternate_vendor, type: :string) - config.add(:doc_auth_vendor_randomize_percent, type: :integer) + config.add(:doc_auth_vendor_default, type: :string) + config.add(:doc_auth_vendor_lexis_nexis_percent, type: :integer) + config.add(:doc_auth_vendor_socure_percent, type: :integer) + config.add(:doc_auth_vendor_switching_enabled, type: :boolean) config.add(:doc_capture_polling_enabled, type: :boolean) config.add(:doc_capture_request_valid_for_minutes, type: :integer) config.add(:drop_off_report_config, type: :json) diff --git a/lib/idp/constants.rb b/lib/idp/constants.rb index 5a3b32bce42..d7ba925e42d 100644 --- a/lib/idp/constants.rb +++ b/lib/idp/constants.rb @@ -12,6 +12,7 @@ module Constants module Vendors ACUANT = 'acuant' LEXIS_NEXIS = 'lexis_nexis' + SOCURE = 'socure' MOCK = 'mock' USPS = 'usps' AAMVA = 'aamva' diff --git a/spec/config/initializers/ab_tests_spec.rb b/spec/config/initializers/ab_tests_spec.rb index b6313e51bd6..f858344346d 100644 --- a/spec/config/initializers/ab_tests_spec.rb +++ b/spec/config/initializers/ab_tests_spec.rb @@ -3,13 +3,7 @@ RSpec.describe AbTests do describe '#all' do it 'returns all registered A/B tests' do - expect(AbTests.all).to match( - { - ACUANT_SDK: an_instance_of(AbTest), - DOC_AUTH_VENDOR: an_instance_of(AbTest), - - }, - ) + expect(AbTests.all.values).to all(be_kind_of(AbTest)) end end @@ -119,20 +113,20 @@ let(:enable_ab_test) do -> { - allow(IdentityConfig.store).to receive(:doc_auth_vendor). + allow(IdentityConfig.store).to receive(:doc_auth_vendor_default). and_return('vendor_a') - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize). + allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled). and_return(true) - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_alternate_vendor). - and_return('vendor_b') - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_percent). + allow(IdentityConfig.store).to receive(:doc_auth_vendor_socure_percent). and_return(50) + allow(IdentityConfig.store).to receive(:doc_auth_vendor_lexis_nexis_percent). + and_return(30) } end let(:disable_ab_test) do -> { - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize). + allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled). and_return(false) } end diff --git a/spec/services/doc_auth_router_spec.rb b/spec/services/doc_auth_router_spec.rb index 76ecdf41e40..6e4cc22a49f 100644 --- a/spec/services/doc_auth_router_spec.rb +++ b/spec/services/doc_auth_router_spec.rb @@ -19,44 +19,6 @@ end end - describe '.doc_auth_vendor' do - def reload_ab_test_initializer! - # undefine the AB tests instances so we can re-initialize them with different config values - AbTests.constants.each do |const_name| - AbTests.class_eval { remove_const(const_name) } - end - load Rails.root.join('config', 'initializers', 'ab_tests.rb').to_s - end - - let(:doc_auth_vendor) { 'test1' } - let(:doc_auth_vendor_randomize_alternate_vendor) { 'test2' } - let(:analytics) { FakeAnalytics.new } - let(:doc_auth_vendor_randomize_percent) { 57 } - let(:doc_auth_vendor_randomize) { true } - - before do - allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return(doc_auth_vendor) - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_alternate_vendor). - and_return(doc_auth_vendor_randomize_alternate_vendor) - - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_percent). - and_return(doc_auth_vendor_randomize_percent) - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize). - and_return(doc_auth_vendor_randomize) - - reload_ab_test_initializer! - end - - after do - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_percent). - and_call_original - allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize). - and_call_original - - reload_ab_test_initializer! - end - end - describe DocAuthRouter::DocAuthErrorTranslatorProxy do subject(:proxy) do DocAuthRouter::DocAuthErrorTranslatorProxy.new(DocAuth::Mock::DocAuthMockClient.new) diff --git a/spec/services/idv/proofing_components_spec.rb b/spec/services/idv/proofing_components_spec.rb index d78fb48b1fc..97e78cc5ab6 100644 --- a/spec/services/idv/proofing_components_spec.rb +++ b/spec/services/idv/proofing_components_spec.rb @@ -32,7 +32,7 @@ let(:pii_from_doc) { Idp::Constants::MOCK_IDV_APPLICANT } before do - allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return('test_vendor') + allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return('test_vendor') idv_session.mark_verify_info_step_complete! idv_session.address_verification_mechanism = 'gpo' allow(FeatureManagement).to receive(:proofing_device_profiling_collecting_enabled?). @@ -78,7 +78,7 @@ context 'doc auth' do before do - allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return('test_vendor') + allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return('test_vendor') end context 'before doc auth complete' do it 'returns nil' do