diff --git a/app/assets/images/inherited_proofing/switch.png b/app/assets/images/inherited_proofing/switch.png deleted file mode 100644 index 315b1e56868..00000000000 Binary files a/app/assets/images/inherited_proofing/switch.png and /dev/null differ diff --git a/app/assets/images/shield-spinner.gif b/app/assets/images/shield-spinner.gif deleted file mode 100644 index 729b9ad7f1c..00000000000 Binary files a/app/assets/images/shield-spinner.gif and /dev/null differ diff --git a/app/controllers/concerns/allowlisted_flow_step_concern.rb b/app/controllers/concerns/allowlisted_flow_step_concern.rb deleted file mode 100644 index 7a2d4ba1657..00000000000 --- a/app/controllers/concerns/allowlisted_flow_step_concern.rb +++ /dev/null @@ -1,37 +0,0 @@ -# This Concern satisfies the brakeman gem "Dynamic Render Path" violation -# that is raised when rendering dynamic content in views and partials -# that come directly from params. In the below example, idv_inherited_proofing_cancel_path -# would render "/verify/inherited_proofing/cancel?step=" where -# == the value of params[:step], which could potentially be dangerous: -# <%= render ButtonComponent.new(action: ->(...) do -# button_to(idv_inherited_proofing_cancel_path(step: params[:step]), ...) ... -# end -# %> -module AllowlistedFlowStepConcern - extend ActiveSupport::Concern - - included do - before_action :flow_step! - end - - private - - def flow_step! - flow_step = flow_step_param - unless flow_step_allowlist.include? flow_step - Rails.logger.warn "Flow step param \"#{flow_step})\" was not whitelisted!" - render_not_found and return - end - - @flow_step = flow_step - end - - # Override this method for flow step params other than params[:step] - def flow_step_param - params[:step] - end - - def flow_step_allowlist - raise NotImplementedError, '#flow_step_allowlist must be overridden' - end -end diff --git a/app/controllers/concerns/inherited_proofing_404_concern.rb b/app/controllers/concerns/inherited_proofing_404_concern.rb deleted file mode 100644 index 51abb1e6cb2..00000000000 --- a/app/controllers/concerns/inherited_proofing_404_concern.rb +++ /dev/null @@ -1,13 +0,0 @@ -module InheritedProofing404Concern - extend ActiveSupport::Concern - - included do - before_action :render_404_if_disabled - end - - private - - def render_404_if_disabled - render_not_found unless IdentityConfig.store.inherited_proofing_enabled - end -end diff --git a/app/controllers/concerns/inherited_proofing_concern.rb b/app/controllers/concerns/inherited_proofing_concern.rb deleted file mode 100644 index 3b26d60826b..00000000000 --- a/app/controllers/concerns/inherited_proofing_concern.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Methods to aid in handling incoming requests from 3rd-party -# inherited proofing service providers. Exclusively, methods -# to handle and help manage incoming requests to create a -# Login.gov account. -module InheritedProofingConcern - extend ActiveSupport::Concern - - # Returns true if Inherited Proofing is currently underway. - def inherited_proofing? - inherited_proofing_service_provider.present? - end - - def inherited_proofing_service_provider - return :va if va_inherited_proofing? - end - - # Department of Veterans Affairs (VA) methods. - # https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/products/identity/Inherited%20Proofing/MHV%20Inherited%20Proofing/inherited-proofing-interface.md - - # Returns true if the incoming request has been identified as a - # request to create a Login.gov account via inherited proofing - # from the VA. - def va_inherited_proofing? - va_inherited_proofing_auth_code.present? - end - - # The VA calls Login.gov to initiate inherited proofing of their - # users. An authorization code is passed as a query param that needs to - # be used in subsequent requests; this method returns this authorization - # code. - def va_inherited_proofing_auth_code - @va_inherited_proofing_auth_code ||= - decorated_session.request_url_params[va_inherited_proofing_auth_code_params_key] - end - - def va_inherited_proofing_auth_code_params_key - 'inherited_proofing_auth' - end - - def inherited_proofing_service_provider_data - if inherited_proofing_service_provider == :va - { auth_code: va_inherited_proofing_auth_code } - else - {} - end - end -end diff --git a/app/controllers/concerns/inherited_proofing_presenter_concern.rb b/app/controllers/concerns/inherited_proofing_presenter_concern.rb deleted file mode 100644 index 993589dda99..00000000000 --- a/app/controllers/concerns/inherited_proofing_presenter_concern.rb +++ /dev/null @@ -1,15 +0,0 @@ -module InheritedProofingPresenterConcern - extend ActiveSupport::Concern - - included do - before_action :init_presenter - end - - private - - def init_presenter - @presenter = Idv::InheritedProofing::InheritedProofingPresenter.new( - service_provider: inherited_proofing_service_provider, - ) - end -end diff --git a/app/controllers/idv/inherited_proofing_cancellations_controller.rb b/app/controllers/idv/inherited_proofing_cancellations_controller.rb deleted file mode 100644 index e14d7048d61..00000000000 --- a/app/controllers/idv/inherited_proofing_cancellations_controller.rb +++ /dev/null @@ -1,77 +0,0 @@ -module Idv - class InheritedProofingCancellationsController < ApplicationController - include IdvSession - include GoBackHelper - include InheritedProofing404Concern - include AllowlistedFlowStepConcern - - before_action :confirm_idv_needed - - def new - analytics.idv_cancellation_visited(step: params[:step], **analytics_properties) - self.session_go_back_path = go_back_path || idv_inherited_proofing_path - @presenter = CancellationsPresenter.new( - sp_name: decorated_session.sp_name, - url_options: url_options, - ) - end - - def update - analytics.idv_cancellation_go_back(step: params[:step], **analytics_properties) - redirect_to session_go_back_path || idv_inherited_proofing_path - end - - def destroy - analytics.idv_cancellation_confirmed(step: params[:step], **analytics_properties) - cancel_session - render json: { redirect_url: cancelled_redirect_path } - end - - private - - def cancel_session - cancel_idv_session - cancel_user_session - end - - def cancel_idv_session - idv_session = user_session[:idv] - idv_session&.clear - end - - def cancel_user_session - user_session['idv'] = {} - end - - def cancelled_redirect_path - return return_to_sp_failure_to_proof_path(location_params) if decorated_session.sp_name - - account_path - end - - def location_params - params.permit(:step, :location).to_h.symbolize_keys - end - - def session_go_back_path=(path) - idv_session.go_back_path = path - end - - def session_go_back_path - idv_session.go_back_path - end - - def flow_step_allowlist - @flow_step_allowlist ||= Idv::Flows::InheritedProofingFlow::STEPS.keys.map(&:to_s) - end - - def effective_user_id - current_user&.id - end - - def analytics_properties - route_properties = ParseControllerFromReferer.new(request.referer).call - route_properties.merge({ analytics_id: @analytics_id }) - end - end -end diff --git a/app/controllers/idv/inherited_proofing_controller.rb b/app/controllers/idv/inherited_proofing_controller.rb deleted file mode 100644 index d434751b33a..00000000000 --- a/app/controllers/idv/inherited_proofing_controller.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Idv - class InheritedProofingController < ApplicationController - before_action :confirm_two_factor_authenticated - - include Flow::FlowStateMachine - include IdvSession - include InheritedProofing404Concern - include InheritedProofingConcern - include InheritedProofingPresenterConcern - - FLOW_STATE_MACHINE_SETTINGS = { - step_url: :idv_inherited_proofing_step_url, - final_url: :idv_phone_url, - flow: Idv::Flows::InheritedProofingFlow, - analytics_id: 'Inherited Proofing', - }.freeze - - def return_to_sp - redirect_to return_to_sp_failure_to_proof_url(step: next_step, location: params[:location]) - end - end -end diff --git a/app/controllers/idv/inherited_proofing_errors_controller.rb b/app/controllers/idv/inherited_proofing_errors_controller.rb deleted file mode 100644 index b7cdf021f72..00000000000 --- a/app/controllers/idv/inherited_proofing_errors_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Idv - class InheritedProofingErrorsController < ApplicationController - include IdvSession - include InheritedProofingConcern - include InheritedProofingPresenterConcern - - def warning - end - - def failure - end - end -end diff --git a/app/controllers/idv/sessions_controller.rb b/app/controllers/idv/sessions_controller.rb index 9f93c28aa36..0021a4f9fa1 100644 --- a/app/controllers/idv/sessions_controller.rb +++ b/app/controllers/idv/sessions_controller.rb @@ -57,7 +57,6 @@ def cancel_in_person_enrollment_if_exists def clear_session user_session['idv/doc_auth'] = {} user_session['idv/in_person'] = {} - user_session['idv/inherited_proofing'] = {} idv_session.clear Pii::Cacher.new(current_user, user_session).delete end diff --git a/app/controllers/idv_controller.rb b/app/controllers/idv_controller.rb index 1968d8c0156..905043cbd51 100644 --- a/app/controllers/idv_controller.rb +++ b/app/controllers/idv_controller.rb @@ -1,7 +1,6 @@ class IdvController < ApplicationController include IdvSession include AccountReactivationConcern - include InheritedProofingConcern include FraudReviewConcern before_action :confirm_two_factor_authenticated @@ -34,7 +33,6 @@ def activated def verify_identity analytics.idv_intro_visit - return redirect_to idv_inherited_proofing_url if inherited_proofing? redirect_to idv_doc_auth_url end diff --git a/app/controllers/openid_connect/authorization_controller.rb b/app/controllers/openid_connect/authorization_controller.rb index 05ecba3247f..4a1e52f4cbe 100644 --- a/app/controllers/openid_connect/authorization_controller.rb +++ b/app/controllers/openid_connect/authorization_controller.rb @@ -6,7 +6,6 @@ class AuthorizationController < ApplicationController include SecureHeadersConcern include AuthorizationCountConcern include BillableEventTrackable - include InheritedProofingConcern include FraudReviewConcern before_action :build_authorize_form_from_params, only: [:index] diff --git a/app/forms/idv/inherited_proofing/base_form.rb b/app/forms/idv/inherited_proofing/base_form.rb deleted file mode 100644 index 16e144690ef..00000000000 --- a/app/forms/idv/inherited_proofing/base_form.rb +++ /dev/null @@ -1,120 +0,0 @@ -module Idv - module InheritedProofing - class BaseForm - include ActiveModel::Model - - class << self - def model_name - ActiveModel::Name.new(self, nil, namespaced_model_name) - end - - def namespaced_model_name - self.to_s.gsub('::', '') - end - end - - private_class_method :namespaced_model_name - - attr_reader :payload_hash - - def initialize(payload_hash:) - raise ArgumentError, 'payload_hash is blank?' if payload_hash.blank? - raise ArgumentError, 'payload_hash is not a Hash' unless payload_hash.is_a? Hash - - @payload_hash = payload_hash.dup - - populate_field_data - end - - def submit - FormResponse.new( - success: valid?, - errors: errors, - extra: {}, - ) - end - - # Perhaps overkill, but a mapper service of some kind, not bound to this class, - # that takes into consideration context, may be more suitable. In the meantime, - # simply return a Hash suitable to place into flow_session[:pii_from_user] in - # our inherited proofing flow steps. - def user_pii - raise NotImplementedError, 'Override this method and return a user PII Hash' - end - - private - - attr_writer :payload_hash - - # Populates our field data from the payload hash. - def populate_field_data - payload_field_info.each do |field_name, field_info| - # Ignore fields we're not interested in. - next unless respond_to? field_name - - value = payload_hash.dig( - *[field_info[:namespace], - field_info[:field_name]].flatten.compact, - ) - public_send("#{field_name}=", value) - end - end - - def payload_field_info - @payload_field_info ||= field_name_info_from payload_hash: payload_hash - end - - # This method simply navigates the payload hash received and creates qualified - # hash key names that can be used to verify/map to our field names in this model. - # This can be used to qualify nested hash fields and saves us some headaches - # if there are nested field names with the same name: - # - # given: - # - # payload_hash = { - # first_name: 'first_name', - # ... - # address: { - # street: '', - # ... - # } - # } - # - # field_name_info_from(payload_hash: payload_hash) #=> - # - # { - # :first_name=>{:field_name=>:first_name, :namespace=>[]}, - # ... - # :address_street=>{:field_name=>:street, :namespace=>[:address]}, - # ... - # } - # - # The generated, qualified field names expected to map to our model, because we named - # them as such. - # - # :field_name is the actual, unqualified field name found in the payload hash sent. - # :namespace is the hash key by which :field_name can be found in the payload hash - # if need be. - def field_name_info_from(payload_hash:, namespace: [], field_name_info: {}) - payload_hash.each do |key, value| - if value.is_a? Hash - field_name_info_from payload_hash: value, namespace: namespace << key, - field_name_info: field_name_info - namespace.pop - next - end - - namespace = namespace.dup - if namespace.blank? - field_name_info[key] = { field_name: key, namespace: namespace } - else - field_name_info["#{namespace.split.join('_')}_#{key}".to_sym] = - { field_name: key, namespace: namespace } - end - end - - field_name_info - end - end - end -end diff --git a/app/forms/idv/inherited_proofing/va/form.rb b/app/forms/idv/inherited_proofing/va/form.rb deleted file mode 100644 index 97878154d4a..00000000000 --- a/app/forms/idv/inherited_proofing/va/form.rb +++ /dev/null @@ -1,68 +0,0 @@ -module Idv - module InheritedProofing - module Va - class Form < Idv::InheritedProofing::BaseForm - REQUIRED_FIELDS = %i[first_name - last_name - birth_date - ssn - address_street - address_zip].freeze - OPTIONAL_FIELDS = %i[phone - address_street2 - address_city - address_state - address_country - service_error].freeze - FIELDS = (REQUIRED_FIELDS + OPTIONAL_FIELDS).freeze - - attr_accessor(*FIELDS) - validate :add_service_error, if: :service_error? - validates(*REQUIRED_FIELDS, presence: true, unless: :service_error?) - - def submit - extra = {} - extra = { service_error: service_error } if service_error? - - FormResponse.new( - success: validate, - errors: errors, - extra: extra, - ) - end - - def user_pii - raise 'User PII is invalid' unless valid? - - user_pii = {} - user_pii[:first_name] = first_name - user_pii[:last_name] = last_name - user_pii[:dob] = birth_date - user_pii[:ssn] = ssn - user_pii[:phone] = phone - user_pii[:address1] = address_street - user_pii[:city] = address_city - user_pii[:state] = address_state - user_pii[:zipcode] = address_zip - user_pii - end - - def service_error? - service_error.present? - end - - private - - def add_service_error - errors.add( - :service_provider, - # Use a "safe" error message for the model in case it's displayed - # to the user at any point. - I18n.t('inherited_proofing.errors.service_provider.communication'), - type: :service_error, - ) - end - end - end - end -end diff --git a/app/jobs/inherited_proofing_job.rb b/app/jobs/inherited_proofing_job.rb deleted file mode 100644 index c4f8d5f79e9..00000000000 --- a/app/jobs/inherited_proofing_job.rb +++ /dev/null @@ -1,21 +0,0 @@ -class InheritedProofingJob < ApplicationJob - include Idv::InheritedProofing::ServiceProviderServices - include JobHelpers::StaleJobHelper - - queue_as :default - - discard_on JobHelpers::StaleJobHelper::StaleJobError - - def perform(service_provider, service_provider_data, uuid) - document_capture_session = DocumentCaptureSession.find_by(uuid: uuid) - - payload_hash = inherited_proofing_service_for( - service_provider, - service_provider_data: service_provider_data, - ).execute - - raise_stale_job! if stale_job?(enqueued_at) - - document_capture_session.store_proofing_result(payload_hash) - end -end diff --git a/app/presenters/idv/inherited_proofing/inherited_proofing_presenter.rb b/app/presenters/idv/inherited_proofing/inherited_proofing_presenter.rb deleted file mode 100644 index cc74d37ba1c..00000000000 --- a/app/presenters/idv/inherited_proofing/inherited_proofing_presenter.rb +++ /dev/null @@ -1,29 +0,0 @@ -module Idv - module InheritedProofing - class InheritedProofingPresenter - attr_reader :service_provider - - def initialize(service_provider:) - @service_provider = service_provider - end - - def learn_more_phone_or_mail_url - 'https://www.va.gov/resources/managing-your-vagov-profile/' if va_inherited_proofing? - end - - def get_help_url - 'https://www.va.gov/resources/managing-your-vagov-profile/' if va_inherited_proofing? - end - - def contact_support_url - 'https://www.va.gov/resources/managing-your-vagov-profile/' if va_inherited_proofing? - end - - private - - def va_inherited_proofing? - service_provider == :va - end - end - end -end diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb index 802ba0e2ad7..83fff0f245f 100644 --- a/app/services/analytics_events.rb +++ b/app/services/analytics_events.rb @@ -567,68 +567,6 @@ def idv_verify_in_person_troubleshooting_option_clicked(flow_path:, in_person_ct ) end - # @param [Boolean] success - # @param [Hash] errors - # @param [String] flow_path Document capture path ("hybrid" or "standard") - # @param [String] step Document step user is on - # The user agrees to allow us to access their data via api call - def idv_inherited_proofing_agreement_submitted(success:, errors:, flow_path:, step:, **extra) - track_event( - 'IdV: inherited proofing agreement submitted', - success: success, - errors: errors, - flow_path: flow_path, - step: step, - **extra, - ) - end - - # @param [String] flow_path Document capture path ("hybrid" or "standard") - # @param [String] step Document step user is on - # The user visited the inherited proofing agreement page - def idv_inherited_proofing_agreement_visited(flow_path:, step:, **extra) - track_event( - 'IdV: inherited proofing agreement visited', - flow_path: flow_path, - step: step, - **extra, - ) - end - - # @param [Boolean] success - # @param [Hash] errors - # @param [String] flow_path Document capture path ("hybrid" or "standard") - # @param [String] step Document step user is on - # The user chooses to begin the inherited proofing process - def idv_inherited_proofing_get_started_submitted(success:, errors:, flow_path:, step:, **extra) - track_event( - 'IdV: inherited proofing get started submitted', - success: success, - errors: errors, - flow_path: flow_path, - step: step, - **extra, - ) - end - - # @param [String] flow_path Document capture path ("hybrid" or "standard") - # @param [String] step Document step user is on - # The user visited the inherited proofing get started step - def idv_inherited_proofing_get_started_visited(flow_path:, step:, **extra) - track_event( - 'IdV: inherited proofing get started visited', - flow_path: flow_path, - step: step, - **extra, - ) - end - - # Retry retrieving the user PII in the case where the first attempt fails - # in the agreement step, and the user initiates a "retry". - def idv_inherited_proofing_redo_retrieve_user_info_submitted(**extra) - track_event('IdV: inherited proofing retry retrieve user information submitted', **extra) - end - # @param [String] flow_path Document capture path ("hybrid" or "standard") # @param [String] in_person_cta_variant Variant testing bucket label # The user visited the in person proofing location step diff --git a/app/services/idv/actions/inherited_proofing/redo_retrieve_user_info_action.rb b/app/services/idv/actions/inherited_proofing/redo_retrieve_user_info_action.rb deleted file mode 100644 index a9fd7ed2c2e..00000000000 --- a/app/services/idv/actions/inherited_proofing/redo_retrieve_user_info_action.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Idv - module Actions - module InheritedProofing - class RedoRetrieveUserInfoAction < Idv::Steps::InheritedProofing::VerifyWaitStepShow - class << self - def analytics_submitted_event - :idv_inherited_proofing_redo_retrieve_user_info_submitted - end - end - - def call - enqueue_job unless api_call_already_in_progress? - - super - end - end - end - end -end diff --git a/app/services/idv/flows/inherited_proofing_flow.rb b/app/services/idv/flows/inherited_proofing_flow.rb deleted file mode 100644 index 2fc56d71103..00000000000 --- a/app/services/idv/flows/inherited_proofing_flow.rb +++ /dev/null @@ -1,42 +0,0 @@ -module Idv - module Flows - class InheritedProofingFlow < Flow::BaseFlow - STEPS = { - get_started: Idv::Steps::InheritedProofing::GetStartedStep, - agreement: Idv::Steps::InheritedProofing::AgreementStep, - verify_wait: Idv::Steps::InheritedProofing::VerifyWaitStep, - verify_info: Idv::Steps::InheritedProofing::VerifyInfoStep, - }.freeze - - OPTIONAL_SHOW_STEPS = { - verify_wait: Idv::Steps::InheritedProofing::VerifyWaitStepShow, - }.freeze - - STEP_INDICATOR_STEPS = [ - { name: :getting_started }, - { name: :verify_info }, - { name: :secure_account }, - ].freeze - - ACTIONS = { - redo_retrieve_user_info: Idv::Actions::InheritedProofing::RedoRetrieveUserInfoAction, - }.freeze - - attr_reader :idv_session - - def initialize(controller, session, name) - @idv_session = self.class.session_idv(session) - super(controller, STEPS, ACTIONS, session[name]) - - @flow_session ||= {} - @flow_session[:pii_from_user] ||= { uuid: current_user.uuid } - applicant = @idv_session['applicant'] || {} - @flow_session[:pii_from_user] = @flow_session[:pii_from_user].to_h.merge(applicant) - end - - def self.session_idv(session) - session[:idv] ||= {} - end - end - end -end diff --git a/app/services/idv/inherited_proofing/service_provider_forms.rb b/app/services/idv/inherited_proofing/service_provider_forms.rb deleted file mode 100644 index 51740b47ba3..00000000000 --- a/app/services/idv/inherited_proofing/service_provider_forms.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Idv - module InheritedProofing - module ServiceProviderForms - def inherited_proofing_form_for(service_provider, payload_hash:) - if service_provider == :va - return Idv::InheritedProofing::Va::Form.new payload_hash: payload_hash - end - - raise 'Inherited proofing form could not be identified' - end - end - end -end diff --git a/app/services/idv/inherited_proofing/service_provider_services.rb b/app/services/idv/inherited_proofing/service_provider_services.rb deleted file mode 100644 index 0dfadedc88b..00000000000 --- a/app/services/idv/inherited_proofing/service_provider_services.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Idv - module InheritedProofing - module ServiceProviderServices - def inherited_proofing_service_for(service_provider, service_provider_data:) - inherited_proofing_service_class_for(service_provider).new(service_provider_data) - end - - def inherited_proofing_service_class_for(service_provider) - unless IdentityConfig.store.inherited_proofing_enabled - raise 'Inherited Proofing is not enabled' - end - - if service_provider == :va - if IdentityConfig.store.va_inherited_proofing_mock_enabled - return Idv::InheritedProofing::Va::Mocks::Service - end - return Idv::InheritedProofing::Va::Service - end - - raise 'Inherited proofing service class could not be identified' - end - end - end -end diff --git a/app/services/idv/inherited_proofing/service_providers.rb b/app/services/idv/inherited_proofing/service_providers.rb deleted file mode 100644 index 7bb6b6ae8e9..00000000000 --- a/app/services/idv/inherited_proofing/service_providers.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Idv - module InheritedProofing - # This module is temporary until InheritedProofing has a viable way - # of identifying/communicating identifying Service Providers - # modules - module ServiceProviders - VA = :va - SERVICE_PROVIDERS = %i[VA] - end - end -end diff --git a/app/services/idv/inherited_proofing/va/mocks/service.rb b/app/services/idv/inherited_proofing/va/mocks/service.rb deleted file mode 100644 index e1150a9528d..00000000000 --- a/app/services/idv/inherited_proofing/va/mocks/service.rb +++ /dev/null @@ -1,59 +0,0 @@ -module Idv - module InheritedProofing - module Va - module Mocks - class Service - VALID_AUTH_CODE = 'mocked-auth-code-for-testing'.freeze - - attr_reader :auth_code - - PAYLOAD_HASH = { - first_name: 'Fakey', - last_name: 'Fakerson', - address: { - street: '123 Fake St', - street2: 'Apt 235', - city: 'Faketown', - state: 'WA', - country: nil, - zip: '98037', - }, - phone: '2063119187', - birth_date: '2022-1-31', - ssn: '123456789', - mhv_data: { - mhvId: 99999999, - identityProofedMethod: 'IPA', - identityDocumentExist: true, - identityProofingDate: '2020-12-14', - identityDocumentInfo: { - primaryIdentityDocumentNumber: '88888888', - primaryIdentityDocumentType: 'StateIssuedId', - primaryIdentityDocumentCountry: 'United States', - primaryIdentityDocumentExpirationDate: '2222-03-30', - }, - }, - }.freeze - - ERROR_HASH = { - service_error: 'the server responded with status 401', - }.freeze - - def initialize(service_provider_data) - @auth_code = service_provider_data[:auth_code] - end - - def execute - invalid_auth_code ? ERROR_HASH : PAYLOAD_HASH - end - - private - - def invalid_auth_code - @auth_code != VALID_AUTH_CODE - end - end - end - end - end -end diff --git a/app/services/idv/inherited_proofing/va/service.rb b/app/services/idv/inherited_proofing/va/service.rb deleted file mode 100644 index 7e7c76a7e28..00000000000 --- a/app/services/idv/inherited_proofing/va/service.rb +++ /dev/null @@ -1,111 +0,0 @@ -module Idv - module InheritedProofing - module Va - # Encapsulates request, response, error handling, validation, etc. for calling - # the VA service to gain PII for a particular user that will be subsequently - # used to proof the user using inherited proofing. - class Service - BASE_URI = IdentityConfig.store.inherited_proofing_va_base_url - - attr_reader :auth_code - - def initialize(service_provider_data) - @auth_code = service_provider_data[:auth_code] - end - - # Calls the endpoint and returns the decrypted response. - def execute - raise 'The provided auth_code is blank?' if auth_code.blank? - - begin - response = request - return payload_to_hash decrypt_payload(response) if response.status == 200 - - service_error(not_200_service_error(response.status)) - rescue => error - service_error(error.message) - end - end - - private - - def service_error(message) - { service_error: message } - end - - def not_200_service_error(http_status) - # Under certain circumstances, Faraday may return a nil http status. - # https://lostisland.github.io/faraday/middleware/raise-error - if http_status.blank? - http_status = 'unavailable' - http_status_description = 'unavailable' - else - http_status_description = Rack::Utils::HTTP_STATUS_CODES[http_status] - end - "The service provider API returned an http status other than 200: " \ - "#{http_status} (#{http_status_description})" - end - - def request - connection.get(request_uri) { |req| req.headers = request_headers } - end - - def connection - Faraday.new do |conn| - conn.options.timeout = request_timeout - conn.options.read_timeout = request_timeout - conn.options.open_timeout = request_timeout - conn.options.write_timeout = request_timeout - conn.request :instrumentation, name: 'inherited_proofing.va' - - # raises errors on 4XX or 5XX responses - conn.response :raise_error - end - end - - def request_timeout - @request_timeout ||= IdentityConfig.store.doc_auth_s3_request_timeout - end - - def request_uri - @request_uri ||= "#{ URI(BASE_URI) }/inherited_proofing/user_attributes" - end - - def request_headers - { Authorization: "Bearer #{jwt_token}" } - end - - def jwt_token - JWT.encode(jwt_payload, private_key, jwt_encryption) - end - - def jwt_payload - { inherited_proofing_auth: auth_code, exp: jwt_expires } - end - - def private_key - @private_key ||= AppArtifacts.store.oidc_private_key - end - - def jwt_encryption - 'RS256' - end - - def jwt_expires - 1.day.from_now.to_i - end - - def decrypt_payload(response) - payload = JSON.parse(response.body)['data'] - JWE.decrypt(payload, private_key) if payload - end - - def payload_to_hash(decrypted_payload, default: nil) - return default unless decrypted_payload.present? - - JSON.parse(decrypted_payload, symbolize_names: true) - end - end - end - end -end diff --git a/app/services/idv/steps/doc_auth_base_step.rb b/app/services/idv/steps/doc_auth_base_step.rb index bbc63bf9e7d..4c4a68c9b86 100644 --- a/app/services/idv/steps/doc_auth_base_step.rb +++ b/app/services/idv/steps/doc_auth_base_step.rb @@ -109,10 +109,6 @@ def document_capture_session_uuid_key :document_capture_session_uuid end - def inherited_proofing_verify_step_document_capture_session_uuid_key - :inherited_proofing_verify_step_document_capture_session_uuid - end - def verify_step_document_capture_session_uuid_key :idv_verify_step_document_capture_session_uuid end diff --git a/app/services/idv/steps/inherited_proofing/agreement_step.rb b/app/services/idv/steps/inherited_proofing/agreement_step.rb deleted file mode 100644 index b49e3d7ec7d..00000000000 --- a/app/services/idv/steps/inherited_proofing/agreement_step.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Idv - module Steps - module InheritedProofing - class AgreementStep < VerifyBaseStep - include UserPiiJobInitiator - - delegate :controller, :idv_session, to: :@flow - STEP_INDICATOR_STEP = :getting_started - - def self.analytics_visited_event - :idv_inherited_proofing_agreement_visited - end - - def self.analytics_submitted_event - :idv_inherited_proofing_agreement_submitted - end - - def call - enqueue_job - end - - def form_submit - Idv::ConsentForm.new.submit(consent_form_params) - end - - def consent_form_params - params.require(:inherited_proofing).permit(:ial2_consent_given) - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/get_started_step.rb b/app/services/idv/steps/inherited_proofing/get_started_step.rb deleted file mode 100644 index 7afedc41f9b..00000000000 --- a/app/services/idv/steps/inherited_proofing/get_started_step.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Idv - module Steps - module InheritedProofing - class GetStartedStep < InheritedProofingBaseStep - STEP_INDICATOR_STEP = :getting_started - - def self.analytics_visited_event - :idv_inherited_proofing_get_started_visited - end - - def self.analytics_submitted_event - :idv_inherited_proofing_get_started_submitted - end - - def call - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/user_pii_job_initiator.rb b/app/services/idv/steps/inherited_proofing/user_pii_job_initiator.rb deleted file mode 100644 index 3d39f3b0599..00000000000 --- a/app/services/idv/steps/inherited_proofing/user_pii_job_initiator.rb +++ /dev/null @@ -1,35 +0,0 @@ -module Idv - module Steps - module InheritedProofing - module UserPiiJobInitiator - private - - def enqueue_job - return if api_call_already_in_progress? - - create_document_capture_session( - inherited_proofing_verify_step_document_capture_session_uuid_key, - ).tap do |doc_capture_session| - doc_capture_session.create_proofing_session - - InheritedProofingJob.perform_later( - controller.inherited_proofing_service_provider, - controller.inherited_proofing_service_provider_data, - doc_capture_session.uuid, - ) - end - end - - def api_call_already_in_progress? - DocumentCaptureSession.find_by( - uuid: flow_session[inherited_proofing_verify_step_document_capture_session_uuid_key], - ).present? - end - - def delete_async - flow_session.delete(inherited_proofing_verify_step_document_capture_session_uuid_key) - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/user_pii_managable.rb b/app/services/idv/steps/inherited_proofing/user_pii_managable.rb deleted file mode 100644 index 08521d7cbc3..00000000000 --- a/app/services/idv/steps/inherited_proofing/user_pii_managable.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Idv - module Steps - module InheritedProofing - module UserPiiManagable - def inherited_proofing_save_user_pii_to_session!(user_pii) - inherited_proofing_save_session!(user_pii) - inherited_proofing_skip_steps! - end - - private - - def inherited_proofing_save_session!(user_pii) - flow_session[:pii_from_user] = - flow_session[:pii_from_user].to_h.merge(user_pii) - # This is unnecessary, but added for completeness. Any subsequent FLOWS we - # might splice into will pull from idv_session['applicant'] and merge into - # flow_session[:pii_from_user] anyhow in their #initialize(r); any subsequent - # STEP FLOWS we might splice into will populate idv_session['applicant'] and - # ultimately get merged in to flow_session[:pii_from_user] as well. - idv_session['applicant'] = flow_session[:pii_from_user] - end - - def inherited_proofing_skip_steps! - idv_session['profile_confirmation'] = true - idv_session['vendor_phone_confirmation'] = false - idv_session['user_phone_confirmation'] = false - idv_session['address_verification_mechanism'] = 'phone' - idv_session['resolution_successful'] = 'phone' - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/user_pii_retrievable.rb b/app/services/idv/steps/inherited_proofing/user_pii_retrievable.rb deleted file mode 100644 index 36323660088..00000000000 --- a/app/services/idv/steps/inherited_proofing/user_pii_retrievable.rb +++ /dev/null @@ -1,39 +0,0 @@ -module Idv - module Steps - module InheritedProofing - module UserPiiRetrievable - def inherited_proofing_user_pii - inherited_proofing_info[0] - end - - def inherited_proofing_form_response - inherited_proofing_info[1] - end - - private - - # This needs error handling. - def inherited_proofing_info - return @inherited_proofing_info if defined? @inherited_proofing_info - - payload_hash = inherited_proofing_service.execute.dup - form = inherited_proofing_form(payload_hash) - form_response = form.submit - - user_pii = {} - user_pii = form.user_pii if form_response.success? - - @inherited_proofing_info = [user_pii, form_response] - end - - def inherited_proofing_service - controller.inherited_proofing_service - end - - def inherited_proofing_form(payload_hash) - controller.inherited_proofing_form payload_hash - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/verify_info_step.rb b/app/services/idv/steps/inherited_proofing/verify_info_step.rb deleted file mode 100644 index b54f4e26e91..00000000000 --- a/app/services/idv/steps/inherited_proofing/verify_info_step.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Idv - module Steps - module InheritedProofing - class VerifyInfoStep < InheritedProofingBaseStep - STEP_INDICATOR_STEP = :verify_info - - def self.analytics_visited_event - :idv_doc_auth_verify_visited - end - - def self.analytics_submitted_event - :idv_doc_auth_verify_submitted - end - - def call - end - - def extra_view_variables - { - pii: pii, - step_url: method(:idv_inherited_proofing_step_url), - } - end - - def pii - flow_session[:pii_from_user] - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/verify_wait_step.rb b/app/services/idv/steps/inherited_proofing/verify_wait_step.rb deleted file mode 100644 index 856d20a55e7..00000000000 --- a/app/services/idv/steps/inherited_proofing/verify_wait_step.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Idv - module Steps - module InheritedProofing - class VerifyWaitStep < InheritedProofingBaseStep - STEP_INDICATOR_STEP = :getting_started - - def self.analytics_visited_event - :idv_doc_auth_verify_wait_step_visited - end - - def call; end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing/verify_wait_step_show.rb b/app/services/idv/steps/inherited_proofing/verify_wait_step_show.rb deleted file mode 100644 index 611c8d8731d..00000000000 --- a/app/services/idv/steps/inherited_proofing/verify_wait_step_show.rb +++ /dev/null @@ -1,114 +0,0 @@ -module Idv - module Steps - module InheritedProofing - class VerifyWaitStepShow < VerifyBaseStep - include UserPiiJobInitiator - include UserPiiManagable - include Idv::InheritedProofing::ServiceProviderForms - delegate :controller, :idv_session, to: :@flow - - STEP_INDICATOR_STEP = :getting_started - - def self.analytics_optional_step_event - :idv_doc_auth_optional_verify_wait_submitted - end - - def call - poll_with_meta_refresh(IdentityConfig.store.poll_rate_for_verify_in_seconds) - - process_async_state(async_state) - end - - private - - def process_async_state(current_async_state) - return if current_async_state.in_progress? - - if current_async_state.none? - mark_step_incomplete(:agreement) - elsif current_async_state.missing? - flash[:error] = I18n.t('idv.failure.timeout') - delete_async - mark_step_incomplete(:agreement) - @flow.analytics.idv_proofing_resolution_result_missing - elsif current_async_state.done? - async_state_done(current_async_state) - end - end - - def async_state - return ProofingSessionAsyncResult.none if dcs_uuid.nil? - return ProofingSessionAsyncResult.missing if document_capture_session.nil? - return ProofingSessionAsyncResult.missing if api_job_result.nil? - - api_job_result - end - - def async_state_done(_current_async_state) - service_provider = controller.inherited_proofing_service_provider - - form = inherited_proofing_form_for( - service_provider, - payload_hash: api_job_result[:result], - ) - form_response = form.submit - - delete_async - - if form_response.success? - inherited_proofing_save_user_pii_to_session!(form.user_pii) - mark_step_complete(:verify_wait) - elsif throttle.throttled? - idv_failure(form_response) - else - mark_step_complete(:agreement) - idv_failure(form_response) - end - - form_response - end - - def dcs_uuid - @dcs_uuid ||= - flow_session[inherited_proofing_verify_step_document_capture_session_uuid_key] - end - - def document_capture_session - @document_capture_session ||= DocumentCaptureSession.find_by(uuid: dcs_uuid) - end - - def api_job_result - document_capture_session.load_proofing_result - end - - # Base class overrides - - def throttle - @throttle ||= Throttle.new( - user: current_user, - throttle_type: :inherited_proofing, - ) - end - - def idv_failure_log_throttled - @flow.analytics.throttler_rate_limit_triggered( - throttle_type: throttle.throttle_type, - step_name: self.class.name, - ) - end - - def throttled_url - idv_inherited_proofing_errors_failure_url(flow: :inherited_proofing) - end - - def exception_url - idv_inherited_proofing_errors_failure_url(flow: :inherited_proofing) - end - - def warning_url - idv_inherited_proofing_errors_no_information_url(flow: :inherited_proofing) - end - end - end - end -end diff --git a/app/services/idv/steps/inherited_proofing_base_step.rb b/app/services/idv/steps/inherited_proofing_base_step.rb deleted file mode 100644 index 43c18f90889..00000000000 --- a/app/services/idv/steps/inherited_proofing_base_step.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Idv - module Steps - class InheritedProofingBaseStep < Flow::BaseStep - delegate :controller, :idv_session, to: :@flow - - def initialize(flow) - super(flow, :inherited_proofing) - end - - private - - def sp_session - session.fetch(:sp, {}) - end - end - end -end diff --git a/app/services/throttle.rb b/app/services/throttle.rb index 04adb68310d..b5c4a992c78 100644 --- a/app/services/throttle.rb +++ b/app/services/throttle.rb @@ -211,10 +211,6 @@ def self.load_throttle_config max_attempts: IdentityConfig.store.phone_confirmation_max_attempts, attempt_window: IdentityConfig.store.phone_confirmation_max_attempt_window_in_minutes, }, - inherited_proofing: { - max_attempts: IdentityConfig.store.inherited_proofing_max_attempts, - attempt_window: IdentityConfig.store.inherited_proofing_max_attempt_window_in_minutes, - }, phone_otp: { max_attempts: IdentityConfig.store.otp_delivery_blocklist_maxretry + 1, attempt_window: IdentityConfig.store.otp_delivery_blocklist_findtime, diff --git a/app/views/idv/inherited_proofing/_cancel.html.erb b/app/views/idv/inherited_proofing/_cancel.html.erb deleted file mode 100644 index 52947a558bc..00000000000 --- a/app/views/idv/inherited_proofing/_cancel.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%# -locals: -* step: Current step, used in analytics logging. -%> -<%= render PageFooterComponent.new do %> - <%= link_to cancel_link_text, idv_inherited_proofing_cancel_path(step: local_assigns[:step]) %> -<% end %> diff --git a/app/views/idv/inherited_proofing/_verify.html.erb b/app/views/idv/inherited_proofing/_verify.html.erb deleted file mode 100644 index 3efa83cbd3b..00000000000 --- a/app/views/idv/inherited_proofing/_verify.html.erb +++ /dev/null @@ -1,70 +0,0 @@ -<%# -locals: - pii - user's information - step_url - generator for step URLs -%> -<% title t('inherited_proofing.headings.verify_information') %> - -<%= render PageHeadingComponent.new.with_content(t('titles.idv.verify_info')) %> -
-
-
-
-
<%= t('idv.form.first_name') %>:
-
<%= pii[:first_name] %>
-
-
-
<%= t('idv.form.last_name') %>:
-
<%= pii[:last_name] %>
-
-
-
<%= t('idv.form.dob') %>:
-
<%= pii[:dob] %>
-
-
-
-
-
-
-
<%= t('idv.form.address1') %>:
-
<%= pii[:address1] %>
-
- <% if pii[:address2].present? %> -
-
<%= t('idv.form.address2') %>:
-
<%= pii[:address2] %>
-
- <% end %> -
-
<%= t('idv.form.city') %>:
-
<%= pii[:city] %>
-
-
-
<%= t('idv.form.state') %>:
-
<%= pii[:state] %>
-
-
-
<%= t('idv.form.zipcode') %>:
-
<%= pii[:zipcode] %>
-
-
-
-
-
- <%= t('idv.form.ssn') %>: - <%= render( - 'shared/masked_text', - text: SsnFormatter.format(pii[:ssn]), - masked_text: SsnFormatter.format_masked(pii[:ssn]), - accessible_masked_text: t( - 'idv.accessible_labels.masked_ssn', - first_number: pii[:ssn][0], - last_number: pii[:ssn][-1], - ), - toggle_label: t('forms.ssn.show'), - ) %> -
-
-
- -<% javascript_packs_tag_once 'form-steps-wait' %> diff --git a/app/views/idv/inherited_proofing/agreement.html.erb b/app/views/idv/inherited_proofing/agreement.html.erb deleted file mode 100644 index e74f11a9206..00000000000 --- a/app/views/idv/inherited_proofing/agreement.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -<% title t('inherited_proofing.headings.lets_go') %> - -<%= render AlertComponent.new( - type: :error, - class: [ - 'js-consent-form-alert', - 'margin-bottom-4', - flow_session[:error_message].blank? && 'display-none', - ].select(&:present?), - message: flow_session[:error_message].presence || t('errors.inherited_proofing.consent_form'), - ) %> - -<%= render PageHeadingComponent.new.with_content(t('inherited_proofing.headings.lets_go')) %> -

