Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d964d3b
Route + controller for outage page
matthinz Mar 7, 2023
ec70d3c
View for outage page
matthinz Mar 7, 2023
2b68a8b
Wire up exit button
matthinz Mar 8, 2023
569f314
Add idv_available config && feature
matthinz Mar 8, 2023
c6e8dd9
Return error when IDV is unavailable
matthinz Mar 9, 2023
2156ac2
Update translations
matthinz Mar 9, 2023
57b9496
Remove unused spec file
matthinz Mar 9, 2023
a790712
Make French be in French:wq
matthinz Mar 9, 2023
7e8f83d
Be less clever in erb
matthinz Mar 10, 2023
6607faa
Fix borked rename
matthinz Mar 10, 2023
66cbfb0
Remove unused tests
matthinz Mar 10, 2023
5dd2ac2
Don't rely on route to test IdvController::unavailable
matthinz Mar 10, 2023
2bba983
Revert formatting changes to routes.rb
matthinz Mar 10, 2023
f0ecbf4
Superstition: reload routes on cleanup to avoid poisoning other tests
matthinz Mar 10, 2023
db215ca
Remove stray to_h method
matthinz Mar 10, 2023
434bf49
Don't use `raise` + concern for unavailable error
matthinz Mar 13, 2023
081451e
Attempt to redirect user back from outage page
matthinz Mar 14, 2023
1797426
changelog: User-Facing Improvements, Identity verification, Provide a…
matthinz Mar 14, 2023
bfc1934
Remove from, from_idv from VendorStatus
matthinz Mar 14, 2023
f0825fe
Log when we hit IDV unavailable screen from the create account page
matthinz Mar 14, 2023
5e1a073
Remove unneeded VendorStatus test
matthinz Mar 14, 2023
0137f4c
Fix #track_event test
matthinz Mar 14, 2023
f18d53f
Remove unused translations
matthinz Mar 14, 2023
ac1b7c5
Clean up unavailable actions / views / etc.
matthinz Mar 15, 2023
ac4f9fc
Hoist constant up to class level
matthinz Mar 15, 2023
98f82b6
Remove unused action on IdvController
matthinz Mar 15, 2023
4b39a0a
Fixup: unavailable view
matthinz Mar 15, 2023
e116e8e
Don't use separate actions for idv unavailable message
matthinz Mar 15, 2023
6aa9f06
Spell "unavailable" correctly
matthinz Mar 15, 2023
7689c7a
Use StatusPageComponent for IdV unavailable message
matthinz Mar 15, 2023
82fb5d5
Return 200 OK from unavailable error page
matthinz Mar 15, 2023
3e23672
Refactor redirect in UnavailableController out to before_action
matthinz Mar 17, 2023
ec9d077
Remove irrelevant test
matthinz Mar 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/controllers/idv/doc_auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ class DocAuthController < ApplicationController
before_action :redirect_if_flow_completed
before_action :override_document_capture_step_csp
before_action :update_if_skipping_upload
# rubocop:disable Rails/LexicallyScopedActionFilter
before_action :check_for_outage, only: :show
# rubocop:enable Rails/LexicallyScopedActionFilter

before_action :override_csp_for_threat_metrix

