From 09471401c236a845bb6d50a65b6694f36cb74cf9 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Wed, 31 May 2023 17:17:32 -0400 Subject: [PATCH 01/13] add outage to all post FSM controllers changelog: Internal, Identity Verification, add outage actions to post-FSM controllers --- .../concerns/idv/outage_concern.rb | 30 +++++++++++++++++++ app/controllers/idv/doc_auth_controller.rb | 23 +------------- .../idv/document_capture_controller.rb | 1 + .../idv/hybrid_handoff_controller.rb | 1 + app/controllers/idv/link_sent_controller.rb | 1 + app/controllers/idv/phone_controller.rb | 1 + app/controllers/idv/ssn_controller.rb | 1 + app/controllers/idv/verify_info_controller.rb | 1 + 8 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 app/controllers/concerns/idv/outage_concern.rb diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb new file mode 100644 index 00000000000..02d958f15b1 --- /dev/null +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -0,0 +1,30 @@ +module Idv + module OutageConcern + extend ActiveSupport::Concern + + included do + # rubocop:disable Rails/LexicallyScopedActionFilter + before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter + end + + def check_for_outage + return if flow_session[:skip_vendor_outage] + + return redirect_for_gpo_only if FeatureManagement.idv_gpo_only? + end + + def redirect_for_gpo_only + return redirect_to vendor_outage_url unless FeatureManagement.gpo_verification_enabled? + + # During a phone outage, skip the hybrid handoff + # step and go straight to document upload + flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? + + session[:vendor_outage_redirect] = current_step + session[:vendor_outage_redirect_from_idv] = true + + redirect_to idv_mail_only_warning_url + end + end +end \ No newline at end of file diff --git a/app/controllers/idv/doc_auth_controller.rb b/app/controllers/idv/doc_auth_controller.rb index 848180d6cee..8021a3a1701 100644 --- a/app/controllers/idv/doc_auth_controller.rb +++ b/app/controllers/idv/doc_auth_controller.rb @@ -8,13 +8,11 @@ class DocAuthController < ApplicationController include Flow::FlowStateMachine include Idv::ThreatMetrixConcern include FraudReviewConcern + include Idv::OutageConcern before_action :redirect_if_flow_completed before_action :handle_fraud before_action :update_if_skipping_upload - # rubocop:disable Rails/LexicallyScopedActionFilter - before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter before_action :override_csp_for_threat_metrix @@ -56,24 +54,5 @@ def do_meta_refresh(meta_refresh_count) def flow_session user_session['idv/doc_auth'] end - - def check_for_outage - return if flow_session[:skip_vendor_outage] - - return redirect_for_gpo_only if FeatureManagement.idv_gpo_only? - end - - def redirect_for_gpo_only - return redirect_to vendor_outage_url unless FeatureManagement.gpo_verification_enabled? - - # During a phone outage, skip the hybrid handoff - # step and go straight to document upload - flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? - - session[:vendor_outage_redirect] = current_step - session[:vendor_outage_redirect_from_idv] = true - - redirect_to idv_mail_only_warning_url - end end end diff --git a/app/controllers/idv/document_capture_controller.rb b/app/controllers/idv/document_capture_controller.rb index 044de86df5e..7c498fe34ff 100644 --- a/app/controllers/idv/document_capture_controller.rb +++ b/app/controllers/idv/document_capture_controller.rb @@ -4,6 +4,7 @@ class DocumentCaptureController < ApplicationController include DocumentCaptureConcern include IdvSession include IdvStepConcern + include OutageConcern include StepIndicatorConcern include StepUtilitiesConcern include RateLimitConcern diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index fdf07d77a04..bbc8d80f5f5 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -3,6 +3,7 @@ class HybridHandoffController < ApplicationController include ActionView::Helpers::DateHelper include IdvSession include IdvStepConcern + include OutageConcern include StepIndicatorConcern include StepUtilitiesConcern diff --git a/app/controllers/idv/link_sent_controller.rb b/app/controllers/idv/link_sent_controller.rb index a225ce44cd1..d37f9c02309 100644 --- a/app/controllers/idv/link_sent_controller.rb +++ b/app/controllers/idv/link_sent_controller.rb @@ -3,6 +3,7 @@ class LinkSentController < ApplicationController include DocumentCaptureConcern include IdvSession include IdvStepConcern + include OutageConcern include StepIndicatorConcern include StepUtilitiesConcern diff --git a/app/controllers/idv/phone_controller.rb b/app/controllers/idv/phone_controller.rb index b811b2ba8ae..b71379fbaac 100644 --- a/app/controllers/idv/phone_controller.rb +++ b/app/controllers/idv/phone_controller.rb @@ -2,6 +2,7 @@ module Idv class PhoneController < ApplicationController include IdvStepConcern include StepIndicatorConcern + include OutageConcern include PhoneOtpRateLimitable include PhoneOtpSendable diff --git a/app/controllers/idv/ssn_controller.rb b/app/controllers/idv/ssn_controller.rb index bc53eae9798..b737ea56fad 100644 --- a/app/controllers/idv/ssn_controller.rb +++ b/app/controllers/idv/ssn_controller.rb @@ -2,6 +2,7 @@ module Idv class SsnController < ApplicationController include IdvSession include IdvStepConcern + include OutageConcern include StepIndicatorConcern include StepUtilitiesConcern include Steps::ThreatMetrixStepHelper diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index caee85ef348..ff2dc6d3f87 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -1,6 +1,7 @@ module Idv class VerifyInfoController < ApplicationController include IdvStepConcern + include OutageConcern include StepUtilitiesConcern include StepIndicatorConcern include VerifyInfoConcern From 8898123815db2809c8ee758b78a346bd907c6141 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Thu, 1 Jun 2023 12:55:01 -0400 Subject: [PATCH 02/13] session keys not used - vendor_outage_redirect_from_idv and vendor_outage_redirect --- app/controllers/concerns/idv/outage_concern.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index 02d958f15b1..8fe6d90ad75 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -21,8 +21,8 @@ def redirect_for_gpo_only # step and go straight to document upload flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? - session[:vendor_outage_redirect] = current_step - session[:vendor_outage_redirect_from_idv] = true + # session[:vendor_outage_redirect] = current_step + # session[:vendor_outage_redirect_from_idv] = true redirect_to idv_mail_only_warning_url end From 8081a7de788f37c50b297c40bc73c322a12413c9 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Fri, 2 Jun 2023 12:47:32 -0400 Subject: [PATCH 03/13] check_for_outage must occur after authentication is confirmed --- app/controllers/concerns/idv/outage_concern.rb | 6 ------ app/controllers/idv/document_capture_controller.rb | 1 + app/controllers/idv/hybrid_handoff_controller.rb | 1 + app/controllers/idv/link_sent_controller.rb | 1 + app/controllers/idv/phone_controller.rb | 1 + app/controllers/idv/ssn_controller.rb | 1 + app/controllers/idv/verify_info_controller.rb | 1 + 7 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index 8fe6d90ad75..d0f55a409d1 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -2,12 +2,6 @@ module Idv module OutageConcern extend ActiveSupport::Concern - included do - # rubocop:disable Rails/LexicallyScopedActionFilter - before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter - end - def check_for_outage return if flow_session[:skip_vendor_outage] diff --git a/app/controllers/idv/document_capture_controller.rb b/app/controllers/idv/document_capture_controller.rb index 7c498fe34ff..a3a8056c1af 100644 --- a/app/controllers/idv/document_capture_controller.rb +++ b/app/controllers/idv/document_capture_controller.rb @@ -13,6 +13,7 @@ class DocumentCaptureController < ApplicationController before_action :confirm_upload_step_complete before_action :confirm_document_capture_needed before_action :override_csp_to_allow_acuant + before_action :check_for_outage, only: :show def show analytics.idv_doc_auth_document_capture_visited(**analytics_arguments) diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index bbc8d80f5f5..c4a60900f4c 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -10,6 +10,7 @@ class HybridHandoffController < ApplicationController before_action :confirm_two_factor_authenticated before_action :confirm_agreement_step_complete before_action :confirm_hybrid_handoff_needed, only: :show + before_action :check_for_outage, only: :show def show analytics.idv_doc_auth_upload_visited(**analytics_arguments) diff --git a/app/controllers/idv/link_sent_controller.rb b/app/controllers/idv/link_sent_controller.rb index d37f9c02309..d8e2832f38d 100644 --- a/app/controllers/idv/link_sent_controller.rb +++ b/app/controllers/idv/link_sent_controller.rb @@ -11,6 +11,7 @@ class LinkSentController < ApplicationController before_action :confirm_upload_step_complete before_action :confirm_document_capture_needed before_action :extend_timeout_using_meta_refresh + before_action :check_for_outage, only: :show def show analytics.idv_doc_auth_link_sent_visited(**analytics_arguments) diff --git a/app/controllers/idv/phone_controller.rb b/app/controllers/idv/phone_controller.rb index b71379fbaac..c2029fed6bc 100644 --- a/app/controllers/idv/phone_controller.rb +++ b/app/controllers/idv/phone_controller.rb @@ -11,6 +11,7 @@ class PhoneController < ApplicationController before_action :confirm_verify_info_step_complete before_action :confirm_step_needed before_action :set_idv_form + before_action :check_for_outage, only: :show def new analytics.idv_phone_use_different(step: params[:step]) if params[:step] diff --git a/app/controllers/idv/ssn_controller.rb b/app/controllers/idv/ssn_controller.rb index b737ea56fad..b33a7c7b73d 100644 --- a/app/controllers/idv/ssn_controller.rb +++ b/app/controllers/idv/ssn_controller.rb @@ -11,6 +11,7 @@ class SsnController < ApplicationController before_action :confirm_verify_info_step_needed before_action :confirm_document_capture_complete before_action :override_csp_for_threat_metrix_no_fsm + before_action :check_for_outage, only: :show attr_accessor :error_message diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index ff2dc6d3f87..f88706d7c39 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -9,6 +9,7 @@ class VerifyInfoController < ApplicationController before_action :confirm_ssn_step_complete before_action :confirm_verify_info_step_needed + before_action :check_for_outage, only: :show def show @step_indicator_steps = step_indicator_steps From 461ea2f34d0716bfa75eea367eae674836b4d837 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Fri, 2 Jun 2023 14:26:41 -0400 Subject: [PATCH 04/13] before_action to be declare in doc_auth controller since removed from concern --- app/controllers/idv/doc_auth_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/idv/doc_auth_controller.rb b/app/controllers/idv/doc_auth_controller.rb index 8021a3a1701..bc14efb2a3e 100644 --- a/app/controllers/idv/doc_auth_controller.rb +++ b/app/controllers/idv/doc_auth_controller.rb @@ -13,6 +13,7 @@ class DocAuthController < ApplicationController before_action :redirect_if_flow_completed before_action :handle_fraud before_action :update_if_skipping_upload + before_action :check_for_outage, only: :show before_action :override_csp_for_threat_metrix From ee50ac2d05a892b072ea93ebf63b9abe05a3c2b7 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Fri, 2 Jun 2023 15:02:11 -0400 Subject: [PATCH 05/13] happy linting --- app/controllers/concerns/idv/outage_concern.rb | 2 +- app/controllers/idv/doc_auth_controller.rb | 2 ++ app/controllers/idv/document_capture_controller.rb | 2 ++ app/controllers/idv/hybrid_handoff_controller.rb | 2 ++ app/controllers/idv/link_sent_controller.rb | 2 ++ app/controllers/idv/phone_controller.rb | 2 ++ app/controllers/idv/ssn_controller.rb | 2 ++ app/controllers/idv/verify_info_controller.rb | 2 ++ 8 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index d0f55a409d1..f275bea6d77 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -21,4 +21,4 @@ def redirect_for_gpo_only redirect_to idv_mail_only_warning_url end end -end \ No newline at end of file +end diff --git a/app/controllers/idv/doc_auth_controller.rb b/app/controllers/idv/doc_auth_controller.rb index bc14efb2a3e..84078e5a105 100644 --- a/app/controllers/idv/doc_auth_controller.rb +++ b/app/controllers/idv/doc_auth_controller.rb @@ -13,7 +13,9 @@ class DocAuthController < ApplicationController before_action :redirect_if_flow_completed before_action :handle_fraud before_action :update_if_skipping_upload + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter before_action :override_csp_for_threat_metrix diff --git a/app/controllers/idv/document_capture_controller.rb b/app/controllers/idv/document_capture_controller.rb index a3a8056c1af..b4f384bc13b 100644 --- a/app/controllers/idv/document_capture_controller.rb +++ b/app/controllers/idv/document_capture_controller.rb @@ -13,7 +13,9 @@ class DocumentCaptureController < ApplicationController before_action :confirm_upload_step_complete before_action :confirm_document_capture_needed before_action :override_csp_to_allow_acuant + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter def show analytics.idv_doc_auth_document_capture_visited(**analytics_arguments) diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index c4a60900f4c..3886d78aa34 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -10,7 +10,9 @@ class HybridHandoffController < ApplicationController before_action :confirm_two_factor_authenticated before_action :confirm_agreement_step_complete before_action :confirm_hybrid_handoff_needed, only: :show + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter def show analytics.idv_doc_auth_upload_visited(**analytics_arguments) diff --git a/app/controllers/idv/link_sent_controller.rb b/app/controllers/idv/link_sent_controller.rb index d8e2832f38d..8962025da28 100644 --- a/app/controllers/idv/link_sent_controller.rb +++ b/app/controllers/idv/link_sent_controller.rb @@ -11,7 +11,9 @@ class LinkSentController < ApplicationController before_action :confirm_upload_step_complete before_action :confirm_document_capture_needed before_action :extend_timeout_using_meta_refresh + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter def show analytics.idv_doc_auth_link_sent_visited(**analytics_arguments) diff --git a/app/controllers/idv/phone_controller.rb b/app/controllers/idv/phone_controller.rb index c2029fed6bc..7cc37046e70 100644 --- a/app/controllers/idv/phone_controller.rb +++ b/app/controllers/idv/phone_controller.rb @@ -11,7 +11,9 @@ class PhoneController < ApplicationController before_action :confirm_verify_info_step_complete before_action :confirm_step_needed before_action :set_idv_form + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter def new analytics.idv_phone_use_different(step: params[:step]) if params[:step] diff --git a/app/controllers/idv/ssn_controller.rb b/app/controllers/idv/ssn_controller.rb index b33a7c7b73d..7c7a25ecab6 100644 --- a/app/controllers/idv/ssn_controller.rb +++ b/app/controllers/idv/ssn_controller.rb @@ -11,7 +11,9 @@ class SsnController < ApplicationController before_action :confirm_verify_info_step_needed before_action :confirm_document_capture_complete before_action :override_csp_for_threat_metrix_no_fsm + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter attr_accessor :error_message diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index f88706d7c39..6f64f66cf72 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -9,7 +9,9 @@ class VerifyInfoController < ApplicationController before_action :confirm_ssn_step_complete before_action :confirm_verify_info_step_needed + # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show + # rubocop:enable Rails/LexicallyScopedActionFilter def show @step_indicator_steps = step_indicator_steps From 56cc0252b6ca3ccd7dfb531f792289dbe2d5904e Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Fri, 2 Jun 2023 15:02:45 -0400 Subject: [PATCH 06/13] appears to be unused lingering code --- app/controllers/concerns/idv/outage_concern.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index f275bea6d77..5798d47a116 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -15,9 +15,6 @@ def redirect_for_gpo_only # step and go straight to document upload flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? - # session[:vendor_outage_redirect] = current_step - # session[:vendor_outage_redirect_from_idv] = true - redirect_to idv_mail_only_warning_url end end From bde8ebc357c73606fad9d62512fc9e5c74157219 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Mon, 5 Jun 2023 10:58:03 -0400 Subject: [PATCH 07/13] happy linting --- app/controllers/idv/document_capture_controller.rb | 2 -- app/controllers/idv/hybrid_handoff_controller.rb | 2 -- app/controllers/idv/link_sent_controller.rb | 2 -- app/controllers/idv/ssn_controller.rb | 2 -- app/controllers/idv/verify_info_controller.rb | 2 -- 5 files changed, 10 deletions(-) diff --git a/app/controllers/idv/document_capture_controller.rb b/app/controllers/idv/document_capture_controller.rb index b4f384bc13b..a3a8056c1af 100644 --- a/app/controllers/idv/document_capture_controller.rb +++ b/app/controllers/idv/document_capture_controller.rb @@ -13,9 +13,7 @@ class DocumentCaptureController < ApplicationController before_action :confirm_upload_step_complete before_action :confirm_document_capture_needed before_action :override_csp_to_allow_acuant - # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter def show analytics.idv_doc_auth_document_capture_visited(**analytics_arguments) diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index 3886d78aa34..c4a60900f4c 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -10,9 +10,7 @@ class HybridHandoffController < ApplicationController before_action :confirm_two_factor_authenticated before_action :confirm_agreement_step_complete before_action :confirm_hybrid_handoff_needed, only: :show - # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter def show analytics.idv_doc_auth_upload_visited(**analytics_arguments) diff --git a/app/controllers/idv/link_sent_controller.rb b/app/controllers/idv/link_sent_controller.rb index 8962025da28..d8e2832f38d 100644 --- a/app/controllers/idv/link_sent_controller.rb +++ b/app/controllers/idv/link_sent_controller.rb @@ -11,9 +11,7 @@ class LinkSentController < ApplicationController before_action :confirm_upload_step_complete before_action :confirm_document_capture_needed before_action :extend_timeout_using_meta_refresh - # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter def show analytics.idv_doc_auth_link_sent_visited(**analytics_arguments) diff --git a/app/controllers/idv/ssn_controller.rb b/app/controllers/idv/ssn_controller.rb index 7c7a25ecab6..b33a7c7b73d 100644 --- a/app/controllers/idv/ssn_controller.rb +++ b/app/controllers/idv/ssn_controller.rb @@ -11,9 +11,7 @@ class SsnController < ApplicationController before_action :confirm_verify_info_step_needed before_action :confirm_document_capture_complete before_action :override_csp_for_threat_metrix_no_fsm - # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter attr_accessor :error_message diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index 6f64f66cf72..f88706d7c39 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -9,9 +9,7 @@ class VerifyInfoController < ApplicationController before_action :confirm_ssn_step_complete before_action :confirm_verify_info_step_needed - # rubocop:disable Rails/LexicallyScopedActionFilter before_action :check_for_outage, only: :show - # rubocop:enable Rails/LexicallyScopedActionFilter def show @step_indicator_steps = step_indicator_steps From 5443afc1a3115964ea36f8f107b926a5f7b6992b Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Mon, 5 Jun 2023 11:26:52 -0400 Subject: [PATCH 08/13] add outageconcern to missing controllers --- app/controllers/idv/address_controller.rb | 2 ++ app/controllers/idv/in_person/verify_info_controller.rb | 2 ++ app/controllers/idv/review_controller.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/controllers/idv/address_controller.rb b/app/controllers/idv/address_controller.rb index 29acabfd2ca..2100911d972 100644 --- a/app/controllers/idv/address_controller.rb +++ b/app/controllers/idv/address_controller.rb @@ -2,8 +2,10 @@ module Idv class AddressController < ApplicationController include IdvSession include IdvStepConcern + include OutageConcern before_action :confirm_document_capture_complete + before_action :check_for_outage, only: :show def new analytics.idv_address_visit diff --git a/app/controllers/idv/in_person/verify_info_controller.rb b/app/controllers/idv/in_person/verify_info_controller.rb index 154ad7c5641..c09e2dc8cad 100644 --- a/app/controllers/idv/in_person/verify_info_controller.rb +++ b/app/controllers/idv/in_person/verify_info_controller.rb @@ -6,10 +6,12 @@ class VerifyInfoController < ApplicationController include StepUtilitiesConcern include Steps::ThreatMetrixStepHelper include VerifyInfoConcern + include OutageConcern before_action :renders_404_if_flag_not_set before_action :confirm_ssn_step_complete before_action :confirm_verify_info_step_needed + before_action :check_for_outage, only: :show def show @step_indicator_steps = step_indicator_steps diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb index 2cb7ad61914..06fec19856d 100644 --- a/app/controllers/idv/review_controller.rb +++ b/app/controllers/idv/review_controller.rb @@ -6,10 +6,12 @@ class ReviewController < ApplicationController include StepIndicatorConcern include PhoneConfirmation include FraudReviewConcern + inclue OutageConcern before_action :confirm_verify_info_step_complete before_action :confirm_address_step_complete before_action :confirm_current_password, only: [:create] + before_action :check_for_outage, only: :show helper_method :step_indicator_step From 919ae7e7a0ebbd2a17bf6483802723d4abaaa22c Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Mon, 5 Jun 2023 11:46:28 -0400 Subject: [PATCH 09/13] fix typo --- app/controllers/idv/review_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb index 06fec19856d..9eb139098cc 100644 --- a/app/controllers/idv/review_controller.rb +++ b/app/controllers/idv/review_controller.rb @@ -6,7 +6,7 @@ class ReviewController < ApplicationController include StepIndicatorConcern include PhoneConfirmation include FraudReviewConcern - inclue OutageConcern + include OutageConcern before_action :confirm_verify_info_step_complete before_action :confirm_address_step_complete From 97ccdea222ad2ae156a03519c625b16c6e59ea46 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Mon, 5 Jun 2023 12:02:12 -0400 Subject: [PATCH 10/13] no show controller remove outage concern before_action --- app/controllers/idv/address_controller.rb | 2 -- app/controllers/idv/review_controller.rb | 2 -- 2 files changed, 4 deletions(-) diff --git a/app/controllers/idv/address_controller.rb b/app/controllers/idv/address_controller.rb index 2100911d972..29acabfd2ca 100644 --- a/app/controllers/idv/address_controller.rb +++ b/app/controllers/idv/address_controller.rb @@ -2,10 +2,8 @@ module Idv class AddressController < ApplicationController include IdvSession include IdvStepConcern - include OutageConcern before_action :confirm_document_capture_complete - before_action :check_for_outage, only: :show def new analytics.idv_address_visit diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb index 9eb139098cc..2cb7ad61914 100644 --- a/app/controllers/idv/review_controller.rb +++ b/app/controllers/idv/review_controller.rb @@ -6,12 +6,10 @@ class ReviewController < ApplicationController include StepIndicatorConcern include PhoneConfirmation include FraudReviewConcern - include OutageConcern before_action :confirm_verify_info_step_complete before_action :confirm_address_step_complete before_action :confirm_current_password, only: [:create] - before_action :check_for_outage, only: :show helper_method :step_indicator_step From 8fe1296efd77f6d7b8af2102c0573c48cc6dab23 Mon Sep 17 00:00:00 2001 From: Amir Reavis-Bey <1261794+amirbey@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:54:25 -0400 Subject: [PATCH 11/13] specify flow session due to in_person flow having flow_session override :eyes: https://github.com/18F/identity-idp/pull/8517#discussion_r1218643539 Co-authored-by: Sonia Connolly --- app/controllers/concerns/idv/outage_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index 5798d47a116..af4ef978441 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -3,7 +3,7 @@ module OutageConcern extend ActiveSupport::Concern def check_for_outage - return if flow_session[:skip_vendor_outage] + return if user_session['idv/doc_auth'][:skip_vendor_outage] return redirect_for_gpo_only if FeatureManagement.idv_gpo_only? end From 2d381aa1dfe9e429ce7bba7174696b65cae1e189 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Tue, 6 Jun 2023 11:07:35 -0400 Subject: [PATCH 12/13] mimic flow_session method with default {} --- app/controllers/concerns/idv/outage_concern.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index af4ef978441..911c28234c6 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -3,7 +3,7 @@ module OutageConcern extend ActiveSupport::Concern def check_for_outage - return if user_session['idv/doc_auth'][:skip_vendor_outage] + return if user_session.fetch('idv/doc_auth', {})[:skip_vendor_outage] return redirect_for_gpo_only if FeatureManagement.idv_gpo_only? end @@ -13,7 +13,7 @@ def redirect_for_gpo_only # During a phone outage, skip the hybrid handoff # step and go straight to document upload - flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? + user_session.fetch('idv/doc_auth', {})[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? redirect_to idv_mail_only_warning_url end From c090f3b401ee61bf88d6d7bf8f15bc949df95d62 Mon Sep 17 00:00:00 2001 From: AmirReavis-Bey Date: Tue, 6 Jun 2023 11:41:15 -0400 Subject: [PATCH 13/13] happy linting --- app/controllers/concerns/idv/outage_concern.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/idv/outage_concern.rb b/app/controllers/concerns/idv/outage_concern.rb index 911c28234c6..73893f96ddb 100644 --- a/app/controllers/concerns/idv/outage_concern.rb +++ b/app/controllers/concerns/idv/outage_concern.rb @@ -13,7 +13,9 @@ def redirect_for_gpo_only # During a phone outage, skip the hybrid handoff # step and go straight to document upload - user_session.fetch('idv/doc_auth', {})[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? + unless FeatureManagement.idv_allow_hybrid_flow? + user_session.fetch('idv/doc_auth', {})[:skip_upload_step] = true + end redirect_to idv_mail_only_warning_url end