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
8 changes: 0 additions & 8 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1323,14 +1323,6 @@ def idv_doc_auth_link_sent_visited(**extra)
track_event('IdV: doc auth link_sent visited', **extra)
end

def idv_doc_auth_randomizer_defaulted(**extra)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This turned out to be unused.

track_event(
'IdV: doc_auth random vendor error',
error: 'document_capture_session_uuid_key missing',
**extra,
)
end

def idv_doc_auth_redo_ssn_submitted(**extra)
track_event('IdV: doc auth redo_ssn submitted', **extra)
end
Expand Down
11 changes: 8 additions & 3 deletions app/services/doc_auth_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,14 @@ def self.client(vendor:, warn_notifier: nil)
# rubocop:enable Layout/LineLength

def self.doc_auth_vendor_for_bucket(bucket)
bucket == :alternate_vendor ?
IdentityConfig.store.doc_auth_vendor_randomize_alternate_vendor :
IdentityConfig.store.doc_auth_vendor
case bucket
when :socure
Idp::Constants::Vendors::SOCURE
when :lexis_nexis
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is here since they are a vendor, even though they are currently set to the default.

Copy link
Copy Markdown
Contributor

@amirbey amirbey Aug 26, 2024

Choose a reason for hiding this comment

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

this would never get a hit in the current implementation right? we would have to add a :lexis_nexis bucket in DOC_AUTH_VENDOR, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'm wondering if there is a comment that could be added to make this clear ... so that someone could know that extra code is needed to make this bucket possible to be hit

Idp::Constants::Vendors::LEXIS_NEXIS
else # e.g., nil
IdentityConfig.store.doc_auth_vendor_default
end
end

def self.doc_auth_vendor(
Expand Down
1 change: 0 additions & 1 deletion app/services/idv/analytics_events_enhancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module AnalyticsEventsEnhancer
idv_doc_auth_hybrid_handoff_visited
idv_doc_auth_link_sent_submitted
idv_doc_auth_link_sent_visited
idv_doc_auth_randomizer_defaulted
idv_doc_auth_redo_ssn_submitted
idv_doc_auth_ssn_submitted
idv_doc_auth_ssn_visited
Expand Down
11 changes: 7 additions & 4 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ doc_auth_max_submission_attempts_before_native_camera: 3
doc_auth_selfie_desktop_test_mode: false
doc_auth_separate_pages_enabled: false
doc_auth_supported_country_codes: '["US", "GU", "VI", "AS", "MP", "PR", "USA" ,"GUM", "VIR", "ASM", "MNP", "PRI"]'
doc_auth_vendor_randomize: false
doc_auth_vendor_randomize_alternate_vendor: ''
doc_auth_vendor_randomize_percent: 0
doc_auth_vendor_lexis_nexis_percent: 100 # note, LN is currently the default vendor
doc_auth_vendor_socure_percent: 0
doc_auth_vendor_switching_enabled: false
doc_capture_polling_enabled: true
doc_capture_request_valid_for_minutes: 15
drop_off_report_config: '[{"emails":["ursula@example.com"],"issuers": ["urn:gov:gsa:openidconnect.profiles:sp:sso:agency_name:app_name"]}]'
Expand Down Expand Up @@ -396,6 +396,7 @@ development:
dashboard_url: http://localhost:3001/api/service_providers
doc_auth_selfie_desktop_test_mode: true
doc_auth_vendor: 'mock'
doc_auth_vendor_default: 'mock'
domain_name: localhost:3000
enable_rate_limiting: false
hmac_fingerprinter_key: a2c813d4dca919340866ba58063e4072adc459b767a74cf2666d5c1eef3861db26708e7437abde1755eb24f4034386b0fea1850a1cb7e56bff8fae3cc6ade96c
Expand Down Expand Up @@ -452,7 +453,8 @@ production:
dashboard_url: https://dashboard.demo.login.gov
disable_email_sending: false
disable_logout_get_request: false
doc_auth_vendor: 'acuant'
doc_auth_vendor: 'lexisnexis'
doc_auth_vendor_default: 'lexisnexis'
domain_name: login.gov
email_registrations_per_ip_track_only_mode: true
enable_test_routes: false
Expand Down Expand Up @@ -507,6 +509,7 @@ test:
doc_auth_max_attempts: 4
doc_auth_selfie_desktop_test_mode: true
doc_auth_vendor: 'mock'
doc_auth_vendor_default: 'mock'
doc_capture_polling_enabled: false
domain_name: www.example.com
email_registrations_per_ip_limit: 3
Expand Down
10 changes: 7 additions & 3 deletions config/initializers/ab_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ def self.all
constants.index_with { |test_name| const_get(test_name) }
end

# This "test" will permanently be in place to allow a graceful transition from TrueID being the
# sole vendor to a multi-vendor configuration.
DOC_AUTH_VENDOR = AbTest.new(
experiment_name: 'Doc Auth Vendor',
should_log: /^idv/i,
default_bucket: :lexis_nexis,
buckets: {
alternate_vendor: IdentityConfig.store.doc_auth_vendor_randomize ?
IdentityConfig.store.doc_auth_vendor_randomize_percent :
0,
socure: IdentityConfig.store.doc_auth_vendor_switching_enabled ?
IdentityConfig.store.doc_auth_vendor_socure_percent : 0,
lexis_nexis: IdentityConfig.store.doc_auth_vendor_switching_enabled ?
IdentityConfig.store.doc_auth_vendor_lexis_nexis_percent : 0,
}.compact,
) do |service_provider:, session:, user:, user_session:, **|
document_capture_session_uuid_discriminator(service_provider:, session:, user:, user_session:)
Expand Down
2 changes: 1 addition & 1 deletion lib/ab_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class AbTest

MAX_SHA = (16 ** 64) - 1

# @param [Proc<String>,RegExp,string,Boolean,nil] should_log Controls whether bucket data for this
# @param [Proc<String>,Regexp,string,Boolean,nil] should_log Controls whether bucket data for this
# A/B test is logged with specific
# events.
# @yieldparam [ActionDispatch::Request] request
Expand Down
7 changes: 4 additions & 3 deletions lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ def self.store
config.add(:doc_auth_separate_pages_enabled, type: :boolean)
config.add(:doc_auth_supported_country_codes, type: :json)
config.add(:doc_auth_vendor, type: :string)
config.add(:doc_auth_vendor_randomize, type: :boolean)
config.add(:doc_auth_vendor_randomize_alternate_vendor, type: :string)
config.add(:doc_auth_vendor_randomize_percent, type: :integer)
config.add(:doc_auth_vendor_default, type: :string)
config.add(:doc_auth_vendor_lexis_nexis_percent, type: :integer)
config.add(:doc_auth_vendor_socure_percent, type: :integer)
config.add(:doc_auth_vendor_switching_enabled, type: :boolean)
config.add(:doc_capture_polling_enabled, type: :boolean)
config.add(:doc_capture_request_valid_for_minutes, type: :integer)
config.add(:drop_off_report_config, type: :json)
Expand Down
1 change: 1 addition & 0 deletions lib/idp/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Constants
module Vendors
ACUANT = 'acuant'
LEXIS_NEXIS = 'lexis_nexis'
SOCURE = 'socure'
MOCK = 'mock'
USPS = 'usps'
AAMVA = 'aamva'
Expand Down
20 changes: 7 additions & 13 deletions spec/config/initializers/ab_tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
RSpec.describe AbTests do
describe '#all' do
it 'returns all registered A/B tests' do
expect(AbTests.all).to match(
{
ACUANT_SDK: an_instance_of(AbTest),
DOC_AUTH_VENDOR: an_instance_of(AbTest),

},
)
expect(AbTests.all.values).to all(be_kind_of(AbTest))
end
end

Expand Down Expand Up @@ -119,20 +113,20 @@

let(:enable_ab_test) do
-> {
allow(IdentityConfig.store).to receive(:doc_auth_vendor).
allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).
and_return('vendor_a')
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize).
allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled).
and_return(true)
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_alternate_vendor).
and_return('vendor_b')
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_percent).
allow(IdentityConfig.store).to receive(:doc_auth_vendor_socure_percent).
and_return(50)
allow(IdentityConfig.store).to receive(:doc_auth_vendor_lexis_nexis_percent).
and_return(30)
}
end