FLOW_STATE_MACHINE_SETTINGS = {
Expand Down Expand Up @@ -68,13 +64,5 @@ def do_meta_refresh(meta_refresh_count)
def flow_session
user_session['idv/doc_auth']
end

def check_for_outage
if VendorStatus.new.any_ial2_vendor_outage?
session[:vendor_outage_redirect] = current_step
session[:vendor_outage_redirect_from_idv] = true
redirect_to vendor_outage_url
end
end
end
end
34 changes: 34 additions & 0 deletions app/controllers/idv/unavailable_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module Idv
class UnavailableController < ApplicationController
ALLOWED_FROM_LOCATIONS = [SignUp::RegistrationsController::CREATE_ACCOUNT]

before_action :redirect_if_idv_available_and_from_create_account

def show
analytics.vendor_outage(
vendor_status: {
acuant: IdentityConfig.store.vendor_status_acuant,
lexisnexis_instant_verify: IdentityConfig.store.vendor_status_lexisnexis_instant_verify,
lexisnexis_trueid: IdentityConfig.store.vendor_status_lexisnexis_trueid,
sms: IdentityConfig.store.vendor_status_sms,
voice: IdentityConfig.store.vendor_status_voice,
},
redirect_from: from,
)
end

private

def from
params[:from] if ALLOWED_FROM_LOCATIONS.include?(params[:from])
end

def from_create_account?
from == SignUp::RegistrationsController::CREATE_ACCOUNT
end

def redirect_if_idv_available_and_from_create_account
redirect_to sign_up_email_url if FeatureManagement.idv_available? && from_create_account?
end
end
end
7 changes: 3 additions & 4 deletions app/controllers/sign_up/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ def sp_request_id
end

def redirect_if_ial2_and_vendor_outage
return unless ial2_requested? && VendorStatus.new.any_ial2_vendor_outage?

session[:vendor_outage_redirect] = CREATE_ACCOUNT
return redirect_to vendor_outage_url
if ial2_requested? && !FeatureManagement.idv_available?
redirect_to idv_unavailable_path(from: CREATE_ACCOUNT)
end
end
end
end
2 changes: 0 additions & 2 deletions app/controllers/vendor_outage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ class VendorOutageController < ApplicationController
def show
vendor_status = VendorStatus.new(
sp: current_sp,
from: session.delete(:vendor_outage_redirect),
from_idv: session.delete(:vendor_outage_redirect_from_idv),
)
@specific_message = vendor_status.outage_message
@show_gpo_option = from_idv_phone? && gpo_letter_available?
Expand Down
4 changes: 2 additions & 2 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2901,12 +2901,12 @@ def user_registration_2fa_setup_visit
track_event('User Registration: 2FA Setup visited')
end

# @param [String] redirect_from
# @param [String,nil] redirect_from
# @param [Hash] vendor_status
# Tracks when vendor has outage
def vendor_outage(
redirect_from:,
vendor_status:,
redirect_from: nil,
**extra
)
track_event(
Expand Down
27 changes: 4 additions & 23 deletions app/services/vendor_status.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class VendorStatus
include ActionView::Helpers::TranslationHelper

def initialize(from: nil, from_idv: nil, sp: nil)
@from = from
@from_idv = from_idv
def initialize(sp: nil)
@sp = sp
end

Expand Down Expand Up @@ -49,31 +47,15 @@ def all_phone_vendor_outage?
all_vendor_outage?(PHONE_VENDORS)
end

def from_idv?
from_idv
end

# Returns an appropriate error message based upon the type of outage or what the user was doing
# when they encountered the outage.
#
# @return [String, nil] the localized message.
def outage_message
if any_ial2_vendor_outage?
if from_idv?
if sp
t('vendor_outage.blocked.idv.with_sp', service_provider: sp.friendly_name)
else
t('vendor_outage.blocked.idv.without_sp')
end
else
t('vendor_outage.blocked.idv.generic')
end
t('vendor_outage.blocked.idv.generic')
elsif any_phone_vendor_outage?
if from_idv?
t('vendor_outage.blocked.phone.idv')
else
t('vendor_outage.blocked.phone.default')
end
t('vendor_outage.blocked.phone.default')
end
end

Expand All @@ -88,11 +70,10 @@ def track_event(analytics)
sms: IdentityConfig.store.vendor_status_sms,
voice: IdentityConfig.store.vendor_status_voice,
},
redirect_from: from,
)
end

private

attr_reader :from, :from_idv, :sp
attr_reader :sp
end
38 changes: 38 additions & 0 deletions app/views/idv/unavailable/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<% title t('idv.titles.unavailable') %>

<%= render StatusPageComponent.new(status: :error) do |c| %>

<% c.header { t('idv.titles.unavailable') } %>

<p>
<% if decorated_session.sp_name.present? %>
<%= t('idv.unavailable.idv_explanation.with_sp', sp: decorated_session.sp_name) %>
<% else %>
<%= t('idv.unavailable.idv_explanation.without_sp') %>
<% end %>
</p>

