Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy RC 333 to Prod #9603

Merged
merged 21 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bdbc58f
Fix AnalyticsEventsDocumenter for symbol event names (#9582)
zachmargolis Nov 13, 2023
af8c6ef
LG-11258 Ssn page off ramp (#9568)
soniaconnolly Nov 13, 2023
15f9b25
Remove columns not present in db from schema.rb (#9584)
matthinz Nov 13, 2023
adcb454
Customize IRB prompt to include env name (#9585)
zachmargolis Nov 14, 2023
e8446a6
LG-11442: exit question flag (#9579)
dawei-nava Nov 14, 2023
40923fb
Redirect /verify/activated to personal key page if unackowledged (#9586)
matthinz Nov 14, 2023
c56b867
Tweaks to GPO expiration job + rake task (#9590)
matthinz Nov 14, 2023
be9692f
Color IRB prompts based on environment (#9592)
zachmargolis Nov 15, 2023
ee8c8c6
LG-11260: fix config item name and account url(losing user language p…
dawei-nava Nov 15, 2023
150404e
Adds AAMVA test scripts (#9588)
zachmargolis Nov 15, 2023
92a3dbb
LG-11537 Access the active profile in the userinfo endpoint (#9596)
jmhooper Nov 15, 2023
6b1150a
LG-11538 Show the PII from the active profile on the completions scre…
jmhooper Nov 15, 2023
6a38687
LG-11147: Break up MFA selection presenter classes for PivCac (#9581)
jmdembe Nov 15, 2023
19e387c
LG-11461 add FlowPolicy#undo_steps_from! and add to #update through d…
theabrad Nov 15, 2023
4055b1b
[Snyk] Security upgrade rails from 7.1.1 to 7.1.2 (#9577)
JJediny Nov 15, 2023
558a8f8
Start writing idv_session.personal_key_acknowledged (#9595)
matthinz Nov 15, 2023
8240c4b
Switch put_pii to keyword arguments
zachmargolis Nov 15, 2023
1063842
Revert "Switch put_pii to keyword arguments" (#9604)
zachmargolis Nov 15, 2023
8600e4c
LG-10465 Add update route for address controller (#9489)
svalexander Nov 15, 2023
1a136fd
Switch put_pii to keyword arguments (#9605)
zachmargolis Nov 15, 2023
59755ae
Revert "[Snyk] Security upgrade rails from 7.1.1 to 7.1.2 (#9577)" (#…
zachmargolis Nov 16, 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
6 changes: 2 additions & 4 deletions .irbrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
IRB.conf[:USE_AUTOCOMPLETE] = false
require_relative './lib/env_irb_prompt'

on_deployed_box = File.directory?('/srv/idp/releases/')

IRB.conf[:SAVE_HISTORY] = on_deployed_box ? nil : 1000
EnvIrbPrompt.new.configure!
4 changes: 4 additions & 0 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@ def url_for_latest_step
step_info = flow_policy.info_for_latest_step
url_for(controller: step_info.controller, action: step_info.action)
end

def clear_invalid_steps!
flow_policy.undo_steps_from_controller!(controller: self.class)
end
end
2 changes: 2 additions & 0 deletions app/controllers/idv/agreement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def show
end

def update
clear_invalid_steps!
skip_to_capture if params[:skip_hybrid_handoff]

result = Idv::ConsentForm.new.submit(consent_form_params)
Expand Down Expand Up @@ -48,6 +49,7 @@ def self.step_info
controller: controller_name,
next_steps: [:hybrid_handoff, :document_capture, :phone_question, :how_to_verify],
preconditions: ->(idv_session:, user:) { idv_session.welcome_visited },
undo_step: ->(idv_session:, user:) { idv_session.idv_consent_given = nil },
)
end

Expand Down
5 changes: 5 additions & 0 deletions app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def show
end

def update
clear_invalid_steps!
idv_session.redo_document_capture = nil # done with this redo
# Not used in standard flow, here for data consistency with hybrid flow.
document_capture_session.confirm_ocr
Expand Down Expand Up @@ -60,6 +61,10 @@ def self.step_info
controller: controller_name,
next_steps: [:success], # [:ssn],
preconditions: ->(idv_session:, user:) { idv_session.flow_path == 'standard' },
undo_step: ->(idv_session:, user:) do
idv_session.pii_from_doc = nil
idv_session.invalidate_in_person_pii_from_user!
end,
)
end

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/idv/how_to_verify_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def show
end

def update
clear_invalid_steps!
result = Idv::HowToVerifyForm.new.submit(how_to_verify_form_params)

analytics.idv_doc_auth_how_to_verify_submitted(
Expand All @@ -39,6 +40,7 @@ def self.step_info
preconditions: ->(idv_session:, user:) do
self.enabled?
end,
undo_step: ->(idv_session:, user:) {}, # clear any saved data
)
end

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def show
end

def update
clear_invalid_steps!
irs_attempts_api_tracker.idv_document_upload_method_selected(
upload_method: params[:type],
)
Expand All @@ -41,6 +42,7 @@ def self.step_info
controller: controller_name,
next_steps: [:link_sent, :document_capture],
preconditions: ->(idv_session:, user:) { idv_session.idv_consent_given },
undo_step: ->(idv_session:, user:) { idv_session.flow_path = nil },
)
end

Expand Down
37 changes: 31 additions & 6 deletions app/controllers/idv/in_person/address_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,34 @@ class AddressController < ApplicationController

before_action :render_404_if_in_person_residential_address_controller_enabled_not_set
before_action :confirm_in_person_state_id_step_complete
before_action :confirm_in_person_address_step_needed
before_action :confirm_in_person_address_step_needed, only: :show

def show
analytics.idv_in_person_proofing_address_visited(**analytics_arguments)

render :show, locals: extra_view_variables
end

def update
attrs = Idv::InPerson::AddressForm::ATTRIBUTES.difference([:same_address_as_id])
pii_from_user[:same_address_as_id] = 'false' if updating_address?
form_result = form.submit(flow_params)

analytics.idv_in_person_proofing_residential_address_submitted(
**analytics_arguments.merge(**form_result.to_h),
)

if form_result.success?
attrs.each do |attr|
pii_from_user[attr] = flow_params[attr]
end
flow_session['Idv::Steps::InPerson::AddressStep'] = true
redirect_to_next_page
else
render :show, locals: extra_view_variables
end
end

def extra_view_variables
{
form:,
Expand Down Expand Up @@ -47,19 +67,23 @@ def flow_params
)
end

def form_submit
form.submit(flow_params)
end

def analytics_arguments
{
flow_path: flow_path,
flow_path: idv_session.flow_path,
step: 'address',
analytics_id: 'In Person Proofing',
irs_reproofing: irs_reproofing?,
}
end

def redirect_to_next_page
if updating_address?
redirect_to idv_in_person_verify_info_url
else
redirect_to idv_in_person_ssn_url
end
end

def render_404_if_in_person_residential_address_controller_enabled_not_set
render_not_found unless
IdentityConfig.store.in_person_residential_address_controller_enabled
Expand All @@ -73,6 +97,7 @@ def confirm_in_person_state_id_step_complete
def confirm_in_person_address_step_needed
return if pii_from_user && pii_from_user[:same_address_as_id] == 'false' &&
!pii_from_user.has_key?(:address1)
return if request.referer == idv_in_person_verify_info_url
redirect_to idv_in_person_ssn_url
end
end
Expand Down
28 changes: 19 additions & 9 deletions app/controllers/idv/in_person/ssn_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,36 @@ class SsnController < ApplicationController
before_action :confirm_repeat_ssn, only: :show
before_action :override_csp_for_threat_metrix

attr_reader :ssn_presenter

# Keep this code in sync with Idv::SsnController

def show
@step_indicator_steps = step_indicator_steps
@ssn_form = Idv::SsnFormatForm.new(idv_session.ssn)
@ssn_presenter = Idv::SsnPresenter.new(
sp_name: decorated_sp_session.sp_name,
ssn_form: Idv::SsnFormatForm.new(idv_session.ssn),
step_indicator_steps: step_indicator_steps,
)

analytics.idv_doc_auth_redo_ssn_submitted(**analytics_arguments) if @ssn_form.updating_ssn?
if ssn_presenter.updating_ssn?
analytics.idv_doc_auth_redo_ssn_submitted(**analytics_arguments)
end
analytics.idv_doc_auth_ssn_visited(**analytics_arguments)

Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
call('ssn', :view, true)

render 'idv/shared/ssn', locals: threatmetrix_view_variables
render 'idv/shared/ssn', locals: threatmetrix_view_variables(ssn_presenter.updating_ssn?)
end

def update
@ssn_form = Idv::SsnFormatForm.new(idv_session.ssn)
form_response = @ssn_form.submit(params.require(:doc_auth).permit(:ssn))

ssn_form = Idv::SsnFormatForm.new(idv_session.ssn)
form_response = ssn_form.submit(params.require(:doc_auth).permit(:ssn))
@ssn_presenter = Idv::SsnPresenter.new(
sp_name: decorated_sp_session.sp_name,
ssn_form: ssn_form,
step_indicator_steps: step_indicator_steps,
)
analytics.idv_doc_auth_ssn_submitted(
**analytics_arguments.merge(form_response.to_h),
)
Expand All @@ -45,8 +56,7 @@ def update
redirect_to next_url
else
flash[:error] = form_response.first_error_message
@step_indicator_steps = step_indicator_steps
render 'idv/shared/ssn', locals: threatmetrix_view_variables
render 'idv/shared/ssn', locals: threatmetrix_view_variables(ssn_presenter.updating_ssn?)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/in_person/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def flow_session

def analytics_arguments
{
flow_path: flow_session[:flow_path],
flow_path: idv_session.flow_path,
step: 'verify',
analytics_id: 'In Person Proofing',
irs_reproofing: irs_reproofing?,
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/idv/link_sent_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def show
end

def update
clear_invalid_steps!
analytics.idv_doc_auth_link_sent_submitted(**analytics_arguments)

return render_document_capture_cancelled if document_capture_session&.cancelled_at
Expand All @@ -46,6 +47,10 @@ def self.step_info
controller: controller_name,
next_steps: [:success], # [:ssn],
preconditions: ->(idv_session:, user:) { idv_session.flow_path == 'hybrid' },
undo_step: ->(idv_session:, user:) do
idv_session.pii_from_doc = nil
idv_session.invalidate_in_person_pii_from_user!
end,
)
end

Expand Down
4 changes: 3 additions & 1 deletion app/controllers/idv/personal_key_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def update
fraud_review_pending: fraud_review_pending?,
fraud_rejection: fraud_rejection?,
)
idv_session.personal_key = nil

idv_session.acknowledge_personal_key!

redirect_to next_step
end

Expand Down
3 changes: 3 additions & 0 deletions app/controllers/idv/phone_question_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ def show
end

def phone_with_camera
clear_invalid_steps!
idv_session.phone_with_camera = true
analytics.idv_doc_auth_phone_question_submitted(**analytics_arguments)

redirect_to idv_hybrid_handoff_url
end

def phone_without_camera
clear_invalid_steps!
idv_session.flow_path = 'standard'
idv_session.phone_with_camera = false
analytics.idv_doc_auth_phone_question_submitted(**analytics_arguments)
Expand All @@ -39,6 +41,7 @@ def self.step_info
AbTests::IDV_PHONE_QUESTION.bucket(user.uuid) == :show_phone_question &&
idv_session.idv_consent_given
end,
undo_step: ->(idv_session:, user:) { idv_session.phone_with_camera = nil },
)
end

Expand Down
30 changes: 20 additions & 10 deletions app/controllers/idv/ssn_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,36 @@ class SsnController < ApplicationController
before_action :confirm_repeat_ssn, only: :show
before_action :override_csp_for_threat_metrix

attr_reader :ssn_presenter

# Keep this code in sync with Idv::InPerson::SsnController

def show
@step_indicator_steps = step_indicator_steps
@ssn_form = Idv::SsnFormatForm.new(idv_session.ssn)
@ssn_presenter = Idv::SsnPresenter.new(
sp_name: decorated_sp_session.sp_name,
ssn_form: Idv::SsnFormatForm.new(idv_session.ssn),
step_indicator_steps: step_indicator_steps,
)

analytics.idv_doc_auth_redo_ssn_submitted(**analytics_arguments) if @ssn_form.updating_ssn?
if ssn_presenter.updating_ssn?
analytics.idv_doc_auth_redo_ssn_submitted(**analytics_arguments)
end
analytics.idv_doc_auth_ssn_visited(**analytics_arguments)

Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
call('ssn', :view, true)

render 'idv/shared/ssn', locals: threatmetrix_view_variables
render 'idv/shared/ssn', locals: threatmetrix_view_variables(ssn_presenter.updating_ssn?)
end

def update
@ssn_form = Idv::SsnFormatForm.new(idv_session.ssn)
form_response = @ssn_form.submit(params.require(:doc_auth).permit(:ssn))

ssn_form = Idv::SsnFormatForm.new(idv_session.ssn)
form_response = ssn_form.submit(params.require(:doc_auth).permit(:ssn))
@ssn_presenter = Idv::SsnPresenter.new(
sp_name: decorated_sp_session.sp_name,
ssn_form: ssn_form,
step_indicator_steps: step_indicator_steps,
)
analytics.idv_doc_auth_ssn_submitted(
**analytics_arguments.merge(form_response.to_h),
)
Expand All @@ -43,8 +54,7 @@ def update
redirect_to next_url
else
flash[:error] = form_response.first_error_message
@step_indicator_steps = step_indicator_steps
render 'idv/shared/ssn', locals: threatmetrix_view_variables
render 'idv/shared/ssn', locals: threatmetrix_view_variables(ssn_presenter.updating_ssn?)
end
end

Expand All @@ -58,7 +68,7 @@ def confirm_repeat_ssn
end

def next_url
if idv_session.pii_from_doc[:state] == 'PR' && !@ssn_form.updating_ssn?
if idv_session.pii_from_doc[:state] == 'PR' && !ssn_presenter.updating_ssn?
idv_address_url
else
idv_verify_info_url
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/idv/welcome_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def show
end

def update
clear_invalid_steps!
analytics.idv_doc_auth_welcome_submitted(**analytics_arguments)

create_document_capture_session
Expand All @@ -39,6 +40,7 @@ def self.step_info
controller: controller_name,
next_steps: [:agreement],
preconditions: ->(idv_session:, user:) { true },
undo_step: ->(idv_session:, user:) { idv_session.welcome_visited = nil },
)
end

Expand Down
5 changes: 5 additions & 0 deletions app/controllers/idv_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def index
end

def activated
if idv_session.personal_key.present?
redirect_to idv_personal_key_url
return
end

redirect_to idv_url unless active_profile?
idv_session.clear
end
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/sign_up/completions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def track_completion_event(last_page)
end

def pii
Pii::Cacher.new(current_user, user_session).fetch || Pii::Attributes.new
Pii::Cacher.new(current_user, user_session).fetch(current_user.active_profile&.id) ||
Pii::Attributes.new
end

def send_in_person_completion_survey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export interface DocumentCaptureNotReadyProps {
function DocumentCaptureNotReady({ navigate }: DocumentCaptureNotReadyProps) {
const { t } = useI18n();
const { trackEvent } = useContext(AnalyticsContext);
const { currentStep } = useContext(FlowContext);
const { currentStep, accountURL } = useContext(FlowContext);
const { name: spName, failureToProofURL } = useContext(ServiceProviderContext);
const appName = getConfigValue('appName');
const handleExit = () => {
trackEvent('IdV: docauth not ready link clicked');
forceRedirect(
addSearchParams(spName ? failureToProofURL : '/account', {
addSearchParams(spName ? failureToProofURL : accountURL, {
step: currentStep,
location: 'not_ready',
}),
Expand Down
Loading