From cb0eec11563ec3afbf631ed8bfd55e21666e3836 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 20 Nov 2024 11:36:06 -0500 Subject: [PATCH 01/10] default users requiring facial match to LN changelog: Upcoming Features, IdV Socure, default users requiring facial match to LN --- .../concerns/idv/doc_auth_vendor_concern.rb | 6 ++++- .../hybrid_mobile/entry_controller_spec.rb | 13 ++++++++++ .../document_capture_controller_spec.rb | 24 +++++++++++++++---- .../document_capture_controller_spec.rb | 24 +++++++++++++++---- 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index 25225c3d6a4..9053c70891f 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -6,7 +6,11 @@ module DocAuthVendorConcern # @returns[String] String identifying the vendor to use for doc auth. def doc_auth_vendor - bucket = ab_test_bucket(:DOC_AUTH_VENDOR) + if resolved_authn_context_result.facial_match? + bucket = :lexis_nexis + else + bucket = ab_test_bucket(:DOC_AUTH_VENDOR) + end DocAuthRouter.doc_auth_vendor_for_bucket(bucket) end end diff --git a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb index 8d43b38e37f..3241f380cc4 100644 --- a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb @@ -56,9 +56,13 @@ {} end let(:idv_vendor) { Idp::Constants::Vendors::MOCK } + let(:vot) { 'P1' } before do + resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse allow(controller).to receive(:session).and_return(session) + allow(controller).to receive(:resolved_authn_context_result). + and_return(resolved_authn_context) get :show, params: { 'document-capture-session': session_uuid } end @@ -70,6 +74,15 @@ end end + context 'doc auth vendor is socure but facial match is required' do + let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } + let(:vot) { 'Pb' } + + it 'redirects to the lexis nexis first step' do + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end + end + context 'doc auth vendor is lexis nexis' do let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } diff --git a/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb index 427b42a7a7f..368cf0a910d 100644 --- a/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb @@ -64,11 +64,27 @@ end context 'when we try to use this controller but we should be using the LN/mock version' do - let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } + context 'when doc_auth_vendor is Lexis Nexis' do + let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } - it 'redirects to the LN/mock controller' do - get :show - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + it 'redirects to the LN/mock controller' do + get :show + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end + end + + context 'when facial match is required' do + let(:vot) { 'Pb' } + before do + resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse + allow(controller).to receive(:resolved_authn_context_result). + and_return(resolved_authn_context) + end + + it 'redirects to the LN/mock controller' do + get :show + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end end end diff --git a/spec/controllers/idv/socure/document_capture_controller_spec.rb b/spec/controllers/idv/socure/document_capture_controller_spec.rb index 93db87d1ca9..03acdf4d342 100644 --- a/spec/controllers/idv/socure/document_capture_controller_spec.rb +++ b/spec/controllers/idv/socure/document_capture_controller_spec.rb @@ -77,11 +77,27 @@ end context 'when we try to use this controller but we should be using the LN/mock version' do - let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } + context 'when doc_auth_vendor is Lexis Nexis' do + let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } - it 'redirects to the LN/mock controller' do - get :show - expect(response).to redirect_to idv_document_capture_url + it 'redirects to the LN/mock controller' do + get :show + expect(response).to redirect_to idv_document_capture_url + end + end + + context 'when facial match is required' do + let(:vot) { 'Pb' } + before do + resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse + allow(controller).to receive(:resolved_authn_context_result). + and_return(resolved_authn_context) + end + + it 'redirects to the LN/mock controller' do + get :show + expect(response).to redirect_to idv_document_capture_url + end end end From 0b53d6a6a3e6676f138d01d63a4496abb7cffd96 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 20 Nov 2024 16:00:45 -0500 Subject: [PATCH 02/10] add check for mock vendor --- app/controllers/concerns/idv/doc_auth_vendor_concern.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index 9053c70891f..84d9308d811 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -6,12 +6,16 @@ module DocAuthVendorConcern # @returns[String] String identifying the vendor to use for doc auth. def doc_auth_vendor - if resolved_authn_context_result.facial_match? + if resolved_authn_context_result.facial_match? && default_vendor_is_not_mock? bucket = :lexis_nexis else bucket = ab_test_bucket(:DOC_AUTH_VENDOR) end DocAuthRouter.doc_auth_vendor_for_bucket(bucket) end + + def default_vendor_is_not_mock? + IdentityConfig.store.doc_auth_vendor_default != Idp::Constants::Vendors::MOCK + end end end From 186fbad8b7906ba13d72c190b93ec1b306eea630 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Fri, 22 Nov 2024 13:33:43 -0500 Subject: [PATCH 03/10] also route to mock for doc auth vendor --- app/controllers/concerns/idv/doc_auth_vendor_concern.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index 84d9308d811..cf3e2721569 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -6,8 +6,8 @@ module DocAuthVendorConcern # @returns[String] String identifying the vendor to use for doc auth. def doc_auth_vendor - if resolved_authn_context_result.facial_match? && default_vendor_is_not_mock? - bucket = :lexis_nexis + if resolved_authn_context_result.facial_match? + bucket = default_vendor_is_not_mock? ? :lexis_nexis : :mock else bucket = ab_test_bucket(:DOC_AUTH_VENDOR) end From cbb481dfe8d9c8abe793b3561f42e0a2f95a1fd6 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Fri, 22 Nov 2024 15:38:00 -0500 Subject: [PATCH 04/10] add mock to doc auth buckets --- app/services/doc_auth_router.rb | 2 ++ .../idv/hybrid_mobile/entry_controller_spec.rb | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/app/services/doc_auth_router.rb b/app/services/doc_auth_router.rb index a4c43f1d75f..c985bf876d9 100644 --- a/app/services/doc_auth_router.rb +++ b/app/services/doc_auth_router.rb @@ -201,6 +201,8 @@ def self.doc_auth_vendor_for_bucket(bucket) Idp::Constants::Vendors::SOCURE when :lexis_nexis Idp::Constants::Vendors::LEXIS_NEXIS + when :mock + Idp::Constants::Vendors::MOCK else # e.g., nil IdentityConfig.store.doc_auth_vendor_default end diff --git a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb index 3241f380cc4..38a5e7a486e 100644 --- a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb @@ -91,6 +91,14 @@ end end + context 'doc auth vendor is mock' do + let(:idv_vendor) { Idp::Constants::Vendors::MOCK } + + it 'redirects to the first step' do + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end + end + context 'but we already had a session' do let!(:different_document_capture_session) do DocumentCaptureSession.create!( From f4665679310889605d7b6b78e5175a4605a4952b Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Mon, 25 Nov 2024 11:46:17 -0500 Subject: [PATCH 05/10] changed some vot specs to acr --- .../idv/document_capture_controller_spec.rb | 17 +++++++++ .../hybrid_mobile/entry_controller_spec.rb | 35 +++++++++++++++++-- .../document_capture_controller_spec.rb | 14 ++++++-- .../document_capture_controller_spec.rb | 14 ++++++-- 4 files changed, 73 insertions(+), 7 deletions(-) diff --git a/spec/controllers/idv/document_capture_controller_spec.rb b/spec/controllers/idv/document_capture_controller_spec.rb index 88d1ca61523..e0029be48d1 100644 --- a/spec/controllers/idv/document_capture_controller_spec.rb +++ b/spec/controllers/idv/document_capture_controller_spec.rb @@ -142,6 +142,23 @@ end end + context 'socure is the default vendor but facial match is required' do + let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } + let(:vot) { 'Pb' } + + before do + resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse + allow(controller).to receive(:resolved_authn_context_result). + and_return(resolved_authn_context) + end + + it 'does not redirect to Socure controller' do + get :show + + expect(response).to_not redirect_to idv_socure_document_capture_url + end + end + it 'renders the show template' do expect(subject).to receive(:render).with( :show, diff --git a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb index 38a5e7a486e..e8bb1ee4099 100644 --- a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb @@ -56,10 +56,20 @@ {} end let(:idv_vendor) { Idp::Constants::Vendors::MOCK } - let(:vot) { 'P1' } + let(:acr_values) do + [ + Saml::Idp::Constants::IAL2_AUTHN_CONTEXT_CLASSREF, + Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF, + ].join(' ') + end before do - resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse + resolved_authn_context = AuthnContextResolver.new( + user: user, + service_provider: nil, + vtr: nil, + acr_values: acr_values, + ).result allow(controller).to receive(:session).and_return(session) allow(controller).to receive(:resolved_authn_context_result). and_return(resolved_authn_context) @@ -76,7 +86,26 @@ context 'doc auth vendor is socure but facial match is required' do let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } - let(:vot) { 'Pb' } + let(:acr_values) do + [ + Saml::Idp::Constants::IAL2_BIO_REQUIRED_AUTHN_CONTEXT_CLASSREF, + Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF, + ].join(' ') + end + + it 'redirects to the lexis nexis first step' do + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end + end + + context 'doc auth vendor is mock but facial match is required' do + let(:idv_vendor) { Idp::Constants::Vendors::MOCK } + let(:acr_values) do + [ + Saml::Idp::Constants::IAL2_BIO_REQUIRED_AUTHN_CONTEXT_CLASSREF, + Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF, + ].join(' ') + end it 'redirects to the lexis nexis first step' do expect(response).to redirect_to idv_hybrid_mobile_document_capture_url diff --git a/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb index 4aa5cabd926..98b0f520ac0 100644 --- a/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb @@ -74,9 +74,19 @@ end context 'when facial match is required' do - let(:vot) { 'Pb' } + let(:acr_values) do + [ + Saml::Idp::Constants::IAL2_BIO_REQUIRED_AUTHN_CONTEXT_CLASSREF, + Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF, + ].join(' ') + end before do - resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse + resolved_authn_context = AuthnContextResolver.new( + user: user, + service_provider: nil, + vtr: nil, + acr_values: acr_values, + ).result allow(controller).to receive(:resolved_authn_context_result). and_return(resolved_authn_context) end diff --git a/spec/controllers/idv/socure/document_capture_controller_spec.rb b/spec/controllers/idv/socure/document_capture_controller_spec.rb index d6a7bf0c644..ad41244cf84 100644 --- a/spec/controllers/idv/socure/document_capture_controller_spec.rb +++ b/spec/controllers/idv/socure/document_capture_controller_spec.rb @@ -89,9 +89,19 @@ end context 'when facial match is required' do - let(:vot) { 'Pb' } + let(:acr_values) do + [ + Saml::Idp::Constants::IAL2_BIO_REQUIRED_AUTHN_CONTEXT_CLASSREF, + Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF, + ].join(' ') + end before do - resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse + resolved_authn_context = AuthnContextResolver.new( + user: user, + service_provider: nil, + vtr: nil, + acr_values: acr_values, + ).result allow(controller).to receive(:resolved_authn_context_result). and_return(resolved_authn_context) end From eeb1cd2bd2ea6a435a818e673a528af42bd7cf5e Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Wed, 27 Nov 2024 14:24:04 -0500 Subject: [PATCH 06/10] change doc_auth_vendor to nil if LN is disabled --- .../concerns/idv/doc_auth_vendor_concern.rb | 7 ++++ .../hybrid_mobile/entry_controller_spec.rb | 42 ++++++++++++------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index cf3e2721569..c11e5328ddd 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -7,6 +7,7 @@ module DocAuthVendorConcern # @returns[String] String identifying the vendor to use for doc auth. def doc_auth_vendor if resolved_authn_context_result.facial_match? + return nil if lexis_nexis_not_enabled? bucket = default_vendor_is_not_mock? ? :lexis_nexis : :mock else bucket = ab_test_bucket(:DOC_AUTH_VENDOR) @@ -14,6 +15,12 @@ def doc_auth_vendor DocAuthRouter.doc_auth_vendor_for_bucket(bucket) end + def lexis_nexis_not_enabled? + (IdentityConfig.store.doc_auth_vendor_default == Idp::Constants::Vendors::SOCURE || + IdentityConfig.store.doc_auth_vendor_default.nil?) && + IdentityConfig.store.doc_auth_vendor_lexis_nexis_percent == 0 + end + def default_vendor_is_not_mock? IdentityConfig.store.doc_auth_vendor_default != Idp::Constants::Vendors::MOCK end diff --git a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb index e8bb1ee4099..a21d8897314 100644 --- a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb @@ -56,6 +56,7 @@ {} end let(:idv_vendor) { Idp::Constants::Vendors::MOCK } + let(:lexis_nexis_percent) { 100 } let(:acr_values) do [ Saml::Idp::Constants::IAL2_AUTHN_CONTEXT_CLASSREF, @@ -73,6 +74,8 @@ allow(controller).to receive(:session).and_return(session) allow(controller).to receive(:resolved_authn_context_result). and_return(resolved_authn_context) + allow(IdentityConfig.store).to receive(:doc_auth_vendor_lexis_nexis_percent). + and_return(lexis_nexis_percent) get :show, params: { 'document-capture-session': session_uuid } end @@ -84,8 +87,7 @@ end end - context 'doc auth vendor is socure but facial match is required' do - let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } + context 'facial match is required' do let(:acr_values) do [ Saml::Idp::Constants::IAL2_BIO_REQUIRED_AUTHN_CONTEXT_CLASSREF, @@ -93,22 +95,34 @@ ].join(' ') end - it 'redirects to the lexis nexis first step' do - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + context 'doc auth vendor is socure with facial match required' do + let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } + + it 'redirects to the lexis nexis first step' do + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end end - end - context 'doc auth vendor is mock but facial match is required' do - let(:idv_vendor) { Idp::Constants::Vendors::MOCK } - let(:acr_values) do - [ - Saml::Idp::Constants::IAL2_BIO_REQUIRED_AUTHN_CONTEXT_CLASSREF, - Saml::Idp::Constants::DEFAULT_AAL_AUTHN_CONTEXT_CLASSREF, - ].join(' ') + context 'doc auth vendor is mock with facial match required' do + let(:idv_vendor) { Idp::Constants::Vendors::MOCK } + + it 'redirects to the lexis nexis first step' do + expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + end end - it 'redirects to the lexis nexis first step' do - expect(response).to redirect_to idv_hybrid_mobile_document_capture_url + context 'lexis nexis is disabled' do + let(:idv_vendor) { nil } + let(:lexis_nexis_percent) { 0 } + + before do + allow(IdentityConfig.store).to receive(:doc_auth_vendor_lexis_nexis_percent). + and_return(lexis_nexis_percent) + end + + it 'causes an 404 error' do + expect(response.status).to eq(404) + end end end From d38a8a922ad732c15c2639db607322bd751d836f Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Tue, 3 Dec 2024 13:15:57 -0500 Subject: [PATCH 07/10] Update app/controllers/concerns/idv/doc_auth_vendor_concern.rb Co-authored-by: Amir Reavis-Bey --- .../concerns/idv/doc_auth_vendor_concern.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index c11e5328ddd..a6ce1f37ed5 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -15,10 +15,18 @@ def doc_auth_vendor DocAuthRouter.doc_auth_vendor_for_bucket(bucket) end - def lexis_nexis_not_enabled? - (IdentityConfig.store.doc_auth_vendor_default == Idp::Constants::Vendors::SOCURE || - IdentityConfig.store.doc_auth_vendor_default.nil?) && - IdentityConfig.store.doc_auth_vendor_lexis_nexis_percent == 0 + def doc_auth_vendor_enabled?(vendor) + return true if IdentityConfig.store.doc_auth_vendor_default == vendor + return false unless IdentityConfig.store.doc_auth_vendor_switching_enabled + + case vendor + when Idp::Constants::Vendors::SOCURE + IdentityConfig.store.doc_auth_vendor_socure_percent > 0 + when Idp::Constants::Vendors::LEXIS_NEXIS + IdentityConfig.store.doc_auth_vendor_lexis_nexis_percent > 0 + else + false + end end def default_vendor_is_not_mock? From 2b3b086bd4f11ad0f259dcabc838fc0411f88840 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Tue, 3 Dec 2024 13:16:28 -0500 Subject: [PATCH 08/10] change doc auth vendor bucketing Co-authored-by: Amir Reavis-Bey --- app/controllers/concerns/idv/doc_auth_vendor_concern.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index a6ce1f37ed5..7c96a83d218 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -7,8 +7,13 @@ module DocAuthVendorConcern # @returns[String] String identifying the vendor to use for doc auth. def doc_auth_vendor if resolved_authn_context_result.facial_match? - return nil if lexis_nexis_not_enabled? - bucket = default_vendor_is_not_mock? ? :lexis_nexis : :mock + if doc_auth_vendor_enabled?(Idp::Constants::Vendors::LEXIS_NEXIS) + bucket = :lexis_nexis + elsif doc_auth_vendor_enabled?(Idp::Constants::Vendors::MOCK) + bucket = :mock + else + return nil + end else bucket = ab_test_bucket(:DOC_AUTH_VENDOR) end From d0dd148a7f83042a8574050330adf929df71ab86 Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Tue, 3 Dec 2024 15:05:27 -0500 Subject: [PATCH 09/10] add vendor_switching_enabled to tests --- spec/controllers/idv/document_capture_controller_spec.rb | 4 ++++ spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb | 4 ++++ .../hybrid_mobile/socure/document_capture_controller_spec.rb | 3 +++ .../idv/socure/document_capture_controller_spec.rb | 3 +++ 4 files changed, 14 insertions(+) diff --git a/spec/controllers/idv/document_capture_controller_spec.rb b/spec/controllers/idv/document_capture_controller_spec.rb index e0029be48d1..50b01750c8d 100644 --- a/spec/controllers/idv/document_capture_controller_spec.rb +++ b/spec/controllers/idv/document_capture_controller_spec.rb @@ -117,6 +117,7 @@ end let(:idv_vendor) { Idp::Constants::Vendors::LEXIS_NEXIS } + let(:vendor_switching_enabled) { true } before do allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return( @@ -125,6 +126,9 @@ allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return( idv_vendor, ) + allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled).and_return( + vendor_switching_enabled, + ) end it 'has non-nil presenter' do diff --git a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb index a21d8897314..15d1bb50191 100644 --- a/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/entry_controller_spec.rb @@ -56,6 +56,7 @@ {} end let(:idv_vendor) { Idp::Constants::Vendors::MOCK } + let(:vendor_switching_enabled) { true } let(:lexis_nexis_percent) { 100 } let(:acr_values) do [ @@ -74,6 +75,8 @@ allow(controller).to receive(:session).and_return(session) allow(controller).to receive(:resolved_authn_context_result). and_return(resolved_authn_context) + allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled). + and_return(vendor_switching_enabled) allow(IdentityConfig.store).to receive(:doc_auth_vendor_lexis_nexis_percent). and_return(lexis_nexis_percent) get :show, params: { 'document-capture-session': session_uuid } @@ -113,6 +116,7 @@ context 'lexis nexis is disabled' do let(:idv_vendor) { nil } + let(:vendor_switching_enabled) { false } let(:lexis_nexis_percent) { 0 } before do diff --git a/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb b/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb index 98b0f520ac0..c3a9088a164 100644 --- a/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb +++ b/spec/controllers/idv/hybrid_mobile/socure/document_capture_controller_spec.rb @@ -4,6 +4,7 @@ include FlowPolicyHelper let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } + let(:vendor_switching_enabled) { true } let(:fake_socure_endpoint) { 'https://fake-socure.test' } let(:user) { create(:user) } let(:stored_result) { nil } @@ -24,6 +25,8 @@ and_return(fake_socure_endpoint) allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return(idv_vendor) allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return(idv_vendor) + allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled). + and_return(vendor_switching_enabled) allow(subject).to receive(:stored_result).and_return(stored_result) diff --git a/spec/controllers/idv/socure/document_capture_controller_spec.rb b/spec/controllers/idv/socure/document_capture_controller_spec.rb index ad41244cf84..9e03f8e8cdd 100644 --- a/spec/controllers/idv/socure/document_capture_controller_spec.rb +++ b/spec/controllers/idv/socure/document_capture_controller_spec.rb @@ -4,6 +4,7 @@ include FlowPolicyHelper let(:idv_vendor) { Idp::Constants::Vendors::SOCURE } + let(:vendor_switching_enabled) { true } let(:fake_socure_endpoint) { 'https://fake-socure.test' } let(:user) { create(:user) } let(:doc_auth_success) { true } @@ -33,6 +34,8 @@ and_return(fake_socure_endpoint) allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return(idv_vendor) allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return(idv_vendor) + allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled). + and_return(vendor_switching_enabled) allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) allow(subject).to receive(:stored_result).and_return(stored_result) From 3a3803f434de1b3057a7823c3e5390a9993612fb Mon Sep 17 00:00:00 2001 From: Alex Bradley Date: Tue, 3 Dec 2024 15:58:59 -0500 Subject: [PATCH 10/10] remove unused function in doc_auth_vendor_concern --- app/controllers/concerns/idv/doc_auth_vendor_concern.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb index 7c96a83d218..079a828753b 100644 --- a/app/controllers/concerns/idv/doc_auth_vendor_concern.rb +++ b/app/controllers/concerns/idv/doc_auth_vendor_concern.rb @@ -33,9 +33,5 @@ def doc_auth_vendor_enabled?(vendor) false end end - - def default_vendor_is_not_mock? - IdentityConfig.store.doc_auth_vendor_default != Idp::Constants::Vendors::MOCK - end end end