<%= t('inherited_proofing.info.lets_go') %>

-

<%= t('inherited_proofing.headings.verify_identity') %>

-

<%= t('inherited_proofing.info.verify_identity') %>

-

<%= t('inherited_proofing.headings.secure_account') %>

-

<%= t('inherited_proofing.info.secure_account') %>

- -<%= simple_form_for( - :inherited_proofing, - url: url_for, - method: 'put', - html: { autocomplete: 'off', class: 'margin-top-2 margin-bottom-5 js-consent-continue-form' }, - ) do |f| %> - <%= render ValidatedFieldComponent.new( - form: f, - name: :ial2_consent_given, - as: :boolean, - label: capture do %> - <%= t('inherited_proofing.instructions.consent', app_name: APP_NAME) %> - <%= new_window_link_to( - t('inherited_proofing.instructions.learn_more'), - MarketingSite.security_and_privacy_practices_url, - ) %> - <% end, - required: true, - ) %> - <%= f.submit t('inherited_proofing.buttons.continue'), class: 'margin-top-4' %> -<% end %> - -<%= render 'idv/inherited_proofing/cancel', step: 'agreement' %> diff --git a/app/views/idv/inherited_proofing/get_started.html.erb b/app/views/idv/inherited_proofing/get_started.html.erb deleted file mode 100644 index 93bd0b9552f..00000000000 --- a/app/views/idv/inherited_proofing/get_started.html.erb +++ /dev/null @@ -1,58 +0,0 @@ -<% title t('inherited_proofing.headings.welcome') %> - -<%= render JavascriptRequiredComponent.new( - header: t('idv.welcome.no_js_header'), - intro: t('idv.welcome.no_js_intro', sp_name: decorated_session.sp_name || t('inherited_proofing.info.no_sp_name')), - ) do %> - <%= render PageHeadingComponent.new.with_content(t('inherited_proofing.headings.welcome')) %> -