let(:disable_ab_test) do
-> {
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize).
allow(IdentityConfig.store).to receive(:doc_auth_vendor_switching_enabled).
and_return(false)
}
end
Expand Down
38 changes: 0 additions & 38 deletions spec/services/doc_auth_router_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,6 @@
end
end

describe '.doc_auth_vendor' do
def reload_ab_test_initializer!
# undefine the AB tests instances so we can re-initialize them with different config values
AbTests.constants.each do |const_name|
AbTests.class_eval { remove_const(const_name) }
end
load Rails.root.join('config', 'initializers', 'ab_tests.rb').to_s
end

let(:doc_auth_vendor) { 'test1' }
let(:doc_auth_vendor_randomize_alternate_vendor) { 'test2' }
let(:analytics) { FakeAnalytics.new }
let(:doc_auth_vendor_randomize_percent) { 57 }
let(:doc_auth_vendor_randomize) { true }

before do
allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return(doc_auth_vendor)
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_alternate_vendor).
and_return(doc_auth_vendor_randomize_alternate_vendor)

allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_percent).
and_return(doc_auth_vendor_randomize_percent)
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize).
and_return(doc_auth_vendor_randomize)

reload_ab_test_initializer!
end

after do
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize_percent).
and_call_original
allow(IdentityConfig.store).to receive(:doc_auth_vendor_randomize).
and_call_original

reload_ab_test_initializer!
end
end

describe DocAuthRouter::DocAuthErrorTranslatorProxy do
subject(:proxy) do
DocAuthRouter::DocAuthErrorTranslatorProxy.new(DocAuth::Mock::DocAuthMockClient.new)
Expand Down
4 changes: 2 additions & 2 deletions spec/services/idv/proofing_components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
let(:pii_from_doc) { Idp::Constants::MOCK_IDV_APPLICANT }

before do
allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return('test_vendor')
allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return('test_vendor')
idv_session.mark_verify_info_step_complete!
idv_session.address_verification_mechanism = 'gpo'
allow(FeatureManagement).to receive(:proofing_device_profiling_collecting_enabled?).
Expand Down Expand Up @@ -78,7 +78,7 @@

context 'doc auth' do
before do
allow(IdentityConfig.store).to receive(:doc_auth_vendor).and_return('test_vendor')
allow(IdentityConfig.store).to receive(:doc_auth_vendor_default).and_return('test_vendor')
end
context 'before doc auth complete' do
it 'returns nil' do
Expand Down