Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9aea097
LG-12041: Prevent user from resubmitting a selfie that already failed…
amirbey Jan 31, 2024
39cdd8d
LG-11893: Selfie Liveness Errors on the FE (#9975)
charleyf Jan 31, 2024
250625e
Lg 12117 summarize multiple apps (#10008)
ThatSpaceGuy Jan 31, 2024
eb7aa03
Silently ignore invalid params for FormSteps (#10005)
aduth Feb 1, 2024
21d5b41
LG-12033: selfie_check_performed verifies the vendor performed a self…
amirbey Feb 1, 2024
913b82b
Send RISC password reset to confirmed emails (#10022)
aduth Feb 1, 2024
abeed61
Load error tracking script asynchronously (#10013)
aduth Feb 2, 2024
a7a2684
Remove routes associated with legacy WebAuthn deletion (#10019)
aduth Feb 2, 2024
772c912
LG-11893: Fix Doubled 'attempts' Warning (#10021)
charleyf Feb 2, 2024
6fc419d
LG-12018: Refactor account deletion/message to be variable (#9927)
jmdembe Feb 2, 2024
d1e5d30
Port and limit entrypoints to TypeScript (#10025)
aduth Feb 2, 2024
6f8efa1
LG-12183: selfie image metadata (#10006)
amirbey Feb 2, 2024
5722498
LG-12310: Revert refactor to zipcode pii validation (#10024)
eileen-nava Feb 2, 2024
6f8c676
LG-12075: Rename attempt properties in analytics for clarity (#10011)
Feb 3, 2024
759241d
LG-12091 Send please call email (#9977)
svalexander Feb 5, 2024
5e18112
Bump libphonenumber-js from 1.10.54 to 1.10.55 (#10032)
dependabot[bot] Feb 5, 2024
d20b3f6
LG-11699/LG-11700: Allow verified user to repeat idv if they need bio…
matthinz Feb 5, 2024
b75b9ca
Read `vtr` property while reading and writing `ServiceProviderRequest…
jmhooper Feb 5, 2024
4957a12
LG-12275 | Fixes opt-in IPP page displaying incorrectly (#10016)
n1zyy Feb 5, 2024
f5d5549
Fix attaching of selfie image in specs (#10034)
matthinz Feb 5, 2024
6abbb42
Update nokogiri to 1.16.2 (#10038)
Feb 6, 2024
0145c7e
LG-12190 Store vtr and acr_values in sp_session (#10004)
jmhooper Feb 6, 2024
3e8fac1
LG-12039: capture session read from new capture session results for d…
dawei-nava Feb 6, 2024
b5f1603
LG-11918: Update documentation for SDK monitoring length to 3 days (#…
Feb 6, 2024
04361ce
Revert "LG-12190 Store vtr and acr_values in sp_session (#10004)" (#1…
jmhooper Feb 6, 2024
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 Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ GEM
net-ssh (6.1.0)
newrelic_rpm (9.7.0)
nio4r (2.7.0)
nokogiri (1.16.0)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
openssl (3.0.2)
Expand Down
Binary file added app/assets/images/email/phone_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/components/base_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def before_render

def self.scripts
@scripts ||= begin
scripts = sidecar_files_basenames(['js', 'ts'])
scripts = sidecar_files_basenames(['ts'])
scripts.concat superclass.scripts if superclass.respond_to?(:scripts)
scripts
end
Expand Down
File renamed without changes.
16 changes: 15 additions & 1 deletion app/controllers/account_reset/pending_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module AccountReset
class PendingController < ApplicationController
include UserAuthenticator
include ActionView::Helpers::DateHelper

before_action :authenticate_user
before_action :confirm_account_reset_request_exists
Expand All @@ -10,7 +11,9 @@ def show
@pending_presenter = AccountReset::PendingPresenter.new(pending_account_reset_request)
end

def confirm; end
def confirm
@account_reset_deletion_period_interval = account_reset_deletion_period_interval
end

def cancel
analytics.pending_account_reset_cancelled
Expand All @@ -29,5 +32,16 @@ def pending_account_reset_request
current_user,
).call
end

def account_reset_deletion_period_interval
current_time = Time.zone.now

distance_of_time_in_words(
current_time,
current_time + IdentityConfig.store.account_reset_wait_period_days.days,
true,
accumulate_on: :hours,
)
end
end
end
13 changes: 13 additions & 0 deletions app/controllers/account_reset/request_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module AccountReset
class RequestController < ApplicationController
include TwoFactorAuthenticatable
include ActionView::Helpers::DateHelper

before_action :confirm_two_factor_enabled

def show
analytics.account_reset_visit
@account_reset_deletion_period_interval = account_reset_deletion_period_interval
end

def create
Expand Down Expand Up @@ -39,5 +41,16 @@ def analytics_attributes
email_addresses: current_user.email_addresses.count,
}
end

def account_reset_deletion_period_interval
current_time = Time.zone.now

distance_of_time_in_words(
current_time,
current_time + IdentityConfig.store.account_reset_wait_period_days.days,
true,
accumulate_on: :hours,
)
end
end
end
4 changes: 2 additions & 2 deletions app/controllers/concerns/idv/document_capture_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def extract_pii_from_doc(user, response, store_in_session: false)
idv_session.had_barcode_read_failure = response.attention_with_barcode?
if store_in_session
idv_session.pii_from_doc = response.pii_from_doc
idv_session.selfie_check_performed = response.selfie_check_performed
idv_session.selfie_check_performed = response.selfie_check_performed?
end
end

Expand All @@ -49,7 +49,7 @@ def stored_result
end

def selfie_requirement_met?
!decorated_sp_session.selfie_required? || stored_result.selfie_check_performed
!decorated_sp_session.selfie_required? || stored_result.selfie_check_performed?
end

private
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def idv_failure_log_rate_limited(rate_limit_type)
def idv_failure_log_error
analytics.idv_doc_auth_exception_visited(
step_name: STEP_NAME,
remaining_attempts: resolution_rate_limiter.remaining_count,
remaining_submit_attempts: resolution_rate_limiter.remaining_count,
)
end

def idv_failure_log_warning
analytics.idv_doc_auth_warning_visited(
step_name: STEP_NAME,
remaining_attempts: resolution_rate_limiter.remaining_count,
remaining_submit_attempts: resolution_rate_limiter.remaining_count,
)
end

Expand Down
17 changes: 12 additions & 5 deletions app/controllers/concerns/idv_session_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ module IdvSessionConcern
end

def confirm_idv_needed
return if idv_session_user.active_profile.blank? ||
decorated_sp_session.requested_more_recent_verification? ||
idv_session_user.reproof_for_irs?(service_provider: current_sp)

redirect_to idv_activated_url
redirect_to idv_activated_url unless idv_needed?
end

def hybrid_session?
session[:doc_capture_user_id].present?
end

def idv_needed?
user_needs_selfie? ||
idv_session_user.active_profile.blank? ||
decorated_sp_session.requested_more_recent_verification? ||
idv_session_user.reproof_for_irs?(service_provider: current_sp)
end

def idv_session
@idv_session ||= Idv::Session.new(
user_session: user_session,
Expand Down Expand Up @@ -66,4 +69,8 @@ def idv_session_user

current_user
end

def user_needs_selfie?
decorated_sp_session.selfie_required? && !current_user.identity_verified_with_selfie?
end
end
4 changes: 3 additions & 1 deletion app/controllers/idv/how_to_verify_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def self.step_info
controller: self,
next_steps: [:hybrid_handoff, :document_capture],
preconditions: ->(idv_session:, user:) do
self.enabled? && idv_session.idv_consent_given
self.enabled? &&
idv_session.idv_consent_given &&
idv_session.service_provider&.in_person_proofing_enabled
end,
undo_step: ->(idv_session:, user:) { idv_session.skip_doc_auth = nil },
)
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/idv/phone_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PhoneErrorsController < ApplicationController
before_action :ignore_form_step_wait_requests

def warning
@remaining_attempts = rate_limiter.remaining_count
@remaining_submit_attempts = rate_limiter.remaining_count

if idv_session.previous_phone_step_params
@phone = idv_session.previous_phone_step_params[:phone]
Expand All @@ -21,12 +21,12 @@ def warning
end

def timeout
@remaining_step_attempts = rate_limiter.remaining_count
@remaining_submit_attempts = rate_limiter.remaining_count
track_event(type: :timeout)
end

def jobfail
@remaining_attempts = rate_limiter.remaining_count
@remaining_submit_attempts = rate_limiter.remaining_count
track_event(type: :jobfail)
end

Expand Down Expand Up @@ -63,7 +63,7 @@ def track_event(type:)
if type == :failure
attributes[:limiter_expires_at] = @expires_at
else
attributes[:remaining_attempts] = @remaining_attempts
attributes[:remaining_submit_attempts] = @remaining_submit_attempts
end

analytics.idv_phone_error_visited(**attributes)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/idv/session_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def warning
)

@step_indicator_steps = step_indicator_steps
@remaining_attempts = rate_limiter.remaining_count
@remaining_submit_attempts = rate_limiter.remaining_count
log_event(based_on_limiter: rate_limiter)
end

Expand Down Expand Up @@ -93,7 +93,7 @@ def log_event(based_on_limiter: nil)
type: params[:action],
}

options[:attempts_remaining] = based_on_limiter.remaining_count if based_on_limiter
options[:submit_attempts_remaining] = based_on_limiter.remaining_count if based_on_limiter

analytics.idv_session_error_visited(**options)
end
Expand Down
13 changes: 9 additions & 4 deletions app/controllers/idv_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ class IdvController < ApplicationController
before_action :confirm_not_rate_limited

def index
if decorated_sp_session.requested_more_recent_verification? ||
current_user.reproof_for_irs?(service_provider: current_sp)
verify_identity
elsif active_profile?
if already_verified?
redirect_to idv_activated_url
else
verify_identity
Expand All @@ -32,6 +29,14 @@ def activated

private

def already_verified?
if decorated_sp_session.selfie_required?
return current_user.identity_verified_with_selfie?
end

return current_user.active_profile.present?
end

def verify_identity
analytics.idv_intro_visit
redirect_to idv_welcome_url
Expand Down
55 changes: 0 additions & 55 deletions app/controllers/users/webauthn_setup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,6 @@ def confirm
end
end

def delete
if MfaPolicy.new(current_user).multiple_factors_enabled?
handle_successful_delete
else
handle_failed_delete
end
redirect_to account_two_factor_authentication_path
end

def show_delete
@webauthn = WebauthnConfiguration.where(
user_id: current_user.id, id: delete_params[:id],
).first

if @webauthn
render 'users/webauthn_setup/delete'
else
flash[:error] = t('errors.general')
redirect_back fallback_location: new_user_session_url, allow_other_host: false
end
end

private

def validate_existing_platform_authenticator
Expand Down Expand Up @@ -142,35 +120,6 @@ def exclude_credentials
current_user.webauthn_configurations.map(&:credential_id)
end

def handle_successful_delete
webauthn = WebauthnConfiguration.find_by(user_id: current_user.id, id: delete_params[:id])
return unless webauthn

create_user_event(:webauthn_key_removed)
webauthn.destroy
revoke_remember_device(current_user)
event = PushNotification::RecoveryInformationChangedEvent.new(user: current_user)
PushNotification::HttpPush.deliver(event)
if webauthn.platform_authenticator
flash[:success] = t('notices.webauthn_platform_deleted')
else
flash[:success] = t('notices.webauthn_deleted')
end
track_delete(success: true, platform_authenticator: webauthn.platform_authenticator?)
end

def handle_failed_delete
track_delete(success: false, platform_authenticator: nil)
end

def track_delete(success:, platform_authenticator:)
analytics.webauthn_delete_submitted(
success:,
configuration_id: delete_params[:id],
platform_authenticator:,
)
end

def save_challenge_in_session
credential_creation_options = WebAuthn::Credential.options_for_create(user: current_user)
user_session[:webauthn_challenge] = credential_creation_options.challenge.bytes.to_a
Expand Down Expand Up @@ -224,9 +173,5 @@ def confirm_params
:transports,
)
end

def delete_params
params.permit(:id)
end
end
end
4 changes: 2 additions & 2 deletions app/forms/gpo_verify_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def submit
enqueued_at: gpo_confirmation_code&.code_sent_at,
which_letter: which_letter,
letter_count: letter_count,
attempts: attempts,
submit_attempts: submit_attempts,
pii_like_keypaths: [[:errors, :otp], [:error_details, :otp]],
pending_in_person_enrollment: !!pending_profile&.in_person_enrollment&.pending?,
fraud_check_failed: fraud_check_failed,
Expand Down Expand Up @@ -76,7 +76,7 @@ def letter_count
pending_profile&.gpo_confirmation_codes&.count
end

def attempts
def submit_attempts
RateLimiter.new(user: user, rate_limit_type: :verify_gpo_key).attempts
end

Expand Down
Loading