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
1 change: 0 additions & 1 deletion app/controllers/idv/gpo_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ def enqueue_job
document_capture_session,
should_proof_state_id: false,
trace_id: amzn_trace_id,
document_expired: idv_session.document_expired,
)
end

Expand Down
9 changes: 4 additions & 5 deletions app/jobs/resolution_proofing_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ResolutionProofingJob < ApplicationJob
)

def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:,
dob_year_only:, document_expired:)
dob_year_only:)
timer = JobHelpers::Timer.new

raise_stale_job! if stale_job?(enqueued_at)
Expand All @@ -25,7 +25,7 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:,

applicant_pii = decrypted_args[:applicant_pii]

callback_log_data = if !document_expired && dob_year_only && should_proof_state_id
callback_log_data = if dob_year_only && should_proof_state_id
proof_aamva_then_lexisnexis_dob_only(
timer: timer,
applicant_pii: applicant_pii,
Expand All @@ -36,7 +36,6 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:,
timer: timer,
applicant_pii: applicant_pii,
should_proof_state_id: should_proof_state_id,
document_expired: document_expired,
)
end

Expand All @@ -57,7 +56,7 @@ def perform(result_id:, encrypted_arguments:, trace_id:, should_proof_state_id:,
private

# @return [CallbackLogData]
def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:, document_expired:)
def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:)
proofer_result = timer.time('resolution') do
resolution_proofer.proof(applicant_pii)
end
Expand Down Expand Up @@ -89,7 +88,7 @@ def proof_lexisnexis_then_aamva(timer:, applicant_pii:, should_proof_state_id:,
}

state_id_success = nil
if should_proof_state_id && result[:success] && !document_expired
if should_proof_state_id && result[:success]
timer.time('state_id') do
proof_state_id(applicant_pii: applicant_pii, result: result)
end
Expand Down
3 changes: 0 additions & 3 deletions app/services/doc_auth_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ def respond_to_missing?(method_name, include_private = false)
def translate_form_response!(response)
return response unless response.is_a?(DocAuth::Response)

# This needs to happen before we translate, since it relies on the original error keys
response = ExpiredLicenseAllower.new(response).processed_response

translate_doc_auth_errors!(response)
translate_generic_errors!(response)

Expand Down
59 changes: 0 additions & 59 deletions app/services/expired_license_allower.rb

This file was deleted.

6 changes: 1 addition & 5 deletions app/services/idv/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ def initialize(applicant)
end

def proof_resolution(
document_capture_session,
should_proof_state_id:,
trace_id:,
document_expired:
document_capture_session, should_proof_state_id:, trace_id:
)
document_capture_session.create_proofing_session

Expand All @@ -22,7 +19,6 @@ def proof_resolution(
dob_year_only: IdentityConfig.store.proofing_send_partial_dob,
trace_id: trace_id,
result_id: document_capture_session.result_id,
document_expired: document_expired,
}

if IdentityConfig.store.ruby_workers_idv_enabled
Expand Down
8 changes: 2 additions & 6 deletions app/services/idv/profile_maker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ module Idv
class ProfileMaker
attr_reader :pii_attributes

def initialize(applicant:, user:, user_password:, document_expired:)
def initialize(applicant:, user:, user_password:)
self.pii_attributes = Pii::Attributes.new_from_hash(applicant)
self.user = user
self.user_password = user_password
self.document_expired = document_expired
end

def save_profile
Expand All @@ -16,9 +15,6 @@ def save_profile
)
profile.encrypt_pii(pii_attributes, user_password)
profile.proofing_components = current_proofing_components
if document_expired
profile.reproof_at = IdentityConfig.store.proofing_expired_license_reproof_at
end
profile.save!
profile
end
Expand All @@ -29,7 +25,7 @@ def current_proofing_components
user.proofing_component&.as_json || {}
end

attr_accessor :user, :user_password, :phone_confirmed, :document_expired
attr_accessor :user, :user_password, :phone_confirmed
attr_writer :pii_attributes
end
end
5 changes: 0 additions & 5 deletions app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ def user_phone_confirmation_session=(new_user_phone_confirmation_session)
session[:user_phone_confirmation_session] = new_user_phone_confirmation_session.to_h
end

def document_expired
user_session.dig('idv/doc_auth', :document_expired) # via flow_session[:document_expired]
end

private

attr_accessor :user_session
Expand Down Expand Up @@ -144,7 +140,6 @@ def build_profile_maker(user_password)
applicant: applicant,
user: current_user,
user_password: user_password,
document_expired: document_expired,
)
end
end
Expand Down
7 changes: 0 additions & 7 deletions app/services/idv/steps/doc_auth_base_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ def extract_pii_from_doc(response)
phone: effective_user.phone_configurations.take&.phone,
uuid_prefix: ServiceProvider.find_by(issuer: sp_session[:issuer])&.app_id,
)
if response.respond_to?(:extra)
# Sync flow: DocAuth::Response
flow_session[:document_expired] = response.extra&.dig(:document_expired)
elsif response.respond_to?(:result)
# Async flow: DocumentCaptureSessionAsyncResult
flow_session[:document_expired] = response.result&.dig(:document_expired)
end
track_document_state
end

Expand Down
5 changes: 0 additions & 5 deletions app/services/idv/steps/verify_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,13 @@ def enqueue_job
document_capture_session,
should_proof_state_id: should_use_aamva?(pii_from_doc),
trace_id: amzn_trace_id,
document_expired: document_expired,
)
end

def pii_from_doc
flow_session[:pii_from_doc]
end

