Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ GIT

GIT
remote: https://github.com/18F/identity-idp-functions.git
revision: d32d49bc27c62a510695c6fe498c6d9b8942f6be
ref: d32d49bc27c62a510695c6fe498c6d9b8942f6be
revision: ba23bc6d0a5673a1a1f27a0abcfa54fd72372104
ref: ba23bc6d0a5673a1a1f27a0abcfa54fd72372104
specs:
identity-idp-functions (0.3.2)
retries (>= 0.0.5)
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/idv/usps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def send_reminder
end

def enqueue_job
return if idv_session.idv_usps_document_capture_session_uuid
document_capture_session = DocumentCaptureSession.create(
user_id: current_user.id,
issuer: sp_session[:issuer],
Expand All @@ -189,7 +190,10 @@ def enqueue_job

document_capture_session.store_proofing_pii_from_doc(pii)
idv_session.idv_usps_document_capture_session_uuid = document_capture_session.uuid
VendorProofJob.perform_resolution_proof(document_capture_session.uuid, false)
Idv::Agent.new(pii).proof_resolution(
document_capture_session,
should_proof_state_id: false,
)
end

def async_state
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/lambda_callback/address_proof_result_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ def create
dcs = DocumentCaptureSession.new
dcs.result_id = result_id_parameter
dcs.store_proofing_result(address_result_parameter.to_h)

track_exception_in_result(address_result_parameter)
end

private
Expand All @@ -17,6 +19,14 @@ def address_result_parameter
errors: {}, context: {})
end

def track_exception_in_result(result)
exception = result[:exception]
return if exception.nil?

NewRelic::Agent.notice_error(exception)
ExceptionNotifier.notify_exception(exception)
end

def config_auth_token
Figaro.env.address_proof_result_lambda_token
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ def create
dcs = DocumentCaptureSession.new
dcs.result_id = result_id_parameter
dcs.store_proofing_result(resolution_result_parameter)

track_exception_in_result(resolution_result_parameter)
end

private
Expand All @@ -13,7 +15,16 @@ def result_id_parameter
end

def resolution_result_parameter
params.require(:resolution_result)
params.require(:resolution_result).permit(:exception, :success, :timed_out,
errors: {}, context: {})
end

def track_exception_in_result(result)
exception = result[:exception]
return if exception.nil?

NewRelic::Agent.notice_error(exception)
ExceptionNotifier.notify_exception(exception)
end

def config_auth_token
Expand Down
8 changes: 0 additions & 8 deletions app/jobs/vendor_proof_job.rb

This file was deleted.

11 changes: 10 additions & 1 deletion app/services/flow/flow_state_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ def call_optional_show_step(step)
return unless @flow.class.const_defined?('OPTIONAL_SHOW_STEPS')
optional_show_step = @flow.class::OPTIONAL_SHOW_STEPS.with_indifferent_access[step]
return unless optional_show_step
optional_show_step.new(@flow).base_call
result = optional_show_step.new(@flow).base_call

if @analytics_id
analytics.track_event(analytics_optional_step, result.to_h.merge(step: optional_show_step))
end

if next_step.to_s != step
if next_step_is_url
redirect_to next_step
Expand Down Expand Up @@ -137,6 +142,10 @@ def analytics_visited
@analytics_id + ' visited'
end

def analytics_optional_step
@analytics_id + 'optional submitted'
Comment thread
mitchellhenke marked this conversation as resolved.
Outdated
end

def next_step
flow.next_step
end
Expand Down
18 changes: 12 additions & 6 deletions app/services/idv/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ def initialize(applicant)
@applicant = applicant.symbolize_keys
end

def proof_resolution(should_proof_state_id:)
vendor = Idv::Proofer.resolution_vendor.new
results = submit_applicant(vendor: vendor, results: init_results)
def proof_resolution(document_capture_session, should_proof_state_id:)
callback_url = Rails.application.routes.url_helpers.resolution_proof_result_url(
document_capture_session.result_id,
)

return results unless results[:success] && should_proof_state_id
LambdaJobs::Runner.new(
job_name: nil, job_class: Idv::Proofer.resolution_job_class,
args: { applicant_pii: @applicant, callback_url: callback_url,
should_proof_state_id: should_proof_state_id }
).run do |idv_result|
document_capture_session.store_proofing_result(idv_result[:resolution_result])

vendor = Idv::Proofer.state_id_vendor.new
submit_applicant(vendor: vendor, results: results)
nil
end
end

def proof_address(document_capture_session)
Expand Down
1 change: 1 addition & 0 deletions app/services/idv/phone_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def idv_max_attempts
end

def proof_address
return if idv_session.idv_phone_step_document_capture_session_uuid
document_capture_session = DocumentCaptureSession.create(user_id: idv_session.current_user.id,
requested_at: Time.zone.now)

Expand Down
19 changes: 5 additions & 14 deletions app/services/idv/proofer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,18 @@ class << self
def validate_vendors!
if mock_fallback_enabled?
require 'identity-idp-functions/proof_address_mock'
require 'identity-idp-functions/proof_resolution_mock'
else
require 'identity-idp-functions/proof_address'
end

resolution_vendor.new
state_id_vendor.new
end

