Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/concerns/idv/document_capture_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ def choose_id_type_path
idv_choose_id_type_path
end

def doc_auth_upload_enabled?
# false for now until we consolidate this method with desktop_selfie_test_mode_enabled
false
end

private

def track_document_issuing_state(user, state)
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ def self.step_info

private

def doc_auth_upload_enabled?
!(resolved_authn_context_result.facial_match? ||
ab_test_bucket(:DOC_AUTH_MANUAL_UPLOAD_DISABLED) == :manual_upload_disabled)
end

def extra_view_variables
{
id_type:,
Expand Down
13 changes: 3 additions & 10 deletions app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HybridHandoffController < ApplicationController

def show
abandon_any_ipp_progress
@upload_disabled = upload_disabled?
@upload_enabled = upload_enabled?

@direct_ipp_with_selfie_enabled = IdentityConfig.store.in_person_doc_auth_button_enabled &&
Idv::InPersonConfig.enabled_for_issuer?(
Expand Down Expand Up @@ -147,15 +147,8 @@ def sp_or_app_name
current_sp&.friendly_name.presence || APP_NAME
end

def upload_disabled?
return true if document_capture_session.doc_auth_vendor == Idp::Constants::Vendors::SOCURE

(idv_session.selfie_check_required || doc_auth_upload_disabled?) &&
!idv_session.desktop_selfie_test_mode_enabled?
end

def doc_auth_upload_disabled?
ab_test_bucket(:DOC_AUTH_MANUAL_UPLOAD_DISABLED) == :manual_upload_disabled
def upload_enabled?
idv_session.desktop_selfie_test_mode_enabled?
end

def build_telephony_form_response(telephony_result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ def extra_view_variables

private

def doc_auth_upload_enabled?
!(resolved_authn_context_result.facial_match? ||
ab_test_bucket(:DOC_AUTH_MANUAL_UPLOAD_DISABLED, user: document_capture_user) ==
:manual_upload_disabled)
end

def analytics_arguments
{
flow_path: 'hybrid',
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/hybrid_handoff/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</div>
</div>
<% end %>
<% unless @upload_disabled %>
<% if @upload_enabled %>
<hr class="margin-bottom-4" />
<div class="grid-row grid-gap grid-gap-2">
<div class="grid-col-12 tablet:grid-col-auto">
Expand Down
2 changes: 0 additions & 2 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ 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
Expand Down
12 changes: 0 additions & 12 deletions config/initializers/ab_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,6 @@ def self.all
user&.uuid
end.freeze

DOC_AUTH_MANUAL_UPLOAD_DISABLED = AbTest.new(
experiment_name: 'Doc Auth Manual Upload Disabled',
should_log: /^idv/i,
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

PROOFING_VENDOR = AbTest.new(
experiment_name: 'Proofing Vendor',
should_log: /^idv/i,
Expand Down
2 changes: 0 additions & 2 deletions lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ 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)
Expand Down
24 changes: 0 additions & 24 deletions spec/config/initializers/ab_tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -536,30 +536,6 @@
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

describe 'PROOFING_VENDOR' do
let(:ab_test) { :PROOFING_VENDOR }

Expand Down
24 changes: 1 addition & 23 deletions spec/controllers/idv/document_capture_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
let(:facial_match_required) { false }
let(:flow_path) { 'standard' }
let(:doc_auth_selfie_desktop_test_mode) { false }
let(:upload_disabled) { :default }

# document capture setup
let(:doc_auth_success) { true }
Expand Down Expand Up @@ -55,9 +54,6 @@
resolved_authn_context = Vot::Parser.new(vector_of_trust: vot).parse
allow(controller).to receive(:resolved_authn_context_result)
.and_return(resolved_authn_context)
allow(subject).to receive(:ab_test_bucket).and_call_original
allow(subject).to receive(:ab_test_bucket).with(:DOC_AUTH_MANUAL_UPLOAD_DISABLED)
.and_return(upload_disabled)
allow(subject).to receive(:ab_test_analytics_buckets).and_return(ab_test_args)

allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return(idv_vendor)
Expand Down Expand Up @@ -156,7 +152,7 @@
locals: hash_including(
document_capture_session_uuid: document_capture_session_uuid,
doc_auth_selfie_capture: false,
doc_auth_upload_enabled: true,
doc_auth_upload_enabled: false,
),
).and_call_original

Expand Down Expand Up @@ -255,24 +251,6 @@
end
end

context 'when manual upload is disabled' do
let(:upload_disabled) { :manual_upload_disabled }

it 'does not allow manual upload' do
expect(subject).to receive(:render).with(
:show,
locals: hash_including(
document_capture_session_uuid: document_capture_session_uuid,
doc_auth_selfie_capture: false,
doc_auth_upload_enabled: false,
),
).and_call_original

get :show
expect(response).to render_template :show
end
end

context 'redo_document_capture' do
it 'adds redo_document_capture to analytics' do
subject.idv_session.redo_document_capture = true
Expand Down
37 changes: 17 additions & 20 deletions spec/controllers/idv/hybrid_handoff_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
let(:in_person_proofing) { false }
let(:ipp_opt_in_enabled) { false }
let(:sp_selfie_enabled) { false }
let(:desktop_test_mode_enabled) { false }
let(:document_capture_session) { create(:document_capture_session) }
let(:document_capture_session_uuid) { document_capture_session.uuid }

Expand All @@ -29,6 +30,8 @@
allow(subject).to receive(:resolved_authn_context_result)
.and_return(resolved_authn_context_result)

allow(IdentityConfig.store).to receive(:doc_auth_selfie_desktop_test_mode)
.and_return(desktop_test_mode_enabled)
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { in_person_proofing }
allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) {
ipp_opt_in_enabled
Expand Down Expand Up @@ -75,10 +78,10 @@
expect(response).to render_template :show
end

it 'defaults to upload disabled being false' do
it 'defaults to upload enabled being false' do
get :show

expect(assigns(:upload_disabled)).to be false
expect(assigns(:upload_enabled)).to be false
end

it 'sends analytics_visited event' do
Expand Down Expand Up @@ -107,29 +110,23 @@
end
end

context '@upload_disabled is true' do
before do
allow(IdentityConfig.store).to receive(:doc_auth_selfie_desktop_test_mode).and_return(false)
allow(subject).to receive(:ab_test_bucket).and_call_original
allow(subject).to receive(:ab_test_bucket).with(:DOC_AUTH_MANUAL_UPLOAD_DISABLED)
.and_return(:manual_upload_disabled)
end
context '@upload_enabled is false' do
let(:desktop_test_mode_enabled) { false }

context 'selfie check required is true' do
let(:sp_selfie_enabled) { true }
it 'returns true' do
get :show
it 'returns false' do
get :show

expect(assigns(:upload_disabled)).to be true
end
expect(assigns(:upload_enabled)).to be false
end
end

context 'doc_auth_upload_disabled? is true' do
it 'returns true' do
get :show
context '@upload_enabled is true' do
let(:desktop_test_mode_enabled) { true }

expect(assigns(:upload_disabled)).to be true
end
it 'returns true' do
get :show

expect(assigns(:upload_enabled)).to be true
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
end

let(:upload_disabled) { :default }
let(:document_capture_session_uuid) { document_capture_session&.uuid }

let(:document_capture_session_requested_at) { Time.zone.now }
Expand All @@ -26,10 +25,6 @@
session[:doc_capture_user_id] = user&.id
session[:document_capture_session_uuid] = document_capture_session_uuid

allow(subject).to receive(:ab_test_bucket).and_call_original
allow(subject).to receive(:ab_test_bucket).with(:DOC_AUTH_MANUAL_UPLOAD_DISABLED, user: user)
.and_return(upload_disabled)

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)
end
Expand Down Expand Up @@ -94,7 +89,7 @@
:show,
locals: hash_including(
document_capture_session_uuid: document_capture_session_uuid,
doc_auth_upload_enabled: true,
doc_auth_upload_enabled: false,
),
).and_call_original

Expand Down Expand Up @@ -124,24 +119,6 @@
end
end

context 'when manual upload is disabled' do
let(:upload_disabled) { :manual_upload_disabled }

it 'does not allow manual upload' do
expect(subject).to receive(:render).with(
:show,
locals: hash_including(
document_capture_session_uuid: document_capture_session_uuid,
doc_auth_upload_enabled: false,
),
).and_call_original

get :show

expect(response).to render_template :show
end
end

it 'sends analytics_visited event' do
get :show

Expand Down
8 changes: 0 additions & 8 deletions spec/features/idv/doc_auth/hybrid_handoff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ def verify_no_upload_photos_section_and_link(page)
it 'shows non selfie version of top content and upload section,
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand All @@ -396,7 +395,6 @@ def verify_no_upload_photos_section_and_link(page)
it 'shows non selfie version of top content and upload section,
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand All @@ -422,7 +420,6 @@ def verify_no_upload_photos_section_and_link(page)
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_handoff_page_no_ipp_option_shown(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand All @@ -435,7 +432,6 @@ def verify_no_upload_photos_section_and_link(page)
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_handoff_page_no_ipp_option_shown(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand Down Expand Up @@ -464,7 +460,6 @@ def verify_no_upload_photos_section_and_link(page)
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_handoff_page_no_ipp_option_shown(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand All @@ -485,7 +480,6 @@ def verify_no_upload_photos_section_and_link(page)
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_handoff_page_no_ipp_option_shown(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand All @@ -510,7 +504,6 @@ def verify_no_upload_photos_section_and_link(page)
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_handoff_page_no_ipp_option_shown(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand All @@ -531,7 +524,6 @@ def verify_no_upload_photos_section_and_link(page)
no ipp option section' do
verify_handoff_page_non_selfie_version_content(page)
verify_handoff_page_no_ipp_option_shown(page)
verify_upload_photos_section_and_link(page)
end
end
end
Expand Down
7 changes: 0 additions & 7 deletions spec/views/idv/hybrid_handoff/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@
)
end

it 'has a form for starting desktop doc auth with an aria label tag' do
expect(rendered).to have_selector(
:xpath,
"//form[@aria-label=\"#{t('forms.buttons.upload_photos')}\"]",
)
end

it 'displays the expected headings from the "a" case' do
expect(rendered).to have_selector('h1', text: t('doc_auth.headings.how_to_verify'))
expect(rendered).to have_selector('h2', text: t('doc_auth.headings.upload_from_phone'))
Expand Down
Loading