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
2 changes: 1 addition & 1 deletion app/forms/idv/phone_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def valid_phone_for_allowed_countries?(phone)
def phone_info
return @phone_info if defined?(@phone_info)

if phone.blank? || !IdentityConfig.store.voip_check
if phone.blank? || !IdentityConfig.store.phone_service_check
@phone_info = nil
else
@phone_info = Telephony.phone_info(phone)
Expand Down
4 changes: 2 additions & 2 deletions app/forms/new_phone_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def delivery_preference_voice?
def phone_info
return @phone_info if defined?(@phone_info)

if phone.blank? || !IdentityConfig.store.voip_check
if phone.blank? || !IdentityConfig.store.phone_service_check
@phone_info = nil
else
@phone_info = Telephony.phone_info(phone)
Expand Down Expand Up @@ -91,7 +91,7 @@ def extra_analytics_attributes
end

def validate_not_voip
return if phone.blank? || !IdentityConfig.store.voip_check
return if phone.blank? || !IdentityConfig.store.phone_service_check
return unless IdentityConfig.store.voip_block

if phone_info.type == :voip &&
Expand Down
2 changes: 1 addition & 1 deletion config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ personal_key_retired: true
phone_carrier_registration_blocklist: ''
phone_confirmation_max_attempts: 20
phone_confirmation_max_attempt_window_in_minutes: 1_440
phone_service_check: true
phone_setups_per_ip_limit: 25
phone_setups_per_ip_period: 300
phone_setups_per_ip_track_only_mode: false
Expand Down Expand Up @@ -325,7 +326,6 @@ get_usps_proofing_results_job_reprocess_delay_minutes: 5
get_usps_proofing_results_job_request_delay_milliseconds: 1000
voice_otp_pause_time: '0.5s'
voice_otp_speech_rate: 'slow'
voip_check: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I expect we're using the default value in most live environments, but it might be a good idea to do a pass for how it's configured, and update for the rename or remove redundant configurations.

voip_block: true
voip_allowed_phones: '[]'

Expand Down
2 changes: 1 addition & 1 deletion lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def self.build_store(config_map)
config.add(:piv_cac_service_timeout, type: :float)
config.add(:piv_cac_verify_token_secret)
config.add(:piv_cac_verify_token_url)
config.add(:phone_service_check, type: :boolean)
config.add(:phone_setups_per_ip_track_only_mode, type: :boolean)
config.add(:platform_auth_set_up_enabled, type: :boolean)
config.add(:poll_rate_for_verify_in_seconds, type: :integer)
Expand Down Expand Up @@ -424,7 +425,6 @@ def self.build_store(config_map)
config.add(:voice_otp_speech_rate)
config.add(:voip_allowed_phones, type: :json)
config.add(:voip_block, type: :boolean)
config.add(:voip_check, type: :boolean)

@key_types = config.key_types
@store = RedactedStruct.new('IdentityConfig', *config.written_env.keys, keyword_init: true).
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/users/phone_setup_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe Users::PhoneSetupController do
before do
allow(IdentityConfig.store).to receive(:voip_check).and_return(true)
allow(IdentityConfig.store).to receive(:phone_service_check).and_return(true)
allow(IdentityConfig.store).to receive(:voip_block).and_return(true)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/phone/add_phone_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@

scenario 'adding a VOIP phone' do
allow(IdentityConfig.store).to receive(:voip_block).and_return(true)
allow(IdentityConfig.store).to receive(:voip_check).and_return(true)
allow(IdentityConfig.store).to receive(:phone_service_check).and_return(true)

user = create(:user, :signed_up)

Expand Down
10 changes: 5 additions & 5 deletions spec/forms/new_phone_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
end

before do
allow(IdentityConfig.store).to receive(:voip_check).and_return(true)
allow(IdentityConfig.store).to receive(:phone_service_check).and_return(true)

expect(Telephony).to receive(:phone_info).with(phone).
and_raise(Aws::Pinpoint::Errors::BadRequestException.new(nil, nil))
Expand All @@ -209,11 +209,11 @@
context 'voip numbers' do
let(:telephony_gem_voip_number) { '+12255552000' }
let(:voip_block) { false }
let(:voip_check) { true }
let(:phone_service_check) { true }

before do
allow(IdentityConfig.store).to receive(:voip_block).and_return(voip_block)
allow(IdentityConfig.store).to receive(:voip_check).and_return(voip_check)
allow(IdentityConfig.store).to receive(:phone_service_check).and_return(phone_service_check)
end

subject(:result) do
Expand Down Expand Up @@ -262,7 +262,7 @@
end

context 'when voip checks are disabled' do
let(:voip_check) { false }
let(:phone_service_check) { false }

it 'does not check the phone type' do
expect(Telephony).to_not receive(:phone_info)
Expand All @@ -289,7 +289,7 @@
end

context 'when voip checks are disabled' do
let(:voip_check) { false }
let(:phone_service_check) { false }

it 'does not check the phone type' do
expect(Telephony).to_not receive(:phone_info)
Expand Down