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
11 changes: 0 additions & 11 deletions app/controllers/concerns/idv/document_capture_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module DocumentCaptureConcern

def handle_stored_result(user: current_user, store_in_session: true)
if stored_result&.success? && selfie_requirement_met?
save_proofing_components(user)
extract_pii_from_doc(user, store_in_session: store_in_session)
flash[:success] = t('doc_auth.headings.capture_complete')
successful_response
Expand All @@ -18,16 +17,6 @@ def handle_stored_result(user: current_user, store_in_session: true)
end
end

def save_proofing_components(user)
return unless user

component_attributes = {
document_check: doc_auth_vendor,
document_type: 'state_id',
}
ProofingComponent.create_or_find_by(user: user).update(component_attributes)
end

def successful_response
FormResponse.new(success: true)
end
Expand Down
17 changes: 1 addition & 16 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,26 +267,11 @@ def summarize_result_and_rate_limit(summary_result)
proofing_results_exception = summary_result.extra.dig(:proofing_results, :exception)
resolution_rate_limiter.increment! if proofing_results_exception.blank?

if summary_result.success?
add_proofing_components(summary_result)
else
if !summary_result.success?
idv_failure(summary_result)
end
end

def add_proofing_components(summary_result)
ProofingComponent.create_or_find_by(user: current_user).update(
resolution_check: Idp::Constants::Vendors::LEXIS_NEXIS,
source_check: summary_result.extra.dig(
:proofing_results,
:context,
:stages,
:state_id,
:vendor_name,
),
)
end

def load_async_state
dcs_uuid = idv_session.verify_info_step_document_capture_session_uuid
dcs = DocumentCaptureSession.find_by(uuid: dcs_uuid)
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/idv/by_mail/request_letter_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ def update_tracking

log_letter_requested_analytics(resend: false)
create_user_event(:gpo_mail_sent, current_user)

ProofingComponent.find_or_create_by(user: current_user).update(address_check: 'gpo_letter')
end

def confirm_mail_not_rate_limited
Expand Down
12 changes: 2 additions & 10 deletions app/controllers/idv/in_person/usps_locations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,9 @@ def update
sponsor_id: enrollment_sponsor_id,
)

add_proofing_component

render json: { success: true }, status: :ok
end

private

