From 59e89aead589f86d614a4e90621053b81ed91421 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Mon, 12 Feb 2024 15:57:41 -0500 Subject: [PATCH 1/4] remove all passed from TrueIDREsponse --- .../lexis_nexis/responses/true_id_response.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 bdfbc98da61..bfa3acb7a82 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 @@ -37,7 +37,8 @@ def initialize(http_response, config, liveness_checking_enabled = false) # document type # bar code attention def successful_result? - (all_passed? || attention_with_barcode?) && id_type_supported? + doc_auth_success? && + (@liveness_checking_enabled ? selfie_passed? : true) end # all checks from document perspectives, without considering selfie: @@ -193,15 +194,6 @@ def basic_logging_info } end - # Status of all checks from Vendor perspective - def all_passed? - transaction_status_passed? && - true_id_product.present? && - product_status_passed? && - doc_auth_result_passed? && - (@liveness_checking_enabled ? selfie_passed? : true) - end - def selfie_result portrait_match_results&.dig(:FaceMatchResult) end From fe5d54da8b3be040379218ed08efa3788fd050ec Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Mon, 12 Feb 2024 16:29:14 -0500 Subject: [PATCH 2/4] [skip changelog] From 901595ff299df7196ab99ac0e79025cc7c044265 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Wed, 14 Feb 2024 11:23:50 -0500 Subject: [PATCH 3/4] add test for failing selfie with attention barcode --- ...ttention_barcode_with_face_match_fail.json | 765 ++++++++++++++++++ .../responses/true_id_response_spec.rb | 36 +- spec/support/lexis_nexis_fixtures.rb | 6 + 3 files changed, 797 insertions(+), 10 deletions(-) create mode 100644 spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json diff --git a/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json new file mode 100644 index 00000000000..b2a6d6421d2 --- /dev/null +++ b/spec/fixtures/proofing/lexis_nexis/true_id/true_id_response_attention_barcode_with_face_match_fail.json @@ -0,0 +1,765 @@ +{ + "Status": { + "ConversationId": "31000438698728", + "RequestId": "749574578", + "TransactionStatus": "passed", + "TransactionReasonCode": { + "Code": "trueid_pass", + "Description": "TRUEID PASS" + }, + "Reference": "923c0c86-6f68-47d6-979e-08ff9e53b631" + }, "Products": [ + { + "ProductType": "TrueID", + "ExecutedStepName": "True_ID_Step", + "ProductConfigurationName": "GSA.V3.TrueID.Flow", + "ProductStatus": "pass", + "ParameterDetails": [ + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocumentName", + "Values": [{"Value": "Maryland (MD) Driver's License - STAR"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocAuthResult", + "Values": [{"Value": "Attention"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocIssuerCode", + "Values": [{"Value": "MD"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocIssuerName", + "Values": [{"Value": "Maryland"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocIssuerType", + "Values": [{"Value": "StateProvince"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocClassCode", + "Values": [{"Value": "DriversLicense"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocClass", + "Values": [{"Value": "DriversLicense"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocClassName", + "Values": [{"Value": "Drivers License"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocIsGeneric", + "Values": [{"Value": "false"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocIssue", + "Values": [{"Value": "2016"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocIssueType", + "Values": [{"Value": "Driver's License - STAR"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DocSize", + "Values": [{"Value": "ID1"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "ClassificationMode", + "Values": [{"Value": "Automatic"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "OrientationChanged", + "Values": [{"Value": "true"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "PresentationChanged", + "Values": [{"Value": "false"}] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "Side", + "Values": [ + {"Value": "Front"}, + {"Value": "Back"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "GlareMetric", + "Values": [ + {"Value": "100"}, + {"Value": "100"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "SharpnessMetric", + "Values": [ + {"Value": "65"}, + {"Value": "65"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "IsTampered", + "Values": [ + {"Value": "0"}, + {"Value": "0"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "IsCropped", + "Values": [ + {"Value": "1"}, + {"Value": "1"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "HorizontalResolution", + "Values": [ + {"Value": "600"}, + {"Value": "600"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "VerticalResolution", + "Values": [ + {"Value": "600"}, + {"Value": "600"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "Light", + "Values": [ + {"Value": "White"}, + {"Value": "White"} + ] + }, + { + "Group": "IMAGE_METRICS_RESULT", + "Name": "MimeType", + "Values": [ + {"Value": "image/vnd.ms-photo"}, + {"Value": "image/vnd.ms-photo"} + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "FullName", + "Values": [{"Value": "DAVID LICENSE SAMPLE"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Sex", + "Values": [{"Value": "Male"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Age", + "Values": [{"Value": "33"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DOB_Year", + "Values": [{"Value": "1986"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DOB_Month", + "Values": [{"Value": "10"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "DOB_Day", + "Values": [{"Value": "13"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "ExpirationDate_Year", + "Values": [{"Value": "2099"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "ExpirationDate_Month", + "Values": [{"Value": "10"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "ExpirationDate_Day", + "Values": [{"Value": "15"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_1_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_2_AlertName", + "Values": [{"Value": "2D Barcode Content"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_3_AlertName", + "Values": [{"Value": "2D Barcode Read"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_4_AlertName", + "Values": [{"Value": "Birth Date Crosscheck"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_5_AlertName", + "Values": [{"Value": "Birth Date Valid"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_6_AlertName", + "Values": [{"Value": "Document Classification"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_7_AlertName", + "Values": [{"Value": "Document Crosscheck Aggregation"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_8_AlertName", + "Values": [{"Value": "Document Expired"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_9_AlertName", + "Values": [{"Value": "Document Number Crosscheck"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_10_AlertName", + "Values": [{"Value": "Expiration Date Crosscheck"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_11_AlertName", + "Values": [{"Value": "Expiration Date Valid"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_12_AlertName", + "Values": [{"Value": "Full Name Crosscheck"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_13_AlertName", + "Values": [{"Value": "Issue Date Crosscheck"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_14_AlertName", + "Values": [{"Value": "Issue Date Valid"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_15_AlertName", + "Values": [{"Value": "Sex Crosscheck"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_16_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_17_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_18_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_19_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_20_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_21_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_22_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_23_AlertName", + "Values": [{"Value": "Visible Pattern"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_1_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_2_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Checked the contents of the two-dimensional barcode on the document." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_3_AuthenticationResult", + "Values": [ + { + "Value": "Attention", + "Detail": "Verified that the two-dimensional barcode on the document was read successfully." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_4_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compare the machine-readable birth date field to the human-readable birth date field." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_5_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified that the birth date is valid." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_6_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified that the type of document is supported and is able to be fully authenticated." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_7_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compared the machine-readable fields to the human-readable fields." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_8_AuthenticationResult", + "Values": [ + {"Value": "Passed", "Detail": "Checked if the document is expired."} + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_9_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compare the machine-readable document number field to the human-readable document number field." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_10_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compare the machine-readable expiration date field to the human-readable expiration date field." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_11_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified that the expiration date is valid." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_12_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compare the machine-readable full name field to the human-readable full name field." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_13_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compare the machine-readable issue date field to the human-readable issue date field." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_14_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified that the issue date is valid." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_15_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Compare the machine-readable sex field to the human-readable sex field." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_16_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_17_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_18_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_19_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_20_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_21_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_22_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_23_AuthenticationResult", + "Values": [ + { + "Value": "Passed", + "Detail": "Verified the presence of a pattern on the visible image." + } + ] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_1_Regions", + "Values": [{"Value": "Background Stripes"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_16_Regions", + "Values": [{"Value": "Flag"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_17_Regions", + "Values": [{"Value": "Red Background Center"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_18_Regions", + "Values": [{"Value": "Background Above Secondary Photo"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_19_Regions", + "Values": [{"Value": "Oval Edge"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_20_Regions", + "Values": [{"Value": "Curved Lines"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_21_Regions", + "Values": [{"Value": "Bottom Left Background"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_22_Regions", + "Values": [{"Value": "Center Background"}] + }, + { + "Group": "AUTHENTICATION_RESULT", + "Name": "Alert_23_Regions", + "Values": [{"Value": "Right Background"}] + }, + { + "Group": "PORTRAIT_MATCH_RESULT", + "Name": "FaceMatchResult", + "Values": [{"Value": "Fail"}] + }, + { + "Group": "PORTRAIT_MATCH_RESULT", + "Name": "FaceMatchScore", + "Values": [{"Value": "50"}] + }, + { + "Group": "PORTRAIT_MATCH_RESULT", + "Name": "FaceStatusCode", + "Values": [{"Value": "1"}] + }, + { + "Group": "PORTRAIT_MATCH_RESULT", + "Name": "FaceErrorMessage", + "Values": [{"Value": "Successful. Liveness: Live"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_FullName", + "Values": [{"Value": "DAVID LICENSE SAMPLE"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_Surname", + "Values": [{"Value": "SAMPLE"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_GivenName", + "Values": [{"Value": "DAVID LICENSE"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_FirstName", + "Values": [{"Value": "DAVID"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_MiddleName", + "Values": [{"Value": "LICENSE"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_DOB_Year", + "Values": [{"Value": "1986"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_DOB_Month", + "Values": [{"Value": "10"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_DOB_Day", + "Values": [{"Value": "13"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_DocumentClassName", + "Values": [{"Value": "Drivers License"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_DocumentNumber", + "Values": [{"Value": "M555555555555"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_ExpirationDate_Year", + "Values": [{"Value": "2099"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_ExpirationDate_Month", + "Values": [{"Value": "10"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_xpirationDate_Day", + "Values": [{"Value": "15"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_IssuingStateCode", + "Values": [{"Value": "MD"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_IssuingStateName", + "Values": [{"Value": "Maryland"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_Address", + "Values": [{"Value": "123 ABC AVExE2x80xA8ANYTOWN, MD 12345"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_AddressLine1", + "Values": [{"Value": "123 ABC AVE"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_City", + "Values": [{"Value": "ANYTOWN"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_State", + "Values": [{"Value": "MD"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_PostalCode", + "Values": [{"Value": "12345"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_Sex", + "Values": [{"Value": "M"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_Height", + "Values": [{"Value": "5' 10\""}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_IssueDate_Year", + "Values": [{"Value": "2016"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_IssueDate_Month", + "Values": [{"Value": "10"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_IssueDate_Day", + "Values": [{"Value": "15"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_LicenseClass", + "Values": [{"Value": "C"}] + }, + { + "Group": "IDAUTH_FIELD_DATA", + "Name": "Fields_LicenseRestrictions", + "Values": [{"Value": "B"}] + } + ] + }, + { + "ProductType": "TrueID_Decision", + "ExecutedStepName": "Decision", + "ProductConfigurationName": "TRUEID_PASS", + "ProductStatus": "pass", + "ProductReason": { + "Code": "trueid_pass", + "Description": "TRUEID PASS" + } + } +] +} 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 7eb9b77643a..ea80e02f749 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 @@ -39,6 +39,9 @@ let(:attention_barcode_read) do instance_double(Faraday::Response, status: 200, body: LexisNexisFixtures.true_id_barcode_read_attention) end + let(:attention_barcode_read_with_face_match_fail) do + instance_double(Faraday::Response, status: 200, body: LexisNexisFixtures.true_id_barcode_read_attention_with_face_match_fail) + end let(:failure_response_no_liveness_low_dpi) do instance_double(Faraday::Response, status: 200, body: LexisNexisFixtures.true_id_response_failure_no_liveness_low_dpi) end @@ -695,18 +698,17 @@ def get_decision_product(resp) end describe '#successful_result?' do - context 'when all checks other than selfie pass' do - context 'and selfie check is enabled' do - liveness_checking_enabled = true - - it 'returns true with a passing selfie' do - response = described_class.new( - success_with_liveness_response, config, liveness_checking_enabled - ) + context 'and selfie check is enabled' do + liveness_checking_enabled = true - expect(response.successful_result?).to eq(true) - end + it 'returns true with a passing selfie' do + response = described_class.new( + success_with_liveness_response, config, liveness_checking_enabled + ) + expect(response.successful_result?).to eq(true) + end + context 'when portrait match fails' do it 'returns false with a failing selfie' do response = described_class.new( failure_response_face_match_fail, config, liveness_checking_enabled @@ -714,6 +716,20 @@ def get_decision_product(resp) expect(response.successful_result?).to eq(false) end + context 'when attention with barcode' do + let(:response) do + described_class.new( + attention_barcode_read_with_face_match_fail, + config, + liveness_checking_enabled, + ) + end + + it 'returns false' do + expect(response.doc_auth_success?).to eq(true) + expect(response.successful_result?).to eq(false) + end + end end context 'and selfie check is disabled' do diff --git a/spec/support/lexis_nexis_fixtures.rb b/spec/support/lexis_nexis_fixtures.rb index 922cf8026d2..c9782428861 100644 --- a/spec/support/lexis_nexis_fixtures.rb +++ b/spec/support/lexis_nexis_fixtures.rb @@ -148,6 +148,12 @@ def true_id_barcode_read_attention read_fixture_file_at_path('true_id/true_id_response_attention_barcode.json') end + def true_id_barcode_read_attention_with_face_match_fail + read_fixture_file_at_path( + 'true_id/true_id_response_attention_barcode_with_face_match_fail.json', + ) + end + def true_id_failure_empty read_fixture_file_at_path('true_id/true_id_response_failure_empty.json') end From f59c31291859d90271aa473f2724c8fe3de43e43 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey Date: Wed, 14 Feb 2024 11:31:38 -0500 Subject: [PATCH 4/4] fix liveness_checking_enabled defn --- .../doc_auth/lexis_nexis/responses/true_id_response_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ea80e02f749..bc20b791e96 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 @@ -699,7 +699,7 @@ def get_decision_product(resp) describe '#successful_result?' do context 'and selfie check is enabled' do - liveness_checking_enabled = true + let(:liveness_checking_enabled) { true } it 'returns true with a passing selfie' do response = described_class.new(