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
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ gem 'rack-timeout', require: false
gem 'redacted_struct'
gem 'redis', '>= 3.2.0'
gem 'redis-namespace'
gem 'redis-session-store', '>= 0.11.4'
gem 'redis-session-store', github: '18F/redis-session-store', tag: 'v0.12-18f'
gem 'retries'
gem 'rotp', '~> 6.1'
gem 'rqrcode'
Expand All @@ -72,7 +72,7 @@ gem 'view_component', '~> 2.82.0'
gem 'webauthn', '~> 2.5.2'
gem 'xmldsig', '~> 0.6'
gem 'xmlenc', '~> 0.7', '>= 0.7.1'
gem 'yard'
gem 'yard', require: false

# This version of the zxcvbn gem matches the data and behavior of the zxcvbn NPM package.
# It should not be updated without verifying that the behavior still matches JS version 4.4.2.
Expand Down
24 changes: 15 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ GIT
specs:
identity_validations (0.7.2)

GIT
remote: https://github.com/18F/redis-session-store.git
revision: 253aa4f466cf61e129625ea01d1f120fb9c8685d
tag: v0.12-18f
specs:
redis-session-store (0.12.pre.18f)
actionpack (>= 6, < 8)
redis (>= 3, < 6)

GIT
remote: https://github.com/18F/saml_idp.git
revision: d8e7deb7da3aa43bae0e5b0891c8de123d492484
Expand Down Expand Up @@ -213,8 +222,8 @@ GEM
coderay (1.1.3)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.2.0)
connection_pool (2.2.5)
concurrent-ruby (1.2.2)
connection_pool (2.3.0)
cose (1.3.0)
cbor (~> 0.5.9)
openssl-signature_algorithm (~> 1.0)
Expand Down Expand Up @@ -394,7 +403,7 @@ GEM
mini_histogram (0.3.1)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.17.0)
minitest (5.18.0)
msgpack (1.6.0)
multiset (0.5.3)
nenv (0.3.0)
Expand Down Expand Up @@ -521,15 +530,12 @@ GEM
ffi (~> 1.0)
redacted_struct (1.1.0)
redcarpet (3.6.0)
redis (5.0.5)
redis (5.0.6)
redis-client (>= 0.9.0)
redis-client (0.12.0)
redis-client (0.14.0)
connection_pool
redis-namespace (1.8.1)
redis (>= 3.0.4)
redis-session-store (0.11.5)
actionpack (>= 6, < 8)
redis (>= 3, < 6)
regexp_parser (2.6.1)
reline (0.2.7)
io-console (~> 0.5)
Expand Down Expand Up @@ -797,7 +803,7 @@ DEPENDENCIES
redacted_struct
redis (>= 3.2.0)
redis-namespace
redis-session-store (>= 0.11.4)
redis-session-store!
retries
rotp (~> 6.1)
rqrcode
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/idv/address_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class AddressController < ApplicationController

def new
analytics.idv_address_visit

@presenter = AddressPresenter.new(pii: @pii)
end

