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: 1 addition & 0 deletions app/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Profile < ApplicationRecord
legacy_unsupervised: 1,
legacy_in_person: 2,
unsupervised_with_selfie: 3,
in_person: 4,
}

attr_reader :personal_key
Expand Down
6 changes: 5 additions & 1 deletion app/services/idv/profile_maker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def save_profile(

def set_idv_level(in_person_verification_needed:, selfie_check_performed:)
if in_person_verification_needed
:legacy_in_person
if IdentityConfig.store.in_person_proofing_enforce_tmx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting here that I will add a check for FeatureManagement.proofing_device_profiling_decisioning_enabled? in a separate pull request.

:in_person
else
:legacy_in_person
end
elsif FeatureManagement.idv_allow_selfie_check? && selfie_check_performed
:unsupervised_with_selfie
else
Expand Down
10 changes: 6 additions & 4 deletions spec/features/idv/analytics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,21 +510,21 @@
in_person_verification_pending: true,
address_verification_method: 'phone',
encrypted_profiles_missing: false,
active_profile_idv_level: nil, pending_profile_idv_level: 'legacy_in_person',
active_profile_idv_level: nil, pending_profile_idv_level: 'in_person',
proofing_components: { document_check: 'usps', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'lexis_nexis_address' }
},
'IdV: personal key acknowledgment toggled' => {
checked: true,
active_profile_idv_level: nil, pending_profile_idv_level: 'legacy_in_person',
active_profile_idv_level: nil, pending_profile_idv_level: 'in_person',
proofing_components: { document_check: 'usps', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'lexis_nexis_address' }
},
'IdV: personal key submitted' => {
address_verification_method: 'phone', fraud_review_pending: false, fraud_rejection: false, in_person_verification_pending: true, deactivation_reason: nil,
active_profile_idv_level: nil, pending_profile_idv_level: 'legacy_in_person',
active_profile_idv_level: nil, pending_profile_idv_level: 'in_person',
proofing_components: { document_check: 'usps', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'lexis_nexis_address' }
},
'IdV: in person ready to verify visited' => {
active_profile_idv_level: nil, pending_profile_idv_level: 'legacy_in_person',
active_profile_idv_level: nil, pending_profile_idv_level: 'in_person',
proofing_components: { document_check: 'usps', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'lexis_nexis_address' }
},
'IdV: user clicked what to bring link on ready to verify page' => {},
Expand Down Expand Up @@ -867,6 +867,8 @@
to receive(:service_provider_homepage_url).and_return(return_sp_url)
allow_any_instance_of(Idv::InPerson::ReadyToVerifyPresenter).
to receive(:sp_name).and_return(sp_friendly_name)
allow(IdentityConfig.store).to receive(:in_person_proofing_enforce_tmx).
and_return(true)

start_idv_from_sp(:saml)
sign_in_and_2fa_user(user)
Expand Down
89 changes: 68 additions & 21 deletions spec/services/idv/profile_maker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let(:user) { create(:user, :fully_registered) }
let(:user_password) { user.password }
let(:initiating_service_provider) { nil }
let(:in_person_proofing_enforce_tmx_mock) { false }

subject do
described_class.new(
Expand Down Expand Up @@ -135,28 +136,74 @@
end

context 'with in_person_verification_needed' do
let(:profile) do
subject.save_profile(
fraud_pending_reason: nil,
gpo_verification_needed: false,
deactivation_reason: nil,
in_person_verification_needed: true,
selfie_check_performed: false,
)
end
it 'creates a pending profile for in person verification' do
expect(profile.activated_at).to be_nil
expect(profile.active).to eq(false)
expect(profile.deactivation_reason).to be_nil
expect(profile.fraud_pending_reason).to be_nil
expect(profile.in_person_verification_pending?).to eq(true)
expect(profile.fraud_review_pending?).to eq(false)
expect(profile.gpo_verification_pending_at.present?).to eq(false)
expect(profile.initiating_service_provider).to eq(nil)
expect(profile.verified_at).to be_nil
context 'when threatmetrix decisioning is disabled' do
before do
allow(IdentityConfig.store).to receive(:in_person_proofing_enforce_tmx).
and_return(in_person_proofing_enforce_tmx_mock)
end

let(:profile) do
subject.save_profile(
fraud_pending_reason: nil,
gpo_verification_needed: false,
deactivation_reason: nil,
in_person_verification_needed: true,
selfie_check_performed: false,
)
end

it 'creates a pending profile for in person verification' do
expect(profile.activated_at).to be_nil
expect(profile.active).to eq(false)
expect(profile.deactivation_reason).to be_nil
expect(profile.fraud_pending_reason).to be_nil
expect(profile.in_person_verification_pending?).to eq(true)
expect(profile.fraud_review_pending?).to eq(false)
expect(profile.gpo_verification_pending_at.present?).to eq(false)
expect(profile.initiating_service_provider).to eq(nil)
expect(profile.verified_at).to be_nil
end

it 'marks the profile as legacy_in_person' do
expect(profile.idv_level).to eql('legacy_in_person')
end
end
it 'marks the profile as legacy_in_person' do
expect(profile.idv_level).to eql('legacy_in_person')
end

context 'with in_person_verification_needed' do
context 'when threatmetrix decisioning is enabled' do
let(:in_person_proofing_enforce_tmx_mock) { true }

before do
allow(IdentityConfig.store).to receive(:in_person_proofing_enforce_tmx).
and_return(in_person_proofing_enforce_tmx_mock)
end

let(:profile) do
subject.save_profile(
fraud_pending_reason: nil,
gpo_verification_needed: false,
deactivation_reason: nil,
in_person_verification_needed: true,
selfie_check_performed: false,
)
end

it 'creates a pending profile for in person verification' do
expect(profile.activated_at).to be_nil
expect(profile.active).to eq(false)
expect(profile.deactivation_reason).to be_nil
expect(profile.fraud_pending_reason).to be_nil
expect(profile.in_person_verification_pending?).to eq(true)
expect(profile.fraud_review_pending?).to eq(false)
expect(profile.gpo_verification_pending_at.present?).to eq(false)
expect(profile.initiating_service_provider).to eq(nil)
expect(profile.verified_at).to be_nil
end

it 'marks the profile as in_person' do
expect(profile.idv_level).to eql('in_person')
end
end
end

Expand Down