def idv_session
if user_session && current_user
@idv_session ||= Idv::Session.new(
Expand All @@ -80,6 +76,8 @@ def idv_session
end
end

private

def document_capture_session
if idv_session&.document_capture_session_uuid # standard flow
DocumentCaptureSession.find_by(uuid: idv_session.document_capture_session_uuid)
Expand All @@ -92,12 +90,6 @@ def proofer
@proofer ||= EnrollmentHelper.usps_proofer
end

def add_proofing_component
ProofingComponent.
create_or_find_by(user: current_or_hybrid_user).
update(document_check: Idp::Constants::Vendors::USPS)
end

def localized_locations(locations)
return nil if locations.nil?
locations.map do |location|
Expand Down
1 change: 0 additions & 1 deletion app/controllers/idv/link_sent_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def analytics_arguments
end

def handle_document_verification_success
save_proofing_components(current_user)
extract_pii_from_doc(current_user, store_in_session: true)
idv_session.flow_path = 'hybrid'
end
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/idv/personal_key_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def show
if pii_is_missing?
redirect_to_retrieve_pii
else
add_proofing_component
finish_idv_session
end
end
Expand Down Expand Up @@ -78,10 +77,6 @@ def next_step
end
end

def add_proofing_component
ProofingComponent.find_or_create_by(user: current_user).update(verified_at: Time.zone.now)
end

def finish_idv_session
@code = personal_key
@personal_key_generated_at = current_user.personal_key_generated_at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def mark_profile_inactive

user.active_profile&.deactivate(:password_reset)
Funnel::DocAuth::ResetSteps.call(@user.id)
user.proofing_component&.destroy
end

def extra_analytics_attributes
Expand Down
1 change: 0 additions & 1 deletion app/forms/reset_password_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def mark_profile_inactive

active_profile.deactivate(:password_reset)
Funnel::DocAuth::ResetSteps.call(user.id)
user.proofing_component&.destroy
end

# It is possible for an account that is resetting their password to be "invalid".
Expand Down
8 changes: 0 additions & 8 deletions app/jobs/resolution_proofing_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def make_vendor_proofing_requests(
)

log_threatmetrix_info(result.device_profiling_result, user)
add_threatmetrix_proofing_component(user.id, result.device_profiling_result) if user.present?

CallbackLogData.new(
device_profiling_success: result.device_profiling_result.success?,
Expand Down Expand Up @@ -139,11 +138,4 @@ def logger_info_hash(hash)
def progressive_proofer
@progressive_proofer ||= Proofing::Resolution::ProgressiveProofer.new
end

def add_threatmetrix_proofing_component(user_id, threatmetrix_result)
ProofingComponent.
create_or_find_by(user_id: user_id).
update(threatmetrix: FeatureManagement.proofing_device_profiling_collecting_enabled?,
threatmetrix_review_status: threatmetrix_result.review_status)
end
end
5 changes: 0 additions & 5 deletions app/models/proofing_component.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class User < ApplicationRecord
has_many :backup_code_configurations, dependent: :destroy
has_many :document_capture_sessions, dependent: :destroy
has_one :registration_log, dependent: :destroy
has_one :proofing_component, dependent: :destroy
has_many :service_providers,
through: :identities,
source: :service_provider_record
Expand Down
3 changes: 0 additions & 3 deletions app/services/idv/phone_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ def failed_due_to_timeout_or_exception?
def update_idv_session
idv_session.applicant = applicant
idv_session.mark_phone_step_started!

ProofingComponent.find_or_create_by(user: idv_session.current_user).
update(address_check: 'lexis_nexis_address')
end

def start_phone_confirmation_session
Expand Down
15 changes: 0 additions & 15 deletions app/services/idv/steps/doc_auth_base_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@ def initialize(flow)

private

def save_proofing_components
return unless current_user

doc_auth_vendor = DocAuthRouter.doc_auth_vendor(
discriminator: flow_session[document_capture_session_uuid_key],
analytics: @flow.analytics,
)

component_attributes = {
document_check: doc_auth_vendor,
document_type: 'state_id',
}
ProofingComponent.create_or_find_by(user: current_user).update(component_attributes)
end

def user_id_from_token
flow_session[:doc_capture_user_id]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def force_gpo

context 'via current idv session' do
before do
ProofingComponent.create(user: user, document_check: Idp::Constants::Vendors::USPS)
create(:in_person_enrollment, :establishing, user: user)
end

Expand Down
1 change: 0 additions & 1 deletion spec/controllers/idv/enter_password_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ def show
stub_request_enroll
subject.idv_session.applicant =
Idp::Constants::MOCK_IDV_APPLICANT_SAME_ADDRESS_AS_ID_WITH_PHONE
ProofingComponent.create(user: user, document_check: Idp::Constants::Vendors::USPS)
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
end

Expand Down
26 changes: 22 additions & 4 deletions spec/controllers/idv/in_person/usps_locations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,20 @@
end

it 'updates proofing component vendor' do
expect(user.proofing_component&.document_check).to be_nil
proofing_components = Idv::ProofingComponents.new(
idv_session: controller.idv_session,
session: controller.session,
user_session: controller.user_session,
user:,
)

expect(proofing_components.document_check).to be_nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I'm missing some context here. Is an equivalent to Idv::ProofingComponents.new happening in the controller?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idv::ProofingComponents reads info from sessions (Rails, user, and Idv::) to derive the current components. Previously the controller was updating the proofing_component attached to the user. Here we're just taking the various sessions the controller is interacting with and essentially checking that it made the changes we are expecting. You could make an argument that this test might be duplicative now (we should be testing that the controller is updating Idv::Session appropriately elsewhere)


response

expect(user.proofing_component.document_check).to eq Idp::Constants::Vendors::USPS
user.reload

expect(proofing_components.document_check).to eq Idp::Constants::Vendors::USPS
end
end

Expand All @@ -404,11 +413,20 @@
end

it 'updates proofing component vendor' do
expect(user.proofing_component&.document_check).to be_nil
proofing_components = Idv::ProofingComponents.new(
idv_session: controller.idv_session,
session: controller.session,
user_session: controller.user_session,
user:,
)

expect(proofing_components.document_check).to be_nil

response

expect(user.proofing_component.document_check).to eq Idp::Constants::Vendors::USPS
user.reload

expect(proofing_components.document_check).to eq Idp::Constants::Vendors::USPS
end
end

Expand Down
11 changes: 8 additions & 3 deletions spec/controllers/idv/link_sent_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@

expect(response).to redirect_to(idv_ssn_url)

pc = ProofingComponent.find_by(user_id: user.id)
expect(pc.document_check).to eq('mock')
expect(pc.document_type).to eq('state_id')
proofing_components = Idv::ProofingComponents.new(
idv_session: subject.idv_session,
session: subject.session,
user_session: subject.user_session,
user:,
)
expect(proofing_components.document_check).to eq('mock')
expect(proofing_components.document_type).to eq('state_id')
end

context 'redo document capture' do
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/idv/personal_key_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ def assert_personal_key_generated_for_profiles(*profile_pii_pairs)
end

before do
ProofingComponent.create(user: user, document_check: Idp::Constants::Vendors::USPS)
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
end

Expand Down
17 changes: 11 additions & 6 deletions spec/features/idv/end_to_end_idv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

validate_verify_info_page
complete_verify_step
validate_verify_info_submit(user)
validate_verify_info_submit

validate_phone_page
try_to_skip_ahead_from_phone
Expand Down Expand Up @@ -265,12 +265,8 @@ def validate_verify_info_page
expect(page).to have_text(DocAuthHelper::GOOD_SSN)
end

def validate_verify_info_submit(user)
def validate_verify_info_submit
expect(page).to have_content(t('doc_auth.forms.doc_success'))
expect(user.proofing_component.resolution_check).to eq(Idp::Constants::Vendors::LEXIS_NEXIS)
expect(user.proofing_component.source_check).to satisfy do |v|
Idp::Constants::Vendors::SOURCE_CHECK.include?(v)
end
end

def validate_phone_page
Expand Down Expand Up @@ -333,6 +329,15 @@ def validate_enter_password_submit(user)
profile = user.profiles.first

expect(profile.active?).to eq true
expect(profile.proofing_components).to eql(
'source_check' => 'StateIdMock',
'threatmetrix' => true,
'address_check' => 'lexis_nexis_address',
'document_type' => 'state_id',
'document_check' => 'mock',
'resolution_check' => 'lexis_nexis',
'threatmetrix_review_status' => 'pass',
)
expect(GpoConfirmation.count).to eq(0)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,4 @@
expect(user.reload.valid_password?(new_password)).to eq(false)
end
end

context 'user has an active profile' do
let(:user) { create(:user, :proofed) }

it 'destroys the proofing component' do
ProofingComponent.create(user_id: user.id, document_check: 'mock')

subject.submit(password: new_password)

expect(user.reload.proofing_component).to be_nil
end
end

context 'user does not have an active profile' do
it 'does not destroy the proofing component' do
ProofingComponent.create(user_id: user.id, document_check: 'mock')

subject.submit(password: new_password)

expect(user.reload.proofing_component).to_not be_nil
end
end
end
8 changes: 0 additions & 8 deletions spec/forms/gpo_verify_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@
)
end

let(:proofing_components) do
ProofingComponent.create(user: user, document_check: Idp::Constants::Vendors::USPS)
end

before do
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
end
Expand Down Expand Up @@ -194,10 +190,6 @@
)
end

let(:proofing_components) do
ProofingComponent.create(user: user, document_check: Idp::Constants::Vendors::USPS)
end

before do
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
end
Expand Down
Loading