def update
Expand Down
1 change: 0 additions & 1 deletion app/controllers/idv/in_person/usps_locations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def update_params
params.require(:usps_location).permit(
:formatted_city_state_zip,
:name,
:phone,
:saturday_hours,
:street_address,
:sunday_hours,
Expand Down
7 changes: 6 additions & 1 deletion app/forms/idv/in_person/address_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ def self.model_name
def submit(params)
consume_params(params)

cleaned_errors = errors.deep_dup
cleaned_errors.delete(:city, :nontransliterable_field)
cleaned_errors.delete(:address1, :nontransliterable_field)
cleaned_errors.delete(:address2, :nontransliterable_field)

FormResponse.new(
success: valid?,
errors: errors,
errors: cleaned_errors,
)
end

Expand Down
6 changes: 5 additions & 1 deletion app/forms/idv/state_id_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ def initialize(pii)
def submit(params)
consume_params(params)

cleaned_errors = errors.deep_dup
cleaned_errors.delete(:first_name, :nontransliterable_field)
cleaned_errors.delete(:last_name, :nontransliterable_field)

FormResponse.new(
success: valid?,
errors: errors,
errors: cleaned_errors,
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ export interface PostOffice {
city: string;
distance: string;
name: string;
phone: string;
saturday_hours: string;
state: string;
sunday_hours: string;
tty: string;
weekday_hours: string;
zip_code_4: string;
zip_code_5: string;
Expand Down Expand Up @@ -49,11 +47,9 @@ const formatLocations = (postOffices: PostOffice[]): FormattedLocation[] =>
id: index,
distance: po.distance,
name: po.name,
phone: po.phone,
saturdayHours: po.saturday_hours,
streetAddress: po.address,
sundayHours: po.sunday_hours,
tty: po.tty,
weekdayHours: po.weekday_hours,
isPilot: !!po.is_pilot,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ interface PostOffice {
address: string;
city: string;
name: string;
phone: string;
saturday_hours: string;
state: string;
sunday_hours: string;
Expand All @@ -25,7 +24,6 @@ interface FormattedLocation {
formattedCityStateZip: string;
id: number;
name: string;
phone: string;
saturdayHours: string;
streetAddress: string;
sundayHours: string;
Expand Down Expand Up @@ -53,7 +51,6 @@ const formatLocation = (postOffices: PostOffice[]) => {
formattedCityStateZip: `${po.city}, ${po.state}, ${po.zip_code_5}-${po.zip_code_4}`,
id: index,
name: po.name,
phone: po.phone,
saturdayHours: po.saturday_hours,
streetAddress: po.address,
sundayHours: po.sunday_hours,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export interface FormattedLocation {
distance: string;
id: number;
name: string;
phone: string;
saturdayHours: string;
streetAddress: string;
sundayHours: string;
Expand Down Expand Up @@ -55,7 +54,6 @@ function InPersonLocations({ locations, onSelect, address }: InPersonLocationsPr
streetAddress={item.streetAddress}
selectId={item.id}
formattedCityStateZip={item.formattedCityStateZip}
phone={item.phone}
weekdayHours={item.weekdayHours}
saturdayHours={item.saturdayHours}
sundayHours={item.sundayHours}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ describe('LocationCollectionItem', () => {
const { getByText } = render(
<LocationCollectionItem
distance="1.0 mi"
phone="555-123-4567"
name=""
streetAddress="123 Test Address"
formattedCityStateZip=""
Expand All @@ -81,7 +80,6 @@ describe('LocationCollectionItem', () => {

const addressParent = getByText('123 Test Address').parentElement!;
expect(addressParent.textContent).to.contain('in_person_proofing.body.location.distance');
expect(addressParent.textContent).to.contain('555-123-4567');
});

context('when no retail hours are known', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ interface LocationCollectionItemProps {
formattedCityStateZip: string;
handleSelect: (event: React.FormEvent<HTMLInputElement>, selection: number) => void;
name?: string;
phone?: string;
saturdayHours: string;
selectId: number;
streetAddress: string;
Expand All @@ -19,7 +18,6 @@ function LocationCollectionItem({
formattedCityStateZip,
handleSelect,
name,
phone,
saturdayHours,
selectId,
streetAddress,
Expand Down Expand Up @@ -62,12 +60,6 @@ function LocationCollectionItem({
{`${t('in_person_proofing.body.location.retail_hours_sun')} ${sundayHours}`}
</div>
)}
{phone && (
<div>
<h4>{t('in_person_proofing.body.location.contact_info_heading')}</h4>
<div>{`${t('in_person_proofing.body.location.phone')} ${phone}`}</div>
</div>
)}
<Button
id={`location_button_mobile_${selectId}`}
className="tablet:display-none margin-top-2 width-full"
Expand Down
21 changes: 0 additions & 21 deletions app/javascript/packages/personal-key-input/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions app/javascript/packages/personal-key-input/index.spec.js

This file was deleted.

10 changes: 0 additions & 10 deletions app/javascript/packages/personal-key-input/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion app/javascript/packs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ import { FormSteps } from '@18f/identity-form-steps';

const appRoot = document.getElementById('app-root');

render(<FormSteps initialValues={{ personalKey: appRoot.dataset.personalKey }} />, appRoot);
render(<FormSteps initialValues={appRoot.dataset} />, appRoot);
```
19 changes: 19 additions & 0 deletions app/jobs/fraud_rejection_daily_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class FraudRejectionDailyJob < ApplicationJob
queue_as :low

def perform(_date)
profiles_eligible_for_fraud_rejection.find_each do |profile|
analytics.automatic_fraud_rejection(verified_at: profile.verified_at)
profile.reject_for_fraud(notify_user: false)
end
end

private

def profiles_eligible_for_fraud_rejection
Profile.where(
fraud_review_pending: true,
verified_at: ..30.days.ago,
)
end
end
4 changes: 2 additions & 2 deletions app/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def deactivate_for_fraud_review
update!(active: false, fraud_review_pending: true, fraud_rejection: false)
end

def reject_for_fraud
def reject_for_fraud(notify_user:)
update!(active: false, fraud_review_pending: false, fraud_rejection: true)
UserAlerts::AlertUserAboutAccountRejected.call(user)
UserAlerts::AlertUserAboutAccountRejected.call(user) if notify_user
end

def decrypt_pii(password)
Expand Down
31 changes: 31 additions & 0 deletions app/presenters/idv/address_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Idv
class AddressPresenter
def initialize(pii:)
@pii = pii
end

def puerto_rico_address?
@pii[:state] == 'PR'
end

def pii
@pii
end

def address_line1_hint
"#{I18n.t('forms.example')} 150 Calle A Apt 3" if puerto_rico_address?
end

def address_line2_hint
"#{I18n.t('forms.example')} URB Las Gladiolas" if puerto_rico_address?
end

def city_hint
"#{I18n.t('forms.example')} San Juan" if puerto_rico_address?
end

def zipcode_hint
"#{I18n.t('forms.example')} 00926" if puerto_rico_address?
end
end
end
10 changes: 10 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ def authentication_confirmation_reset
track_event('Authentication Confirmation: Reset selected')
end

# @param [Date] verified_at
# Tracks when a profile is automatically rejected due to being under review for 30 days
def automatic_fraud_rejection(verified_at:, **extra)
track_event(
'Fraud: Automatic Fraud Rejection',
verified_at: verified_at,
**extra,
)
end

# Tracks when the user creates a set of backup mfa codes.
# @param [Integer] enabled_mfa_methods_count number of registered mfa methods for the user
def backup_code_created(enabled_mfa_methods_count:, **extra)
Expand Down
Loading