Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 1 addition & 5 deletions app/services/idv/steps/document_capture_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Idv
module Steps
class DocumentCaptureStep < DocAuthBaseStep
IMAGE_UPLOAD_PARAM_NAMES = %i[
front_image back_image selfie_image
front_image back_image
].freeze

def self.analytics_visited_event
Expand All @@ -29,10 +29,6 @@ def extra_view_variables
image_type: 'back',
transaction_id: flow_session[:document_capture_session_uuid],
),
selfie_image_upload_url: url_builder.presigned_image_upload_url(
image_type: 'selfie',
transaction_id: flow_session[:document_capture_session_uuid],
),
}.merge(native_camera_ab_testing_variables)
end

Expand Down
1 change: 0 additions & 1 deletion app/views/idv/capture_doc/document_capture.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
failure_to_proof_url: idv_capture_doc_return_to_sp_url,
front_image_upload_url: front_image_upload_url,
back_image_upload_url: back_image_upload_url,
selfie_image_upload_url: selfie_image_upload_url,
native_camera_a_b_testing_enabled: native_camera_a_b_testing_enabled,
native_camera_only: native_camera_only,
) %>
1 change: 0 additions & 1 deletion app/views/idv/doc_auth/document_capture.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
failure_to_proof_url: idv_doc_auth_return_to_sp_url,
front_image_upload_url: front_image_upload_url,
back_image_upload_url: back_image_upload_url,
selfie_image_upload_url: selfie_image_upload_url,
native_camera_a_b_testing_enabled: native_camera_a_b_testing_enabled,
native_camera_only: native_camera_only,
) %>
3 changes: 1 addition & 2 deletions app/views/idv/shared/_document_capture.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% end %>
<% add_document_capture_image_urls_to_csp(
request,
[front_image_upload_url, back_image_upload_url, selfie_image_upload_url],
[front_image_upload_url, back_image_upload_url],
)
session_id = flow_session[:document_capture_session_uuid]
%>
Expand Down Expand Up @@ -39,7 +39,6 @@
failure_to_proof_url: failure_to_proof_url,
front_image_upload_url: front_image_upload_url,
back_image_upload_url: back_image_upload_url,
selfie_image_upload_url: selfie_image_upload_url,
keep_alive_endpoint: sessions_keepalive_url,
idv_in_person_url: Idv::InPersonConfig.enabled_for_issuer?(decorated_session.sp_issuer) ? idv_in_person_url : nil,
security_and_privacy_how_it_works_url: MarketingSite.security_and_privacy_how_it_works_url,
Expand Down
1 change: 0 additions & 1 deletion config/initializers/rack_timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Rack
class Timeout
@excludes = [
'/api/verify/images',
'/verify/doc_auth/selfie',
'/verify/doc_auth/document_capture',
'/verify/doc_auth/verify',
'/verify/capture_doc/document_capture',
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/idv/capture_doc_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
locals: hash_including(
:back_image_upload_url,
:front_image_upload_url,
:selfie_image_upload_url,
:flow_session,
step_template: 'idv/capture_doc/document_capture',
flow_namespace: 'idv',
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/idv/doc_auth_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
locals: hash_including(
:back_image_upload_url,
:front_image_upload_url,
:selfie_image_upload_url,
:flow_session,
step_template: 'idv/doc_auth/document_capture',
flow_namespace: 'idv',
Expand Down
1 change: 0 additions & 1 deletion spec/forms/idv/api_image_upload_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
let(:back_image_metadata) do
{ width: 20, height: 20, mimeType: 'image/png', source: 'upload' }.to_json
end
let(:selfie_image) { DocAuthImageFixtures.selfie_image_multipart }
let!(:document_capture_session) { DocumentCaptureSession.create!(user: create(:user)) }
let(:document_capture_session_uuid) { document_capture_session.uuid }
let(:fake_analytics) { FakeAnalytics.new }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,11 @@ describe('document-capture/components/acuant-capture', () => {
});

it('renders retry button when value and capture supported', async () => {
const selfie = await getFixtureFile('doc_auth_images/selfie.jpg');
const image = await getFixtureFile('doc_auth_images/id-front.jpg');
const { getByText } = render(
<DeviceContext.Provider value={{ isMobile: true }}>
<AcuantContextProvider sdkSrc="about:blank" cameraSrc="about:blank">
<AcuantCapture label="Image" value={selfie} />
<AcuantCapture label="Image" value={image} />
</AcuantContextProvider>
</DeviceContext.Provider>,
);
Expand Down
54 changes: 12 additions & 42 deletions spec/services/db/add_document_verification_and_selfie_costs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,22 @@
)
end

context 'with no selfie' do
it 'has costing for front, back, and result when billed' do
subject.call(billed_response)
it 'has costing for front, back, and result when billed' do
subject.call(billed_response)

expect(costing_for(:acuant_front_image)).to be_present
expect(costing_for(:acuant_back_image)).to be_present
expect(costing_for(:acuant_result)).to be_present
expect(costing_for(:acuant_selfie)).to be_nil
end

it 'has costing for front, back, but not result when not billed' do
subject.call(not_billed_response)

expect(costing_for(:acuant_front_image)).to be_present
expect(costing_for(:acuant_back_image)).to be_present
expect(costing_for(:acuant_result)).to be_nil
expect(costing_for(:acuant_selfie)).to be_nil
end
expect(costing_for(:acuant_front_image)).to be_present
expect(costing_for(:acuant_back_image)).to be_present
expect(costing_for(:acuant_result)).to be_present
expect(costing_for(:acuant_selfie)).to be_nil
end

context 'with a selfie' do
it 'has costing for front, back, and result when is is billed' do
subject.call(billed_response)

expect(costing_for(:acuant_front_image)).to be_present
expect(costing_for(:acuant_back_image)).to be_present
expect(costing_for(:acuant_result)).to be_present
end

it 'has costing for front, back, but not result when it is not billed' do
subject.call(not_billed_response)

expect(costing_for(:acuant_front_image)).to be_present
expect(costing_for(:acuant_back_image)).to be_present
expect(costing_for(:acuant_result)).to be_nil
end

it 'does not fail when _count field is null' do
proofing_cost = ::ProofingCost.create_or_find_by(user_id: user_id)
proofing_cost.acuant_front_image_count = nil
proofing_cost.save

subject.call(billed_response)
it 'has costing for front, back, but not result when not billed' do
subject.call(not_billed_response)

expect(proofing_cost.reload.acuant_front_image_count).to eq 1
end
expect(costing_for(:acuant_front_image)).to be_present
expect(costing_for(:acuant_back_image)).to be_present
expect(costing_for(:acuant_result)).to be_nil
expect(costing_for(:acuant_selfie)).to be_nil
end

def costing_for(cost_type)
Expand Down
8 changes: 0 additions & 8 deletions spec/support/acuant_fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ def self.get_results_response_expired
load_response_fixture('get_results_response_expired.json')
end

def self.get_face_image_response
load_response_fixture('get_face_image_response.jpg')
end

def self.facial_match_response_success
load_response_fixture('facial_match_response_success.json')
end

def self.facial_match_response_failure
load_response_fixture('facial_match_response_failure.json')
end
Expand Down
16 changes: 0 additions & 16 deletions spec/support/doc_auth_image_fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ def self.document_back_image_multipart
Rack::Test::UploadedFile.new(fixture_path('id-back.jpg'), 'image/jpeg')
end

def self.document_face_image
load_image_data('id-face.jpg')
end

def self.document_face_image_multipart
Rack::Test::UploadedFile.new(fixture_path('id-face.jpg'), 'image/jpeg')
end

def self.selfie_image
load_image_data('selfie.jpg')
end

def self.selfie_image_multipart
Rack::Test::UploadedFile.new(fixture_path('selfie.jpg'), 'image/jpeg')
end

def self.error_yaml_multipart
path = File.join(
File.dirname(__FILE__),
Expand Down
4 changes: 0 additions & 4 deletions spec/views/idv/shared/_document_capture.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
let(:in_person_proofing_enabled_issuer) { nil }
let(:front_image_upload_url) { nil }
let(:back_image_upload_url) { nil }
let(:selfie_image_upload_url) { nil }
let(:native_camera_a_b_testing_enabled) { false }
let(:native_camera_only) { false }

Expand Down Expand Up @@ -47,7 +46,6 @@
failure_to_proof_url: failure_to_proof_url,
front_image_upload_url: front_image_upload_url,
back_image_upload_url: back_image_upload_url,
selfie_image_upload_url: selfie_image_upload_url,
native_camera_a_b_testing_enabled: native_camera_a_b_testing_enabled,
native_camera_only: native_camera_only,
}
Expand All @@ -71,15 +69,13 @@
let(:async_uploads_enabled) { true }
let(:front_image_upload_url) { 'https://s3.example.com/bucket/a?X-Amz-Security-Token=UAOL2' }
let(:back_image_upload_url) { 'https://s3.example.com/bucket/b?X-Amz-Security-Token=UAOL2' }
let(:selfie_image_upload_url) { 'https://s3.example.com/bucket/c?X-Amz-Security-Token=UAOL2' }

it 'does modifies CSP connect_src headers to include upload urls' do
render_partial

connect_src = controller.request.content_security_policy.connect_src
expect(connect_src).to include('https://s3.example.com/bucket/a')
expect(connect_src).to include('https://s3.example.com/bucket/b')
expect(connect_src).to include('https://s3.example.com/bucket/c')
end
end
end
Expand Down