diff --git a/app/controllers/idv/image_uploads_controller.rb b/app/controllers/idv/image_uploads_controller.rb index aa656b2cc55..353743ac1ee 100644 --- a/app/controllers/idv/image_uploads_controller.rb +++ b/app/controllers/idv/image_uploads_controller.rb @@ -20,7 +20,6 @@ def create def image_upload_form @image_upload_form ||= Idv::ApiImageUploadForm.new( params, - liveness_checking_enabled: liveness_checking_enabled?, service_provider: current_sp, analytics: analytics, uuid_prefix: current_sp&.app_id, @@ -32,17 +31,5 @@ def image_upload_form def store_encrypted_images? IdentityConfig.store.encrypted_document_storage_enabled end - - def liveness_checking_enabled? - IdentityConfig.store.doc_auth_selfie_capture[:enabled] - end - - def ial_context - @ial_context ||= IalContext.new( - ial: sp_session_ial, - service_provider: current_sp, - user: current_user, - ) - end end end diff --git a/app/forms/idv/api_image_upload_form.rb b/app/forms/idv/api_image_upload_form.rb index 73a4d7419f9..b15b71c3af7 100644 --- a/app/forms/idv/api_image_upload_form.rb +++ b/app/forms/idv/api_image_upload_form.rb @@ -5,7 +5,6 @@ class ApiImageUploadForm validates_presence_of :front validates_presence_of :back - validates_presence_of :selfie, if: :liveness_checking_enabled validates_presence_of :document_capture_session validate :validate_images @@ -13,8 +12,7 @@ class ApiImageUploadForm validate :limit_if_rate_limited def initialize(params, service_provider:, analytics: nil, - uuid_prefix: nil, irs_attempts_api_tracker: nil, store_encrypted_images: false, - liveness_checking_enabled: false) + uuid_prefix: nil, irs_attempts_api_tracker: nil, store_encrypted_images: false) @params = params @service_provider = service_provider @analytics = analytics @@ -22,7 +20,6 @@ def initialize(params, service_provider:, analytics: nil, @uuid_prefix = uuid_prefix @irs_attempts_api_tracker = irs_attempts_api_tracker @store_encrypted_images = store_encrypted_images - @liveness_checking_enabled = liveness_checking_enabled end def submit @@ -54,7 +51,7 @@ def submit private attr_reader :params, :analytics, :service_provider, :form_response, :uuid_prefix, - :irs_attempts_api_tracker, :liveness_checking_enabled + :irs_attempts_api_tracker def increment_rate_limiter! return unless document_capture_session @@ -83,11 +80,9 @@ def post_images_to_client doc_auth_client.post_images( front_image: front_image_bytes, back_image: back_image_bytes, - selfie_image: liveness_checking_enabled ? selfie_image_bytes : nil, image_source: image_source, user_uuid: user_uuid, uuid_prefix: uuid_prefix, - liveness_checking_enabled: liveness_checking_enabled, ) end @@ -110,10 +105,6 @@ def back_image_bytes @back_image_bytes ||= back.read end - def selfie_image_bytes - @selfie_image_bytes ||= selfie.read - end - def validate_pii_from_doc(client_response) response = Idv::DocPiiForm.new( pii: client_response.pii_from_doc, @@ -210,10 +201,6 @@ def back as_readable(:back) end - def selfie - as_readable(:selfie) - end - def document_capture_session @document_capture_session ||= DocumentCaptureSession.find_by( uuid: document_capture_session_uuid, @@ -233,12 +220,6 @@ def validate_images type: :not_a_file ) end - if selfie.is_a? DataUrlImage::InvalidUrlFormatError - errors.add( - :selfie, t('doc_auth.errors.not_a_file'), - type: :not_a_file - ) - end end def validate_duplicate_images @@ -391,8 +372,7 @@ def image_metadata def add_costs(response) Db::AddDocumentVerificationAndSelfieCosts. new(user_id: user_id, - service_provider: service_provider, - liveness_checking_enabled: liveness_checking_enabled). + service_provider: service_provider). call(response) end diff --git a/app/services/db/add_document_verification_and_selfie_costs.rb b/app/services/db/add_document_verification_and_selfie_costs.rb index 96192917989..0d89768a255 100644 --- a/app/services/db/add_document_verification_and_selfie_costs.rb +++ b/app/services/db/add_document_verification_and_selfie_costs.rb @@ -1,8 +1,7 @@ module Db class AddDocumentVerificationAndSelfieCosts - def initialize(user_id:, service_provider:, liveness_checking_enabled:) + def initialize(user_id:, service_provider:) @service_provider = service_provider - @liveness_checking_enabled = liveness_checking_enabled @user_id = user_id end @@ -14,7 +13,7 @@ def call(client_response) private - attr_reader :service_provider, :user_id, :liveness_checking_enabled + attr_reader :service_provider, :user_id def add_cost(token) Db::SpCost::AddSpCost.call(service_provider, 2, token) diff --git a/app/services/db/sp_cost/add_sp_cost.rb b/app/services/db/sp_cost/add_sp_cost.rb index ea31d8d9b1f..3e1a0dedb48 100644 --- a/app/services/db/sp_cost/add_sp_cost.rb +++ b/app/services/db/sp_cost/add_sp_cost.rb @@ -7,7 +7,6 @@ class SpCostTypeError < StandardError; end aamva acuant_front_image acuant_back_image - acuant_selfie acuant_result lexis_nexis_resolution lexis_nexis_address diff --git a/app/services/doc_auth/acuant/acuant_client.rb b/app/services/doc_auth/acuant/acuant_client.rb index eccef4d89c0..7b29b7419d5 100644 --- a/app/services/doc_auth/acuant/acuant_client.rb +++ b/app/services/doc_auth/acuant/acuant_client.rb @@ -42,9 +42,7 @@ def post_images( back_image:, image_source:, user_uuid: nil, - uuid_prefix: nil, - selfie_image: nil, - liveness_checking_enabled: false + uuid_prefix: nil ) document_response = create_document(image_source: image_source) return document_response unless document_response.success? diff --git a/app/services/doc_auth/error_generator.rb b/app/services/doc_auth/error_generator.rb index ded26d8915d..7f1f521ce16 100644 --- a/app/services/doc_auth/error_generator.rb +++ b/app/services/doc_auth/error_generator.rb @@ -12,14 +12,12 @@ def initialize(config) ID = :id FRONT = :front BACK = :back - SELFIE = :selfie GENERAL = :general ERROR_KEYS = [ ID, FRONT, BACK, - SELFIE, GENERAL, ].to_set.freeze @@ -64,9 +62,7 @@ def generate_doc_auth_errors(response_info) image_metric_errors = get_image_metric_errors(response_info[:image_metrics]) return image_metric_errors.to_h unless image_metric_errors.empty? - liveness_enabled = response_info[:liveness_enabled] - alert_errors = get_error_messages(liveness_enabled, response_info) - alert_error_count += 1 if alert_errors.include?(SELFIE) + alert_errors = get_error_messages(response_info) error = '' side = nil @@ -175,7 +171,7 @@ def get_image_metric_errors(processed_image_metrics) error_result end - def get_error_messages(liveness_enabled, response_info) + def get_error_messages(response_info) errors = Hash.new { |hash, key| hash[key] = Set.new } if response_info[:doc_auth_result] != 'Passed' @@ -189,11 +185,6 @@ def get_error_messages(liveness_enabled, response_info) end end - portrait_match_results = response_info[:portrait_match_results] || {} - if liveness_enabled && portrait_match_results.dig(:FaceMatchResult) != 'Pass' - errors[SELFIE] << Errors::SELFIE_FAILURE - end - errors end @@ -224,12 +215,8 @@ def scan_for_unknown_alerts(response_info) unknown_fail_count end - def self.general_error(_liveness_enabled) - Errors::GENERAL_ERROR - end - - def self.wrapped_general_error(liveness_enabled) - { general: [ErrorGenerator.general_error(liveness_enabled)], hints: true } + def self.wrapped_general_error + { general: [Errors::GENERAL_ERROR], hints: true } end def supported_country_codes diff --git a/app/services/doc_auth/errors.rb b/app/services/doc_auth/errors.rb index cdd8e79bdc7..fbc15666cab 100644 --- a/app/services/doc_auth/errors.rb +++ b/app/services/doc_auth/errors.rb @@ -26,7 +26,6 @@ module Errors MULTIPLE_BACK_ID_FAILURES = 'multiple_back_id_failures' MULTIPLE_FRONT_ID_FAILURES = 'multiple_front_id_failures' REF_CONTROL_NUMBER_CHECK = 'ref_control_number_check' - SELFIE_FAILURE = 'selfie_failure' SEX_CHECK = 'sex_check' VISIBLE_COLOR_CHECK = 'visible_color_check' VISIBLE_PHOTO_CHECK = 'visible_photo_check' @@ -67,7 +66,6 @@ module Errors MULTIPLE_BACK_ID_FAILURES, MULTIPLE_FRONT_ID_FAILURES, REF_CONTROL_NUMBER_CHECK, - SELFIE_FAILURE, SEX_CHECK, VISIBLE_COLOR_CHECK, VISIBLE_PHOTO_CHECK, @@ -115,8 +113,6 @@ module Errors MULTIPLE_FRONT_ID_FAILURES => { long_msg: MULTIPLE_FRONT_ID_FAILURES, field_msg: FALLBACK_FIELD_LEVEL, hints: true }, MULTIPLE_BACK_ID_FAILURES => { long_msg: MULTIPLE_BACK_ID_FAILURES, field_msg: FALLBACK_FIELD_LEVEL, hints: true }, GENERAL_ERROR => { long_msg: GENERAL_ERROR, field_msg: FALLBACK_FIELD_LEVEL, hints: true }, - # Liveness, use general error for now - SELFIE_FAILURE => { long_msg: GENERAL_ERROR, field_msg: FALLBACK_FIELD_LEVEL, hints: false }, } # rubocop:enable Layout/LineLength end diff --git a/app/services/doc_auth/lexis_nexis/config.rb b/app/services/doc_auth/lexis_nexis/config.rb index d17321ae892..35572d96011 100644 --- a/app/services/doc_auth/lexis_nexis/config.rb +++ b/app/services/doc_auth/lexis_nexis/config.rb @@ -7,8 +7,6 @@ module LexisNexis :trueid_account_id, :trueid_noliveness_cropping_workflow, :trueid_noliveness_nocropping_workflow, - :trueid_liveness_cropping_workflow, - :trueid_liveness_nocropping_workflow, :trueid_password, :trueid_username, :hmac_key_id, @@ -25,8 +23,6 @@ module LexisNexis :request_mode, :trueid_noliveness_cropping_workflow, :trueid_noliveness_nocropping_workflow, - :trueid_liveness_cropping_workflow, - :trueid_liveness_nocropping_workflow, :locale, :dpi_threshold, :sharpness_threshold, diff --git a/app/services/doc_auth/lexis_nexis/lexis_nexis_client.rb b/app/services/doc_auth/lexis_nexis/lexis_nexis_client.rb index 8c6a8438af8..e4253ca4caa 100644 --- a/app/services/doc_auth/lexis_nexis/lexis_nexis_client.rb +++ b/app/services/doc_auth/lexis_nexis/lexis_nexis_client.rb @@ -15,11 +15,9 @@ def create_document def post_images( front_image:, back_image:, - selfie_image: nil, image_source: nil, user_uuid: nil, - uuid_prefix: nil, - liveness_checking_enabled: false + uuid_prefix: nil ) Requests::TrueIdRequest.new( config: config, @@ -27,9 +25,7 @@ def post_images( uuid_prefix: uuid_prefix, front_image: front_image, back_image: back_image, - selfie_image: selfie_image, image_source: image_source, - liveness_checking_required: liveness_checking_enabled, ).fetch end end diff --git a/app/services/doc_auth/lexis_nexis/requests/true_id_request.rb b/app/services/doc_auth/lexis_nexis/requests/true_id_request.rb index a12d02b3eb0..5a20ec6bea7 100644 --- a/app/services/doc_auth/lexis_nexis/requests/true_id_request.rb +++ b/app/services/doc_auth/lexis_nexis/requests/true_id_request.rb @@ -2,7 +2,7 @@ module DocAuth module LexisNexis module Requests class TrueIdRequest < DocAuth::LexisNexis::Request - attr_reader :front_image, :back_image, :selfie_image, :liveness_checking_required + attr_reader :front_image, :back_image def initialize( config:, @@ -10,17 +10,12 @@ def initialize( uuid_prefix:, front_image:, back_image:, - selfie_image: nil, - image_source: nil, - liveness_checking_required: false + image_source: nil ) super(config: config, user_uuid: user_uuid, uuid_prefix: uuid_prefix) @front_image = front_image @back_image = back_image - @selfie_image = selfie_image @image_source = image_source - # when set to required, be sure to pass in selfie_image - @liveness_checking_required = liveness_checking_required end private @@ -30,10 +25,9 @@ def body Document: { Front: encode(front_image), Back: encode(back_image), - Selfie: (encode(selfie_image) if include_liveness?), DocumentType: 'DriversLicense', }, - }.compact + } settings.merge(document).to_json end @@ -41,7 +35,6 @@ def body def handle_http_response(http_response) LexisNexis::Responses::TrueIdResponse.new( http_response, - liveness_checking_required, config, ) end @@ -64,13 +57,9 @@ def password def workflow if acuant_sdk_source? - include_liveness? ? - config.trueid_liveness_nocropping_workflow : - config.trueid_noliveness_nocropping_workflow + config.trueid_noliveness_nocropping_workflow else - include_liveness? ? - config.trueid_liveness_cropping_workflow : - config.trueid_noliveness_cropping_workflow + config.trueid_noliveness_cropping_workflow end end @@ -89,10 +78,6 @@ def metric_name def timeout IdentityConfig.store.lexisnexis_trueid_timeout end - - def include_liveness? - liveness_checking_required - end end end end diff --git a/app/services/doc_auth/lexis_nexis/responses/true_id_response.rb b/app/services/doc_auth/lexis_nexis/responses/true_id_response.rb index a48f155fd22..e9291a4cc77 100644 --- a/app/services/doc_auth/lexis_nexis/responses/true_id_response.rb +++ b/app/services/doc_auth/lexis_nexis/responses/true_id_response.rb @@ -44,10 +44,10 @@ class TrueIdResponse < DocAuth::Response }.freeze attr_reader :config, :http_response - def initialize(http_response, config, liveness_checking_enabled = false) + def initialize(http_response, config) @config = config @http_response = http_response - @liveness_checking_enabled = liveness_checking_enabled + super( success: successful_result?, errors: error_messages, @@ -74,7 +74,7 @@ def error_messages if true_id_product&.dig(:AUTHENTICATION_RESULT).present? ErrorGenerator.new(config).generate_doc_auth_errors(response_info) elsif true_id_product.present? - ErrorGenerator.wrapped_general_error(@liveness_checking_enabled) + ErrorGenerator.wrapped_general_error else { network: true } # return a generic technical difficulties error to user end diff --git a/app/services/doc_auth/mock/doc_auth_mock_client.rb b/app/services/doc_auth/mock/doc_auth_mock_client.rb index a72aa774b2d..141f8f986c7 100644 --- a/app/services/doc_auth/mock/doc_auth_mock_client.rb +++ b/app/services/doc_auth/mock/doc_auth_mock_client.rb @@ -52,11 +52,9 @@ def post_back_image(image:, instance_id:) def post_images( front_image:, back_image:, - selfie_image: nil, image_source: nil, user_uuid: nil, - uuid_prefix: nil, - liveness_checking_enabled: false + uuid_prefix: nil ) return mocked_response_for_method(__method__) if method_mocked?(__method__) diff --git a/app/services/doc_auth_router.rb b/app/services/doc_auth_router.rb index a1faba9cf0b..2545bbd859a 100644 --- a/app/services/doc_auth_router.rb +++ b/app/services/doc_auth_router.rb @@ -126,7 +126,6 @@ def translate_form_response!(response) def translate_doc_auth_errors!(response) error_keys = DocAuth::ErrorGenerator::ERROR_KEYS.dup - error_keys.delete(:selfie) if @client.is_a?(DocAuth::Acuant::AcuantClient) error_keys.each do |category| cat_errors = response.errors[category] @@ -179,8 +178,6 @@ def self.client(vendor_discriminator: nil, warn_notifier: nil, analytics: nil) trueid_account_id: IdentityConfig.store.lexisnexis_trueid_account_id, trueid_noliveness_cropping_workflow: IdentityConfig.store.lexisnexis_trueid_noliveness_cropping_workflow, trueid_noliveness_nocropping_workflow: IdentityConfig.store.lexisnexis_trueid_noliveness_nocropping_workflow, - trueid_liveness_cropping_workflow: IdentityConfig.store.lexisnexis_trueid_liveness_cropping_workflow, - trueid_liveness_nocropping_workflow: IdentityConfig.store.lexisnexis_trueid_liveness_nocropping_workflow, trueid_password: IdentityConfig.store.lexisnexis_trueid_password, trueid_username: IdentityConfig.store.lexisnexis_trueid_username, hmac_key_id: IdentityConfig.store.lexisnexis_trueid_hmac_key_id, @@ -207,18 +204,11 @@ def self.client(vendor_discriminator: nil, warn_notifier: nil, analytics: nil) def self.doc_auth_vendor(discriminator: nil, analytics: nil) case AbTests::DOC_AUTH_VENDOR.bucket(discriminator) when :alternate_vendor - vendor = IdentityConfig.store.doc_auth_vendor_randomize_alternate_vendor + IdentityConfig.store.doc_auth_vendor_randomize_alternate_vendor else analytics&.idv_doc_auth_randomizer_defaulted if discriminator.blank? - vendor = IdentityConfig.store.doc_auth_vendor + IdentityConfig.store.doc_auth_vendor end - - # if vendor is not set to mock and selfie enabled use lexisnexis - if IdentityConfig.store.doc_auth_selfie_capture[:enabled] && - vendor != Idp::Constants::Vendors::MOCK - vendor = Idp::Constants::Vendors::LEXIS_NEXIS - end - vendor end end diff --git a/app/views/idv/document_capture/show.html.erb b/app/views/idv/document_capture/show.html.erb index 9742a47df57..7598c4f3611 100644 --- a/app/views/idv/document_capture/show.html.erb +++ b/app/views/idv/document_capture/show.html.erb @@ -9,4 +9,4 @@ acuant_version: acuant_version, phone_question_ab_test_bucket: phone_question_ab_test_bucket, phone_with_camera: phone_with_camera, - ) %> + ) %> \ No newline at end of file diff --git a/config/application.yml.default b/config/application.yml.default index cb84d0d8cf8..ce1b7a51314 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -383,12 +383,12 @@ development: database_worker_jobs_host: '' database_worker_jobs_password: '' doc_auth_exit_question_section_enabled: true - doc_auth_not_ready_section_enabled: true - doc_auth_selfie_capture: '{"enabled": true}' + doc_auth_selfie_capture: '{"enabled":false}' doc_auth_vendor: 'mock' doc_auth_vendor_randomize: false doc_auth_vendor_randomize_percent: 0 doc_auth_vendor_randomize_alternate_vendor: '' + doc_auth_not_ready_section_enabled: true domain_name: localhost:3000 enable_rate_limiting: false hmac_fingerprinter_key: a2c813d4dca919340866ba58063e4072adc459b767a74cf2666d5c1eef3861db26708e7437abde1755eb24f4034386b0fea1850a1cb7e56bff8fae3cc6ade96c @@ -523,11 +523,11 @@ test: database_worker_jobs_host: '' database_worker_jobs_password: '' doc_auth_max_attempts: 4 - doc_auth_selfie_capture: '{"enabled":false}' doc_auth_vendor: 'mock' doc_auth_vendor_randomize: false doc_auth_vendor_randomize_percent: 0 doc_auth_vendor_randomize_alternate_vendor: '' + doc_auth_selfie_capture: '{"enabled":false}' doc_capture_polling_enabled: false domain_name: www.example.com hmac_fingerprinter_key: a2c813d4dca919340866ba58063e4072adc459b767a74cf2666d5c1eef3861db26708e7437abde1755eb24f4034386b0fea1850a1cb7e56bff8fae3cc6ade96c diff --git a/spec/controllers/idv/image_uploads_controller_spec.rb b/spec/controllers/idv/image_uploads_controller_spec.rb index f41cea53f58..7f1efc5684a 100644 --- a/spec/controllers/idv/image_uploads_controller_spec.rb +++ b/spec/controllers/idv/image_uploads_controller_spec.rb @@ -5,7 +5,7 @@ let(:document_filename_regex) { /^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}\.[a-z]+$/ } let(:base64_regex) { /^[a-z0-9+\/]+=*$/i } - let(:selfie_img) { nil } + describe '#create' do subject(:action) do post :create, params: params @@ -19,11 +19,10 @@ front: DocAuthImageFixtures.document_front_image_multipart, front_image_metadata: '{"glare":99.99}', back: DocAuthImageFixtures.document_back_image_multipart, - selfie: (selfie_img unless selfie_img.nil?), back_image_metadata: '{"glare":99.99}', document_capture_session_uuid: document_capture_session.uuid, flow_path: flow_path, - }.compact + } end let(:json) { JSON.parse(response.body, symbolize_names: true) } @@ -1006,20 +1005,6 @@ ] end end - - context 'when liveness checking enabled' do - before do - allow(IdentityConfig.store).to receive(:doc_auth_selfie_capture). - and_return({ enabled: true }) - end - let(:selfie_img) { DocAuthImageFixtures.selfie_image_multipart } - it 'returns a successful response' do - action - expect(response.status).to eq(200) - expect(json[:success]).to eq(true) - expect(document_capture_session.reload.load_result.success?).to eq(true) - end - end end def expect_funnel_update_counts(user, count) diff --git a/spec/forms/idv/api_image_upload_form_spec.rb b/spec/forms/idv/api_image_upload_form_spec.rb index 6ee0e804541..b92875d83b5 100644 --- a/spec/forms/idv/api_image_upload_form_spec.rb +++ b/spec/forms/idv/api_image_upload_form_spec.rb @@ -10,21 +10,17 @@ front_image_metadata: front_image_metadata, back: back_image, back_image_metadata: back_image_metadata, - selfie: selfie_image, document_capture_session_uuid: document_capture_session_uuid, ), service_provider: build(:service_provider, issuer: 'test_issuer'), analytics: fake_analytics, irs_attempts_api_tracker: irs_attempts_api_tracker, store_encrypted_images: store_encrypted_images, - liveness_checking_enabled: liveness_checking_enabled, ) end let(:front_image) { DocAuthImageFixtures.document_front_image_multipart } let(:back_image) { DocAuthImageFixtures.document_back_image_multipart } - let(:selfie_image) { nil } - let(:liveness_checking_enabled) { false } let(:front_image_metadata) do { width: 40, height: 40, mimeType: 'image/png', source: 'upload' }.to_json end @@ -77,19 +73,6 @@ expect(form.errors[:limit]).to eq([I18n.t('errors.doc_auth.rate_limited_heading')]) end end - - context 'when liveness check is enabled' do - let(:liveness_checking_enabled) { true } - it 'is not valid without selfie' do - expect(form.valid?).to eq(false) - end - context 'with valid selfie' do - let(:selfie_image) { DocAuthImageFixtures.selfie_image_multipart } - it 'is valid' do - expect(form.valid?).to eq(true) - end - end - end end describe '#submit' do diff --git a/spec/services/db/add_document_verification_and_selfie_costs_spec.rb b/spec/services/db/add_document_verification_and_selfie_costs_spec.rb index e8f28a94c29..273c028e323 100644 --- a/spec/services/db/add_document_verification_and_selfie_costs_spec.rb +++ b/spec/services/db/add_document_verification_and_selfie_costs_spec.rb @@ -3,7 +3,6 @@ RSpec.describe Db::AddDocumentVerificationAndSelfieCosts do let(:user_id) { 1 } let(:service_provider) { build(:service_provider, issuer: 'foo') } - let(:liveness_checking_enabled) { true } let(:billed_response) do DocAuth::Response.new( success: true, @@ -31,19 +30,15 @@ described_class.new( user_id: user_id, service_provider: service_provider, - liveness_checking_enabled: liveness_checking_enabled, ) end - context 'when livness check is disabled' do - let(:liveness_checking_enabled) { false } - 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 - 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 end it 'has costing for front, back, but not result when not billed' do diff --git a/spec/services/doc_auth/error_generator_spec.rb b/spec/services/doc_auth/error_generator_spec.rb index 84f1ff11e39..2d78483712f 100644 --- a/spec/services/doc_auth/error_generator_spec.rb +++ b/spec/services/doc_auth/error_generator_spec.rb @@ -36,14 +36,6 @@ IssuerType: 'Country' } end - let(:liveness_enabled) { nil } - let(:face_match_result) { 'Pass' } - let(:portrait_match_results) do - { - FaceMatchResult: face_match_result, - } - end - def build_error_info( doc_result: nil, passed: [], @@ -54,7 +46,7 @@ def build_error_info( { conversation_id: 31000406181234, reference: 'Reference1', - liveness_enabled: liveness_enabled, + liveness_enabled: false, vendor: 'Test', transaction_reason_code: 'testing', doc_auth_result: doc_result, @@ -63,7 +55,7 @@ def build_error_info( failed: failed, }, alert_failure_count: failed&.count.to_i, - portrait_match_results: portrait_match_results, + portrait_match_results: { FaceMatchResult: 'Pass' }, image_metrics: image_metrics, classification_info: classification_info, } @@ -508,49 +500,6 @@ def build_error_info( end end - context 'The correct errors are delivered for selfie with metric error' do - let(:metrics) do - { - front: { - 'HorizontalResolution' => 300, - 'VerticalResolution' => 300, - 'SharpnessMetric' => 50, - 'GlareMetric' => 50, - }, - back: { - 'HorizontalResolution' => 300, - 'VerticalResolution' => 300, - 'SharpnessMetric' => 50, - 'GlareMetric' => 50, - }, - } - end - context 'when liveness is enabled' do - let(:liveness_enabled) { true } - context 'when liveness check passed' do - let(:face_match_result) { 'Pass' } - it 'DocAuthResult is Passed with no other error' do - error_info = build_error_info(doc_result: 'Passed', image_metrics: metrics) - - # this is an edge case, the generate_doc_auth_errors function should no be - # called when everything is successful - expect(warn_notifier).to receive(:call). - with(hash_including(:response_info, :message)).once - described_class.new(config).generate_doc_auth_errors(error_info) - end - end - - context 'when liveness check failed' do - let(:face_match_result) { 'Failure' } - it 'DocAuthResult is failed with selfie error' do - error_info = build_error_info(doc_result: 'Failed', image_metrics: metrics) - errors = described_class.new(config).generate_doc_auth_errors(error_info) - expect(errors.keys).to contain_exactly(:general, :selfie, :hints) - end - end - end - end - context 'with both doc type error and image metric error' do let(:metrics) do { diff --git a/spec/services/doc_auth/lexis_nexis/requests/true_id_request_spec.rb b/spec/services/doc_auth/lexis_nexis/requests/true_id_request_spec.rb index b8e8e2f52a8..7ad5597fe51 100644 --- a/spec/services/doc_auth/lexis_nexis/requests/true_id_request_spec.rb +++ b/spec/services/doc_auth/lexis_nexis/requests/true_id_request_spec.rb @@ -14,12 +14,8 @@ base_url: base_url, trueid_noliveness_cropping_workflow: 'test_workflow_cropping', trueid_noliveness_nocropping_workflow: 'test_workflow', - trueid_liveness_cropping_workflow: 'test_workflow_liveness_cropping', - trueid_liveness_nocropping_workflow: 'test_workflow_liveness', ) end - let(:selfie_image) { DocAuthImageFixtures.selfie_image } - let(:liveness_checking_required) { false } let(:subject) do described_class.new( config: config, @@ -28,63 +24,34 @@ image_source: image_source, user_uuid: applicant[:uuid], uuid_prefix: applicant[:uuid_prefix], - selfie_image: selfie_image, - liveness_checking_required: liveness_checking_required, ) end shared_examples 'a successful request' do it 'uploads the image and returns a successful result' do - include_liveness = liveness_checking_required && !selfie_image.nil? - request_stub_liveness = stub_request(:post, full_url).with do |request| - JSON.parse(request.body, symbolize_names: true)[:Document][:Selfie].present? - end.to_return(body: response_body(include_liveness), status: 201) - request_stub = stub_request(:post, full_url).with do |request| - !JSON.parse(request.body, symbolize_names: true)[:Document][:Selfie].present? - end.to_return(body: response_body(include_liveness), status: 201) + request_stub = stub_request(:post, full_url).to_return(body: response_body, status: 201) response = subject.fetch expect(response.success?).to eq(true) expect(response.errors).to eq({}) expect(response.exception).to be_nil - if include_liveness - expect(request_stub_liveness).to have_been_requested - else - expect(request_stub).to have_been_requested - end + expect(request_stub).to have_been_requested end end - context 'with liveness_checking_enabled as false' do - let(:liveness_checking_required) { false } - context 'with acuant image source' do - let(:workflow) { 'test_workflow' } - let(:image_source) { DocAuth::ImageSources::ACUANT_SDK } - it_behaves_like 'a successful request' - end - context 'with unknown image source' do - let(:workflow) { 'test_workflow_cropping' } - let(:image_source) { DocAuth::ImageSources::UNKNOWN } + context 'with acuant image source' do + let(:workflow) { 'test_workflow' } + let(:image_source) { DocAuth::ImageSources::ACUANT_SDK } - it_behaves_like 'a successful request' - end + it_behaves_like 'a successful request' end - context 'with liveness_checking_enabled as true' do - let(:liveness_checking_required) { true } - context 'with acuant image source' do - let(:workflow) { 'test_workflow_liveness' } - let(:image_source) { DocAuth::ImageSources::ACUANT_SDK } + context 'with unknown image source' do + let(:workflow) { 'test_workflow_cropping' } + let(:image_source) { DocAuth::ImageSources::UNKNOWN } - it_behaves_like 'a successful request' - end - context 'with unknown image source' do - let(:workflow) { 'test_workflow_liveness_cropping' } - let(:image_source) { DocAuth::ImageSources::UNKNOWN } - - it_behaves_like 'a successful request' - end + it_behaves_like 'a successful request' end context 'with non 200 http status code' do @@ -103,7 +70,7 @@ end end -def response_body(include_liveness) +def response_body { Status: { TransactionStatus: 'passed', @@ -122,15 +89,6 @@ def response_body(include_liveness) }, ], }, - *( - if include_liveness - [ - Group: 'PORTRAIT_MATCH_RESULT', - Name: 'FaceMatchResult', - Values: [{ Value: 'Success' }], - ] - end - ), ], }, ], diff --git a/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb b/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb index 3c39172fcb8..c95940c1a0e 100644 --- a/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb +++ b/spec/services/doc_auth/lexis_nexis/responses/true_id_response_spec.rb @@ -6,7 +6,6 @@ instance_double(Faraday::Response, status: 200, body: success_response_body) end let(:failure_body_no_liveness) { LexisNexisFixtures.true_id_response_failure_no_liveness } - let(:failure_body_with_liveness) { LexisNexisFixtures.true_id_response_failure_with_liveness } let(:failure_body_with_all_failures) do LexisNexisFixtures.true_id_response_failure_with_all_failures end @@ -22,9 +21,6 @@ let(:failure_response_no_liveness) do instance_double(Faraday::Response, status: 200, body: failure_body_no_liveness) end - let(:failure_response_with_liveness) do - instance_double(Faraday::Response, status: 200, body: failure_body_with_liveness) - end let(:failure_response_tampering) do instance_double(Faraday::Response, status: 200, body: failure_body_tampering) end @@ -319,11 +315,6 @@ def get_decision_product(resp) to match(a_hash_including(visible_pattern: { no_side: 'Failed' })) end - it 'returns Failed for liveness failure' do - output = described_class.new(failure_response_with_liveness, config).to_h - expect(output[:success]).to eq(false) - end - it 'produces expected hash output' do output = described_class.new(failure_response_with_all_failures, config).to_h diff --git a/spec/services/doc_auth_router_spec.rb b/spec/services/doc_auth_router_spec.rb index 116a33f619d..bbfcaec3c8c 100644 --- a/spec/services/doc_auth_router_spec.rb +++ b/spec/services/doc_auth_router_spec.rb @@ -81,32 +81,6 @@ def reload_ab_test_initializer! expect(result).to eq(doc_auth_vendor) end - - context 'when selfie is enabled' do - before do - allow(IdentityConfig.store).to receive(:doc_auth_selfie_capture). - and_return({ enabled: true }) - end - context 'when vendor is not set to mock' do - it 'chose lexisnexis' do - result = DocAuthRouter.doc_auth_vendor( - discriminator: discriminator, - analytics: analytics, - ) - expect(result).to eq(Idp::Constants::Vendors::LEXIS_NEXIS) - end - end - context 'when vendor is set to mock' do - let(:doc_auth_vendor) { Idp::Constants::Vendors::MOCK } - it 'stays with the mock' do - result = DocAuthRouter.doc_auth_vendor( - discriminator: discriminator, - analytics: analytics, - ) - expect(result).to eq(Idp::Constants::Vendors::MOCK) - end - end - end end context 'with a discriminator that hashes inside the test group' do @@ -121,25 +95,6 @@ def reload_ab_test_initializer! to eq(doc_auth_vendor_randomize_alternate_vendor) end - context 'with selfie enabled' do - before do - allow(IdentityConfig.store).to receive(:doc_auth_selfie_capture). - and_return({ enabled: true }) - end - it 'is the lexisnexis vendor' do - expect(DocAuthRouter.doc_auth_vendor(discriminator: discriminator)). - to eq(Idp::Constants::Vendors::LEXIS_NEXIS) - end - - context 'when alternate is set to mock' do - let(:doc_auth_vendor_randomize_alternate_vendor) { Idp::Constants::Vendors::MOCK } - it 'stays with the mock vendor' do - expect(DocAuthRouter.doc_auth_vendor(discriminator: discriminator)). - to eq(Idp::Constants::Vendors::MOCK) - end - end - end - context 'with randomize false' do let(:doc_auth_vendor_randomize) { false } diff --git a/spec/support/doc_auth_image_fixtures.rb b/spec/support/doc_auth_image_fixtures.rb index 4063e925fe8..a1fe793ae37 100644 --- a/spec/support/doc_auth_image_fixtures.rb +++ b/spec/support/doc_auth_image_fixtures.rb @@ -19,18 +19,6 @@ def self.document_back_image_multipart Rack::Test::UploadedFile.new(fixture_path('id-back.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.selfie_image_data_uri - "data:image/jpeg;base64,#{Base64.strict_encode64(selfie_image)}" - end - def self.error_yaml_multipart path = File.join( File.dirname(__FILE__),