<p class="margin-bottom-5">
<%= t(
'idv.unavailable.next_steps_html',
app_name: APP_NAME,
status_page_link: new_window_link_to(
t('idv.unavailable.status_page_link'),
StatusPage.base_url,
),
) %>
</p>

<% c.action_button(
action: ->(**tag_options, &block) do
link_to(
return_to_sp_failure_to_proof_path(location: :unavailable),
**tag_options,
&block
)
end,
big: true,
wide: true,
).with_content(t('idv.unavailable.exit_button', app_name: APP_NAME)) %>

<% end %>
1 change: 1 addition & 0 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ hide_phone_mfa_signup: false
identity_pki_disabled: false
identity_pki_local_dev: false
idv_attempt_window_in_hours: 6
idv_available: true
idv_contact_url: https://www.example.com
idv_contact_phone_number: (844) 555-5555
idv_max_attempts: 5
Expand Down
12 changes: 12 additions & 0 deletions config/locales/idv/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ en:
session:
phone: Enter your phone number
review: Re-enter your %{app_name} password to protect your data
unavailable: 'We are working to resolve an error'
troubleshooting:
headings:
missing_required_items: Are you missing one of these items?
Expand All @@ -215,6 +216,17 @@ en:
learn_more_verify_in_person: Learn more about verifying in person
supported_documents: See a list of accepted state-issued IDs
verify_by_mail: Verify your address by mail instead
unavailable:
exit_button: 'Exit %{app_name}'
idv_explanation:
with_sp: '%{sp} needs to make sure you are you — not someone pretending to be
you.'
without_sp: 'The agency that you are trying to access needs to make sure you are
you — not someone pretending to be you.'
next_steps_html: 'Unfortunately, we are having technical difficulties and cannot
verify your identity at this time. %{status_page_link} or exit
%{app_name} and try again later.'
status_page_link: 'Get updates on our status page'
welcome:
no_js_header: You must enable JavaScript to verify your identity.
no_js_intro: '%{sp_name} needs you to verify your identity. You need to enable
Expand Down
13 changes: 13 additions & 0 deletions config/locales/idv/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ es:
session:
phone: Introduzca su número de teléfono
review: Vuelve a ingresar tu contraseña de %{app_name} para encriptar tus datos
unavailable: Estamos trabajando para resolver un error
troubleshooting:
headings:
missing_required_items: '¿Le falta alguno de estos puntos?'
Expand All @@ -231,6 +232,18 @@ es:
supported_documents: Vea la lista de documentos de identidad emitidos por el
estado que son aceptados
verify_by_mail: Verifique su dirección por correo
unavailable:
exit_button: 'Salir de %{app_name}'
idv_explanation:
with_sp: '%{sp} necesita asegurarse de que es usted realmente y no alguien que
se hace pasar por usted.'
without_sp: 'La agencia a la que está intentando acceder debe asegurarse de que
usted sea quien dice ser, y no alguien que se hace pasar por usted.'
next_steps_html: 'Lamentablemente, debido a problemas técnicos por nuestra
parte, tal vez no podamos verificar su identidad en estos momentos.
%{status_page_link} o salga de %{app_name} y vuelva a intentarlo más
tarde.'
status_page_link: 'Consulte las actualizaciones en nuestra página de estado'
welcome:
no_js_header: Debe habilitar JavaScript para verificar su identidad.
no_js_intro: '%{sp_name} requiere que usted verifique su identidad. Debe
Expand Down
14 changes: 14 additions & 0 deletions config/locales/idv/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ fr:
session:
phone: Entrez votre numéro de téléphone
review: Entrez à nouveau votre mot de passe %{app_name} pour crypter vos données
unavailable: Nous travaillons à la résolution d’une erreur
troubleshooting:
headings:
missing_required_items: Est-ce qu’il vous manque un de ces éléments?
Expand All @@ -245,6 +246,19 @@ fr:
learn_more_verify_in_person: En savoir plus sur la vérification en personne
supported_documents: Voir la liste des pièces d’identité acceptées et délivrées par l’État
verify_by_mail: Vérifiez plutôt votre adresse par courrier
unavailable:
exit_button: 'Quitter %{app_name}'
idv_explanation:
with_sp: '%{sp} doit s’assurer que c’est bien vous — et non quelqu’un qui se
fait passer pour vous.'
without_sp: 'L’agence à laquelle vous essayez d’accéder doit s’assurer qu’il
s’agit bien de vous, et non de quelqu’un qui se fait passer pour
vous.'
next_steps_html: 'Malheureusement, nous rencontrons des difficultés techniques
et ne pouvons pas vérifier votre identité pour le moment.
%{status_page_link} ou quittez le site %{app_name} et réessayez plus
tard.'
status_page_link: 'Obtenez des mises à jour sur notre page de statut'
welcome:
no_js_header: Vous devez activer JavaScript pour vérifier votre identité.
no_js_intro: '%{sp_name} a besoin de vous pour vérifier votre identité. Vous
Expand Down
10 changes: 0 additions & 10 deletions config/locales/vendor_outage/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@ en:
idv:
generic: We are having technical difficulties on our end and cannot verify your
identity at this time. Please try again later.
with_sp: '%{service_provider} needs to make sure you are you — not someone
pretending to be you. Unfortunately, we are having technical
difficulties and cannot verify your identity at this time. Please try
again later.'
without_sp: The agency that you are trying to access needs to make sure you are
you — not someone pretending to be you. Unfortunately, we are having
technical difficulties and cannot verify your identity at this time.
Please try again later.
phone:
default: We cannot verify phones at this time. Please try again later.
idv: We cannot verify phones at this time. Please try again later or verify your
address by mail instead.
get_updates: Get updates
get_updates_on_status_page: Get updates on our status page
working: We are working to resolve an error
13 changes: 0 additions & 13 deletions config/locales/vendor_outage/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,9 @@ es:
generic: Debido a problemas técnicos por nuestra parte, no podemos verificar su
identidad en estos momentos. Por favor, inténtelo nuevamente más
tarde.
with_sp: '%{service_provider} necesita asegurarse de que es usted realmente y no
alguien que se hace pasar por usted. Lamentablemente, debido a
problemas técnicos por nuestra parte, tal vez no podamos verificar su
identidad en estos momentos. Por favor, inténtelo nuevamente más
tarde.'
without_sp: La agencia a la que está intentando acceder debe asegurarse de que
usted sea quien dice ser, y no alguien que se hace pasar por usted.
Lamentablemente, debido a problemas técnicos por nuestra parte, tal
vez no podamos verificar su identidad en estos momentos. Por favor,
inténtelo nuevamente más tarde.
phone:
default: No podemos verificar teléfonos en estos momentos. Por favor, inténtelo
nuevamente más tarde.
idv: No podemos verificar teléfonos en estos momentos. Por favor, inténtelo
nuevamente más tarde o, en lugar de ello, verifique su dirección por
correo.
get_updates: Obtenga actualizaciones
get_updates_on_status_page: Reciba actualizaciones en nuestra página de estado
working: Estamos trabajando para corregir un error
11 changes: 0 additions & 11 deletions config/locales/vendor_outage/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,9 @@ fr:
idv:
generic: Nous rencontrons des difficultés techniques et ne pouvons pas vérifier
votre identité pour le moment. Veuillez réessayer plus tard.
with_sp: '%{service_provider} doit s’assurer que c’est bien vous — et non
quelqu’un qui se fait passer pour vous. Malheureusement, nous
rencontrons des difficultés techniques et ne pouvons pas vérifier
votre identité pour le moment. Veuillez réessayer plus tard.'
without_sp: L’agence à laquelle vous essayez d’accéder doit s’assurer qu’il
s’agit bien de vous, et non de quelqu’un qui se fait passer pour vous.
Malheureusement, nous rencontrons des difficultés techniques et ne
pouvons pas vérifier votre identité pour le moment. Veuillez réessayer
plus tard.
phone:
default: Nous ne pouvons pas vérifier les téléphones pour le moment. Veuillez
réessayer plus tard.
idv: Nous ne pouvons pas vérifier les téléphones pour le moment. Veuillez
réessayer plus tard ou vérifier votre adresse par la poste.
get_updates: Obtenir des mises à jour
get_updates_on_status_page: Obtenez des mises à jour sur notre page de statut
working: Nous travaillons à la résolution d’une erreur
Loading