- <%= t('inherited_proofing.info.welcome_html', sp_name: decorated_session.sp_name || t('inherited_proofing.info.no_sp_name')) %> -

- -

- <%= t('inherited_proofing.instructions.verify_requirements') %> - <%= new_window_link_to(t('inherited_proofing.troubleshooting.options.learn_more_phone_or_mail'), 'https://www.va.gov/resources/managing-your-vagov-profile/') %> -

- - <%= simple_form_for :inherited_proofing, - url: url_for, - method: 'put', - html: { autocomplete: 'off', class: 'margin-y-5' } do |f| %> - <%= f.submit t('inherited_proofing.buttons.continue') %> - <% end %> - - <%= render( - 'shared/troubleshooting_options', - heading_tag: :h3, - heading: t('inherited_proofing.troubleshooting.headings.missing_required_items'), - options: [ - { - url: @presenter.learn_more_phone_or_mail_url, - text: t('inherited_proofing.troubleshooting.options.learn_more_phone_or_mail'), - new_tab: true, - }, - { - url: @presenter.get_help_url, - text: t( - 'inherited_proofing.troubleshooting.options.get_help', - sp_name: decorated_session.sp_name, - ), - new_tab: true, - }, - ].select(&:present?), - ) %> - -

<%= t('inherited_proofing.instructions.privacy') %>

-

- <%= t( - 'inherited_proofing.info.privacy_html', - app_name: APP_NAME, - link: new_window_link_to( - t('inherited_proofing.instructions.learn_more'), - MarketingSite.security_and_privacy_practices_url, - ), - ) %> -

- - <%= render 'shared/cancel', link: idv_inherited_proofing_cancel_path(step: 'get_started') %> -<% end %> diff --git a/app/views/idv/inherited_proofing/verify_info.html.erb b/app/views/idv/inherited_proofing/verify_info.html.erb deleted file mode 100644 index ee7321025aa..00000000000 --- a/app/views/idv/inherited_proofing/verify_info.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%= render 'verify', pii: pii, step_url: step_url %> - -<%= simple_form_for :inherited_proofing, - url: url_for, - method: 'put', - html: { autocomplete: 'off', class: 'margin-y-5' } do |f| %> - <%= f.submit t('inherited_proofing.buttons.continue') %> -<% end %> - -<%= render( - 'shared/troubleshooting_options', - heading_tag: :h3, - heading: t('inherited_proofing.troubleshooting.headings.need_help_updating'), - options: [ - { - url: @presenter.get_help_url, - text: t( - 'inherited_proofing.troubleshooting.options.get_help', - sp_name: decorated_session.sp_name, - ), - new_tab: true, - }, - ].select(&:present?), - ) %> - -<%= render 'idv/inherited_proofing/cancel', step: 'verify_info' %> diff --git a/app/views/idv/inherited_proofing/verify_wait.html.erb b/app/views/idv/inherited_proofing/verify_wait.html.erb deleted file mode 100644 index 2936142e739..00000000000 --- a/app/views/idv/inherited_proofing/verify_wait.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<%= content_for(:meta_refresh) { @meta_refresh.to_s } %> -<% title t('inherited_proofing.headings.retrieval') %> - -<%= render PageHeadingComponent.new.with_content(t('inherited_proofing.headings.retrieval')) %> - -
- <%= image_tag( - asset_url('shield-spinner.gif'), - alt: '', - width: 120, - height: 120, - ) %> -
- -

<%= t('inherited_proofing.info.retrieval_time') %>

-

<%= t('inherited_proofing.info.retrieval_thanks') %>

-<%= render 'idv/inherited_proofing/cancel', step: 'verify_info' %> diff --git a/app/views/idv/inherited_proofing_cancellations/destroy.html.erb b/app/views/idv/inherited_proofing_cancellations/destroy.html.erb deleted file mode 100644 index 116524f15b5..00000000000 --- a/app/views/idv/inherited_proofing_cancellations/destroy.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% title t('titles.inherited_proofing.cancelled') %> - -<%= render StatusPageComponent.new(status: :error) do |c| %> - <% c.header { t('inherited_proofing.cancel.headings.confirmation.hybrid') } %> - -

<%= t('inherited_proofing.cancel.instructions.switch_back') %>

- <%= image_tag(asset_url('inherited_proofing/switch.png'), width: 193, height: 109, alt: t('inherited_proofing.cancel.instructions.switch_back_image')) %> -<% end %> diff --git a/app/views/idv/inherited_proofing_cancellations/new.html.erb b/app/views/idv/inherited_proofing_cancellations/new.html.erb deleted file mode 100644 index 159f8363027..00000000000 --- a/app/views/idv/inherited_proofing_cancellations/new.html.erb +++ /dev/null @@ -1,54 +0,0 @@ -<% title t('titles.inherited_proofing.cancellation_prompt') %> - -<%= render StatusPageComponent.new(status: :warning) do |c| %> - <% c.header { t('inherited_proofing.cancel.headings.prompt.standard') } %> - -

<%= t('inherited_proofing.cancel.headings.start_over') %>

- -

<%= t('inherited_proofing.cancel.description.start_over') %>

- -
- <%= render ButtonComponent.new( - action: ->(**tag_options, &block) do - button_to(idv_inherited_proofing_session_path(step: @flow_step), **tag_options, &block) - end, - method: :delete, - big: true, - wide: true, - ).with_content(t('inherited_proofing.cancel.actions.start_over')) %> -
- <%= render ButtonComponent.new( - action: ->(**tag_options, &block) do - button_to(idv_inherited_proofing_cancel_path(step: @flow_step), **tag_options, &block) - end, - method: :put, - big: true, - wide: true, - outline: true, - ).with_content(t('inherited_proofing.cancel.actions.keep_going')) %> -
-
- -
- -

<%= @presenter.exit_heading %>

- - <% @presenter.exit_description.each do |p_content| %> -

<%= p_content %>

- <% end %> - -
- <%= render SpinnerButtonComponent.new( - action: ->(**tag_options, &block) do - button_to(idv_inherited_proofing_cancel_path(step: @flow_step, location: 'cancel'), **tag_options, &block) - end, - method: :delete, - big: true, - wide: true, - outline: true, - form: { data: { form_steps_wait: '' } }, - ).with_content(@presenter.exit_action_text) %> -
-<% end %> - -<% javascript_packs_tag_once 'form-steps-wait' %> diff --git a/app/views/idv/inherited_proofing_errors/failure.html.erb b/app/views/idv/inherited_proofing_errors/failure.html.erb deleted file mode 100644 index 1fc683429f7..00000000000 --- a/app/views/idv/inherited_proofing_errors/failure.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= render( - 'idv/shared/error', - title: t('inherited_proofing.errors.cannot_retrieve.title'), - heading: t('inherited_proofing.errors.cannot_retrieve.heading'), - ) do %> -

- <%= t('inherited_proofing.errors.cannot_retrieve.failure_info') %> -

- - <%= render( - 'shared/troubleshooting_options', - heading: t('inherited_proofing.troubleshooting.headings.need_assistance'), - options: [ - { - url: @presenter.get_help_url, - text: t( - 'inherited_proofing.troubleshooting.options.get_help', - sp_name: decorated_session.sp_name, - ), - new_tab: true, - }, - { - url: @presenter.contact_support_url, - text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), - new_tab: true, - }, - ], - ) %> -<% end %> diff --git a/app/views/idv/inherited_proofing_errors/warning.html.erb b/app/views/idv/inherited_proofing_errors/warning.html.erb deleted file mode 100644 index 70448fbd81e..00000000000 --- a/app/views/idv/inherited_proofing_errors/warning.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%= render( - 'idv/shared/error', - type: :warning, - title: t('inherited_proofing.errors.cannot_retrieve.title'), - heading: t('inherited_proofing.errors.cannot_retrieve.heading'), - ) do %> -

- <%= t('inherited_proofing.errors.cannot_retrieve.info') %> -

