Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d9abb97
LG-11553 Remove recovery PII re-encryption from `PersonalKeyVerificat…
jmhooper Nov 16, 2023
8aff3ea
LG-11573: Add RISC events for account suspension, account reinstateme…
olatifflexion Nov 16, 2023
05b9e58
LG-11534 Load the active profile from the session on broken personal …
jmhooper Nov 16, 2023
82cd349
Restructure analytics error_details as hash (#9572)
aduth Nov 16, 2023
314baf7
Remove failure_reason from Attempts API stub (#9576)
zachmargolis Nov 16, 2023
e958e9d
Use Icon List component for requested attributes consent (#9555)
aduth Nov 16, 2023
4e01839
Update AAMVA test scripts (#9608)
zachmargolis Nov 17, 2023
992c728
LG 11432 Prevent duplicate F/T setup if user hits back button on seco…
kevinsmaster5 Nov 17, 2023
515a919
LG 11145 Break up MFA selection presenter classes for Phone Presenter…
kevinsmaster5 Nov 17, 2023
1611540
Refactor WebauthnVerificationForm to handle error messages (#9613)
aduth Nov 17, 2023
7f80d9d
Add analytics property for WebAuthn sign-in frontend error (#9611)
aduth Nov 17, 2023
3f46adc
Finalize cleanup for MFA selection presenters (#9612)
aduth Nov 17, 2023
1261184
Use ActiveRecord built-in validator for WebAuthn error validation (#9…
aduth Nov 17, 2023
821f38d
LG-11535 Encrypt the pending and active profile when a user updates t…
jmhooper Nov 17, 2023
e9706e6
LG-11542 Texas conditional hint text for id number (#9600)
svalexander Nov 17, 2023
f3dbce3
Update Prettier to v3.1 (#9618)
aduth Nov 17, 2023
0fa30a3
Log service_provider for RackAttack events (#9620)
Nov 17, 2023
5eeabfc
Remove GPO verification rake task (#9621)
matthinz Nov 17, 2023
f55f49d
LG-11520: Enable daily GPO expiration job (#9622)
matthinz Nov 17, 2023
6791267
Update State ID hint, move HTML out of translation strings into templ…
zachmargolis Nov 18, 2023
c43ec80
LG-11477: doc class error for some identification card (#9597)
dawei-nava Nov 18, 2023
d491d4d
Update Stylelint config dependencies in preparation for release publi…
aduth Nov 20, 2023
7b4b7b5
LG-11435: Track frontend analytics for changed country in phone input…
aduth Nov 20, 2023
2715663
LG-11025: Only log acuantCaptureMode when using acuant SDK (#9610)
amirbey Nov 20, 2023
e30cbe9
Prepare publish normalize-yaml to NPM (#9627)
aduth Nov 20, 2023
357c855
Restore width collapse for unstyled buttons (#9632)
aduth Nov 21, 2023
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: 2 additions & 0 deletions app/assets/stylesheets/components/_btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
margin-right: 0;
}

// Upstream: https://github.com/uswds/uswds/pull/5631
.usa-button--unstyled {
// Temporary: To be backported to design system. Unstyled buttons should inherit the appearance
// of a link.
display: inline;
width: auto;
}

.usa-button:disabled.usa-button--active,
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@forward 'hr';
@forward 'icon';
@forward 'language-picker';
@forward 'list';
@forward 'modal';
@forward 'nav';
@forward 'page-heading';
Expand Down
17 changes: 0 additions & 17 deletions app/assets/stylesheets/components/_list.scss

This file was deleted.

5 changes: 3 additions & 2 deletions app/components/icon_list_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def css_class
end

class IconListItemComponent < BaseComponent
attr_reader :icon, :color
attr_reader :icon, :color, :tag_options

def initialize(icon:, color:)
def initialize(icon:, color:, **tag_options)
@icon = icon
@color = color
@tag_options = tag_options
end

def icon_css_class
Expand Down
4 changes: 2 additions & 2 deletions app/components/icon_list_item_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<li class="usa-icon-list__item">
<%= content_tag(:li, **tag_options, class: [*tag_options[:class], 'usa-icon-list__item']) do %>
<%= content_tag(:div, class: icon_css_class) do %>
<%= render IconComponent.new(icon: icon) %>
<% end %>
<div class="usa-icon-list__content"><%= content %></div>
</li>
<% end %>
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def fix_broken_personal_key_url
if pii_unlocked
cacher = Pii::Cacher.new(current_user, user_session)
profile = current_user.active_profile
user_session[:personal_key] = profile.encrypt_recovery_pii(cacher.fetch)
user_session[:personal_key] = profile.encrypt_recovery_pii(cacher.fetch(profile.id))
profile.save!

analytics.broken_personal_key_regenerated
Expand Down
16 changes: 9 additions & 7 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def process_async_state(current_async_state)

log_idv_verification_submitted_event(
success: false,
failure_reason: { idv_verification: [:timeout] },
)
end
end
Expand All @@ -192,14 +191,18 @@ def async_state_done(current_async_state)
extra: {
address_edited: !!idv_session.address_edited,
address_line2_present: !pii[:address2].blank?,
pii_like_keypaths: [[:errors, :ssn], [:response_body, :first_name],
[:same_address_as_id],
[:state_id, :state_id_jurisdiction]],
pii_like_keypaths: [
[:errors, :ssn],
[:proofing_results, :context, :stages, :resolution, :errors, :ssn],
[:proofing_results, :context, :stages, :residential_address, :errors, :ssn],
[:proofing_results, :context, :stages, :threatmetrix, :response_body, :first_name],
[:same_address_as_id],
[:proofing_results, :context, :stages, :state_id, :state_id_jurisdiction],
],
},
)
log_idv_verification_submitted_event(
success: form_response.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(form_response),
)

form_response.extra[:ssn_is_unique] = DuplicateSsnFinder.new(
Expand Down Expand Up @@ -292,7 +295,7 @@ def idv_result_to_form_response(
)
end

def log_idv_verification_submitted_event(success: false, failure_reason: nil)
def log_idv_verification_submitted_event(success: false)
pii_from_doc = pii || {}
irs_attempts_api_tracker.idv_verification_submitted(
success: success,
Expand All @@ -305,7 +308,6 @@ def log_idv_verification_submitted_event(success: false, failure_reason: nil)
date_of_birth: pii_from_doc[:dob],
address: pii_from_doc[:address1],
ssn: idv_session.ssn,
failure_reason: failure_reason,
)
end

Expand Down
5 changes: 4 additions & 1 deletion app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def confirm_address_step_complete

def extra_analytics_properties
extra = {
pii_like_keypaths: [[:same_address_as_id], [:state_id, :state_id_jurisdiction]],
pii_like_keypaths: [
[:same_address_as_id],
[:proofing_results, :context, :stages, :state_id, :state_id_jurisdiction],
],
}

unless flow_session.dig(:pii_from_user, :same_address_as_id).nil?
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/concerns/unconfirmed_user_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def track_user_already_confirmed_event
irs_attempts_api_tracker.user_registration_email_confirmation(
email: @email_address.email,
success: false,
failure_reason: { email: [:already_confirmed] },
)
end

Expand All @@ -39,7 +38,6 @@ def stop_if_invalid_token
irs_attempts_api_tracker.user_registration_email_confirmation(
email: @email_address&.email,
success: false,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
process_unsuccessful_confirmation
end
Expand Down
8 changes: 7 additions & 1 deletion app/controllers/frontend_log_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FrontendLogController < ApplicationController

# Please try to keep this list alphabetical as well!
# rubocop:disable Layout/LineLength
EVENT_MAP = {
LEGACY_EVENT_MAP = {
'Frontend Error' => FrontendErrorLogger.method(:track_error),
'IdV: Acuant SDK loaded' => :idv_acuant_sdk_loaded,
'IdV: back image added' => :idv_back_image_added,
Expand Down Expand Up @@ -46,6 +46,12 @@ class FrontendLogController < ApplicationController
}.freeze
# rubocop:enable Layout/LineLength

ALLOWED_EVENTS = %i[
phone_input_country_changed
].freeze

EVENT_MAP = ALLOWED_EVENTS.index_by(&:to_s).merge(LEGACY_EVENT_MAP).freeze

def create
result = frontend_logger.track_event(log_params[:event], log_params[:payload].to_h)

Expand Down
1 change: 0 additions & 1 deletion app/controllers/idv/by_mail/enter_code_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def create
analytics.idv_verify_by_mail_enter_code_submitted(**result.to_h)
irs_attempts_api_tracker.idv_gpo_verification_submitted(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if !result.success?
Expand Down
5 changes: 1 addition & 4 deletions app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,15 @@ def handle_phone_submission
telephony_result = send_link
telephony_form_response = build_telephony_form_response(telephony_result)

failure_reason = nil
if !telephony_result.success?
failure_reason = { telephony: [telephony_result.error.class.name.demodulize] }
failure(telephony_form_response.errors[:message])
end
irs_attempts_api_tracker.idv_phone_upload_link_sent(
success: telephony_result.success?,
phone_number: formatted_destination_phone,
failure_reason: failure_reason,
)

if !failure_reason
if telephony_result.success?
redirect_to idv_link_sent_url
else
redirect_to idv_hybrid_handoff_url
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/idv/otp_verification_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ def update
result = phone_confirmation_otp_verification_form.submit(code: params[:code])
analytics.idv_phone_confirmation_otp_submitted(**result.to_h)

parsed_failure_reason =
(result.extra.slice(:code_expired) if result.extra[:code_expired]) ||
(result.extra.slice(:code_matches) if !result.success? && !result.extra[:code_matches]) ||
{}
irs_attempts_api_tracker.idv_phone_otp_submitted(
success: result.success?,
phone_number: idv_session.user_phone_confirmation_session.phone,
failure_reason: parsed_failure_reason,
)

if result.success?
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/idv/phone_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def create
irs_attempts_api_tracker.idv_phone_submitted(
success: result.success?,
phone_number: step_params[:phone],
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
submit_proofing_attempt
Expand Down Expand Up @@ -96,7 +95,6 @@ def send_phone_confirmation_otp_and_handle_result
phone_number: @idv_phone,
success: result.success?,
otp_delivery_method: idv_session.previous_phone_step_params[:otp_delivery_preference],
failure_reason: result.success? ? {} : otp_sent_tracker_error(result),
)
if result.success?
redirect_to idv_otp_verification_url
Expand Down
1 change: 0 additions & 1 deletion app/controllers/sign_up/email_confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def process_successful_confirmation
irs_attempts_api_tracker.user_registration_email_confirmation(
email: @email_address&.email,
success: true,
failure_reason: nil,
)
redirect_to sign_up_enter_password_url(confirmation_token: @confirmation_token)
end
Expand Down
3 changes: 0 additions & 3 deletions app/controllers/sign_up/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ def render_page
end

def track_analytics(result)
failure_reason = irs_attempts_api_tracker.parse_failure_reason(result)

analytics.password_creation(**result.to_h)
irs_attempts_api_tracker.user_registration_password_submitted(
success: result.success?,
failure_reason: failure_reason,
)
end

Expand Down
1 change: 0 additions & 1 deletion app/controllers/sign_up/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def create
irs_attempts_api_tracker.user_registration_email_submitted(
email: permitted_params[:email],
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if result.success?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def handle_result(result)
if result.success?
_event, disavowal_token = create_user_event_with_disavowal(:personal_key_used)
alert_user_about_personal_key_sign_in(disavowal_token)
generate_new_personal_key_for_verified_users_otherwise_retire_the_key_and_ensure_two_mfa
remove_personal_key
handle_valid_otp
else
handle_invalid_otp(context: context, type: 'personal_key')
Expand All @@ -57,45 +57,17 @@ def alert_user_about_personal_key_sign_in(disavowal_token)
analytics.personal_key_alert_about_sign_in(**response.to_h)
end

def generate_new_personal_key_for_verified_users_otherwise_retire_the_key_and_ensure_two_mfa
if password_reset_profile.present?
re_encrypt_profile_recovery_pii
elsif current_user.identity_verified?
user_session[:personal_key] = PersonalKeyGenerator.new(current_user).create
else
remove_personal_key
end
end

def remove_personal_key
# for now we will regenerate a key and not show it to them so retire personal key page shows
current_user.personal_key = PersonalKeyGenerator.new(current_user).create
current_user.save!
user_session.delete(:personal_key)
end

def re_encrypt_profile_recovery_pii
analytics.personal_key_reactivation_sign_in
Pii::ReEncryptor.new(pii: pii, profile: password_reset_profile).perform
user_session[:personal_key] = password_reset_profile.personal_key
end

def password_reset_profile
@password_reset_profile ||= current_user.password_reset_profile
end

def pii
@pii ||= password_reset_profile.recover_pii(normalized_personal_key)
end

def personal_key_param
params[:personal_key_form][:personal_key]
end

def normalized_personal_key
@personal_key_form.personal_key
end

def handle_valid_otp
handle_valid_verification_for_authentication_context(
auth_method: TwoFactorAuthenticatable::AuthMethod::PERSONAL_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def process_token
irs_attempts_api_tracker.mfa_login_piv_cac(
success: result.success?,
subject_dn: piv_cac_verification_form.x509_dn,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
handle_valid_piv_cac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def handle_webauthn_result(result)
if result.success?
handle_valid_webauthn
else
handle_invalid_webauthn
handle_invalid_webauthn(result)
end
end

Expand All @@ -54,24 +54,12 @@ def handle_valid_webauthn
redirect_to after_sign_in_path_for(current_user)
end

def handle_invalid_webauthn
def handle_invalid_webauthn(result)
flash[:error] = result.first_error_message

if platform_authenticator?
flash[:error] = t(
'two_factor_authentication.webauthn_error.try_again',
link: view_context.link_to(
t('two_factor_authentication.webauthn_error.additional_methods_link'),
login_two_factor_options_path,
),
)
redirect_to login_two_factor_webauthn_url(platform: 'true')
else
flash[:error] = t(
'two_factor_authentication.webauthn_error.connect_html',
link_html: view_context.link_to(
t('two_factor_authentication.webauthn_error.additional_methods_link'),
login_two_factor_options_path,
),
)
redirect_to login_two_factor_webauthn_url
end
end
Expand Down Expand Up @@ -124,6 +112,8 @@ def analytics_properties
def form
@form ||= WebauthnVerificationForm.new(
user: current_user,
platform_authenticator: platform_authenticator?,
url_options:,
challenge: user_session[:webauthn_challenge],
protocol: request.protocol,
authenticator_data: params[:authenticator_data],
Expand Down
1 change: 0 additions & 1 deletion app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def update
analytics.password_changed(**result.to_h)
irs_attempts_api_tracker.logged_in_password_change(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)

if result.success?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def process_piv_cac_setup
irs_attempts_api_tracker.mfa_enroll_piv_cac(
success: result.success?,
subject_dn: user_piv_cac_form.x509_dn,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
process_valid_submission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def process_piv_cac_setup
irs_attempts_api_tracker.mfa_enroll_piv_cac(
success: result.success?,
subject_dn: user_piv_cac_form.x509_dn,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
)
if result.success?
process_valid_submission
Expand Down
Loading