def document_expired
flow_session[:document_expired]
end

def idv_agent
@idv_agent ||= Idv::Agent.new(pii_from_doc)
end
Expand Down
3 changes: 0 additions & 3 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ piv_cac_verify_token_url: https://localhost:8443/
platform_authentication_enabled: true
poll_rate_for_verify_in_seconds: 3
proofer_mock_fallback: true
proofing_allow_expired_license: false
proofing_expired_license_after: '2020-03-01'
proofing_expired_license_reproof_at: '2023-03-01'
proofing_send_partial_dob: false
proof_address_max_attempts: 5
proof_address_max_attempt_window_in_minutes: 360
Expand Down
3 changes: 0 additions & 3 deletions lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@ def self.build_store(config_map)
config.add(:platform_authentication_enabled, type: :boolean)
config.add(:poll_rate_for_verify_in_seconds, type: :integer)
config.add(:proofer_mock_fallback, type: :boolean)
config.add(:proofing_allow_expired_license, type: :boolean)
config.add(:proofing_expired_license_after, type: :date)
config.add(:proofing_expired_license_reproof_at, type: :date)
config.add(:proofing_send_partial_dob, type: :boolean)
config.add(:proof_address_max_attempts, type: :integer)
config.add(:proof_address_max_attempt_window_in_minutes, type: :integer)
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 @@ -17,7 +17,6 @@ def stub_idv_session
applicant: applicant,
user: user,
user_password: password,
document_expired: nil,
)
profile = profile_maker.save_profile
idv_session.pii = profile_maker.pii_attributes
Expand Down
121 changes: 0 additions & 121 deletions spec/features/idv/doc_auth/document_capture_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -350,78 +350,6 @@
end
end

context 'when the only error is an expired drivers license' do
before do
allow(IdentityConfig.store).to receive(:proofing_allow_expired_license).
and_return(proofing_allow_expired_license)
allow(IdentityConfig.store).to receive(:proofing_expired_license_after).
and_return(Date.new(2020, 3, 1))

allow_any_instance_of(ApplicationController).
to receive(:analytics).and_return(fake_analytics)

DocAuth::Mock::DocAuthMockClient.mock_response!(
method: :post_images,
response: DocAuth::Response.new(
pii_from_doc: DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC.merge(
state_id_expiration: '2020-04-01',
),
success: false,
errors: {
id: [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK],
},
),
)
end

context 'when expired licenses are not allowed' do
let(:proofing_allow_expired_license) { false }

it 'shows an error and does not go to the next page' do
attach_and_submit_images
expect(page).to have_current_path(idv_doc_auth_document_capture_step)

expect(fake_analytics).to have_logged_event(
'IdV: ' + "#{Analytics::DOC_AUTH} document_capture submitted".downcase,
document_expired: true,
would_have_passed: true,
)
end
end

context 'when expired licenses are allowed' do
let(:proofing_allow_expired_license) { true }

it 'proceeds to the next page and saves reproof_at to the profile' do
attach_and_submit_images
expect(page).to have_current_path(next_step)

expect(fake_analytics).to have_logged_event(
'IdV: ' + "#{Analytics::DOC_AUTH} document_capture submitted".downcase,
document_expired: true,
)

# finish the rest of the flow so we can make sure the data is plumbed through
fill_out_ssn_form_ok
click_idv_continue

expect(page).to have_content(t('doc_auth.headings.verify'))
click_idv_continue

fill_out_phone_form_mfa_phone(user)
click_idv_continue

fill_in :user_password, with: Features::SessionHelper::VALID_PASSWORD
click_idv_continue

acknowledge_and_confirm_personal_key(js: false)

profile = user.active_profile
expect(profile.reproof_at).to eq(IdentityConfig.store.proofing_expired_license_reproof_at)
end
end
end

context 'when using async uploads', :js do
before do
allow(DocumentProofingJob).to receive(:perform_later).
Expand Down Expand Up @@ -487,55 +415,6 @@
expect(back_plain.b).to eq(original.b)
end
end

context 'when expired licenses are allowed' do
before do
allow(IdentityConfig.store).to receive(:proofing_allow_expired_license).and_return(true)

DocAuth::Mock::DocAuthMockClient.mock_response!(
method: :post_images,
response: DocAuth::Response.new(
success: false,
pii_from_doc: DocAuth::Mock::ResultResponseBuilder::DEFAULT_PII_FROM_DOC.merge(
state_id_expiration: '2020-04-01',
),
errors: {
id: [DocAuth::Errors::DOCUMENT_EXPIRED_CHECK],
},
),
)
end

it 'proceeds to the next page and saves reproof_at to the profile' do
attach_file 'Front of your ID', 'app/assets/images/logo.png'
attach_file 'Back of your ID', 'app/assets/images/logo.png'

form = page.find('#document-capture-form')
front_url = form['data-front-image-upload-url']
back_url = form['data-back-image-upload-url']
click_on 'Submit'

expect(page).to have_current_path(next_step, wait: 20)

# finish the rest of the flow so we can make sure the data is plumbed through
fill_out_ssn_form_ok
click_idv_continue

expect(page).to have_content(t('doc_auth.headings.verify'))
click_idv_continue

fill_out_phone_form_mfa_phone(user)
click_idv_continue

fill_in :user_password, with: Features::SessionHelper::VALID_PASSWORD
click_idv_continue

acknowledge_and_confirm_personal_key(js: true)

profile = user.active_profile
expect(profile.reproof_at).to eq(IdentityConfig.store.proofing_expired_license_reproof_at)
end
end
end

def next_step
Expand Down
Loading