- - <%= button_to t('inherited_proofing.buttons.try_again'), idv_inherited_proofing_step_path(step: :redo_retrieve_user_info), method: :put, class: 'usa-button usa-button--big usa-button--wide' %> - - <%= render( - 'shared/troubleshooting_options', - heading: t('components.troubleshooting_options.default_heading'), - options: [ - { - url: @presenter.get_help_url, - text: t( - 'inherited_proofing.troubleshooting.options.get_help', - sp_name: decorated_session.sp_name, - ), - new_tab: true, - }, - ], - ) %> -<% end %> diff --git a/config/application.yml.default b/config/application.yml.default index 788586fcf0a..4c0b5ee2cbd 100644 --- a/config/application.yml.default +++ b/config/application.yml.default @@ -143,11 +143,6 @@ in_person_results_delay_in_hours: 1 in_person_completion_survey_url: 'https://login.gov' in_person_verify_info_controller_enabled: false include_slo_in_saml_metadata: false -inherited_proofing_enabled: false -inherited_proofing_va_base_url: 'https://staging-api.va.gov' -inherited_proofing_max_attempts: 2 -inherited_proofing_max_attempt_window_in_minutes: 1 -va_inherited_proofing_mock_enabled: false irs_attempt_api_audience: 'https://irs.gov' irs_attempt_api_auth_tokens: '' irs_attempt_api_csp_id: 'LOGIN.gov' @@ -373,8 +368,6 @@ development: hmac_fingerprinter_key_queue: '["11111111111111111111111111111111", "22222222222222222222222222222222"]' identity_pki_local_dev: true in_person_proofing_enabled: true - inherited_proofing_enabled: true - va_inherited_proofing_mock_enabled: true irs_attempt_api_public_key: MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyut9Uio5XxsIUVrXARqCoHvcMVYT0p6WyU1BnbhxLRW4Q60p+4Bn32vVOt9nzeih7qvauYM5M0PZdKEmwOHflqPP+ABfKhL+6jxBhykN5P5UY375wTFBJZ20Fx8jOJbRhJD02oUQ49YKlDu3MG5Y0ApyD4ER4WKgxuB2OdyQKd9vg2ZZa+P2pw1HkFPEin0h8KBUFBeLGDZni8PIJdHBP6dA+xbayGBxSM/8xQC0JIg6KlGTcLql37QJIhP2oSv0nAJNb6idFPAz0uMCQDQWKKWV5FUDCsFVH7VuQz8xUCwnPn/SdaratB+29bwUpVhgHXrHdJ0i8vjBEX7smD7pI8CcFHuVgACt86NMlBnNCVkwumQgZNAAxe2mJoYcotEWOnhCuMc6MwSj985bj8XEdFlbf4ny9QO9rETd5aYcwXBiV/T6vd637uvHb0KenghNmlb1Tv9LMj2b9ZwNc9C6oeCnbN2YAfxSDrb8Ik+yq4hRewOvIK7f0CcpZYDXK25aHXnHm306Uu53KIwMGf1mha5T5LWTNaYy5XFoMWHJ9E+AnU/MUJSrwCAITH/S0JFcna5Oatn70aTE9pISATsqB5Iz1c46MvdrxD8hPoDjT7x6/EO316DZrxQfJhjbWsCB+R0QxYLkXPHczhB2Z0HPna9xB6RbJHzph7ifDizhZoMCAwEAAQ== irs_attempt_api_public_key_id: key1 irs_attempt_api_enabled: true @@ -523,8 +516,6 @@ test: hmac_fingerprinter_key: a2c813d4dca919340866ba58063e4072adc459b767a74cf2666d5c1eef3861db26708e7437abde1755eb24f4034386b0fea1850a1cb7e56bff8fae3cc6ade96c hmac_fingerprinter_key_queue: '["old-key-one", "old-key-two"]' identity_pki_disabled: true - inherited_proofing_enabled: true - va_inherited_proofing_mock_enabled: false irs_attempt_api_auth_tokens: 'test-token-1,test-token-2' irs_attempt_api_public_key: MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyut9Uio5XxsIUVrXARqCoHvcMVYT0p6WyU1BnbhxLRW4Q60p+4Bn32vVOt9nzeih7qvauYM5M0PZdKEmwOHflqPP+ABfKhL+6jxBhykN5P5UY375wTFBJZ20Fx8jOJbRhJD02oUQ49YKlDu3MG5Y0ApyD4ER4WKgxuB2OdyQKd9vg2ZZa+P2pw1HkFPEin0h8KBUFBeLGDZni8PIJdHBP6dA+xbayGBxSM/8xQC0JIg6KlGTcLql37QJIhP2oSv0nAJNb6idFPAz0uMCQDQWKKWV5FUDCsFVH7VuQz8xUCwnPn/SdaratB+29bwUpVhgHXrHdJ0i8vjBEX7smD7pI8CcFHuVgACt86NMlBnNCVkwumQgZNAAxe2mJoYcotEWOnhCuMc6MwSj985bj8XEdFlbf4ny9QO9rETd5aYcwXBiV/T6vd637uvHb0KenghNmlb1Tv9LMj2b9ZwNc9C6oeCnbN2YAfxSDrb8Ik+yq4hRewOvIK7f0CcpZYDXK25aHXnHm306Uu53KIwMGf1mha5T5LWTNaYy5XFoMWHJ9E+AnU/MUJSrwCAITH/S0JFcna5Oatn70aTE9pISATsqB5Iz1c46MvdrxD8hPoDjT7x6/EO316DZrxQfJhjbWsCB+R0QxYLkXPHczhB2Z0HPna9xB6RbJHzph7ifDizhZoMCAwEAAQ== irs_attempt_api_public_key_id: key1 diff --git a/config/locales/errors/en.yml b/config/locales/errors/en.yml index 83688ef42fd..cb1d6c92a8a 100644 --- a/config/locales/errors/en.yml +++ b/config/locales/errors/en.yml @@ -34,9 +34,6 @@ en: security, we limit the number of times you can attempt to verify a document online.' general: Oops, something went wrong. Please try again. - inherited_proofing: - consent_form: Before you can continue, you must give us permission. Please check - the box below and then click continue.blah invalid_totp: Invalid code. Please try again. max_password_attempts_reached: You’ve entered too many incorrect passwords. You can reset your password using the “Forgot your password?” link. diff --git a/config/locales/errors/es.yml b/config/locales/errors/es.yml index bf923b3355f..eb5aa277e49 100644 --- a/config/locales/errors/es.yml +++ b/config/locales/errors/es.yml @@ -35,8 +35,6 @@ es: %{timeout}. Por su seguridad, limitamos el número de veces que puede intentar verificar un documento en línea.' general: '¡Oops! Algo salió mal. Inténtelo de nuevo.' - inherited_proofing: - consent_form: to be implemented invalid_totp: El código es inválido. Vuelva a intentarlo. max_password_attempts_reached: Ha ingresado demasiadas contraseñas incorrectas. Puede restablecer su contraseña usando el enlace “¿Olvidó su contraseña?”. diff --git a/config/locales/errors/fr.yml b/config/locales/errors/fr.yml index d2b4a55b0f0..b1649a805d0 100644 --- a/config/locales/errors/fr.yml +++ b/config/locales/errors/fr.yml @@ -39,8 +39,6 @@ fr: votre sécurité, nous limitons le nombre de fois où vous pouvez tenter de vérifier un document en ligne.' general: Oups, une erreur s’est produite. Veuillez essayer de nouveau. - inherited_proofing: - consent_form: to be implemented invalid_totp: Code non valide. Veuillez essayer de nouveau. max_password_attempts_reached: Vous avez inscrit des mots de passe incorrects un trop grand nombre de fois. Vous pouvez réinitialiser votre mot de passe en diff --git a/config/locales/inherited_proofing/en.yml b/config/locales/inherited_proofing/en.yml deleted file mode 100644 index 38da46a43ab..00000000000 --- a/config/locales/inherited_proofing/en.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -en: - inherited_proofing: - buttons: - continue: Continue - try_again: Try again - cancel: - actions: - keep_going: No, keep going - start_over: Start over - description: - start_over: If you start over, you will restart this process from the beginning - and the information you entered will not be saved. - headings: - confirmation: - hybrid: You have cancelled uploading photos of your ID on this phone - prompt: - standard: Cancel verifying your identity? - start_over: Start over verifying your identity - instructions: - switch_back: Switch back to your computer to finish verifying your identity. - switch_back_image: Arrow pointing from phone to computer - errors: - cannot_retrieve: - failure_info: Please check back later. - heading: We could not retrieve your information from your Partner Agency - info: We are temporarily having trouble retrieving your information. Please try - again. - title: Couldn’t retrieve information - service_provider: - communication: 'communication was unsuccessful' - headings: - lets_go: How verifying your identity works - retrieval: We are retrieving your information from your Partner Agency - secure_account: Secure your account - verify_identity: Verify your identity - verify_information: Verify your information - welcome: Get started verifying your identity - info: - lets_go: 'Identity verification happens in two parts:' - no_sp_name: VA needs to make sure you are you - privacy_html: '%{app_name} is a secure, government website that adheres to the - highest standards in data protection. We only use your data to verify - your identity. %{link} about our privacy and security measures.' - retrieval_thanks: Thanks for your patience! - retrieval_time: This might take up to a minute. We’ll load the next step - automatically when it’s done. - secure_account: We’ll encrypt your account with your password. Encryption means - your data is protected and only you will be able to access or change - your information. - verify_identity: We’ll retrieve your personal information from %{sp_name} and - ask you to verify it. - welcome_html: '%{sp_name} needs to make sure you are you - not someone - pretending to be you.' - instructions: - consent: By checking this box, you are letting login.gov ask for, use, keep, and - share your personal information. We will only use it to verify your - identity. - learn_more: Learn more - privacy: Our privacy and security standards - verify_requirements: We’ll call or text your phone number to verify your - identity. If we can’t verify your phone number, you can verify by mail - instead. - troubleshooting: - headings: - missing_required_items: Don’t have a phone number? Here’s how to get help - need_assistance: 'Need immediate assistance? Here’s how to get help:' - need_help_updating: Need to update your information? Here’s how to get help - options: - get_help: Get help at the %{sp_name} web site - learn_more_phone_or_mail: Learn more about verifying by phone or mail diff --git a/config/locales/inherited_proofing/es.yml b/config/locales/inherited_proofing/es.yml deleted file mode 100644 index d79cfd9ead4..00000000000 --- a/config/locales/inherited_proofing/es.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -es: - inherited_proofing: - buttons: - continue: Continuar - try_again: Inténtelo de nuevo - cancel: - actions: - keep_going: No, continuar - start_over: Empezar de nuevo - description: - start_over: Si empieza de nuevo, el proceso se reiniciará y la información que - haya ingresado se perderá. - headings: - confirmation: - hybrid: Ha cancelado la carga de fotos de su identificación en este teléfono - prompt: - standard: '¿Cancelar la verificación de su identidad?' - start_over: Empezar de nuevo a verificar su identidad - instructions: - switch_back: Regrese a su computadora para continuar con la verificación de su - identidad. - switch_back_image: Flecha que apunta del teléfono a la computadora - errors: - cannot_retrieve: - failure_info: to be implemented - heading: No hemos podido obtener su información de su agencia colaboradora - info: Estamos teniendo problemas temporalmente para obtener su información. - Inténtelo de nuevo. - title: to be implemented - service_provider: - communication: 'la comunicacion no tuvo exito' - headings: - lets_go: Cómo funciona la verificación de su identidad - retrieval: Estamos recuperando su información de su agencia colaboradora - secure_account: Asegure su cuenta - verify_identity: Verifique su identidad - verify_information: Verifique su información - welcome: Empiece con la verificación de su identidad - info: - lets_go: 'La verificación de la identidad se realiza en dos partes:' - no_sp_name: La agencia a la que está intentando acceder - privacy_html: '%{app_name} es un sitio web gubernamental seguro que cumple con - las normas más estrictas de protección de datos. Solo utilizamos sus - datos para verificar su identidad. %{link} sobre nuestras medidas de - privacidad y seguridad.' - retrieval_thanks: '¡Gracias por su paciencia!' - retrieval_time: Esto puede tardar hasta un minuto. Cargaremos el siguiente paso - automáticamente cuando haya terminado. - secure_account: Cifraremos su cuenta con su contraseña. La encriptación - significa que sus datos están protegidos y solo usted podrá acceder o - modificar su información. - verify_identity: Obtendremos su información personal de %{sp_name} y le - pediremos que la verifique. - welcome_html: '%{sp_name} necesita asegurarse de que sea usted y no alguien que - se haga pasar por usted.' - instructions: - consent: Al marcar esta casilla, usted permite que login.gov solicite, utilice, - conserve y comparta su información personal. Solo la utilizaremos para - verificar su identidad. - learn_more: Obtenga más información - privacy: Nuestras normas de privacidad y seguridad - verify_requirements: Te llamaremos o te enviaremos un mensaje de texto a tu - número de teléfono para verificar tu identidad. Si no podemos verificar - tu número de teléfono, puedes realizar la verificación por correo - postal. - troubleshooting: - headings: - missing_required_items: ¿No tienes número de teléfono? A continuación, te - indicamos cómo obtener ayuda - need_assistance: to be implemented - need_help_updating: ¿Necesita actualizar su información? A continuación le - indicamos cómo obtener ayuda - options: - get_help: Obtenga ayuda en %{sp_name} - learn_more_phone_or_mail: Más información sobre la verificación por teléfono o correo postal. diff --git a/config/locales/inherited_proofing/fr.yml b/config/locales/inherited_proofing/fr.yml deleted file mode 100644 index 140a6dc8650..00000000000 --- a/config/locales/inherited_proofing/fr.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -fr: - inherited_proofing: - buttons: - continue: Continuer - try_again: Réessayez - cancel: - actions: - keep_going: Non, continuer - start_over: Recommencer - description: - start_over: Si vous recommencez, vous reprendrez ce processus depuis le début et - les informations que vous avez saisies ne seront pas enregistrées. - headings: - confirmation: - hybrid: Vous avez annulé le téléchargement de vos photos d’identité sur ce - téléphone - prompt: - standard: Annuler la vérification de votre identité? - start_over: Recommencez la vérification de votre identité - instructions: - switch_back: Retournez sur votre ordinateur pour continuer à vérifier votre - identité. - switch_back_image: Flèche pointant du téléphone vers l’ordinateur - errors: - cannot_retrieve: - failure_info: to be implemented - heading: Nous n’avons pas pu récupérer vos informations dans votre agence - partenaire - info: Nous avons temporairement des difficultés à récupérer vos informations. - Veuillez réessayer. - title: to be implemented - service_provider: - communication: 'la communication a échoué' - headings: - lets_go: Comment fonctionne la vérification de votre identité - retrieval: Nous récupérons vos informations depuis votre agence partenaire. - secure_account: Sécuriser votre compte - verify_identity: Vérifier votre identité - verify_information: Vérifier votre information - welcome: Commencez à vérifier votre identité - info: - lets_go: 'La vérification de l’identité se fait en deux temps :' - no_sp_name: L’agence à laquelle vous essayez d’accéder - privacy_html: '%{app_name} est un site gouvernemental sécurisé qui respecte les - normes les plus strictes en matière de protection des données. Nous - n’utilisons vos données uniquement pour vérifier votre identité. %{link} - sur nos mesures de confidentialité et de sécurité.' - retrieval_thanks: Merci de votre patience! - retrieval_time: Cette opération peut prendre jusqu’à une minute. Nous chargerons - automatiquement l’étape suivante lorsque ce sera fait. - secure_account: Votre compte sera crypté avec votre mot de passe. Le cryptage - signifie que vos données sont protégées et que vous seul pourrez accéder - à vos informations ou les modifier. - verify_identity: Nous récupérerons vos informations personnelles sur %{sp_name} - et vous demanderons de les vérifier. - welcome_html: '%{sp_name} doit s’assurer que vous êtes bien vous, et non - quelqu’un qui se fait passer pour vous' - instructions: - consent: En cochant cette case, vous autorisez login.gov à demander, utiliser, - conserver et partager vos renseignements personnels. Nous ne les - utiliserons que pour vérifier votre identité. - learn_more: En savoir plus - privacy: Nos normes de confidentialité et de sécurité - verify_requirements: Nous allons vous appeler ou vous envoyer un SMS à partir de - votre contact pour vérifier votre identité. Si nous ne pouvons pas - vérifier votre numéro de téléphone, vous pouvez le faire par courriel. - troubleshooting: - headings: - missing_required_items: Vous n’avez pas de numéro de téléphone? Voici comment obtenir de l’aide - need_assistance: to be implemented - need_help_updating: Vous devez mettre à jour vos informations? Voici comment - obtenir de l’aide - options: - get_help: Obtenez de l’aide sur %{sp_name} - learn_more_phone_or_mail: En savoir plus sur la vérification par téléphone ou par courriel. diff --git a/config/locales/titles/en.yml b/config/locales/titles/en.yml index 783638a1ef9..2c68199daf3 100644 --- a/config/locales/titles/en.yml +++ b/config/locales/titles/en.yml @@ -42,9 +42,6 @@ en: reset_password: Reset Password review: Re-enter your password verify_info: Verify your information - inherited_proofing: - cancellation_prompt: Cancel identity verification - cancelled: Identity verification is cancelled mfa_setup: suggest_second_mfa: You’ve added your first authentication method! Add a second method as a backup. diff --git a/config/locales/titles/es.yml b/config/locales/titles/es.yml index 458620a62ee..8fd68b95f94 100644 --- a/config/locales/titles/es.yml +++ b/config/locales/titles/es.yml @@ -42,9 +42,6 @@ es: reset_password: Restablecer la contraseña review: Vuelve a ingresar tu contraseña verify_info: Verifica tu información - inherited_proofing: - cancellation_prompt: Cancela la verificación de identidad - cancelled: Se canceló la verificación de identidad mfa_setup: suggest_second_mfa: '¡Has agregado tu primer método de autenticación! Agrega un segundo método como respaldo.' diff --git a/config/locales/titles/fr.yml b/config/locales/titles/fr.yml index 5175de061b2..84a680fed84 100644 --- a/config/locales/titles/fr.yml +++ b/config/locales/titles/fr.yml @@ -42,9 +42,6 @@ fr: reset_password: Réinitialisez le mot de passe review: Saisissez à nouveau votre mot de passe verify_info: Vérifiez vos informations - inherited_proofing: - cancellation_prompt: Annulez la vérification d’identité - cancelled: La vérification d’identité est annulée mfa_setup: suggest_second_mfa: Vous avez ajouté votre première méthode d’authentification ! Ajoutez-en une deuxième en guise de sauvegarde. diff --git a/config/routes.rb b/config/routes.rb index 20fb8449910..bbee73be125 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -366,22 +366,6 @@ post '/confirmations' => 'personal_key#update' end - # Inherited Proofing (IP)-specific routes. - scope '/verify/inherited_proofing', module: 'idv', as: 'idv_inherited_proofing' do - # NOTE: cancellation routes need to be before any other IP - # routes in this scope. - delete '/session' => 'sessions#destroy' - get '/cancel' => 'inherited_proofing_cancellations#new', as: :cancel - put '/cancel' => 'inherited_proofing_cancellations#update' - delete '/cancel' => 'inherited_proofing_cancellations#destroy' - get '/' => 'inherited_proofing#index' - get '/:step' => 'inherited_proofing#show', as: :step - put '/:step' => 'inherited_proofing#update' - get '/return_to_sp' => 'inherited_proofing#return_to_sp' - get '/errors/no_information' => 'inherited_proofing_errors#warning' - get '/errors/failure' => 'inherited_proofing_errors#failure' - end - namespace :api do post '/verify/v2/document_capture' => 'verify/document_capture#create' delete '/verify/v2/document_capture_errors' => 'verify/document_capture_errors#delete' diff --git a/lib/identity_config.rb b/lib/identity_config.rb index e5982dfcfc6..f6ff43b26c1 100644 --- a/lib/identity_config.rb +++ b/lib/identity_config.rb @@ -222,11 +222,6 @@ def self.build_store(config_map) config.add(:in_person_completion_survey_url, type: :string) config.add(:in_person_verify_info_controller_enabled, type: :boolean) config.add(:include_slo_in_saml_metadata, type: :boolean) - config.add(:inherited_proofing_enabled, type: :boolean) - config.add(:inherited_proofing_va_base_url, type: :string) - config.add(:inherited_proofing_max_attempts, type: :integer) - config.add(:inherited_proofing_max_attempt_window_in_minutes, type: :integer) - config.add(:va_inherited_proofing_mock_enabled, type: :boolean) config.add(:irs_attempt_api_audience) config.add(:irs_attempt_api_auth_tokens, type: :comma_separated_string_list) config.add(:irs_attempt_api_bucket_name, type: :string, allow_nil: true) diff --git a/lib/session_encryptor.rb b/lib/session_encryptor.rb index 113a1b496b1..2ac918f8f7d 100644 --- a/lib/session_encryptor.rb +++ b/lib/session_encryptor.rb @@ -20,7 +20,6 @@ class SensitiveValueError < StandardError; end # personal keys are generated and stored in the session between requests, but are used # to decrypt PII bundles, so we treat them similarly to the PII itself. SENSITIVE_PATHS = [ - ['warden.user.user.session', 'idv/inherited_proofing'], ['warden.user.user.session', 'idv/doc_auth'], ['warden.user.user.session', 'idv/in_person'], ['warden.user.user.session', 'idv'], diff --git a/scripts/inherited_proofing/errorable.rb b/scripts/inherited_proofing/errorable.rb deleted file mode 100644 index 2c4bd406de6..00000000000 --- a/scripts/inherited_proofing/errorable.rb +++ /dev/null @@ -1,23 +0,0 @@ -module Scripts - module InheritedProofing - module Errorable - module_function - - def puts_message(message) - puts message - end - - def puts_success(message) - puts_message "Success: #{message}" - end - - def puts_warning(message) - puts_message "Warning: #{message}" - end - - def puts_error(message) - puts_message "Oops! An error occurred: #{message}" - end - end - end -end diff --git a/scripts/inherited_proofing/va/lexis_nexis/phone_finder.rb b/scripts/inherited_proofing/va/lexis_nexis/phone_finder.rb deleted file mode 100644 index 4f32e37e5f1..00000000000 --- a/scripts/inherited_proofing/va/lexis_nexis/phone_finder.rb +++ /dev/null @@ -1,28 +0,0 @@ -module Scripts - module InheritedProofing - module Va - module LexisNexis - module PhoneFinder - class << self - def call(user_pii) - proofer = if IdentityConfig.store.proofer_mock_fallback - Proofing::Mock::AddressMockClient.new - else - Proofing::LexisNexis::PhoneFinder::Proofer.new( - phone_finder_workflow: IdentityConfig.store.lexisnexis_phone_finder_workflow, - account_id: IdentityConfig.store.lexisnexis_account_id, - base_url: IdentityConfig.store.lexisnexis_base_url, - username: IdentityConfig.store.lexisnexis_username, - password: IdentityConfig.store.lexisnexis_password, - request_mode: IdentityConfig.store.lexisnexis_request_mode, - ) - end - - proofer.proof user_pii - end - end - end - end - end - end -end diff --git a/scripts/inherited_proofing/va/lexis_nexis/test_script.rb b/scripts/inherited_proofing/va/lexis_nexis/test_script.rb deleted file mode 100644 index 7a3d17c5262..00000000000 --- a/scripts/inherited_proofing/va/lexis_nexis/test_script.rb +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env ruby - -# rubocop:disable Layout/LineLength - -# Usage -# -# 1) Run with no ARGV and BASE_URI in the Idv::InheritedProofing::Va::Service -# will default to a base uri of: IdentityConfig.store.inherited_proofing_va_base_url -# and a private key using: AppArtifacts.store.oidc_private_key -# -# $ bin/rails r scripts/inherited_proofing/va/lexis_nexis/test_script.rb -# -# 2) To override BASE_URI in the Idv::InheritedProofing::Va::Service class -# and/or use a private key file, and/or force an error return. -# Where -u|-t|-f forces proofing to fail -# -# NOTE: Private key files are forced to be located at "#{Rails.root}/tmp". -# $ bin/rails r scripts/inherited_proofing/va/lexis_nexis/test_script.rb https://staging-api.va.gov private.key -u|-t|-f - -require_relative '../user_attributes/test_server' -require_relative './phone_finder' -require_relative '../../errorable' - -def error_phone_or_default(fail_option:, default_phone:) - return case fail_option - when '-u' - Scripts::InheritedProofing::Errorable.puts_message "Forcing unverifiable phone number failure (#{fail_option})" - Proofing::Mock::AddressMockClient::UNVERIFIABLE_PHONE_NUMBER - when '-t' - Scripts::InheritedProofing::Errorable.puts_message "Forcing proofer timeout failure (#{fail_option})" - Proofing::Mock::AddressMockClient::PROOFER_TIMEOUT_PHONE_NUMBER - when '-f' - Scripts::InheritedProofing::Errorable.puts_message "Forcing failed to contact phone number (#{fail_option})" - Proofing::Mock::AddressMockClient::FAILED_TO_CONTACT_PHONE_NUMBER - else - default_phone - end -end - -raise 'You must run this from the command-line!' unless $PROGRAM_NAME == __FILE__ - -Scripts::InheritedProofing::Errorable.puts_message "\nTesting call to Lexis Nexis Phone Finder - START" - -form, form_response = Scripts::InheritedProofing::Va::UserAttributes::TestServer.new( - auth_code: 'mocked-auth-code-for-testing', - base_uri: ARGV[0], - private_key_file: ARGV[1], -).run - -Scripts::InheritedProofing::Errorable.puts_message "Form response:\n\t#{form_response.to_h}" - -user_pii = form.payload_hash -user_pii[:uuid] = SecureRandom.uuid -# Lexis Nexis Phone Finder expects dob (as opposed to birth_date). -user_pii[:dob] = user_pii.delete(:birth_date) -user_pii[:phone] = error_phone_or_default fail_option: ARGV[2], default_phone: user_pii[:phone] -user_pii.delete(:address) -user_pii.delete(:mhv_data) - -Scripts::InheritedProofing::Errorable.puts_message "Calling Lexis Nexis Phone Finder using:\n\t#{user_pii}}" - -# Verify the user's pii. -address_proofer_results = Scripts::InheritedProofing::Va::LexisNexis::PhoneFinder.call(user_pii) - -Scripts::InheritedProofing::Errorable.puts_message "Call to Lexis Nexis Phone Finder complete. Results:\n\t#{address_proofer_results.to_h}" - -Scripts::InheritedProofing::Errorable.puts_message "\nTesting call to Lexis Nexis Phone Finder - END" - -Scripts::InheritedProofing::Errorable.puts_message "\nDone." -# rubocop:enable Layout/LineLength diff --git a/scripts/inherited_proofing/va/user_attributes/test_script.rb b/scripts/inherited_proofing/va/user_attributes/test_script.rb deleted file mode 100644 index 7586c86ee2e..00000000000 --- a/scripts/inherited_proofing/va/user_attributes/test_script.rb +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env ruby - -# Usage -# -# 1) Run with no ARGV and BASE_URI in the Idv::InheritedProofing::Va::Service -# will default to a base uri of: IdentityConfig.store.inherited_proofing_va_base_url -# and a private key using: AppArtifacts.store.oidc_private_key -# -# $ bin/rails r scripts/inherited_proofing/va/user_attributes/test_script.rb -# -# 2) To override BASE_URI in the Idv::InheritedProofing::Va::Service class -# and/or use a private key file: -# -# rubocop:disable Layout/LineLength -# NOTE: Private key files are forced to be located at "#{Rails.root}/tmp". -# $ bin/rails r scripts/inherited_proofing/va/user_attributes/test_script.rb https://staging-api.va.gov private.key -# rubocop:enable Layout/LineLength - -require_relative '../../../../app/services/idv/inherited_proofing/va/service' -require_relative '../../../../app/forms/idv/inherited_proofing/va/form' -require_relative '../../errorable' -require_relative './test_server' - -raise 'You must run this from the command-line!' unless $PROGRAM_NAME == __FILE__ - -Scripts::InheritedProofing::Errorable.puts_message "\nTesting call to VA API - START\n\n" - -_form, form_response = Scripts::InheritedProofing::Va::UserAttributes::TestServer.new( - auth_code: 'mocked-auth-code-for-testing', - base_uri: ARGV[0], - private_key_file: ARGV[1], -).run - -Scripts::InheritedProofing::Errorable.puts_message "Form response:\n\t#{form_response.to_h}" - -Scripts::InheritedProofing::Errorable.puts_message "\nTesting call to VA API - END" - -Scripts::InheritedProofing::Errorable.puts_message "\nDone." diff --git a/scripts/inherited_proofing/va/user_attributes/test_server.rb b/scripts/inherited_proofing/va/user_attributes/test_server.rb deleted file mode 100644 index ce5a65b2e9b..00000000000 --- a/scripts/inherited_proofing/va/user_attributes/test_server.rb +++ /dev/null @@ -1,88 +0,0 @@ -require_relative '../../errorable' - -module Scripts - module InheritedProofing - module Va - module UserAttributes - class TestServer < Idv::InheritedProofing::Va::Service - include Errorable - - attr_reader :base_uri - - def initialize(auth_code:, private_key_file: nil, base_uri: nil) - super({ auth_code: auth_code }) - - if private_key_file.present? - @private_key_file = force_tmp_private_key_file_name(private_key_file) - end - @base_uri = base_uri || BASE_URI - end - - def run - begin - # rubocop:disable Layout/LineLength - puts_message "Retrieving the user's PII from the VA using auth code: '#{auth_code}' at #{request_uri}..." - puts_message "Retrieved payload containing the user's PII from the VA:\n\tRetrieved user PII: #{user_pii}" - # rubocop:enable Layout/LineLength - - puts_message "Validating payload containing the user's PII from the VA..." - if form_response.success? - puts_success "Retrieved user PII is valid:\n\t#{user_pii}" - else - puts_error "Payload returned from the VA is invalid:" \ - "\n\t#{form.errors.full_messages}" - end - rescue => e - puts_error e.message - end - - [form, form_response] - end - - private - - attr_reader :private_key_file - - # Override - def request_uri - @request_uri ||= "#{ URI(@base_uri) }/inherited_proofing/user_attributes" - end - - def user_pii - @user_pii ||= execute - end - - def form - @form ||= Idv::InheritedProofing::Va::Form.new(payload_hash: user_pii) - end - - def form_response - @form_response ||= form.submit - end - - def private_key - if private_key_file? - if File.exist?(private_key_file) - return OpenSSL::PKey::RSA.new(File.read(private_key_file)) - else - puts_warning "private key file does not exist, using artifacts store: " \ - "#{private_key_file}" - end - end - - AppArtifacts.store.oidc_private_key - end - - def private_key_file? - @private_key_file.present? - end - - # Always ensure we're referencing files in the /tmp/ folder! - def force_tmp_private_key_file_name(private_key_file) - "#{Rails.root}/tmp/#{File.basename(private_key_file)}" - end - end - end - end - end -end diff --git a/scripts/va-api-test.rb b/scripts/va-api-test.rb deleted file mode 100755 index f99e9b6e97d..00000000000 --- a/scripts/va-api-test.rb +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env ruby - -require 'jwt' -require 'jwe' -require 'net/http' - -# Script to test connection to VA API, can be removed once we create code inside the IDV flow -class VaApiTest - def run - uri = URI 'https://staging-api.va.gov/inherited_proofing/user_attributes' - headers = { Authorization: "Bearer #{jwt_token}" } - - response = Net::HTTP.get_response(uri, headers) - decrypt_payload(response) - end - - private - - def jwt_token - payload = { inherited_proofing_auth: 'mocked-auth-code-for-testing', exp: 1.day.from_now.to_i } - JWT.encode(payload, private_key, 'RS256') - end - - def decrypt_payload(response) - payload = JSON.parse(response.body)['data'] - JWE.decrypt(payload, private_key) if payload - end - - def private_key - return AppArtifacts.store.oidc_private_key if private_key_store? - - OpenSSL::PKey::RSA.new(File.read(private_key_file)) - end - - # Returns true if a private key store should be used - # (as opposed to the private key file). - def private_key_store? - Identity::Hostdata.in_datacenter? || !private_key_file? - end - - def private_key_file? - File.exist?(private_key_file) - end - - def private_key_file - @private_key_file ||= 'tmp/va_ip.key' - end -end - -puts(VaApiTest.new.run || 'VaApiTest#run returned no output') if $PROGRAM_NAME == __FILE__ diff --git a/spec/controllers/concerns/inherited_proofing_concern_spec.rb b/spec/controllers/concerns/inherited_proofing_concern_spec.rb deleted file mode 100644 index 5796827f075..00000000000 --- a/spec/controllers/concerns/inherited_proofing_concern_spec.rb +++ /dev/null @@ -1,92 +0,0 @@ -require 'rails_helper' - -RSpec.describe InheritedProofingConcern do - subject do - Class.new do - include InheritedProofingConcern - end.new - end - - before do - allow(IdentityConfig.store).to receive(:inherited_proofing_enabled).and_return(true) - allow(subject).to receive(:va_inherited_proofing_auth_code).and_return auth_code - end - - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - let(:payload_hash) { Idv::InheritedProofing::Va::Mocks::Service::PAYLOAD_HASH } - - describe '#inherited_proofing?' do - context 'when inherited proofing proofing is not effect' do - let(:auth_code) { nil } - - it 'returns false' do - expect(subject.inherited_proofing?).to eq false - end - end - - context 'when inherited proofing proofing is effect' do - it 'returns true' do - expect(subject.inherited_proofing?).to eq true - end - end - end - - describe '#inherited_proofing_service_provider' do - context 'when a service provider cannot be identified' do - before do - allow(subject).to receive(:va_inherited_proofing_auth_code).and_return nil - end - - it 'returns nil' do - expect(subject.inherited_proofing_service_provider).to eq nil - end - end - - context 'when a service provider can be identified' do - let(:va) { :va } - - it 'returns the service provider' do - expect(subject.inherited_proofing_service_provider).to eq va - end - end - end - - describe '#va_inherited_proofing?' do - context 'when the va auth code is present' do - it 'returns true' do - expect(subject.va_inherited_proofing?).to eq true - end - end - - context 'when the va auth code is not present' do - let(:auth_code) { nil } - - it 'returns false' do - expect(subject.va_inherited_proofing?).to eq false - end - end - end - - describe '#va_inherited_proofing_auth_code_params_key' do - it 'returns the correct va auth code url query param key' do - expect(subject.va_inherited_proofing_auth_code_params_key).to eq 'inherited_proofing_auth' - end - end - - describe '#inherited_proofing_service_provider_data' do - context 'when there is a va inherited proofing request' do - it 'returns the correct service provider-specific data' do - expect(subject.inherited_proofing_service_provider_data).to \ - eq({ auth_code: auth_code }) - end - end - - context 'when the inherited proofing request cannot be identified' do - let(:auth_code) { nil } - - it 'returns an empty hash' do - expect(subject.inherited_proofing_service_provider_data).to eq({}) - end - end - end -end diff --git a/spec/controllers/idv/inherited_proofing_cancellations_controller_spec.rb b/spec/controllers/idv/inherited_proofing_cancellations_controller_spec.rb deleted file mode 100644 index 86451d87906..00000000000 --- a/spec/controllers/idv/inherited_proofing_cancellations_controller_spec.rb +++ /dev/null @@ -1,245 +0,0 @@ -require 'rails_helper' - -shared_examples 'an HTML 404 not found' do - it 'returns a 404 not found' do - expect(response).to have_http_status(:not_found) - end -end - -describe Idv::InheritedProofingCancellationsController do - let(:step) { Idv::Flows::InheritedProofingFlow::STEPS.keys.first } - - describe 'before_actions' do - it 'includes before_actions from IdvSession' do - expect(subject).to have_actions(:before, :redirect_if_sp_context_needed) - end - - it 'includes before_actions from InheritedProofing404Concern' do - expect(subject).to have_actions(:before, :render_404_if_disabled) - end - - it 'includes before_actions from AllowlistedFlowStepConcern' do - expect(subject).to have_actions(:before, :flow_step!) - end - end - - describe '#new' do - let(:go_back_path) { '/path/to/return' } - - before do - allow(controller).to receive(:go_back_path).and_return(go_back_path) - end - - context 'when the inherited proofing feature flipper is turned off' do - before do - allow(IdentityConfig.store).to receive(:inherited_proofing_enabled).and_return(false) - stub_sign_in - end - - describe '#new' do - before do - get :new, params: { step: step } - end - - it_behaves_like 'an HTML 404 not found' - end - - describe '#update' do - before do - get :update, params: { step: step } - end - - it_behaves_like 'an HTML 404 not found' - end - - describe '#destroy' do - before do - get :destroy, params: { step: step } - end - - it_behaves_like 'an HTML 404 not found' - end - end - - context 'when the flow step is not in the allowed list' do - before do - stub_sign_in - end - - let(:step) { :not_found_step } - let(:expected_logger_warning) { "Flow step param \"#{step})\" was not whitelisted!" } - - describe '#new' do - before do - expect(Rails.logger).to receive(:warn).with(expected_logger_warning) - get :new, params: { step: step } - end - - it_behaves_like 'an HTML 404 not found' - end - - describe '#update' do - before do - expect(Rails.logger).to receive(:warn).with(expected_logger_warning) - get :update, params: { step: step } - end - - it_behaves_like 'an HTML 404 not found' - end - - describe '#destroy' do - before do - expect(Rails.logger).to receive(:warn).with(expected_logger_warning) - get :destroy, params: { step: step } - end - - it_behaves_like 'an HTML 404 not found' - end - end - - context 'when there is no session' do - it 'redirects to root' do - get :new - - expect(response).to redirect_to(root_url) - end - end - - context 'when there is a session' do - subject(:action) do - get :new, params: { step: step } - end - - before do - stub_sign_in - end - - it 'renders template' do - action - - expect(response).to render_template(:new) - end - - it 'stores go back path' do - action - - expect(controller.user_session[:idv][:go_back_path]).to eq(go_back_path) - end - - it 'tracks the event in analytics' do - stub_analytics - request.env['HTTP_REFERER'] = 'https://example.com/' - - expect(@analytics).to receive(:track_event).with( - 'IdV: cancellation visited', - request_came_from: 'users/sessions#new', - step: step.to_s, - proofing_components: nil, - analytics_id: nil, - ) - - action - end - end - end - - describe '#update' do - subject(:action) do - put :update, params: { step: step, cancel: 'true' } - end - - before do - stub_sign_in - end - - it 'redirects to idv_inherited_proofing_path' do - action - - expect(response).to redirect_to idv_inherited_proofing_url - end - - context 'when a go back path is stored in session' do - let(:go_back_path) { '/path/to/return' } - - before do - allow(controller).to receive(:user_session).and_return( - idv: { go_back_path: go_back_path }, - ) - end - - it 'redirects to go back path' do - action - - expect(response).to redirect_to go_back_path - end - end - - it 'tracks the event in analytics' do - stub_analytics - request.env['HTTP_REFERER'] = 'https://example.com/' - - expect(@analytics).to receive(:track_event).with( - 'IdV: cancellation go back', - request_came_from: 'users/sessions#new', - step: step.to_s, - proofing_components: nil, - analytics_id: nil, - ) - - action - end - end - - describe '#destroy' do - subject(:action) do - delete :destroy, params: { step: step } - end - - context 'when there is no session' do - it 'redirects to root' do - action - - expect(response).to redirect_to(root_url) - end - end - - context 'when there is a session' do - let(:user) { create(:user) } - - before do - stub_sign_in user - allow(controller).to receive(:user_session). - and_return(idv: { go_back_path: '/path/to/return' }) - end - - it 'destroys session' do - expect(controller).to receive(:cancel_session).once - - action - end - - it 'renders a json response with the redirect path set to account_path' do - action - - parsed_body = JSON.parse(response.body, symbolize_names: true) - expect(response).not_to render_template(:destroy) - expect(parsed_body).to eq({ redirect_url: account_path }) - end - - it 'tracks the event in analytics' do - stub_analytics - request.env['HTTP_REFERER'] = 'https://example.com/' - - expect(@analytics).to receive(:track_event).with( - 'IdV: cancellation confirmed', - request_came_from: 'users/sessions#new', - step: step.to_s, - proofing_components: nil, - analytics_id: nil, - ) - - action - end - end - end -end diff --git a/spec/controllers/idv/inherited_proofing_controller_spec.rb b/spec/controllers/idv/inherited_proofing_controller_spec.rb deleted file mode 100644 index 2fc7541ff39..00000000000 --- a/spec/controllers/idv/inherited_proofing_controller_spec.rb +++ /dev/null @@ -1,83 +0,0 @@ -require 'rails_helper' - -shared_examples 'the flow steps work correctly' do - describe '#index' do - it 'redirects to the first step' do - get :index - - expect(response).to redirect_to idv_inherited_proofing_step_url(step: :get_started) - end - - context 'when the inherited proofing feature flag is disabled' do - it 'returns 404 not found' do - allow(IdentityConfig.store).to receive(:inherited_proofing_enabled).and_return(false) - - get :index - - expect(response).to have_http_status(:not_found) - end - end - end - - describe '#show' do - it 'renders the correct template' do - expect(subject).to receive(:render).with( - template: 'layouts/flow_step', - locals: hash_including( - :flow_session, - flow_namespace: 'idv', - step_template: 'idv/inherited_proofing/get_started', - step_indicator: hash_including( - :steps, - current_step: :getting_started, - ), - ), - ).and_call_original - - get :show, params: { step: 'get_started' } - end - - it 'redirects to the configured next step' do - mock_next_step(:some_next_step) - get :show, params: { step: 'getting_started' } - - expect(response).to redirect_to idv_inherited_proofing_step_url(:some_next_step) - end - - it 'redirects to the first step if a non-existent step is given' do - get :show, params: { step: 'non_existent_step' } - - expect(response).to redirect_to idv_inherited_proofing_step_url(step: :get_started) - end - end -end - -def mock_next_step(step) - allow_any_instance_of(Idv::Flows::InheritedProofingFlow).to receive(:next_step).and_return(step) -end - -describe Idv::InheritedProofingController do - let(:sp) { nil } - let(:user) { build(:user) } - - before do - allow(controller).to receive(:current_sp).and_return(sp) - stub_sign_in(user) - end - - context 'when VA inherited proofing mock is enabled' do - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return(true) - end - - it_behaves_like 'the flow steps work correctly' - end - - context 'when VA inherited proofing mock is not enabled' do - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return(false) - end - - it_behaves_like 'the flow steps work correctly' - end -end diff --git a/spec/controllers/idv/sessions_controller_spec.rb b/spec/controllers/idv/sessions_controller_spec.rb index faa34fca6b7..4b9bf2396e1 100644 --- a/spec/controllers/idv/sessions_controller_spec.rb +++ b/spec/controllers/idv/sessions_controller_spec.rb @@ -15,7 +15,6 @@ allow(subject).to receive(:idv_session).and_return(idv_session) controller.user_session['idv/doc_auth'] = flow_session controller.user_session['idv/in_person'] = flow_session - controller.user_session['idv/inherited_proofing'] = flow_session controller.user_session[:decrypted_pii] = pii end @@ -37,10 +36,6 @@ expect(controller.user_session['idv/in_person']).to be_blank end - it 'clears the idv/inherited_proofing session' do - expect(controller.user_session['idv/inherited_proofing']).to be_blank - end - it 'clears the decrypted_pii session' do expect(controller.user_session[:decrypted_pii]).to be_blank end diff --git a/spec/controllers/idv_controller_spec.rb b/spec/controllers/idv_controller_spec.rb index 8775f2e6003..a8de1503938 100644 --- a/spec/controllers/idv_controller_spec.rb +++ b/spec/controllers/idv_controller_spec.rb @@ -70,13 +70,6 @@ expect(response).to redirect_to idv_doc_auth_path end - it 'redirects to inherited proofing with a VA inherited proofing session' do - allow(controller).to receive(:va_inherited_proofing?).and_return(true) - - get :index - expect(response).to redirect_to idv_inherited_proofing_path - end - context 'no SP context' do let(:user) { build(:user, password: ControllerHelper::VALID_PASSWORD) } diff --git a/spec/controllers/openid_connect/authorization_controller_spec.rb b/spec/controllers/openid_connect/authorization_controller_spec.rb index 169aa997467..d0156405b7d 100644 --- a/spec/controllers/openid_connect/authorization_controller_spec.rb +++ b/spec/controllers/openid_connect/authorization_controller_spec.rb @@ -421,28 +421,6 @@ end end - context 'with an inherited_proofing_auth code' do - before do - params[inherited_proofing_auth_key] = inherited_proofing_auth_value - action - end - - let(:inherited_proofing_auth_key) { 'inherited_proofing_auth' } - let(:inherited_proofing_auth_value) { SecureRandom.hex } - let(:decorated_session) { controller.view_context.decorated_session } - - it 'persists the inherited_proofing_auth value' do - expect(decorated_session.request_url_params[inherited_proofing_auth_key]).to \ - eq inherited_proofing_auth_value - end - - it 'redirects to SP landing page with the request_id in the params' do - sp_request_id = ServiceProviderRequestProxy.last.uuid - - expect(response).to redirect_to new_user_session_url(request_id: sp_request_id) - end - end - it 'redirects to SP landing page with the request_id in the params' do action sp_request_id = ServiceProviderRequestProxy.last.uuid diff --git a/spec/features/idv/inherited_proofing/agreement_step_spec.rb b/spec/features/idv/inherited_proofing/agreement_step_spec.rb deleted file mode 100644 index 47e05fb191d..00000000000 --- a/spec/features/idv/inherited_proofing/agreement_step_spec.rb +++ /dev/null @@ -1,78 +0,0 @@ -require 'rails_helper' - -feature 'inherited proofing agreement' do - include InheritedProofingHelper - - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing?).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing_auth_code).and_return auth_code - end - - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - - def expect_ip_verify_info_step - expect(page).to have_current_path(idv_ip_verify_info_step) - end - - def expect_inherited_proofing_first_step - expect(page).to have_current_path(idv_inherited_proofing_agreement_step) - end - - context 'when JS is enabled', :js do - before do - sign_in_and_2fa_user - complete_inherited_proofing_steps_before_agreement_step - end - - it 'shows an inline error if the user clicks continue without giving consent' do - click_continue - expect_inherited_proofing_first_step - expect(page).to have_content(t('forms.validation.required_checkbox')) - end - - it 'allows the user to continue after checking the checkbox' do - check t('inherited_proofing.instructions.consent', app_name: APP_NAME) - click_continue - - expect_ip_verify_info_step - end - - context 'when clicking on the Cancel link' do - it 'redirects to the Cancellation UI' do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) - end - end - end - - context 'when JS is disabled' do - before do - sign_in_and_2fa_user - complete_inherited_proofing_steps_before_agreement_step - end - - it 'shows the notice if the user clicks continue without giving consent' do - click_continue - - expect_inherited_proofing_first_step - expect(page).to have_content(t('errors.doc_auth.consent_form')) - end - - it 'allows the user to continue after checking the checkbox' do - check t('inherited_proofing.instructions.consent', app_name: APP_NAME) - click_continue - - expect_ip_verify_info_step - end - - context 'when clicking on the Cancel link' do - it 'redirects to the Cancellation UI' do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) - end - end - end -end diff --git a/spec/features/idv/inherited_proofing/analytics_spec.rb b/spec/features/idv/inherited_proofing/analytics_spec.rb deleted file mode 100644 index 43462bb74e0..00000000000 --- a/spec/features/idv/inherited_proofing/analytics_spec.rb +++ /dev/null @@ -1,49 +0,0 @@ -require 'rails_helper' - -feature 'Inherited Proofing Analytics Regression', js: true do - include InheritedProofingHelper - - let(:user) { user_with_2fa } - let(:fake_analytics) { FakeAnalytics.new } - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - # rubocop:disable Layout/LineLength - let(:happy_path_events) do - { - 'IdV: inherited proofing get started visited' => { flow_path: 'standard', step: 'get_started', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - 'IdV: inherited proofing get started submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'get_started', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - 'IdV: inherited proofing agreement visited' => { flow_path: 'standard', step: 'agreement', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - 'IdV: inherited proofing agreement submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'agreement', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - 'IdV: doc auth verify_wait visited' => { flow_path: 'standard', step: 'verify_wait', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - 'IdV: doc auth optional verify_wait submitted' => { success: true, errors: {}, step: 'verify_wait_step_show', analytics_id: 'Inherited Proofing' }, - 'IdV: doc auth verify visited' => { flow_path: 'standard', step: 'verify_info', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - 'IdV: doc auth verify submitted' => { success: true, errors: {}, flow_path: 'standard', step: 'verify_info', step_count: 1, analytics_id: 'Inherited Proofing', irs_reproofing: false }, - } - end - # rubocop:enable Layout/LineLength - - before do - allow_any_instance_of(ApplicationController).to receive(:analytics) do |controller| - fake_analytics.user = controller.analytics_user - fake_analytics - end - - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing?).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing_auth_code).and_return auth_code - end - - context 'Happy path' do - before do - sign_in_and_2fa_user - complete_all_inherited_proofing_steps_to_handoff - end - - it 'records all of the events' do - happy_path_events.each do |event, attributes| - expect(fake_analytics).to have_logged_event(event, attributes) - end - end - end -end diff --git a/spec/features/idv/inherited_proofing/get_started_step_spec.rb b/spec/features/idv/inherited_proofing/get_started_step_spec.rb deleted file mode 100644 index 35222000f68..00000000000 --- a/spec/features/idv/inherited_proofing/get_started_step_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require 'rails_helper' - -feature 'inherited proofing get started' do - include InheritedProofingHelper - - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing?).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing_auth_code).and_return auth_code - end - - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - - def expect_ip_get_started_step - expect(page).to have_current_path(idv_ip_get_started_step) - end - - def expect_inherited_proofing_get_started_step - expect(page).to have_current_path(idv_ip_get_started_step) - end - - context 'when JS is enabled', :js do - before do - sign_in_and_2fa_user - complete_inherited_proofing_steps_before_get_started_step - end - - context 'when clicking on the Cancel link' do - it 'redirects to the Cancellation UI' do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) - end - end - end - - context 'when JS is disabled' do - before do - sign_in_and_2fa_user - complete_inherited_proofing_steps_before_get_started_step - end - - context 'when clicking on the Cancel link' do - it 'redirects to the Cancellation UI' do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) - end - end - end -end diff --git a/spec/features/idv/inherited_proofing/inherited_proofing_cancel_spec.rb b/spec/features/idv/inherited_proofing/inherited_proofing_cancel_spec.rb deleted file mode 100644 index cf594bd0c6c..00000000000 --- a/spec/features/idv/inherited_proofing/inherited_proofing_cancel_spec.rb +++ /dev/null @@ -1,151 +0,0 @@ -require 'rails_helper' - -feature 'inherited proofing cancel process', :js do - include InheritedProofingWithServiceProviderHelper - - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true - send_user_from_service_provider_to_login_gov_openid_connect user, inherited_proofing_auth - end - - let!(:user) { user_with_2fa } - let(:inherited_proofing_auth) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - - context 'from the "Get started verifying your identity" view, and clicking the "Cancel" link' do - before do - complete_steps_up_to_inherited_proofing_get_started_step user - end - - it 'should have current path equal to the Getting Started page' do - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) - end - - context 'when clicking the "Start Over" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) - end - - it 'redirects the user back to the start of the Inherited Proofing process' do - click_button t('inherited_proofing.cancel.actions.start_over') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) - end - end - - context 'when clicking the "No, keep going" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) - end - - it 'redirects the user back to where the user left off in the Inherited Proofing process' do - click_button t('inherited_proofing.cancel.actions.keep_going') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) - end - end - - context 'when clicking the "Exit Login.gov" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :get_started)) - end - - it 'redirects the user back to the service provider website' do - click_button t('idv.cancel.actions.exit', app_name: APP_NAME) - expect(page).to have_current_path(/\/auth\/result\?/) - end - end - end - - context 'from the "How verifying your identify works" view, and clicking the "Cancel" link' do - before do - complete_steps_up_to_inherited_proofing_how_verifying_step user - end - - it 'should have current path equal to the How Verifying (agreement step) page' do - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :agreement)) - end - - context 'when clicking the "Start Over" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) - end - - it 'redirects the user back to the start of the Inherited Proofing process' do - click_button t('inherited_proofing.cancel.actions.start_over') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) - end - end - - context 'when clicking the "No, keep going" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) - end - - it 'redirects the user back to where the user left off in the Inherited Proofing process' do - click_button t('inherited_proofing.cancel.actions.keep_going') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :agreement)) - end - end - - context 'when clicking the "Exit Login.gov" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :agreement)) - end - - it 'redirects the user back to the service provider website' do - click_button t('idv.cancel.actions.exit', app_name: APP_NAME) - expect(page).to have_current_path(/\/auth\/result\?/) - end - end - end - - context 'from the "Verify your information..." view, and clicking the "Cancel" link' do - before do - complete_steps_up_to_inherited_proofing_verify_your_info_step user - end - - it 'should have current path equal to the Verify your information (verify_info step) page' do - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :verify_info)) - end - - context 'when clicking the "Start Over" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :verify_info)) - end - - it 'redirects the user back to the start of the Inherited Proofing process' do - click_button t('inherited_proofing.cancel.actions.start_over') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) - end - end - - context 'when clicking the "No, keep going" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :verify_info)) - end - - it 'redirects the user back to where the user left off in the Inherited Proofing process' do - click_button t('inherited_proofing.cancel.actions.keep_going') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :verify_info)) - end - end - - context 'when clicking the "Exit Login.gov" button from the "Cancel" view' do - before do - click_link t('links.cancel') - expect(page).to have_current_path(idv_inherited_proofing_cancel_path(step: :verify_info)) - end - - it 'redirects the user back to the service provider website' do - click_button t('idv.cancel.actions.exit', app_name: APP_NAME) - expect(page).to have_current_path(/\/auth\/result\?/) - end - end - end -end diff --git a/spec/features/idv/inherited_proofing/verify_info_step_spec.rb b/spec/features/idv/inherited_proofing/verify_info_step_spec.rb deleted file mode 100644 index fe1a14ea848..00000000000 --- a/spec/features/idv/inherited_proofing/verify_info_step_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'rails_helper' - -feature 'inherited proofing verify info' do - include InheritedProofingHelper - include_context 'va_user_context' - - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing?).and_return true - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:va_inherited_proofing_auth_code).and_return auth_code - @decorated_session = instance_double(ServiceProviderSessionDecorator) - allow(@decorated_session).to receive(:sp_name).and_return(sp_name) - allow(@decorated_session).to receive(:sp_logo_url).and_return('') - allow_any_instance_of(Idv::InheritedProofingController).to \ - receive(:decorated_session).and_return(@decorated_session) - sign_in_and_2fa_user - complete_inherited_proofing_steps_before_verify_step - end - - let(:sp_name) { 'VA.gov' } - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - - describe 'page content' do - it 'renders the Continue button' do - expect(page).to have_button(t('inherited_proofing.buttons.continue')) - end - - it 'renders content' do - expect(page).to have_content(t('titles.idv.verify_info')) - expect(page).to have_link( - t( - 'inherited_proofing.troubleshooting.options.get_help', - sp_name: sp_name, - ), - ) - end - end - - describe 'user info' do - it "displays the user's personal information" do - expect(page).to have_text user_attributes[:first_name] - expect(page).to have_text user_attributes[:last_name] - expect(page).to have_text user_attributes[:birth_date] - end - - it "displays the user's address" do - expect(page).to have_text user_attributes[:address][:street] - expect(page).to have_text user_attributes[:address][:city] - expect(page).to have_text user_attributes[:address][:state] - expect(page).to have_text user_attributes[:address][:zip] - end - - it "obfuscates the user's ssn" do - expect(page).to have_text '1**-**-***9' - end - - it "can display the user's ssn when selected" do - check 'Show Social Security number' - expect(page).to have_text '123-45-6789' - end - end -end diff --git a/spec/features/idv/inherited_proofing/verify_wait_step_spec.rb b/spec/features/idv/inherited_proofing/verify_wait_step_spec.rb deleted file mode 100644 index 3c17b33d889..00000000000 --- a/spec/features/idv/inherited_proofing/verify_wait_step_spec.rb +++ /dev/null @@ -1,73 +0,0 @@ -require 'rails_helper' - -feature 'inherited proofing verify wait', :js do - include InheritedProofingWithServiceProviderHelper - - before do - allow_any_instance_of(ApplicationController).to receive(:analytics).and_return(fake_analytics) - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return(true) - send_user_from_service_provider_to_login_gov_openid_connect(user, inherited_proofing_auth) - end - - let!(:user) { user_with_2fa } - let(:inherited_proofing_auth) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - let(:fake_analytics) { FakeAnalytics.new } - - context 'when on the "How verifying your identify works" page, ' \ - 'and the user clicks the "Continue" button' do - before do - complete_steps_up_to_inherited_proofing_we_are_retrieving_step user - end - - context 'when there are no service-related errors' do - it 'displays the "Verify your information" page' do - expect(page).to have_current_path( - idv_inherited_proofing_step_path(step: :verify_info), - ) - end - end - - context 'when there are service-related errors on the first attempt' do - let(:inherited_proofing_auth) { 'invalid-auth-code' } - - it 'displays the warning page and allows retries' do - expect(page).to have_current_path( - idv_inherited_proofing_errors_no_information_path(flow: :inherited_proofing), - ) - expect(page).to have_selector(:link_or_button, t('inherited_proofing.buttons.try_again')) - end - end - - context 'when there are service-related errors on the second attempt' do - let(:inherited_proofing_auth) { 'invalid-auth-code' } - - it 'redirects to the error page, prohibits retries and logs the event' do - click_button t('inherited_proofing.buttons.try_again') - expect(page).to have_current_path( - idv_inherited_proofing_errors_failure_url(flow: :inherited_proofing), - ) - expect(fake_analytics).to have_logged_event( - 'Throttler Rate Limit Triggered', - throttle_type: :inherited_proofing, - step_name: Idv::Actions::InheritedProofing::RedoRetrieveUserInfoAction.name, - ) - end - end - end - - context 'when the async state is missing during polling' do - before do - allow_any_instance_of(ProofingSessionAsyncResult).to receive(:missing?).and_return(true) - complete_steps_up_to_inherited_proofing_we_are_retrieving_step user - end - - it 'redirects back to the agreement step and logs the event' do - expect(page).to have_current_path( - idv_inherited_proofing_step_path(step: :agreement), - ) - expect(fake_analytics).to have_logged_event( - 'Proofing Resolution Result Missing', - ) - end - end -end diff --git a/spec/features/services/idv/inherited_proofing/va/mocks/service_spec.rb b/spec/features/services/idv/inherited_proofing/va/mocks/service_spec.rb deleted file mode 100644 index 88d8c7d429f..00000000000 --- a/spec/features/services/idv/inherited_proofing/va/mocks/service_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'Inherited Proofing VA API Proofer Service' do - subject(:form) { Idv::InheritedProofing::Va::Form.new(payload_hash: proofer_results) } - - let(:proofer_results) do - Idv::InheritedProofing::Va::Mocks::Service.new({ auth_code: auth_code }).execute - end - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - - context 'when used with the VA Inherited Proofing Response Form' do - it 'works as expected' do - expect(form.submit.success?).to eq true - end - end -end diff --git a/spec/forms/idv/inherited_proofing/base_form_spec.rb b/spec/forms/idv/inherited_proofing/base_form_spec.rb deleted file mode 100644 index 871142de3eb..00000000000 --- a/spec/forms/idv/inherited_proofing/base_form_spec.rb +++ /dev/null @@ -1,182 +0,0 @@ -require 'rails_helper' - -RSpec.describe Idv::InheritedProofing::BaseForm do - subject { form_object } - - let(:form_class) do - Class.new(Idv::InheritedProofing::BaseForm) do - class << self - def required_fields; [] end - - def optional_fields; [] end - end - - def user_pii; {} end - end - end - - let(:form_object) do - form_class.new(payload_hash: payload_hash) - end - - let(:payload_hash) do - { - first_name: 'Henry', - last_name: 'Ford', - phone: '12222222222', - birth_date: '2000-01-01', - ssn: '111223333', - address: { - street: '1234 Model Street', - street2: 'Suite A', - city: 'Detroit', - state: 'MI', - country: 'United States', - zip: '12345', - }, - } - end - - describe '#initialize' do - subject { form_class } - - context 'when .user_pii is not overridden' do - subject do - Class.new(Idv::InheritedProofing::BaseForm) do - class << self - def required_fields; [] end - - def optional_fields; [] end - end - end - end - - it 'raises an error' do - expected_error = 'Override this method and return a user PII Hash' - expect { subject.new(payload_hash: payload_hash).user_pii }.to raise_error(expected_error) - end - end - end - - describe 'class methods' do - describe '.model_name' do - it 'returns the right model name' do - expect(described_class.model_name).to eq 'IdvInheritedProofingBaseForm' - end - end - end - - describe '#initialize' do - context 'when passing an invalid payload hash' do - context 'when not a Hash' do - let(:payload_hash) { :x } - - it 'raises an error' do - expect { subject }.to raise_error 'payload_hash is not a Hash' - end - end - - context 'when nil?' do - let(:payload_hash) { nil } - - it_behaves_like 'the hash is blank?' - end - - context 'when empty?' do - let(:payload_hash) { {} } - - it_behaves_like 'the hash is blank?' - end - end - - context 'when passing a valid payload hash' do - it 'raises no errors' do - expect { subject }.to_not raise_error - end - end - end - - describe '#validate' do - subject do - Class.new(Idv::InheritedProofing::BaseForm) do - class << self - def required_fields; %i[required] end - - def optional_fields; %i[optional] end - end - - def user_pii; {} end - end.new(payload_hash: payload_hash) - end - - let(:payload_hash) do - { - required: 'Required', - optional: 'Optional', - } - end - - context 'with valid payload data' do - it 'returns true' do - expect(subject.validate).to eq true - end - end - - context 'with invalid payload data' do - context 'when the payload has unrecognized fields' do - let(:payload_hash) do - { - xrequired: 'xRequired', - xoptional: 'xOptional', - } - end - - let(:expected_error_messages) do - [ - # Required field presence - 'Required field is missing', - 'Optional field is missing', - ] - end - - it 'returns true' do - expect(subject.validate).to eq true - end - end - - context 'when the payload has missing required field data' do - let(:payload_hash) do - { - required: nil, - optional: '', - } - end - - it 'returns true' do - expect(subject.validate).to eq true - end - - it 'returns no errors because no data validations take place by default' do - subject.validate - expect(subject.errors.full_messages).to eq [] - end - end - end - end - - describe '#submit' do - it 'returns a FormResponse object' do - expect(subject.submit).to be_kind_of FormResponse - end - - describe 'before returning' do - after do - subject.submit - end - - it 'calls #valid?' do - expect(subject).to receive(:valid?).once - end - end - end -end diff --git a/spec/forms/idv/inherited_proofing/va/form_spec.rb b/spec/forms/idv/inherited_proofing/va/form_spec.rb deleted file mode 100644 index ad734ab37c1..00000000000 --- a/spec/forms/idv/inherited_proofing/va/form_spec.rb +++ /dev/null @@ -1,317 +0,0 @@ -require 'rails_helper' - -RSpec.describe Idv::InheritedProofing::Va::Form do - subject(:form) { described_class.new payload_hash: payload_hash } - - let(:required_fields) { %i[first_name last_name birth_date ssn address_street address_zip] } - let(:optional_fields) do - %i[phone address_street2 address_city address_state address_country service_error] - end - - let(:payload_hash) do - { - first_name: 'Henry', - last_name: 'Ford', - phone: '12222222222', - birth_date: '2000-01-01', - ssn: '111223333', - address: { - street: '1234 Model Street', - street2: 'Suite A', - city: 'Detroit', - state: 'MI', - country: 'United States', - zip: '12345', - }, - } - end - - describe 'constants' do - describe 'FIELDS' do - it 'returns all the fields' do - expect(described_class::FIELDS).to match_array required_fields + optional_fields - end - end - - describe 'REQUIRED_FIELDS' do - it 'returns the required fields' do - expect(described_class::REQUIRED_FIELDS).to match_array required_fields - end - end - - describe 'OPTIONAL_FIELDS' do - it 'returns the optional fields' do - expect(described_class::OPTIONAL_FIELDS).to match_array optional_fields - end - end - end - - describe 'class methods' do - describe '.model_name' do - it 'returns the right model name' do - expect(described_class.model_name).to eq 'IdvInheritedProofingVaForm' - end - end - end - - describe '#initialize' do - context 'when passing an invalid payload hash' do - context 'when not a Hash' do - let(:payload_hash) { :x } - - it 'raises an error' do - expect { form }.to raise_error 'payload_hash is not a Hash' - end - end - - context 'when nil?' do - let(:payload_hash) { nil } - - it_behaves_like 'the hash is blank?' - end - - context 'when empty?' do - let(:payload_hash) { {} } - - it_behaves_like 'the hash is blank?' - end - end - - context 'when passing a valid payload hash' do - it 'raises no errors' do - expect { form }.to_not raise_error - end - end - end - - describe '#validate' do - context 'with valid payload data' do - it 'returns true' do - expect(form.validate).to be true - end - end - - context 'with invalid payload data' do - context 'when the payload has missing fields' do - let(:payload_hash) do - { - xfirst_name: 'Henry', - xlast_name: 'Ford', - xphone: '12222222222', - xbirth_date: '2000-01-01', - xssn: '111223333', - xaddress: { - xstreet: '1234 Model Street', - xstreet2: 'Suite A', - xcity: 'Detroit', - xstate: 'MI', - xcountry: 'United States', - xzip: '12345', - }, - } - end - - let(:expected_error_messages) do - [ - 'First name Please fill in this field.', - 'Last name Please fill in this field.', - 'Birth date Please fill in this field.', - 'Ssn Please fill in this field.', - 'Address street Please fill in this field.', - 'Address zip Please fill in this field.', - ] - end - - it 'returns false' do - expect(form.validate).to be false - end - - it 'adds the correct error messages for missing fields' do - subject.validate - expect(form.errors.full_messages).to match_array expected_error_messages - end - end - - context 'when the payload has missing required field data' do - let(:payload_hash) do - { - first_name: nil, - last_name: '', - phone: nil, - birth_date: '', - ssn: nil, - address: { - street: '', - street2: nil, - city: '', - state: nil, - country: '', - zip: nil, - }, - } - end - - let(:expected_error_messages) do - [ - # Required field data presence - 'First name Please fill in this field.', - 'Last name Please fill in this field.', - 'Birth date Please fill in this field.', - 'Ssn Please fill in this field.', - 'Address street Please fill in this field.', - 'Address zip Please fill in this field.', - ] - end - - it 'returns false' do - expect(form.validate).to be false - end - - it 'adds the correct error messages for required fields that are missing data' do - subject.validate - expect(form.errors.full_messages).to match_array expected_error_messages - end - end - - context 'when the payload has missing optional field data' do - let(:payload_hash) do - { - first_name: 'x', - last_name: 'x', - phone: nil, - birth_date: '01/01/2022', - ssn: '123456789', - address: { - street: 'x', - street2: nil, - city: '', - state: nil, - country: '', - zip: '12345', - }, - } - end - - it 'returns true' do - expect(form.validate).to be true - end - end - - context 'when there is a service-related error' do - before do - subject.validate - end - - let(:payload_hash) { { service_error: 'service error' } } - - it 'returns false' do - expect(form.valid?).to be false - end - - it 'adds a user-friendly model error' do - expect(form.errors.full_messages).to \ - match_array ['Service provider communication was unsuccessful'] - end - end - end - end - - describe '#submit' do - context 'with an invalid payload' do - context 'when the payload has invalid field data' do - let(:payload_hash) do - { - first_name: nil, - last_name: '', - phone: nil, - birth_date: '', - ssn: nil, - address: { - street: '', - street2: nil, - city: '', - state: nil, - country: '', - zip: nil, - }, - } - end - - let(:expected_errors) do - { - # Required field data presence - first_name: ['Please fill in this field.'], - last_name: ['Please fill in this field.'], - birth_date: ['Please fill in this field.'], - ssn: ['Please fill in this field.'], - address_street: ['Please fill in this field.'], - address_zip: ['Please fill in this field.'], - } - end - - it 'returns a FormResponse indicating the correct errors and status' do - form_response = subject.submit - expect(form_response.success?).to be false - expect(form_response.errors).to match_array expected_errors - expect(form_response.extra).to eq({}) - end - end - end - - context 'with a valid payload' do - it 'returns a FormResponse indicating the no errors and successful status' do - form_response = subject.submit - expect(form_response.success?).to be true - expect(form_response.errors).to eq({}) - expect(form_response.extra).to eq({}) - end - end - - context 'when there is a service-related error' do - let(:payload_hash) { { service_error: 'service error' } } - - it 'adds the unfiltered error to the FormResponse :extra Hash' do - form_response = subject.submit - expect(form_response.success?).to be false - expect(form_response.errors).to \ - eq({ service_provider: ['communication was unsuccessful'] }) - expect(form_response.extra).to eq({ service_error: 'service error' }) - end - end - end - - describe '#user_pii' do - let(:expected_user_pii) do - { - first_name: subject.first_name, - last_name: subject.last_name, - dob: subject.birth_date, - ssn: subject.ssn, - phone: subject.phone, - address1: subject.address_street, - city: subject.address_city, - state: subject.address_state, - zipcode: subject.address_zip, - } - end - it 'returns the correct user pii' do - expect(form.user_pii).to eq expected_user_pii - end - end - - describe '#service_error?' do - context 'when there is a service-related error' do - let(:payload_hash) { { service_error: 'service error' } } - - it 'returns true' do - expect(form.service_error?).to be true - end - end - - context 'when there is not a service-related error' do - it 'returns false' do - expect(form.service_error?).to be false - end - end - end -end diff --git a/spec/jobs/inherited_proofing_job_spec.rb b/spec/jobs/inherited_proofing_job_spec.rb deleted file mode 100644 index 839d292cd33..00000000000 --- a/spec/jobs/inherited_proofing_job_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'rails_helper' - -RSpec.describe InheritedProofingJob, type: :job do - include Idv::InheritedProofing::ServiceProviderServices - include Idv::InheritedProofing::ServiceProviderForms - include_context 'va_api_context' - - let(:document_capture_session) { DocumentCaptureSession.new(result_id: SecureRandom.hex) } - let(:service_provider_data) { { auth_code: 'mocked-auth-code-for-testing' } } - let(:service_provider) { Idv::InheritedProofing::ServiceProviders::VA } - - before do - allow(IdentityConfig.store).to receive(:va_inherited_proofing_mock_enabled).and_return true - allow_any_instance_of(Idv::InheritedProofing::ServiceProviderServices).to \ - receive(:inherited_proofing?).and_return true - end - - describe '#perform' do - it 'calls api for user data and stores in document capture session' do - document_capture_session.create_doc_auth_session - - InheritedProofingJob.perform_now( - service_provider, - service_provider_data, - document_capture_session.uuid, - ) - - result = document_capture_session.load_proofing_result[:result] - - expect(result).to be_present - expect(result).to include(last_name: 'Fakerson') - end - end -end diff --git a/spec/services/idv/inherited_proofing/service_provider_forms_spec.rb b/spec/services/idv/inherited_proofing/service_provider_forms_spec.rb deleted file mode 100644 index bbad02b360e..00000000000 --- a/spec/services/idv/inherited_proofing/service_provider_forms_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require 'rails_helper' - -RSpec.describe Idv::InheritedProofing::ServiceProviderForms do - subject do - Class.new do - include Idv::InheritedProofing::ServiceProviderForms - end.new - end - - let(:service_provider) { :va } - let(:payload_hash) { Idv::InheritedProofing::Va::Mocks::Service::PAYLOAD_HASH } - - describe '#inherited_proofing_form_for' do - context 'when there is a va inherited proofing request' do - it 'returns the correct form' do - expect( - subject.inherited_proofing_form_for( - service_provider, - payload_hash: payload_hash, - ), - ).to \ - be_kind_of Idv::InheritedProofing::Va::Form - end - end - - context 'when the inherited proofing request cannot be identified' do - let(:service_provider) { :unknown_service_provider } - - it 'raises an error' do - expect do - subject.inherited_proofing_form_for(service_provider, payload_hash: payload_hash) - end.to \ - raise_error 'Inherited proofing form could not be identified' - end - end - end -end diff --git a/spec/services/idv/inherited_proofing/service_provider_services_spec.rb b/spec/services/idv/inherited_proofing/service_provider_services_spec.rb deleted file mode 100644 index 76380bf2374..00000000000 --- a/spec/services/idv/inherited_proofing/service_provider_services_spec.rb +++ /dev/null @@ -1,101 +0,0 @@ -require 'rails_helper' - -RSpec.describe Idv::InheritedProofing::ServiceProviderServices do - subject do - Class.new do - include Idv::InheritedProofing::ServiceProviderServices - end.new - end - - let(:service_provider) { :va } - let(:service_provider_data) { { auth_code: auth_code } } - let(:auth_code) { Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE } - - describe '#inherited_proofing_service_class_for' do - context 'when va inherited proofing is disabled' do - before do - allow(IdentityConfig.store).to receive(:inherited_proofing_enabled).and_return(false) - end - - it 'raises an error' do - expect do - subject.inherited_proofing_service_class_for(service_provider) - end.to raise_error 'Inherited Proofing is not enabled' - end - end - - context 'when there is a va inherited proofing request' do - context 'when va mock proofing is turned on' do - before do - allow(IdentityConfig.store).to \ - receive(:va_inherited_proofing_mock_enabled).and_return(true) - end - - it 'returns the correct service provider service class' do - expect(subject.inherited_proofing_service_class_for(service_provider)).to \ - eq Idv::InheritedProofing::Va::Mocks::Service - end - end - - context 'when va mock proofing is turned off' do - before do - allow(IdentityConfig.store).to \ - receive(:va_inherited_proofing_mock_enabled).and_return(false) - end - - it 'returns the correct service provider service class' do - expect(subject.inherited_proofing_service_class_for(service_provider)).to \ - eq Idv::InheritedProofing::Va::Service - end - end - end - - context 'when the inherited proofing class cannot be identified' do - let(:service_provider) { :unknown_service_provider } - - it 'raises an error' do - expect do - subject.inherited_proofing_service_class_for(service_provider) - end.to raise_error 'Inherited proofing service class could not be identified' - end - end - end - - describe '#inherited_proofing_service_for' do - context 'when there is a va inherited proofing request' do - context 'when va mock proofing is turned on' do - before do - allow(IdentityConfig.store).to \ - receive(:va_inherited_proofing_mock_enabled).and_return(true) - end - - it 'returns the correct service provider service class' do - expect( - subject.inherited_proofing_service_for( - service_provider, - service_provider_data: service_provider_data, - ), - ).to \ - be_kind_of Idv::InheritedProofing::Va::Mocks::Service - end - end - - context 'when va mock proofing is turned off' do - before do - allow(IdentityConfig.store).to \ - receive(:va_inherited_proofing_mock_enabled).and_return(false) - end - - it 'returns the correct service provider service class' do - expect( - subject.inherited_proofing_service_for( - service_provider, - service_provider_data: service_provider_data, - ), - ).to \ - be_kind_of Idv::InheritedProofing::Va::Service - end - end - end - end -end diff --git a/spec/services/idv/inherited_proofing/va/mocks/service_spec.rb b/spec/services/idv/inherited_proofing/va/mocks/service_spec.rb deleted file mode 100644 index 865383e874b..00000000000 --- a/spec/services/idv/inherited_proofing/va/mocks/service_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'rails_helper' - -RSpec.describe Idv::InheritedProofing::Va::Mocks::Service do - subject { described_class.new({ auth_code: auth_code }) } - let(:auth_code) { described_class::VALID_AUTH_CODE } - - describe '#initialize' do - it 'sets #auth_code' do - expect(subject.auth_code).to eq auth_code - end - end - - describe '#execute' do - context 'when auth_code is valid' do - it 'returns a Hash' do - expect(subject.execute).to eq(described_class::PAYLOAD_HASH) - end - end - - context 'with auth code is invalid' do - let(:auth_code) { "invalid-#{described_class::VALID_AUTH_CODE}" } - - it 'returns an error' do - expect(subject.execute).to eq(described_class::ERROR_HASH) - end - end - end -end diff --git a/spec/services/idv/inherited_proofing/va/service_spec.rb b/spec/services/idv/inherited_proofing/va/service_spec.rb deleted file mode 100644 index 7a5dece157b..00000000000 --- a/spec/services/idv/inherited_proofing/va/service_spec.rb +++ /dev/null @@ -1,124 +0,0 @@ -require 'rails_helper' - -RSpec.shared_examples 'an invalid auth code error is raised' do - it 'raises an error' do - expect { subject.execute }.to raise_error 'The provided auth_code is blank?' - end -end - -RSpec.describe Idv::InheritedProofing::Va::Service do - include_context 'va_api_context' - include_context 'va_user_context' - - subject(:service) { described_class.new(auth_code: auth_code) } - - before do - allow(service).to receive(:private_key).and_return(private_key) - end - - it { respond_to :execute } - - it do - expect(service.send(:private_key)).to eq private_key - end - - describe '#execute' do - context 'when the auth code is valid' do - let(:auth_code) { 'mocked-auth-code-for-testing' } - - it 'makes an authenticated request' do - freeze_time do - stub = stub_request(:get, request_uri). - with(headers: request_headers). - to_return(status: 200, body: '{}', headers: {}) - - service.execute - - expect(stub).to have_been_requested.once - end - end - - it 'decrypts the response' do - freeze_time do - stub_request(:get, request_uri). - with(headers: request_headers). - to_return(status: 200, body: encrypted_user_attributes, headers: {}) - - expect(service.execute).to eq user_attributes - end - end - end - - context 'when the auth code is invalid' do - context 'when an empty? string' do - let(:auth_code) { '' } - - it_behaves_like 'an invalid auth code error is raised' - end - - context 'when an nil?' do - let(:auth_code) { nil } - - it_behaves_like 'an invalid auth code error is raised' - end - end - - context 'when a request error is raised' do - before do - allow(service).to receive(:request).and_raise('Boom!') - end - - it 'rescues and returns the error' do - expect(service.execute).to eq({ service_error: 'Boom!' }) - end - end - - context 'when a decryption error is raised' do - it 'rescues and returns the error' do - freeze_time do - stub_request(:get, request_uri). - with(headers: request_headers). - to_return(status: 200, body: 'xyz', headers: {}) - - expect(service.execute[:service_error]).to match(/unexpected token at 'xyz'/) - end - end - end - - context 'when a non-200 error is raised' do - it 'rescues and returns the error' do - freeze_time do - stub_request(:get, request_uri). - with(headers: request_headers). - to_return(status: 302, body: encrypted_user_attributes, headers: {}) - - expect(service.execute.to_s).to \ - match(/The service provider API returned an http status other than 200/) - end - end - - context 'when http status is unavailable (nil)' do - before do - allow_any_instance_of(Faraday::Response).to receive(:status).and_return(nil) - end - - let(:expected_error) do - { - service_error: 'The service provider API returned an http status other than 200: ' \ - 'unavailable (unavailable)', - } - end - - it 'rescues and returns the error' do - freeze_time do - stub_request(:get, request_uri). - with(headers: request_headers). - to_return(status: nil, body: encrypted_user_attributes, headers: {}) - - expect(service.execute).to eq expected_error - end - end - end - end - end -end diff --git a/spec/support/features/idv_helper.rb b/spec/support/features/idv_helper.rb index 13cf08e2199..2deaaf63487 100644 --- a/spec/support/features/idv_helper.rb +++ b/spec/support/features/idv_helper.rb @@ -152,30 +152,6 @@ def visit_idp_from_oidc_sp_with_ial2( ) end - def visit_idp_from_oidc_va_with_ial2( - client_id: sp_oidc_issuer, - state: SecureRandom.hex, - nonce: SecureRandom.hex, - verified_within: nil, - inherited_proofing_auth: Idv::InheritedProofing::Va::Mocks::Service::VALID_AUTH_CODE - ) - @state = state - @client_id = sp_oidc_issuer - @nonce = nonce - visit openid_connect_authorize_path( - client_id: client_id, - response_type: 'code', - acr_values: Saml::Idp::Constants::IAL2_AUTHN_CONTEXT_CLASSREF, - scope: 'openid email profile:name phone social_security_number', - redirect_uri: sp_oidc_redirect_uri, - state: state, - prompt: 'select_account', - nonce: nonce, - verified_within: verified_within, - inherited_proofing_auth: inherited_proofing_auth, - ) - end - def visit_idp_from_oidc_sp_with_loa3 visit openid_connect_authorize_path( client_id: sp_oidc_issuer, diff --git a/spec/support/features/inherited_proofing_helper.rb b/spec/support/features/inherited_proofing_helper.rb deleted file mode 100644 index 90e397d0ce6..00000000000 --- a/spec/support/features/inherited_proofing_helper.rb +++ /dev/null @@ -1,62 +0,0 @@ -require_relative 'idv_step_helper' -require_relative 'doc_auth_helper' - -module InheritedProofingHelper - include IdvStepHelper - include DocAuthHelper - - # Steps - def idv_ip_get_started_step - idv_inherited_proofing_step_path(step: :get_started) - end - - def idv_inherited_proofing_agreement_step - idv_inherited_proofing_step_path(step: :agreement) - end - - def idv_ip_verify_info_step - idv_inherited_proofing_step_path(step: :verify_info) - end - - # Traverse Steps - - # create account - def complete_inherited_proofing_steps_before_get_started_step(expect_accessible: false) - visit idv_ip_get_started_step unless current_path == idv_ip_get_started_step - expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible - end - - # get started - def complete_get_started_step - click_on t('inherited_proofing.buttons.continue') - end - - def complete_inherited_proofing_steps_before_agreement_step(expect_accessible: false) - complete_inherited_proofing_steps_before_get_started_step(expect_accessible: expect_accessible) - complete_get_started_step - expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible - end - - # get started > agreement > verify_wait > please verify - def complete_agreement_step - find('label', text: t('inherited_proofing.instructions.consent', app_name: APP_NAME)).click - click_on t('inherited_proofing.buttons.continue') - end - - def complete_inherited_proofing_steps_before_verify_step(expect_accessible: false) - complete_inherited_proofing_steps_before_agreement_step(expect_accessible: expect_accessible) - complete_agreement_step - expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible - end - - def complete_inherited_proofing_verify_step - click_on t('inherited_proofing.buttons.continue') - end - - # get_started > agreement > verify_wait > please verify > complete - def complete_all_inherited_proofing_steps_to_handoff(expect_accessible: false) - complete_inherited_proofing_steps_before_verify_step(expect_accessible: expect_accessible) - complete_inherited_proofing_verify_step - expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible - end -end diff --git a/spec/support/features/inherited_proofing_with_service_provider_helper.rb b/spec/support/features/inherited_proofing_with_service_provider_helper.rb deleted file mode 100644 index f899b293d2c..00000000000 --- a/spec/support/features/inherited_proofing_with_service_provider_helper.rb +++ /dev/null @@ -1,55 +0,0 @@ -require_relative 'idv_step_helper' -require_relative 'doc_auth_helper' - -module InheritedProofingWithServiceProviderHelper - include IdvStepHelper - include DocAuthHelper - - # Simulates a user (in this case, a VA inherited proofing-authorized user) - # coming over to login.gov from a service provider, and hitting the - # OpenidConnect::AuthorizationController#index action. - def send_user_from_service_provider_to_login_gov_openid_connect(user, inherited_proofing_auth) - expect(user).to_not be_nil - # NOTE: VA user. - visit_idp_from_oidc_va_with_ial2 inherited_proofing_auth: inherited_proofing_auth - end - - def complete_steps_up_to_inherited_proofing_get_started_step(user, expect_accessible: false) - unless current_path == idv_inherited_proofing_step_path(step: :get_started) - complete_idv_steps_before_phone_step(user) - click_link t('links.cancel') - click_button t('idv.cancel.actions.start_over') - expect(page).to have_current_path(idv_inherited_proofing_step_path(step: :get_started)) - end - expect(page).to be_axe_clean.according_to :section508, :"best-practice" if expect_accessible - end - - def complete_steps_up_to_inherited_proofing_how_verifying_step(user, expect_accessible: false) - complete_steps_up_to_inherited_proofing_get_started_step user, - expect_accessible: expect_accessible - unless current_path == idv_inherited_proofing_step_path(step: :agreement) - click_on t('inherited_proofing.buttons.continue') - end - end - - def complete_steps_up_to_inherited_proofing_we_are_retrieving_step(user, - expect_accessible: false) - complete_steps_up_to_inherited_proofing_how_verifying_step( - user, - expect_accessible: expect_accessible, - ) - unless current_path == idv_inherited_proofing_step_path(step: :verify_wait) - check t('inherited_proofing.instructions.consent', app_name: APP_NAME), - allow_label_click: true - click_on t('inherited_proofing.buttons.continue') - end - end - - def complete_steps_up_to_inherited_proofing_verify_your_info_step(user, - expect_accessible: false) - complete_steps_up_to_inherited_proofing_we_are_retrieving_step( - user, - expect_accessible: expect_accessible, - ) - end -end diff --git a/spec/support/shared_contexts/inherited_proofing/encrypted_user_attributes.json b/spec/support/shared_contexts/inherited_proofing/encrypted_user_attributes.json deleted file mode 100644 index af29a512873..00000000000 --- a/spec/support/shared_contexts/inherited_proofing/encrypted_user_attributes.json +++ /dev/null @@ -1 +0,0 @@ -{"data":"eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.IL_uTLpwR3ZoDQKuRY_clxK1AmrEnf3rCREIj8XGQ-iA7NxCiYfZ2CxuXFOTIzFbKXjcNYT1F56bCUuPwSmHNt88AGumB3RcskR6POfBu8EcjK2CI6myycGuQwm_1Dp9Vi55TQpSFRy5Bld7IR0gbk4ju0qTVSeH59-AyBGr0w07vojdHcPe-SDWEC1pG0_4iyVg0x2wOFAh6kIjMJ04sJYB4e7uW8hEI7lSwDLpiW-8KsjGhwCVIkUGPw7XKtLiWo1U_nXSragpG-E6XRx0Hn3YckSwEAMTATeZZPJr0TAAMO_jtukL0e7_ApwsCI-sEdI035_4befLlDnuz1QFJg.oLmsRlZKFlL_3Th4.YumiTPq6y8jyCpVwuSpqsd8iWQ_AqEN81v8pV9lB2dPb6po03aj05K361IWmWfB3gXir--L3nPpUdlFFkxF1X12QVkpfmH03kj01Zoaq9hZcQvY7d4QoOkMNkdONNFZ3_sp-4-11m5ki2TpD1AidkLe7AIaSvBvhYOq0TC-0veLwRvp5234-XyDq9o5hLogzUa3G1BxcZO_TxpS5IhV4CzJ2a-o_ymSgUULDjrAty23XMiqXxTMFbVCpMDrvgGTX2TYOYx0PngjySlir6Zf4WjKhvFBOd34hvx2MUYTEGPw.UcPA0owzraT7ckc1cRDzeg"} diff --git a/spec/support/shared_contexts/inherited_proofing/va_api_context.rb b/spec/support/shared_contexts/inherited_proofing/va_api_context.rb deleted file mode 100644 index bec50c6a17c..00000000000 --- a/spec/support/shared_contexts/inherited_proofing/va_api_context.rb +++ /dev/null @@ -1,15 +0,0 @@ -RSpec.shared_context 'va_api_context' do - # Sample mocked API call: - # stub_request(:get, request_uri). - # with(headers: request_headers). - # to_return(status: 200, body: '{}', headers: {}) - - let(:auth_code) { 'mocked-auth-code-for-testing' } - let(:private_key) { private_key_from_store_or(file_name: 'empty.key') } - let(:payload) { { inherited_proofing_auth: auth_code, exp: 1.day.from_now.to_i } } - let(:jwt_token) { JWT.encode(payload, private_key, 'RS256') } - let(:request_uri) do - "#{Idv::InheritedProofing::Va::Service::BASE_URI}/inherited_proofing/user_attributes" - end - let(:request_headers) { { Authorization: "Bearer #{jwt_token}" } } -end diff --git a/spec/support/shared_contexts/inherited_proofing/va_user_context.rb b/spec/support/shared_contexts/inherited_proofing/va_user_context.rb deleted file mode 100644 index 81ac0b82545..00000000000 --- a/spec/support/shared_contexts/inherited_proofing/va_user_context.rb +++ /dev/null @@ -1,18 +0,0 @@ -RSpec.shared_context 'va_user_context' do - # As given to us from VA - let(:user_attributes) do - { first_name: 'Fakey', - last_name: 'Fakerson', - address: { street: '123 Fake St', - street2: 'Apt 235', - city: 'Faketown', - state: 'WA', - country: nil, - zip: '98037' }, - phone: '2063119187', - birth_date: '2022-1-31', - ssn: '123456789' } - end - # Encrypted with AppArtifacts.store.oidc_private_key for testing - let(:encrypted_user_attributes) { File.read("#{__dir__}/encrypted_user_attributes.json") } -end diff --git a/spec/views/idv/inherited_proofing/agreement.html.erb_spec.rb b/spec/views/idv/inherited_proofing/agreement.html.erb_spec.rb deleted file mode 100644 index d8f6ac9c379..00000000000 --- a/spec/views/idv/inherited_proofing/agreement.html.erb_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require 'rails_helper' - -describe 'idv/inherited_proofing/agreement.html.erb' do - include Devise::Test::ControllerHelpers - - let(:flow_session) { {} } - let(:sp_name) { 'test' } - - before do - allow(view).to receive(:decorated_session).and_return(@decorated_session) - allow(view).to receive(:flow_session).and_return(flow_session) - allow(view).to receive(:url_for).and_return('https://www.example.com/') - allow(view).to receive(:user_signing_up?).and_return(true) - end - - it 'renders the Continue button' do - render template: 'idv/inherited_proofing/agreement' - - expect(rendered).to have_button(t('inherited_proofing.buttons.continue')) - end - - it 'renders the Cancel link' do - render template: 'idv/inherited_proofing/agreement' - - expect(rendered).to have_link(t('links.cancel_account_creation')) - end - - context 'with or without service provider' do - it 'renders content' do - render template: 'idv/inherited_proofing/agreement' - - expect(rendered).to have_content(t('inherited_proofing.info.lets_go')) - expect(rendered).to have_content( - t('inherited_proofing.headings.verify_identity'), - ) - expect(rendered).to have_content(t('inherited_proofing.info.verify_identity')) - expect(rendered).to have_content( - t('inherited_proofing.headings.secure_account'), - ) - expect(rendered).to have_content( - t('inherited_proofing.info.secure_account', sp_name: sp_name), - ) - end - end -end diff --git a/spec/views/idv/inherited_proofing/get_started.html.erb_spec.rb b/spec/views/idv/inherited_proofing/get_started.html.erb_spec.rb deleted file mode 100644 index 76d27eef061..00000000000 --- a/spec/views/idv/inherited_proofing/get_started.html.erb_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -require 'rails_helper' - -describe 'idv/inherited_proofing/get_started.html.erb' do - include Devise::Test::ControllerHelpers - - let(:flow_session) { {} } - let(:sp_name) { 'test' } - - before do - @decorated_session = instance_double(ServiceProviderSessionDecorator) - allow(@decorated_session).to receive(:sp_name).and_return(sp_name) - allow(view).to receive(:decorated_session).and_return(@decorated_session) - allow(view).to receive(:flow_session).and_return(flow_session) - allow(view).to receive(:url_for).and_return('https://www.example.com/') - allow(view).to receive(:user_fully_authenticated?).and_return(true) - allow(view).to receive(:user_signing_up?).and_return(true) - - @presenter = instance_double(Idv::InheritedProofing::InheritedProofingPresenter) - allow(@presenter).to receive(:learn_more_phone_or_mail_url).and_return('https://www.va.gov/resources/managing-your-vagov-profile/') - allow(@presenter).to receive(:get_help_url).and_return('https://www.va.gov/resources/managing-your-vagov-profile/') - allow(view).to receive(:presenter).and_return(@presenter) - end - - it 'renders the Continue button' do - render template: 'idv/inherited_proofing/get_started' - - expect(rendered).to have_button(t('inherited_proofing.buttons.continue')) - end - - it 'renders the Cancel link' do - render template: 'idv/inherited_proofing/get_started' - - expect(rendered).to have_link(t('links.cancel_account_creation')) - end - - context 'with or without service provider' do - it 'renders troubleshooting options' do - render template: 'idv/inherited_proofing/get_started' - - expect(rendered).to have_link( - t('inherited_proofing.troubleshooting.options.learn_more_phone_or_mail'), - ) - expect(rendered).not_to have_link(nil, href: idv_inherited_proofing_return_to_sp_path) - expect(rendered).to have_link( - t( - 'inherited_proofing.troubleshooting.options.get_help', - sp_name: sp_name, - ), - ) - expect(rendered).to have_link( - t('inherited_proofing.troubleshooting.options.learn_more_phone_or_mail'), - ) - end - end -end diff --git a/spec/views/idv/inherited_proofing/retrieval.html.erb_spec.rb b/spec/views/idv/inherited_proofing/retrieval.html.erb_spec.rb deleted file mode 100644 index 7db2ed40eb1..00000000000 --- a/spec/views/idv/inherited_proofing/retrieval.html.erb_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'rails_helper' - -describe 'idv/inherited_proofing/verify_wait.html.erb' do - include Devise::Test::ControllerHelpers - - it 'renders' do - render template: 'idv/inherited_proofing/verify_wait' - - # Appropriate header - expect(rendered).to have_text(t('inherited_proofing.headings.retrieval')) - - # Spinner - expect(rendered).to have_css("img[src*='shield-spinner']") - - # Appropriate text - expect(rendered).to have_text(t('inherited_proofing.info.retrieval_time')) - expect(rendered).to have_text(t('inherited_proofing.info.retrieval_thanks')) - end -end