def resolution_vendor
if mock_fallback_enabled?
ResolutionMock
else
LexisNexis::InstantVerify::Proofer
require 'identity-idp-functions/proof_resolution'
end
end

def state_id_vendor
def resolution_job_class
if mock_fallback_enabled?
StateIdMock
IdentityIdpFunctions::ProofResolutionMock
else
Aamva::Proofer
IdentityIdpFunctions::ProofResolution
end
end

Expand Down
6 changes: 5 additions & 1 deletion app/services/idv/steps/cac/verify_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def call
private

def enqueue_job
return if flow_session[cac_verify_document_capture_session_uuid_key]
pii_from_doc = flow_session[:pii_from_doc]

document_capture_session = create_document_capture_session(
Expand All @@ -18,7 +19,10 @@ def enqueue_job
document_capture_session.requested_at = Time.zone.now
document_capture_session.store_proofing_pii_from_doc(pii_from_doc)

VendorProofJob.perform_resolution_proof(document_capture_session.uuid, false)
Idv::Agent.new(pii_from_doc).proof_resolution(
document_capture_session,
should_proof_state_id: false,
)
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/services/idv/steps/cac/verify_wait_step_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def async_state_done(current_async_state)
else
mark_step_incomplete(:verify)
end

response
end

def async_state
Expand Down
11 changes: 6 additions & 5 deletions app/services/idv/steps/recover_verify_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def call
private

def enqueue_job
return if flow_session[recover_verify_document_capture_session_uuid_key]

pii_from_doc = flow_session[:pii_from_doc]

document_capture_session = create_document_capture_session(
Expand All @@ -17,11 +19,10 @@ def enqueue_job
document_capture_session.requested_at = Time.zone.now
document_capture_session.store_proofing_pii_from_doc(pii_from_doc)

flow_session[recover_verify_document_capture_session_uuid_key] =
document_capture_session.uuid

VendorProofJob.perform_resolution_proof(document_capture_session.uuid,
should_use_aamva?(pii_from_doc))
Idv::Agent.new(pii_from_doc).proof_resolution(
document_capture_session,
should_proof_state_id: should_use_aamva?(pii_from_doc),
)
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/services/idv/steps/recover_verify_wait_step_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def async_state_done(current_async_state)
else
mark_step_incomplete(:verify)
end

response
end

def async_state
Expand Down
11 changes: 7 additions & 4 deletions app/services/idv/steps/verify_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ def call
private

def enqueue_job
return if flow_session[verify_step_document_capture_session_uuid_key]

pii_from_doc = flow_session[:pii_from_doc]

document_capture_session = create_document_capture_session(
verify_step_document_capture_session_uuid_key,
)

document_capture_session.requested_at = Time.zone.now
document_capture_session.store_proofing_pii_from_doc(pii_from_doc)

flow_session[verify_step_document_capture_session_uuid_key] = document_capture_session.uuid

VendorProofJob.perform_resolution_proof(document_capture_session.uuid,
should_use_aamva?(pii_from_doc))
Idv::Agent.new(pii_from_doc).proof_resolution(
document_capture_session,
should_proof_state_id: should_use_aamva?(pii_from_doc),
)
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/services/idv/steps/verify_wait_step_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def async_state_done(current_async_state)
else
mark_step_incomplete(:verify)
end

response
end

def async_state
Expand Down
2 changes: 1 addition & 1 deletion app/services/lambda_jobs/git_ref.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LambdaJobs
GIT_REF = 'd32d49bc27c62a510695c6fe498c6d9b8942f6be'
GIT_REF = 'ba23bc6d0a5673a1a1f27a0abcfa54fd72372104'
end
3 changes: 2 additions & 1 deletion app/views/idv/cac/verify_wait.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= content_for(:meta_refresh) { "#{@meta_refresh}" } %>
<% title t('doc_auth.titles.doc_auth') %>

<h1 class='h3 my0'><%= t('doc_auth.headings.interstitial') %></h1>
<h1 class="h3 my0"><%= t('doc_auth.info.interstitial_eta') %></h1>
3 changes: 2 additions & 1 deletion app/views/idv/doc_auth/recover_verify_wait.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= content_for(:meta_refresh) { "#{@meta_refresh}" } %>
<% title t('doc_auth.titles.doc_auth') %>

<h1 class='h3 my0'><%= t('doc_auth.headings.interstitial') %></h1>
<h1 class="h3 my0"><%= t('doc_auth.info.interstitial_eta') %></h1>
3 changes: 2 additions & 1 deletion app/views/idv/doc_auth/verify_wait.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= content_for(:meta_refresh) { "#{@meta_refresh}" } %>
<% title t('doc_auth.titles.doc_auth') %>

<h1 class='h3 my0'><%= t('doc_auth.headings.interstitial') %></h1>
<h1 class="h3 my0"><%= t('doc_auth.info.interstitial_eta') %></h1>
Empty file removed lib/proofer_mocks/address_mock.rb
Empty file.
28 changes: 0 additions & 28 deletions lib/proofer_mocks/resolution_mock.rb

This file was deleted.

43 changes: 0 additions & 43 deletions lib/proofer_mocks/state_id_mock.rb

This file was deleted.

Loading