From ef33b3c2ef0e2fa677e13d50053f93c0e16a195d Mon Sep 17 00:00:00 2001
From: Zach Margolis
Date: Wed, 6 Sep 2023 11:45:46 -0700
Subject: [PATCH 01/28] Move user suspended check for sign-in (#9147)
- This path is more in-line with other post-2fa steps for sign in
- Bring back before_filter in accounts controller
changelog: Internal, User suspension, Update suspended user check
---
app/controllers/application_controller.rb | 8 ++++++--
spec/controllers/accounts_controller_spec.rb | 7 +------
.../application_controller_spec.rb | 20 +++++++++++++++++++
spec/features/users/sign_in_spec.rb | 15 ++++++++++++++
4 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ee85bbe5536..82e90938767 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -218,6 +218,7 @@ def fix_broken_personal_key_url
def after_sign_in_path_for(_user)
accept_rules_of_use_url ||
+ user_suspended_url ||
service_provider_mfa_setup_url ||
add_piv_cac_setup_url ||
fix_broken_personal_key_url ||
@@ -228,7 +229,6 @@ def after_sign_in_path_for(_user)
def signed_in_url
return user_two_factor_authentication_url unless user_fully_authenticated?
- return user_please_call_url if current_user.suspended?
return reactivate_account_url if user_needs_to_reactivate_account?
return url_for_pending_profile_reason if user_has_pending_profile?
return backup_code_reminder_url if user_needs_backup_code_reminder?
@@ -292,7 +292,7 @@ def user_fully_authenticated?
end
def confirm_user_is_not_suspended
- redirect_to user_please_call_url if current_user.suspended?
+ redirect_to user_suspended_url if user_suspended_url
end
def confirm_two_factor_authenticated
@@ -350,6 +350,10 @@ def prompt_to_verify_sp_required_mfa
redirect_to sp_required_mfa_verification_url
end
+ def user_suspended_url
+ user_please_call_url if current_user.suspended?
+ end
+
def sp_required_mfa_verification_url
return login_two_factor_piv_cac_url if service_provider_mfa_policy.piv_cac_required?
diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb
index 1ad01244680..f55c61097aa 100644
--- a/spec/controllers/accounts_controller_spec.rb
+++ b/spec/controllers/accounts_controller_spec.rb
@@ -79,14 +79,9 @@
end
context 'when a user is suspended' do
- render_views
it 'redirects to contact support page' do
- user = create(
- :user,
- :fully_registered,
- )
+ user = create(:user, :fully_registered, :suspended)
- user.suspend!
sign_in user
get :show
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index b0fbf257112..f8d4e8838b1 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -210,6 +210,26 @@ def index
end
end
+ describe '#user_suspended_url' do
+ before { sign_in(user) }
+
+ context 'when user is suspended' do
+ let(:user) { create(:user, :suspended) }
+
+ it 'is the please call url' do
+ expect(controller.send(:user_suspended_url)).to eq(user_please_call_url)
+ end
+ end
+
+ context 'when user is not suspended' do
+ let(:user) { create(:user) }
+
+ it 'is nil' do
+ expect(controller.send(:user_suspended_url)).to be_nil
+ end
+ end
+ end
+
describe '#confirm_two_factor_authenticated' do
controller do
before_action :confirm_two_factor_authenticated
diff --git a/spec/features/users/sign_in_spec.rb b/spec/features/users/sign_in_spec.rb
index a44a596e527..1f5a37a1290 100644
--- a/spec/features/users/sign_in_spec.rb
+++ b/spec/features/users/sign_in_spec.rb
@@ -62,6 +62,21 @@
expect(current_path).to eq account_path
end
+ scenario 'user is suspended, gets show please call page after 2fa' do
+ user = create(:user, :fully_registered, :suspended)
+ service_provider = ServiceProvider.find_by(issuer: OidcAuthHelper::OIDC_IAL1_ISSUER)
+ IdentityLinker.new(user, service_provider).link_identity(
+ verified_attributes: %w[openid email],
+ )
+
+ visit_idp_from_sp_with_ial1(:oidc)
+ fill_in_credentials_and_submit(user.email, user.password)
+ fill_in_code_with_last_phone_otp
+ click_submit_default
+
+ expect(current_path).to eq(user_please_call_path)
+ end
+
scenario 'user opts to add piv/cac card' do
perform_steps_to_get_to_add_piv_cac_during_sign_up
nonce = piv_cac_nonce_from_form_action
From fa4183da3f73799ee10c78f4c0aaa1067f1955f1 Mon Sep 17 00:00:00 2001
From: Zach Margolis
Date: Wed, 6 Sep 2023 11:46:02 -0700
Subject: [PATCH 02/28] Update IDV report to support multiple issuers
(LG-10875) (#9148)
- Expanding use so we can support a specific one-off request, but seemed
easier to expand all reports at once
- Update YARD params docs
changelog: Internal, Reporting, Update funnel reports to accept multiple issuers
---
.../reports/identity_verification_report.rb | 2 +-
lib/reporting/authentication_report.rb | 14 ++++++-------
lib/reporting/command_line_options.rb | 8 ++++----
lib/reporting/identity_verification_report.rb | 14 ++++++-------
lib/reporting/monthly_proofing_report.rb | 3 ++-
.../reporting/authentication_report_spec.rb | 4 ++--
.../reporting/command_line_options_spec.rb | 20 +++++++++++++++++--
.../identity_verification_report_spec.rb | 8 +++++---
8 files changed, 46 insertions(+), 27 deletions(-)
diff --git a/app/jobs/reports/identity_verification_report.rb b/app/jobs/reports/identity_verification_report.rb
index 8943374b7c8..ed516fd2fe8 100644
--- a/app/jobs/reports/identity_verification_report.rb
+++ b/app/jobs/reports/identity_verification_report.rb
@@ -16,7 +16,7 @@ def perform(report_date)
def report_maker
Reporting::IdentityVerificationReport.new(
- issuer: nil,
+ issuers: [],
time_range: report_date.all_day,
slice: 4.hours,
)
diff --git a/lib/reporting/authentication_report.rb b/lib/reporting/authentication_report.rb
index 8924c0f9c5e..f13bfc14f0c 100644
--- a/lib/reporting/authentication_report.rb
+++ b/lib/reporting/authentication_report.rb
@@ -14,7 +14,7 @@ module Reporting
class AuthenticationReport
include Reporting::CloudwatchQueryQuoting
- attr_reader :issuer, :time_range
+ attr_reader :issuers, :time_range
module Events
OIDC_AUTH_REQUEST = 'OpenID Connect: authorization request'
@@ -28,17 +28,17 @@ def self.all_events
end
end
- # @param [String] isssuer
+ # @param [Array] issuers
# @param [Range
Il se peut que vous ayez besoin d’utiliser le
- même appareil pour vous connecter chaque fois.%{link}
'
+ même appareil pour vous connecter chaque fois. %{link}'
intro_link_text: En savoir plus sur le déverrouillage facial ou sur le
déverrouillage tactile.
nickname: Pseudo dispositivo
From a5ed9fbfa4766f09121ff1cd1e32e48b59505b83 Mon Sep 17 00:00:00 2001
From: Amir Reavis-Bey
Date: Fri, 8 Sep 2023 16:18:04 -0400
Subject: [PATCH 21/28] Identity Verification report job to immediately exit
when s3 reports are disabled (#9175)
* when s3 reports disabled, Identity verification report to return immediately and not create a report to be uploaded to S3
* [skip changelog]
---
app/jobs/reports/identity_verification_report.rb | 1 +
spec/jobs/reports/identity_verification_report_spec.rb | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/app/jobs/reports/identity_verification_report.rb b/app/jobs/reports/identity_verification_report.rb
index ed516fd2fe8..2903770f8ca 100644
--- a/app/jobs/reports/identity_verification_report.rb
+++ b/app/jobs/reports/identity_verification_report.rb
@@ -7,6 +7,7 @@ class IdentityVerificationReport < BaseReport
attr_accessor :report_date
def perform(report_date)
+ return unless IdentityConfig.store.s3_reports_enabled
self.report_date = report_date
csv = report_maker.to_csv
diff --git a/spec/jobs/reports/identity_verification_report_spec.rb b/spec/jobs/reports/identity_verification_report_spec.rb
index dcba225eca1..56d35b79572 100644
--- a/spec/jobs/reports/identity_verification_report_spec.rb
+++ b/spec/jobs/reports/identity_verification_report_spec.rb
@@ -1,6 +1,10 @@
require 'rails_helper'
RSpec.describe Reports::IdentityVerificationReport do
+ before do
+ allow(IdentityConfig.store).to receive(:s3_reports_enabled).and_return(true)
+ end
+
describe '#perform' do
it 'gets a CSV from the report maker and saves it to S3' do
report_maker = double(Reporting::IdentityVerificationReport, to_csv: 'I am a CSV, see')
From ef9bad62dd5c188d97b517118346998c81fb5dad Mon Sep 17 00:00:00 2001
From: Sonia Connolly
Date: Fri, 8 Sep 2023 14:01:45 -0700
Subject: [PATCH 22/28] LG-10273 idv_session cleanup - remove unused properties
(#9178)
* Remove unused profile_step_params from idv_session
[skip changelog]
* Remove unused profile_confirmation from idv_session
---
app/services/idv/session.rb | 8 --------
1 file changed, 8 deletions(-)
diff --git a/app/services/idv/session.rb b/app/services/idv/session.rb
index 294fc0535ac..e952e9da614 100644
--- a/app/services/idv/session.rb
+++ b/app/services/idv/session.rb
@@ -17,9 +17,7 @@ class Session
phone_for_mobile_flow
pii
previous_phone_step_params
- profile_confirmation
profile_id
- profile_step_params
redo_document_capture
resolution_successful
skip_hybrid_handoff
@@ -186,16 +184,10 @@ def clear_applicant!
def mark_verify_info_step_complete!
session[:resolution_successful] = true
- # This is here to maintain backwards compadibility with old code.
- # Once the code that checks `profile_confirmation` is removed from prod
- # this setter and eventually the value in the Idv::Session struct itself
- # can be removed.
- session[:profile_confirmation] = true
end
def invalidate_verify_info_step!
session[:resolution_successful] = nil
- session[:profile_confirmation] = nil
end
def invalidate_steps_after_verify_info!
From 499c12894af878ade7e6e98689458c7f189e43d5 Mon Sep 17 00:00:00 2001
From: Sonia Connolly
Date: Fri, 8 Sep 2023 14:43:18 -0700
Subject: [PATCH 23/28] Couple more places to add idv_session.ssn (#9168)
* Couple more places to add idv_session.ssn
[skip changelog]
* VerifyInfo show templates need access to @ssn separately from @pii now
---------
Co-authored-by: Gina Yamada
---
app/controllers/concerns/idv/verify_info_concern.rb | 2 +-
app/controllers/idv/in_person/ssn_controller.rb | 2 +-
app/controllers/idv/in_person/verify_info_controller.rb | 1 +
app/controllers/idv/verify_info_controller.rb | 2 +-
app/views/idv/in_person/verify_info/show.html.erb | 9 +++++----
app/views/idv/verify_info/show.html.erb | 9 +++++----
6 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb
index af36451e1c9..11060ce9acc 100644
--- a/app/controllers/concerns/idv/verify_info_concern.rb
+++ b/app/controllers/concerns/idv/verify_info_concern.rb
@@ -301,7 +301,7 @@ def log_idv_verification_submitted_event(success: false, failure_reason: nil)
last_name: pii_from_doc[:last_name],
date_of_birth: pii_from_doc[:dob],
address: pii_from_doc[:address1],
- ssn: pii_from_doc[:ssn],
+ ssn: idv_session.ssn || pii_from_doc[:ssn],
failure_reason: failure_reason,
)
end
diff --git a/app/controllers/idv/in_person/ssn_controller.rb b/app/controllers/idv/in_person/ssn_controller.rb
index 69e4ffaa859..8a717ba6968 100644
--- a/app/controllers/idv/in_person/ssn_controller.rb
+++ b/app/controllers/idv/in_person/ssn_controller.rb
@@ -86,7 +86,7 @@ def analytics_arguments
end
def updating_ssn?
- flow_session.dig(:pii_from_user, :ssn).present?
+ idv_session.ssn.present? || flow_session.dig(:pii_from_user, :ssn).present?
end
def confirm_in_person_address_step_complete
diff --git a/app/controllers/idv/in_person/verify_info_controller.rb b/app/controllers/idv/in_person/verify_info_controller.rb
index 37f3fb6be1d..e2853047e3c 100644
--- a/app/controllers/idv/in_person/verify_info_controller.rb
+++ b/app/controllers/idv/in_person/verify_info_controller.rb
@@ -12,6 +12,7 @@ class VerifyInfoController < ApplicationController
def show
@step_indicator_steps = step_indicator_steps
+ @ssn = idv_session.ssn || flow_session[:pii_from_user][:ssn]
@capture_secondary_id_enabled = capture_secondary_id_enabled
analytics.idv_doc_auth_verify_visited(**analytics_arguments)
diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb
index 6bad7dbec80..833143b4cb7 100644
--- a/app/controllers/idv/verify_info_controller.rb
+++ b/app/controllers/idv/verify_info_controller.rb
@@ -11,6 +11,7 @@ class VerifyInfoController < ApplicationController
def show
@step_indicator_steps = step_indicator_steps
+ @ssn = idv_session.ssn || pii_from_doc[:ssn]
analytics.idv_doc_auth_verify_visited(**analytics_arguments)
Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
@@ -54,7 +55,6 @@ def analytics_arguments
}.merge(ab_test_analytics_buckets)
end
- # copied from verify_step
def pii
@pii = pii_from_doc
end
diff --git a/app/views/idv/in_person/verify_info/show.html.erb b/app/views/idv/in_person/verify_info/show.html.erb
index 6aff91ed815..25ea23ca778 100644
--- a/app/views/idv/in_person/verify_info/show.html.erb
+++ b/app/views/idv/in_person/verify_info/show.html.erb
@@ -2,6 +2,7 @@
locals:
@step_indicator_steps - the correct Idv::Flows variable for this flow
@pii - user's information
+ @ssn - user's ssn
@had_barcode_read_failure - show warning if there's a barcode read error
%>
@@ -132,12 +133,12 @@ locals:
<%= t('idv.form.ssn') %>:
<%= render(
'shared/masked_text',
- text: SsnFormatter.format(@pii[:ssn]),
- masked_text: SsnFormatter.format_masked(@pii[:ssn]),
+ text: SsnFormatter.format(@ssn),
+ masked_text: SsnFormatter.format_masked(@ssn),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
- first_number: @pii[:ssn][0],
- last_number: @pii[:ssn][-1],
+ first_number: @ssn[0],
+ last_number: @ssn[-1],
),
toggle_label: t('forms.ssn.show'),
) %>
diff --git a/app/views/idv/verify_info/show.html.erb b/app/views/idv/verify_info/show.html.erb
index 8ef047236c8..8244ca499c2 100644
--- a/app/views/idv/verify_info/show.html.erb
+++ b/app/views/idv/verify_info/show.html.erb
@@ -2,6 +2,7 @@
locals:
@step_indicator_steps - the correct Idv::Flows variable for this flow
@pii - user's information
+ @ssn - user's ssn
@had_barcode_read_failure - show warning if there's a barcode read error
%>
@@ -97,12 +98,12 @@ locals:
<%= t('idv.form.ssn') %>:
<%= render(
'shared/masked_text',
- text: SsnFormatter.format(@pii[:ssn]),
- masked_text: SsnFormatter.format_masked(@pii[:ssn]),
+ text: SsnFormatter.format(@ssn),
+ masked_text: SsnFormatter.format_masked(@ssn),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
- first_number: @pii[:ssn][0],
- last_number: @pii[:ssn][-1],
+ first_number: @ssn[0],
+ last_number: @ssn[-1],
),
toggle_label: t('forms.ssn.show'),
) %>
From a24506ed6fe5b9f77c1f2e4e0e59914188dc0a8f Mon Sep 17 00:00:00 2001
From: Matt Hinz
Date: Fri, 8 Sep 2023 16:09:26 -0700
Subject: [PATCH 24/28] LG-10530: Improve Verify by Mail controller & route
names (#9136)
* Move GPO controllers into by_mail and rename
[skip changelog]
* Move GPO controller specs into by_mail and rename
* Get RequestLetterController spec passing
* Get LetterEnqueuedController spec passing
* Get EnterCodeController spec passing
* come_back_later -> letter_enqueued
* Update view specs
* Analytics event naming
* Rename some routes and add temporary redirects
* 'come back later visited' -> 'letter enqueued visited'
* idv_letter_enqueued -> idv_gpo_letter_enqueued
* /by_mail -> /by_mail/enter_code
* Fix GpoPresenter spec
* 'USPS address visited' -> 'gpo request letter visited'
* letter enqueued visited -> gpo letter enqueued visited'
* `IdV: GPO verification visited` -> `IdV: gpo enter code visited`
* enter code -> enter verify by mail code
* 'GPO verification submitted' -> 'enter verify by mail code submitted'
* Remove GPO from a couple of analytics event names
* Clarify temporary redirects
Match structure in the gpo_verification_enabled? check
* Update app/services/analytics_events.rb
Co-authored-by: Sonia Connolly
* idv_gpo_url -> idv_request_letter_url
* idv_gpo_letter_enqueued_url -> idv_letter_enqueued_url
* idv_gpo_verify_url -> idv_enter_verify_by_mail_code_path
* idv_gpo_url fixup
* fixup idv_gpo_verify_url
* Idv::GpoPresenter -> Idv::ByMail::RequestLetterPresenter
* A couple of analytics methods
* Fix test
* idv_enter_verify_by_mail_code_url -> idv_verify_by_mail_enter_code_url
* Don't change routes yet
- Add handlers at the new route locations (for the GET routes--the others will PUT/POST to the old paths still)
- Don't do any 302 redirecting yet. Actual route changes will come in a future deploy
* Fix presenter spec
* Update analytics method name
* Add PUT/POST routes for new GPO locations
---------
Co-authored-by: Sonia Connolly
---
.../concerns/idv/verify_info_concern.rb | 2 +-
app/controllers/concerns/idv_step_concern.rb | 2 +-
.../concerns/verify_profile_concern.rb | 2 +-
.../enter_code_controller.rb} | 14 +-
.../letter_enqueued_controller.rb} | 8 +-
.../request_letter_controller.rb} | 12 +-
app/controllers/idv/review_controller.rb | 2 +-
.../request_letter_presenter.rb} | 6 +-
app/services/analytics_events.rb | 158 +++++++++---------
app/services/idv/analytics_events_enhancer.rb | 2 +-
.../accounts/_pending_profile_gpo.html.erb | 2 +-
.../enter_code}/index.html.erb | 6 +-
.../enter_code}/rate_limited.html.erb | 0
.../letter_enqueued}/show.html.erb | 0
.../request_letter}/index.html.erb | 2 +-
.../idv/confirm_start_over/index.html.erb | 2 +-
app/views/idv/phone/new.html.erb | 4 +-
app/views/idv/phone_errors/_warning.html.erb | 2 +-
app/views/idv/phone_errors/failure.html.erb | 2 +-
app/views/idv/phone_errors/warning.html.erb | 2 +-
app/views/user_mailer/gpo_reminder.html.erb | 4 +-
app/views/vendor_outage/show.html.erb | 2 +-
config/routes.rb | 23 ++-
lib/reporting/identity_verification_report.rb | 19 ++-
.../concerns/idv_step_concern_spec.rb | 4 +-
.../enter_code_controller_spec.rb} | 38 +++--
.../letter_enqueued_controller_spec.rb} | 4 +-
.../request_letter_controller_spec.rb} | 13 +-
.../controllers/idv/review_controller_spec.rb | 2 +-
.../authorization_controller_spec.rb | 6 +-
.../users/sessions_controller_spec.rb | 2 +-
spec/features/idv/analytics_spec.rb | 5 +-
.../idv/clearing_and_restarting_spec.rb | 2 +-
spec/features/idv/confirm_start_over_spec.rb | 4 +-
.../idv/doc_auth/verify_info_step_spec.rb | 2 +-
spec/features/idv/end_to_end_idv_spec.rb | 2 +-
spec/features/idv/in_person_spec.rb | 2 +-
spec/features/idv/outage_spec.rb | 2 +-
.../steps/gpo_otp_verification_step_spec.rb | 12 +-
spec/features/idv/steps/gpo_step_spec.rb | 16 +-
spec/features/idv/steps/review_step_spec.rb | 2 +-
spec/features/saml/ial2_sso_spec.rb | 12 +-
spec/features/users/verify_profile_spec.rb | 4 +-
.../identity_verification_report_spec.rb | 9 +
spec/mailers/user_mailer_spec.rb | 4 +-
.../request_letter_presenter_spec.rb} | 2 +-
.../idv_examples/clearing_and_restarting.rb | 2 +-
.../idv_examples/gpo_otp_verification.rb | 6 +-
spec/views/accounts/show.html.erb_spec.rb | 7 +-
.../enter_code}/index.html.erb_spec.rb | 12 +-
.../letter_enqueued}/show.html.erb_spec.rb | 2 +-
.../request_letter}/index.html.erb_spec.rb | 9 +-
.../idv/phone_errors/jobfail.html.erb_spec.rb | 4 +-
.../idv/phone_errors/timeout.html.erb_spec.rb | 4 +-
.../idv/phone_errors/warning.html.erb_spec.rb | 7 +-
55 files changed, 265 insertions(+), 215 deletions(-)
rename app/controllers/idv/{gpo_verify_controller.rb => by_mail/enter_code_controller.rb} (91%)
rename app/controllers/idv/{come_back_later_controller.rb => by_mail/letter_enqueued_controller.rb} (66%)
rename app/controllers/idv/{gpo_controller.rb => by_mail/request_letter_controller.rb} (93%)
rename app/presenters/idv/{gpo_presenter.rb => by_mail/request_letter_presenter.rb} (88%)
rename app/views/idv/{gpo_verify => by_mail/enter_code}/index.html.erb (93%)
rename app/views/idv/{gpo_verify => by_mail/enter_code}/rate_limited.html.erb (100%)
rename app/views/idv/{come_back_later => by_mail/letter_enqueued}/show.html.erb (100%)
rename app/views/idv/{gpo => by_mail/request_letter}/index.html.erb (97%)
rename spec/controllers/idv/{gpo_verify_controller_spec.rb => by_mail/enter_code_controller_spec.rb} (93%)
rename spec/controllers/idv/{come_back_later_controller_spec.rb => by_mail/letter_enqueued_controller_spec.rb} (89%)
rename spec/controllers/idv/{gpo_controller_spec.rb => by_mail/request_letter_controller_spec.rb} (95%)
rename spec/presenters/idv/{gpo_presenter_spec.rb => by_mail/request_letter_presenter_spec.rb} (97%)
rename spec/views/idv/{gpo_verify => by_mail/enter_code}/index.html.erb_spec.rb (91%)
rename spec/views/idv/{come_back_later => by_mail/letter_enqueued}/show.html.erb_spec.rb (96%)
rename spec/views/idv/{gpo => by_mail/request_letter}/index.html.erb_spec.rb (87%)
diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb
index 11060ce9acc..a4172f60aab 100644
--- a/app/controllers/concerns/idv/verify_info_concern.rb
+++ b/app/controllers/concerns/idv/verify_info_concern.rb
@@ -224,7 +224,7 @@ def async_state_done(current_async_state)
end
def next_step_url
- return idv_gpo_url if FeatureManagement.idv_by_mail_only?
+ return idv_request_letter_url if FeatureManagement.idv_by_mail_only?
idv_phone_url
end
diff --git a/app/controllers/concerns/idv_step_concern.rb b/app/controllers/concerns/idv_step_concern.rb
index e3c1eca8141..44ce2834e9d 100644
--- a/app/controllers/concerns/idv_step_concern.rb
+++ b/app/controllers/concerns/idv_step_concern.rb
@@ -17,7 +17,7 @@ module IdvStepConcern
end
def confirm_no_pending_gpo_profile
- redirect_to idv_gpo_verify_url if current_user&.gpo_verification_pending_profile?
+ redirect_to idv_verify_by_mail_enter_code_url if current_user&.gpo_verification_pending_profile?
end
def confirm_no_pending_in_person_enrollment
diff --git a/app/controllers/concerns/verify_profile_concern.rb b/app/controllers/concerns/verify_profile_concern.rb
index 740723a2bd5..45e8a8bca38 100644
--- a/app/controllers/concerns/verify_profile_concern.rb
+++ b/app/controllers/concerns/verify_profile_concern.rb
@@ -2,7 +2,7 @@ module VerifyProfileConcern
private
def url_for_pending_profile_reason
- return idv_gpo_verify_url if current_user.gpo_verification_pending_profile?
+ return idv_verify_by_mail_enter_code_url if current_user.gpo_verification_pending_profile?
return idv_in_person_ready_to_verify_url if current_user.in_person_pending_profile?
return idv_please_call_url if current_user.fraud_review_pending?
idv_not_verified_url if current_user.fraud_rejection?
diff --git a/app/controllers/idv/gpo_verify_controller.rb b/app/controllers/idv/by_mail/enter_code_controller.rb
similarity index 91%
rename from app/controllers/idv/gpo_verify_controller.rb
rename to app/controllers/idv/by_mail/enter_code_controller.rb
index 082c5e96dc1..d7782d08a55 100644
--- a/app/controllers/idv/gpo_verify_controller.rb
+++ b/app/controllers/idv/by_mail/enter_code_controller.rb
@@ -1,7 +1,7 @@
-module Idv
- class GpoVerifyController < ApplicationController
+module Idv::ByMail
+ class EnterCodeController < ApplicationController
include IdvSession
- include StepIndicatorConcern
+ include Idv::StepIndicatorConcern
include FraudReviewConcern
prepend_before_action :note_if_user_did_not_receive_letter
@@ -13,7 +13,7 @@ def index
# slightly different copy on this screen.
@user_did_not_receive_letter = !!params[:did_not_receive_letter]
- analytics.idv_gpo_verification_visited(
+ analytics.idv_verify_by_mail_enter_code_visited(
source: if @user_did_not_receive_letter then 'gpo_reminder_email' end,
)
@@ -52,7 +52,7 @@ def create
@gpo_verify_form = build_gpo_verify_form
result = @gpo_verify_form.submit
- analytics.idv_gpo_verification_submitted(**result.to_h)
+ analytics.idv_verify_by_mail_enter_code_submitted(**result.to_h)
irs_attempts_api_tracker.idv_gpo_verification_submitted(
success: result.success?,
failure_reason: irs_attempts_api_tracker.parse_failure_reason(result),
@@ -60,7 +60,7 @@ def create
if !result.success?
flash[:error] = @gpo_verify_form.errors.first.message
- redirect_to idv_gpo_verify_url
+ redirect_to idv_verify_by_mail_enter_code_url
return
end
@@ -90,7 +90,7 @@ def note_if_user_did_not_receive_letter
if current_user && session.delete(:gpo_user_did_not_receive_letter)
# ...and we can pick things up here.
- redirect_to idv_gpo_verify_path(did_not_receive_letter: 1)
+ redirect_to idv_verify_by_mail_enter_code_path(did_not_receive_letter: 1)
end
end
diff --git a/app/controllers/idv/come_back_later_controller.rb b/app/controllers/idv/by_mail/letter_enqueued_controller.rb
similarity index 66%
rename from app/controllers/idv/come_back_later_controller.rb
rename to app/controllers/idv/by_mail/letter_enqueued_controller.rb
index 55b0415505e..2a9bf4fb720 100644
--- a/app/controllers/idv/come_back_later_controller.rb
+++ b/app/controllers/idv/by_mail/letter_enqueued_controller.rb
@@ -1,13 +1,13 @@
-module Idv
- class ComeBackLaterController < ApplicationController
+module Idv::ByMail
+ class LetterEnqueuedController < ApplicationController
include IdvSession
- include StepIndicatorConcern
+ include Idv::StepIndicatorConcern
before_action :confirm_two_factor_authenticated
before_action :confirm_user_needs_gpo_confirmation
def show
- analytics.idv_come_back_later_visit
+ analytics.idv_letter_enqueued_visit
end
private
diff --git a/app/controllers/idv/gpo_controller.rb b/app/controllers/idv/by_mail/request_letter_controller.rb
similarity index 93%
rename from app/controllers/idv/gpo_controller.rb
rename to app/controllers/idv/by_mail/request_letter_controller.rb
index 32fa3fd8204..6871c080375 100644
--- a/app/controllers/idv/gpo_controller.rb
+++ b/app/controllers/idv/by_mail/request_letter_controller.rb
@@ -1,7 +1,7 @@
-module Idv
- class GpoController < ApplicationController
+module Idv::ByMail
+ class RequestLetterController < ApplicationController
include IdvSession
- include StepIndicatorConcern
+ include Idv::StepIndicatorConcern
include Idv::AbTestAnalyticsConcern
before_action :confirm_two_factor_authenticated
@@ -11,11 +11,11 @@ class GpoController < ApplicationController
before_action :confirm_profile_not_too_old
def index
- @presenter = GpoPresenter.new(current_user, url_options)
+ @presenter = RequestLetterPresenter.new(current_user, url_options)
@step_indicator_current_step = step_indicator_current_step
Funnel::DocAuth::RegisterStep.new(current_user.id, current_sp&.issuer).
call(:usps_address, :view, true)
- analytics.idv_gpo_address_visited(
+ analytics.idv_request_letter_visited(
letter_already_sent: @presenter.resend_requested?,
)
end
@@ -29,7 +29,7 @@ def create
elsif resend_requested?
resend_letter
flash[:success] = t('idv.messages.gpo.another_letter_on_the_way')
- redirect_to idv_come_back_later_url
+ redirect_to idv_letter_enqueued_url
else
redirect_to idv_review_url
end
diff --git a/app/controllers/idv/review_controller.rb b/app/controllers/idv/review_controller.rb
index 4e94f554b01..1fc52488b2a 100644
--- a/app/controllers/idv/review_controller.rb
+++ b/app/controllers/idv/review_controller.rb
@@ -157,7 +157,7 @@ def need_personal_key_confirmation?
def next_step
if gpo_user_flow?
- idv_come_back_later_url
+ idv_letter_enqueued_url
else
idv_personal_key_url
end
diff --git a/app/presenters/idv/gpo_presenter.rb b/app/presenters/idv/by_mail/request_letter_presenter.rb
similarity index 88%
rename from app/presenters/idv/gpo_presenter.rb
rename to app/presenters/idv/by_mail/request_letter_presenter.rb
index 2cb2021f79d..ee96ad76d7a 100644
--- a/app/presenters/idv/gpo_presenter.rb
+++ b/app/presenters/idv/by_mail/request_letter_presenter.rb
@@ -1,5 +1,5 @@
-module Idv
- class GpoPresenter
+module Idv::ByMail
+ class RequestLetterPresenter
include Rails.application.routes.url_helpers
attr_reader :current_user, :url_options
@@ -19,7 +19,7 @@ def button
def fallback_back_path
return idv_verify_info_path if OutageStatus.new.any_phone_vendor_outage?
- user_needs_address_otp_verification? ? idv_gpo_verify_path : idv_phone_path
+ user_needs_address_otp_verification? ? idv_verify_by_mail_enter_code_path : idv_phone_path
end
def resend_requested?
diff --git a/app/services/analytics_events.rb b/app/services/analytics_events.rb
index 537ae4534de..efd3dc1df3f 100644
--- a/app/services/analytics_events.rb
+++ b/app/services/analytics_events.rb
@@ -603,16 +603,6 @@ def idv_cancellation_visited(
)
end
- # The user visited the "come back later" page shown during the GPO mailing flow
- # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components
- def idv_come_back_later_visit(proofing_components: nil, **extra)
- track_event(
- 'IdV: come back later visited',
- proofing_components: proofing_components,
- **extra,
- )
- end
-
# The user checked or unchecked the "By checking this box..." checkbox on the idv agreement step.
# (This is a frontend event.)
# @param [Boolean] checked Whether the user checked the checkbox
@@ -993,19 +983,6 @@ def idv_gpo_address_letter_requested(
)
end
- # @param [Boolean] letter_already_sent
- # GPO address visited
- def idv_gpo_address_visited(
- letter_already_sent:,
- **extra
- )
- track_event(
- 'IdV: USPS address visited',
- letter_already_sent: letter_already_sent,
- **extra,
- )
- end
-
# The user visited the gpo confirm cancellation screen
def idv_gpo_confirm_start_over_visited
track_event('IdV: gpo confirm start over visited')
@@ -1017,60 +994,6 @@ def idv_gpo_reminder_email_sent(user_id:, **extra)
track_event('IdV: gpo reminder email sent', user_id: user_id, **extra)
end
- # @identity.idp.previous_event_name Account verification submitted
- # @param [Boolean] success
- # @param [Hash] errors
- # @param [Hash] pii_like_keypaths
- # @param [DateTime] enqueued_at When was this letter enqueued
- # @param [Integer] which_letter Sorted by enqueue time, which letter had this code
- # @param [Integer] letter_count How many letters did the user enqueue for this profile
- # @param [Integer] attempts Number of attempts to enter a correct code
- # @param [Boolean] pending_in_person_enrollment
- # @param [Boolean] fraud_check_failed
- # @see Reporting::IdentityVerificationReport#query This event is used by the identity verification
- # report. Changes here should be reflected there.
- # GPO verification submitted
- def idv_gpo_verification_submitted(
- success:,
- errors:,
- pii_like_keypaths:,
- enqueued_at:,
- which_letter:,
- letter_count:,
- attempts:,
- pending_in_person_enrollment:,
- fraud_check_failed:,
- **extra
- )
- track_event(
- 'IdV: GPO verification submitted',
- success: success,
- errors: errors,
- pii_like_keypaths: pii_like_keypaths,
- enqueued_at: enqueued_at,
- which_letter: which_letter,
- letter_count: letter_count,
- attempts: attempts,
- pending_in_person_enrollment: pending_in_person_enrollment,
- fraud_check_failed: fraud_check_failed,
- **extra,
- )
- end
-
- # @identity.idp.previous_event_name Account verification visited
- # GPO verification visited
- # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email").
- def idv_gpo_verification_visited(
- source: nil,
- **extra
- )
- track_event(
- 'IdV: GPO verification visited',
- source: source,
- **extra,
- )
- end
-
# Tracks emails that are initiated during InPerson::EmailReminderJob
# @param [String] email_type early or late
# @param [String] enrollment_id
@@ -1903,6 +1826,17 @@ def idv_intro_visit
track_event('IdV: intro visited')
end
+ # The user visited the "letter enqueued" page shown during the verify by mail flow
+ # @param [Idv::ProofingComponentsLogging] proofing_components User's current proofing components
+ # @identity.idp.previous_event_name IdV: come back later visited
+ def idv_letter_enqueued_visit(proofing_components: nil, **extra)
+ track_event(
+ 'IdV: letter enqueued visited',
+ proofing_components: proofing_components,
+ **extra,
+ )
+ end
+
# Tracks when the user visits Mail only warning when vendor_status_sms is set to full_outage
def idv_mail_only_warning_visited(**extra)
track_event(
@@ -2311,6 +2245,20 @@ def idv_proofing_resolution_result_missing(proofing_components: nil, **extra)
)
end
+ # @param [Boolean] letter_already_sent
+ # GPO "request letter" page visited
+ # @identity.idp.previous_event_name IdV: USPS address visited
+ def idv_request_letter_visited(
+ letter_already_sent:,
+ **extra
+ )
+ track_event(
+ 'IdV: request letter visited',
+ letter_already_sent: letter_already_sent,
+ **extra,
+ )
+ end
+
# User submitted IDV password confirm page
# @param [Boolean] success
# @param [Boolean] fraud_review_pending
@@ -2421,6 +2369,62 @@ def idv_usps_auth_token_refresh_job_started(**extra)
)
end
+ # @identity.idp.previous_event_name Account verification submitted
+ # @identity.idp.previous_event_name IdV: GPO verification submitted
+ # @param [Boolean] success
+ # @param [Hash] errors
+ # @param [Hash] pii_like_keypaths
+ # @param [DateTime] enqueued_at When was this letter enqueued
+ # @param [Integer] which_letter Sorted by enqueue time, which letter had this code
+ # @param [Integer] letter_count How many letters did the user enqueue for this profile
+ # @param [Integer] attempts Number of attempts to enter a correct code
+ # @param [Boolean] pending_in_person_enrollment
+ # @param [Boolean] fraud_check_failed
+ # @see Reporting::IdentityVerificationReport#query This event is used by the identity verification
+ # report. Changes here should be reflected there.
+ # GPO verification submitted
+ def idv_verify_by_mail_enter_code_submitted(
+ success:,
+ errors:,
+ pii_like_keypaths:,
+ enqueued_at:,
+ which_letter:,
+ letter_count:,
+ attempts:,
+ pending_in_person_enrollment:,
+ fraud_check_failed:,
+ **extra
+ )
+ track_event(
+ 'IdV: enter verify by mail code submitted',
+ success: success,
+ errors: errors,
+ pii_like_keypaths: pii_like_keypaths,
+ enqueued_at: enqueued_at,
+ which_letter: which_letter,
+ letter_count: letter_count,
+ attempts: attempts,
+ pending_in_person_enrollment: pending_in_person_enrollment,
+ fraud_check_failed: fraud_check_failed,
+ **extra,
+ )
+ end
+
+ # @identity.idp.previous_event_name Account verification visited
+ # @identity.idp.previous_event_name IdV: GPO verification visited
+ # Visited page used to enter address verification code received via US mail.
+ # @param [String,nil] source The source for the visit (i.e., "gpo_reminder_email").
+ def idv_verify_by_mail_enter_code_visited(
+ source: nil,
+ **extra
+ )
+ track_event(
+ 'IdV: enter verify by mail code visited',
+ source: source,
+ **extra,
+ )
+ end
+
# @param [String] flow_path Document capture path ("hybrid" or "standard")
# The user clicked the troubleshooting option to start in-person proofing
def idv_verify_in_person_troubleshooting_option_clicked(flow_path:,
diff --git a/app/services/idv/analytics_events_enhancer.rb b/app/services/idv/analytics_events_enhancer.rb
index a4ea664f4e2..759a3b2d7f5 100644
--- a/app/services/idv/analytics_events_enhancer.rb
+++ b/app/services/idv/analytics_events_enhancer.rb
@@ -4,13 +4,13 @@ module AnalyticsEventsEnhancer
idv_cancellation_confirmed
idv_cancellation_go_back
idv_cancellation_visited
- idv_come_back_later_visit
idv_forgot_password
idv_forgot_password_confirmed
idv_final
idv_gpo_address_letter_enqueued
idv_gpo_address_letter_requested
idv_in_person_ready_to_verify_visit
+ idv_letter_enqueued_visit
idv_personal_key_acknowledgment_toggled
idv_personal_key_downloaded
idv_personal_key_submitted
diff --git a/app/views/accounts/_pending_profile_gpo.html.erb b/app/views/accounts/_pending_profile_gpo.html.erb
index cbc20037104..f613180fda4 100644
--- a/app/views/accounts/_pending_profile_gpo.html.erb
+++ b/app/views/accounts/_pending_profile_gpo.html.erb
@@ -3,6 +3,6 @@
<%= t('account.index.verification.instructions') %>
- <%= link_to t('account.index.verification.reactivate_button'), idv_gpo_verify_path %>
+ <%= link_to t('account.index.verification.reactivate_button'), idv_verify_by_mail_enter_code_path %>
<% end %>
diff --git a/app/views/idv/gpo_verify/index.html.erb b/app/views/idv/by_mail/enter_code/index.html.erb
similarity index 93%
rename from app/views/idv/gpo_verify/index.html.erb
rename to app/views/idv/by_mail/enter_code/index.html.erb
index 034392ef5a5..22c000e0976 100644
--- a/app/views/idv/gpo_verify/index.html.erb
+++ b/app/views/idv/by_mail/enter_code/index.html.erb
@@ -39,7 +39,7 @@
'idv.gpo.did_not_receive_letter.intro.request_new_letter_prompt_html',
request_new_letter_link: link_to(
t('idv.gpo.did_not_receive_letter.intro.request_new_letter_link'),
- idv_gpo_path,
+ idv_request_letter_path,
),
) %>
<% end %>
@@ -60,7 +60,7 @@
<%= simple_form_for(
@gpo_verify_form,
- url: idv_gpo_verify_path,
+ url: idv_verify_by_mail_enter_code_path,
html: { autocomplete: 'off', method: :post },
) do |f| %>
@@ -83,7 +83,7 @@
<% if @should_prompt_user_to_request_another_letter %>
<% unless @user_did_not_receive_letter %>
- <%= link_to t('idv.messages.gpo.resend'), idv_gpo_path, class: 'display-block margin-bottom-2' %>
+ <%= link_to t('idv.messages.gpo.resend'), idv_request_letter_path, class: 'display-block margin-bottom-2' %>
<% end %>
<% end %>
diff --git a/app/views/idv/gpo_verify/rate_limited.html.erb b/app/views/idv/by_mail/enter_code/rate_limited.html.erb
similarity index 100%
rename from app/views/idv/gpo_verify/rate_limited.html.erb
rename to app/views/idv/by_mail/enter_code/rate_limited.html.erb
diff --git a/app/views/idv/come_back_later/show.html.erb b/app/views/idv/by_mail/letter_enqueued/show.html.erb
similarity index 100%
rename from app/views/idv/come_back_later/show.html.erb
rename to app/views/idv/by_mail/letter_enqueued/show.html.erb
diff --git a/app/views/idv/gpo/index.html.erb b/app/views/idv/by_mail/request_letter/index.html.erb
similarity index 97%
rename from app/views/idv/gpo/index.html.erb
rename to app/views/idv/by_mail/request_letter/index.html.erb
index 58664779d38..7fad784e22f 100644
--- a/app/views/idv/gpo/index.html.erb
+++ b/app/views/idv/by_mail/request_letter/index.html.erb
@@ -30,7 +30,7 @@
<%= button_to @presenter.button,
- idv_gpo_path,
+ idv_request_letter_path,
method: 'put',
class: 'usa-button usa-button--big usa-button--wide' %>
diff --git a/app/views/idv/confirm_start_over/index.html.erb b/app/views/idv/confirm_start_over/index.html.erb
index f03d9f93520..41724090fd0 100644
--- a/app/views/idv/confirm_start_over/index.html.erb
+++ b/app/views/idv/confirm_start_over/index.html.erb
@@ -25,4 +25,4 @@
).with_content(t('idv.buttons.continue_plain')) %>
<% end %>
-<%= render('idv/shared/back', step: 'gpo_verify', fallback_path: idv_gpo_verify_path) %>
+<%= render('idv/shared/back', step: 'gpo_verify', fallback_path: idv_verify_by_mail_enter_code_path) %>
diff --git a/app/views/idv/phone/new.html.erb b/app/views/idv/phone/new.html.erb
index ad97b710ce5..9eccdb60444 100644
--- a/app/views/idv/phone/new.html.erb
+++ b/app/views/idv/phone/new.html.erb
@@ -80,7 +80,7 @@
'idv.messages.phone.failed_number.gpo_alert_html',
link_html: link_to(
t('idv.messages.phone.failed_number.gpo_verify_link'),
- idv_gpo_path,
+ idv_request_letter_path,
),
) %>
<% else %>
@@ -129,7 +129,7 @@
heading: t('components.troubleshooting_options.default_heading'),
options: [
gpo_letter_available && {
- url: idv_gpo_path,
+ url: idv_request_letter_path,
text: t('idv.troubleshooting.options.verify_by_mail'),
},
].select(&:present?),
diff --git a/app/views/idv/phone_errors/_warning.html.erb b/app/views/idv/phone_errors/_warning.html.erb
index 13ff634a3c5..3c993d86915 100644
--- a/app/views/idv/phone_errors/_warning.html.erb
+++ b/app/views/idv/phone_errors/_warning.html.erb
@@ -34,7 +34,7 @@ locals:
},
@gpo_letter_available && {
text: t('idv.troubleshooting.options.verify_by_mail'),
- url: idv_gpo_path,
+ url: idv_request_letter_path,
},
decorated_session.sp_name && {
url: return_to_sp_failure_to_proof_path(
diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb
index 594d7837e8f..526da33f467 100644
--- a/app/views/idv/phone_errors/failure.html.erb
+++ b/app/views/idv/phone_errors/failure.html.erb
@@ -34,7 +34,7 @@
<% if @gpo_letter_available %>
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) { link_to idv_gpo_path, **tag_options, &block },
+ action: ->(**tag_options, &block) { link_to idv_request_letter_path, **tag_options, &block },
big: true,
wide: true,
).with_content(t('idv.failure.phone.rate_limited.gpo.button')) %>
diff --git a/app/views/idv/phone_errors/warning.html.erb b/app/views/idv/phone_errors/warning.html.erb
index d962b925021..e53d56d6980 100644
--- a/app/views/idv/phone_errors/warning.html.erb
+++ b/app/views/idv/phone_errors/warning.html.erb
@@ -51,7 +51,7 @@
<%= render ButtonComponent.new(
- action: ->(**tag_options, &block) { link_to idv_gpo_path, **tag_options, &block },
+ action: ->(**tag_options, &block) { link_to idv_request_letter_path, **tag_options, &block },
big: true,
wide: true,
outline: true,
diff --git a/app/views/user_mailer/gpo_reminder.html.erb b/app/views/user_mailer/gpo_reminder.html.erb
index ef04ff809b6..5c4da0812e4 100644
--- a/app/views/user_mailer/gpo_reminder.html.erb
+++ b/app/views/user_mailer/gpo_reminder.html.erb
@@ -27,7 +27,7 @@
|
<%= link_to t('idv.messages.gpo_reminder.finish'),
- idv_gpo_verify_url,
+ idv_verify_by_mail_enter_code_url,
target: '_blank',
class: 'float-center',
align: 'center',
@@ -47,7 +47,7 @@
'idv.messages.gpo_reminder.did_not_get_a_letter_html',
another_letter_link_html: link_to(
t('idv.messages.gpo_reminder.sign_in_and_request_another_letter'),
- idv_gpo_verify_url(did_not_receive_letter: 1),
+ idv_verify_by_mail_enter_code_url(did_not_receive_letter: 1),
{ style: "text-decoration: 'underline'" },
),
) %>
diff --git a/app/views/vendor_outage/show.html.erb b/app/views/vendor_outage/show.html.erb
index f204a6f3a56..281d4715d4d 100644
--- a/app/views/vendor_outage/show.html.erb
+++ b/app/views/vendor_outage/show.html.erb
@@ -4,7 +4,7 @@
options: [
@show_gpo_option && {
text: t('idv.troubleshooting.options.verify_by_mail'),
- url: idv_gpo_path,
+ url: idv_request_letter_path,
},
{
text: t('vendor_outage.get_updates_on_status_page'),
diff --git a/config/routes.rb b/config/routes.rb
index 9552bd8ac54..a0f8f899ecf 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -312,7 +312,6 @@
end
get '/mail_only_warning' => 'mail_only_warning#show'
- get '/come_back_later' => 'come_back_later#show'
get '/personal_key' => 'personal_key#show'
post '/personal_key' => 'personal_key#update'
get '/forgot_password' => 'forgot_password#new'
@@ -391,15 +390,29 @@
get '/in_person/:step' => 'in_person#show', as: :in_person_step
put '/in_person/:step' => 'in_person#update'
- get '/by_mail' => 'gpo_verify#index', as: :gpo_verify
- post '/by_mail' => 'gpo_verify#create'
+ get '/by_mail' => 'by_mail/enter_code#index', as: :verify_by_mail_enter_code
+ post '/by_mail' => 'by_mail/enter_code#create'
get '/by_mail/confirm_start_over' => 'confirm_start_over#index',
as: :confirm_start_over
if FeatureManagement.gpo_verification_enabled?
- get '/usps' => 'gpo#index', as: :gpo
- put '/usps' => 'gpo#create'
+ get '/usps' => 'by_mail/request_letter#index', as: :request_letter
+ put '/usps' => 'by_mail/request_letter#create'
+
+ # These will be made the new "official" routes in a future commit
+ get '/by_mail/request_letter' => 'by_mail/request_letter#index'
+ put '/by_mail/request_letter' => 'by_mail/request_letter#create'
end
+
+ get '/come_back_later' => 'by_mail/letter_enqueued#show', as: :letter_enqueued
+
+ # BEGIN temporary routes in preparation for renaming the GPO routes
+ # These will allow old instances to serve requests for new routes during the 50/50
+ # state when new routes are deployed.
+ get '/by_mail/letter_enqueued' => 'by_mail/letter_enqueued#show'
+ get '/by_mail/enter_code' => 'by_mail/enter_code#index'
+ post '/by_mail/enter_code' => 'by_mail/enter_code#create'
+ # END temporary routes
end
root to: 'users/sessions#new'
diff --git a/lib/reporting/identity_verification_report.rb b/lib/reporting/identity_verification_report.rb
index 8c1deb37ea1..16c9f5963a8 100644
--- a/lib/reporting/identity_verification_report.rb
+++ b/lib/reporting/identity_verification_report.rb
@@ -21,7 +21,8 @@ module Events
IDV_DOC_AUTH_GETTING_STARTED = 'IdV: doc auth getting_started visited'
IDV_DOC_AUTH_IMAGE_UPLOAD = 'IdV: doc auth image upload vendor submitted'
IDV_FINAL_RESOLUTION = 'IdV: final resolution'
- GPO_VERIFICATION_SUBMITTED = 'IdV: GPO verification submitted'
+ GPO_VERIFICATION_SUBMITTED = 'IdV: enter verify by mail code submitted'
+ GPO_VERIFICATION_SUBMITTED_OLD = 'IdV: GPO verification submitted'
USPS_ENROLLMENT_STATUS_UPDATED = 'GetUspsProofingResultsJob: Enrollment status updated'
def self.all_events
@@ -112,7 +113,10 @@ def idv_final_resolution_total_pending
end
def gpo_verification_submitted
- data[Events::GPO_VERIFICATION_SUBMITTED].to_i
+ [
+ data[Events::GPO_VERIFICATION_SUBMITTED].to_i,
+ data[Events::GPO_VERIFICATION_SUBMITTED_OLD].to_i,
+ ].sum
end
def usps_enrollment_status_updated
@@ -177,7 +181,12 @@ def query
issuers: issuers.present? && quote(issuers),
event_names: quote(Events.all_events),
usps_enrollment_status_updated: quote(Events::USPS_ENROLLMENT_STATUS_UPDATED),
- gpo_verification_submitted: quote(Events::GPO_VERIFICATION_SUBMITTED),
+ gpo_verification_submitted: quote(
+ [
+ Events::GPO_VERIFICATION_SUBMITTED,
+ Events::GPO_VERIFICATION_SUBMITTED_OLD,
+ ],
+ ),
idv_final_resolution: quote(Events::IDV_FINAL_RESOLUTION),
}
@@ -189,8 +198,8 @@ def query
| filter name in %{event_names}
| filter (name = %{usps_enrollment_status_updated} and properties.event_properties.passed = 1)
or (name != %{usps_enrollment_status_updated})
- | filter (name = %{gpo_verification_submitted} and properties.event_properties.success = 1 and !properties.event_properties.pending_in_person_enrollment and !properties.event_properties.fraud_check_failed)
- or (name != %{gpo_verification_submitted})
+ | filter (name in %{gpo_verification_submitted} and properties.event_properties.success = 1 and !properties.event_properties.pending_in_person_enrollment and !properties.event_properties.fraud_check_failed)
+ or (name not in %{gpo_verification_submitted})
| fields
coalesce(properties.event_properties.fraud_review_pending, 0) AS fraud_review_pending
, coalesce(properties.event_properties.gpo_verification_pending, 0) AS gpo_verification_pending
diff --git a/spec/controllers/concerns/idv_step_concern_spec.rb b/spec/controllers/concerns/idv_step_concern_spec.rb
index 6868fd455c2..1c126c279ac 100644
--- a/spec/controllers/concerns/idv_step_concern_spec.rb
+++ b/spec/controllers/concerns/idv_step_concern_spec.rb
@@ -247,7 +247,7 @@ def show
get :show
expect(response.body).to eq 'Hello'
- expect(response).to_not redirect_to idv_gpo_verify_url
+ expect(response).to_not redirect_to idv_verify_by_mail_enter_code_url
expect(response.status).to eq 200
end
end
@@ -258,7 +258,7 @@ def show
it 'redirects to enter your code page' do
get :show
- expect(response).to redirect_to idv_gpo_verify_url
+ expect(response).to redirect_to idv_verify_by_mail_enter_code_url
end
end
end
diff --git a/spec/controllers/idv/gpo_verify_controller_spec.rb b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb
similarity index 93%
rename from spec/controllers/idv/gpo_verify_controller_spec.rb
rename to spec/controllers/idv/by_mail/enter_code_controller_spec.rb
index 84566da573f..bc3450d6afd 100644
--- a/spec/controllers/idv/gpo_verify_controller_spec.rb
+++ b/spec/controllers/idv/by_mail/enter_code_controller_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-RSpec.describe Idv::GpoVerifyController do
+RSpec.describe Idv::ByMail::EnterCodeController do
let(:has_pending_profile) { true }
let(:success) { true }
let(:otp) { 'ABC123' }
@@ -53,13 +53,13 @@
it 'renders page' do
controller.user_session[:decrypted_pii] = { address1: 'Address1' }.to_json
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification visited',
+ 'IdV: enter verify by mail code visited',
source: nil,
)
action
- expect(response).to render_template('idv/gpo_verify/index')
+ expect(response).to render_template('idv/by_mail/enter_code/index')
end
it 'sets @should_prompt_user_to_request_another_letter to true' do
@@ -96,7 +96,7 @@
it 'augments analytics event' do
action
expect(@analytics).to have_logged_event(
- 'IdV: GPO verification visited',
+ 'IdV: enter verify by mail code visited',
source: 'gpo_reminder_email',
)
end
@@ -120,7 +120,7 @@
it 'renders rate limited page' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification visited',
+ 'IdV: enter verify by mail code visited',
source: nil,
).once
expect(@analytics).to receive(:track_event).with(
@@ -140,7 +140,9 @@
action
end
it 'redirects user to url with querystring' do
- expect(response).to redirect_to(idv_gpo_verify_path(did_not_receive_letter: 1))
+ expect(response).to redirect_to(
+ idv_verify_by_mail_enter_code_path(did_not_receive_letter: 1),
+ )
end
it 'clears session value' do
expect(session).not_to include(gpo_user_did_not_receive_letter: anything)
@@ -183,7 +185,7 @@
it 'redirects to the sign_up/completions page' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: true,
errors: {},
pending_in_person_enrollment: false,
@@ -233,7 +235,7 @@
it 'redirects to personal key page' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: true,
errors: {},
pending_in_person_enrollment: true,
@@ -272,7 +274,7 @@
it 'redirects to the sign_up/completions page' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: true,
errors: {},
pending_in_person_enrollment: false,
@@ -311,7 +313,7 @@
it 'is reflected in analytics' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: true,
errors: {},
pending_in_person_enrollment: false,
@@ -351,7 +353,7 @@
it 'is reflected in analytics' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: true,
errors: {},
pending_in_person_enrollment: false,
@@ -376,7 +378,7 @@
it 'redirects to the index page to show errors' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: false,
errors: otp_code_error_message,
pending_in_person_enrollment: false,
@@ -393,7 +395,7 @@
action
- expect(response).to redirect_to(idv_gpo_verify_url)
+ expect(response).to redirect_to(idv_verify_by_mail_enter_code_url)
end
it 'does not 500 with missing form keys' do
@@ -422,12 +424,12 @@
pii_like_keypaths: [[:errors, :otp], [:error_details, :otp]],
}
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
**analytics_args,
).once
analytics_args[:attempts] = 2
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
**analytics_args,
).once
@@ -458,14 +460,14 @@
},
)
- expect(response).to render_template('idv/gpo_verify/rate_limited')
+ expect(response).to render_template('idv/by_mail/enter_code/rate_limited')
end
end
context 'valid code is submitted' do
it 'redirects to personal key page' do
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: false,
errors: otp_code_error_message,
pending_in_person_enrollment: false,
@@ -478,7 +480,7 @@
pii_like_keypaths: [[:errors, :otp], [:error_details, :otp]],
).exactly(max_attempts - 1).times
expect(@analytics).to receive(:track_event).with(
- 'IdV: GPO verification submitted',
+ 'IdV: enter verify by mail code submitted',
success: true,
errors: {},
pending_in_person_enrollment: false,
diff --git a/spec/controllers/idv/come_back_later_controller_spec.rb b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb
similarity index 89%
rename from spec/controllers/idv/come_back_later_controller_spec.rb
rename to spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb
index 411eca2db1a..f295c5038bb 100644
--- a/spec/controllers/idv/come_back_later_controller_spec.rb
+++ b/spec/controllers/idv/by_mail/letter_enqueued_controller_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-RSpec.describe Idv::ComeBackLaterController do
+RSpec.describe Idv::ByMail::LetterEnqueuedController do
let(:user) { build_stubbed(:user, :fully_registered) }
let(:gpo_verification_pending_profile) { true }
@@ -15,7 +15,7 @@
stub_analytics
expect(@analytics).to receive(:track_event).with(
- 'IdV: come back later visited',
+ 'IdV: letter enqueued visited',
proofing_components: nil,
)
diff --git a/spec/controllers/idv/gpo_controller_spec.rb b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb
similarity index 95%
rename from spec/controllers/idv/gpo_controller_spec.rb
rename to spec/controllers/idv/by_mail/request_letter_controller_spec.rb
index 2cdc9d01b45..a9c7e8f2d7c 100644
--- a/spec/controllers/idv/gpo_controller_spec.rb
+++ b/spec/controllers/idv/by_mail/request_letter_controller_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-RSpec.describe Idv::GpoController do
+RSpec.describe Idv::ByMail::RequestLetterController do
let(:user) { create(:user) }
let(:ab_test_args) do
@@ -37,9 +37,9 @@
it 'renders confirmation page' do
get :index
- expect(response).to be_ok
+ expect(response).to have_http_status(200)
expect(@analytics).to have_logged_event(
- 'IdV: USPS address visited',
+ 'IdV: request letter visited',
letter_already_sent: false,
)
end
@@ -77,14 +77,15 @@
context 'with letter already sent' do
before do
- allow_any_instance_of(Idv::GpoPresenter).to receive(:resend_requested?).and_return(true)
+ allow_any_instance_of(Idv::ByMail::RequestLetterPresenter).
+ to receive(:resend_requested?).and_return(true)
end
it 'logs visited event' do
get :index
expect(@analytics).to have_logged_event(
- 'IdV: USPS address visited',
+ 'IdV: request letter visited',
letter_already_sent: true,
)
end
@@ -261,6 +262,6 @@ def expect_resend_letter_to_send_letter_and_redirect(otp:)
expect(gpo_confirmation_maker).to receive(:perform)
expect(gpo_confirmation_maker).to receive(:otp) if otp
expect { put :create }.to change { ActionMailer::Base.deliveries.count }.by(1)
- expect(response).to redirect_to idv_come_back_later_path
+ expect(response).to redirect_to idv_letter_enqueued_path
end
end
diff --git a/spec/controllers/idv/review_controller_spec.rb b/spec/controllers/idv/review_controller_spec.rb
index 915ac1af3f6..439112cdba6 100644
--- a/spec/controllers/idv/review_controller_spec.rb
+++ b/spec/controllers/idv/review_controller_spec.rb
@@ -717,7 +717,7 @@ def show
it 'redirects to come back later page' do
put :create, params: { user: { password: ControllerHelper::VALID_PASSWORD } }
- expect(response).to redirect_to idv_come_back_later_url
+ expect(response).to redirect_to idv_letter_enqueued_url
end
end
end
diff --git a/spec/controllers/openid_connect/authorization_controller_spec.rb b/spec/controllers/openid_connect/authorization_controller_spec.rb
index 6fb44a0e6ac..25e49e3a381 100644
--- a/spec/controllers/openid_connect/authorization_controller_spec.rb
+++ b/spec/controllers/openid_connect/authorization_controller_spec.rb
@@ -183,7 +183,7 @@
it 'redirects to gpo verify page' do
action
- expect(controller).to redirect_to(idv_gpo_verify_url)
+ expect(controller).to redirect_to(idv_verify_by_mail_enter_code_url)
end
end
@@ -226,7 +226,7 @@
it 'redirects to gpo verify page' do
action
- expect(controller).to redirect_to(idv_gpo_verify_url)
+ expect(controller).to redirect_to(idv_verify_by_mail_enter_code_url)
end
end
@@ -241,7 +241,7 @@
it 'redirects to gpo verify page' do
action
- expect(controller).to redirect_to(idv_gpo_verify_url)
+ expect(controller).to redirect_to(idv_verify_by_mail_enter_code_url)
end
end
end
diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb
index 5d234433ba5..13fed2ef90d 100644
--- a/spec/controllers/users/sessions_controller_spec.rb
+++ b/spec/controllers/users/sessions_controller_spec.rb
@@ -545,7 +545,7 @@
stub_sign_in(user)
get :new
- expect(response).to redirect_to idv_gpo_verify_path
+ expect(response).to redirect_to idv_verify_by_mail_enter_code_path
end
end
diff --git a/spec/features/idv/analytics_spec.rb b/spec/features/idv/analytics_spec.rb
index c7dd5f7a910..3851f80b57e 100644
--- a/spec/features/idv/analytics_spec.rb
+++ b/spec/features/idv/analytics_spec.rb
@@ -206,6 +206,9 @@
resend: false, phone_step_attempts: 0, first_letter_requested_at: nil, hours_since_first_letter: 0, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil,
proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass' }
},
+ 'IdV: request letter visited' => {
+ letter_already_sent: false,
+ },
'IdV: review info visited' => {
address_verification_method: 'gpo', acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil,
proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' }
@@ -222,7 +225,7 @@
success: true, acuant_sdk_upgrade_ab_test_bucket: :default, getting_started_ab_test_bucket: :welcome_default, skip_hybrid_handoff: nil, fraud_review_pending: false, fraud_rejection: false, gpo_verification_pending: true, in_person_verification_pending: false, deactivation_reason: nil,
proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' }
},
- 'IdV: come back later visited' => {
+ 'IdV: letter enqueued visited' => {
proofing_components: { document_check: 'mock', document_type: 'state_id', source_check: 'aamva', resolution_check: 'lexis_nexis', threatmetrix: threatmetrix, threatmetrix_review_status: 'pass', address_check: 'gpo_letter' },
},
}
diff --git a/spec/features/idv/clearing_and_restarting_spec.rb b/spec/features/idv/clearing_and_restarting_spec.rb
index 7b187af2e95..f1fbc6408ba 100644
--- a/spec/features/idv/clearing_and_restarting_spec.rb
+++ b/spec/features/idv/clearing_and_restarting_spec.rb
@@ -13,7 +13,7 @@
context 'before signing out' do
before do
- visit idv_gpo_verify_path
+ visit idv_verify_by_mail_enter_code_path
end
it_behaves_like 'clearing and restarting idv'
diff --git a/spec/features/idv/confirm_start_over_spec.rb b/spec/features/idv/confirm_start_over_spec.rb
index 1f9e0ecdc9d..eebffe5e028 100644
--- a/spec/features/idv/confirm_start_over_spec.rb
+++ b/spec/features/idv/confirm_start_over_spec.rb
@@ -30,7 +30,7 @@
end
it 'can cancel from confirmation screen' do
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
click_on t('idv.messages.clear_and_start_over')
@@ -47,6 +47,6 @@
click_on t('forms.buttons.back')
expect(fake_analytics).to have_logged_event('IdV: gpo confirm start over visited')
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
end
end
diff --git a/spec/features/idv/doc_auth/verify_info_step_spec.rb b/spec/features/idv/doc_auth/verify_info_step_spec.rb
index 4aac0cabf08..164b2b05952 100644
--- a/spec/features/idv/doc_auth/verify_info_step_spec.rb
+++ b/spec/features/idv/doc_auth/verify_info_step_spec.rb
@@ -418,7 +418,7 @@
it 'redirects to the gpo page when continuing from verify info page' do
click_idv_continue
- expect(page).to have_current_path(idv_gpo_path)
+ expect(page).to have_current_path(idv_request_letter_path)
click_on 'Cancel'
expect(page).to have_current_path(idv_cancel_path(step: :gpo))
diff --git a/spec/features/idv/end_to_end_idv_spec.rb b/spec/features/idv/end_to_end_idv_spec.rb
index d291cb91d08..9eba17c66e0 100644
--- a/spec/features/idv/end_to_end_idv_spec.rb
+++ b/spec/features/idv/end_to_end_idv_spec.rb
@@ -273,7 +273,7 @@ def validate_review_submit(user)
end
def validate_come_back_later_page
- expect(page).to have_current_path(idv_come_back_later_path)
+ expect(page).to have_current_path(idv_letter_enqueued_path)
expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter'))
end
diff --git a/spec/features/idv/in_person_spec.rb b/spec/features/idv/in_person_spec.rb
index dd494493791..99a3357d6c5 100644
--- a/spec/features/idv/in_person_spec.rb
+++ b/spec/features/idv/in_person_spec.rb
@@ -392,7 +392,7 @@
expect_in_person_gpo_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter'))
expect(page).to have_content(t('idv.titles.come_back_later'))
- expect(page).to have_current_path(idv_come_back_later_path)
+ expect(page).to have_current_path(idv_letter_enqueued_path)
click_idv_continue
expect(page).to have_current_path(account_path)
diff --git a/spec/features/idv/outage_spec.rb b/spec/features/idv/outage_spec.rb
index 93b6c36437f..7da2b86ca0c 100644
--- a/spec/features/idv/outage_spec.rb
+++ b/spec/features/idv/outage_spec.rb
@@ -112,7 +112,7 @@ def sign_in_with_idv_required(user:, sms_or_totp: :sms)
complete_ssn_step
complete_verify_step
- expect(current_path).to eq idv_gpo_path
+ expect(current_path).to eq idv_request_letter_path
end
end
diff --git a/spec/features/idv/steps/gpo_otp_verification_step_spec.rb b/spec/features/idv/steps/gpo_otp_verification_step_spec.rb
index 0d676f7a6b4..c7109e1f5f2 100644
--- a/spec/features/idv/steps/gpo_otp_verification_step_spec.rb
+++ b/spec/features/idv/steps/gpo_otp_verification_step_spec.rb
@@ -77,7 +77,7 @@
context 'coming from an "I did not receive my letter" link in a reminder email' do
it 'renders an alternate ui', :js do
- visit idv_gpo_verify_url(did_not_receive_letter: 1)
+ visit idv_verify_by_mail_enter_code_url(did_not_receive_letter: 1)
expect(current_path).to eql(new_user_session_path)
fill_in_credentials_and_submit(user.email, user.password)
@@ -86,7 +86,7 @@
fill_in_code_with_last_phone_otp
click_submit_default
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_css('h1', text: t('idv.gpo.did_not_receive_letter.title'))
end
end
@@ -95,7 +95,7 @@
it 'shows the user a personal key after verification' do
sign_in_live_with_2fa(user)
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_content t('idv.messages.gpo.resend')
gpo_confirmation_code
@@ -123,7 +123,7 @@
it 'allows a user to verify their account for an existing pending profile' do
sign_in_live_with_2fa(user)
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_content t('idv.messages.gpo.resend')
gpo_confirmation_code
@@ -138,7 +138,7 @@
it 'allows a user to cancel and start over withinthe banner' do
sign_in_live_with_2fa(user)
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_content t('idv.gpo.alert_info')
expect(page).to have_content t('idv.gpo.wrong_address')
expect(page).to have_content '1 Secure Way'
@@ -155,7 +155,7 @@
it 'allows a user to cancel and start over in the footer' do
sign_in_live_with_2fa(user)
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
click_on t('idv.messages.clear_and_start_over')
expect(current_path).to eq idv_confirm_start_over_path
diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb
index 34eb14b0244..68e05f6c909 100644
--- a/spec/features/idv/steps/gpo_step_spec.rb
+++ b/spec/features/idv/steps/gpo_step_spec.rb
@@ -45,15 +45,15 @@
expect(page).to have_content(t('idv.messages.gpo.another_letter_on_the_way'))
expect(page).to have_content(t('idv.titles.come_back_later'))
- expect(page).to have_current_path(idv_come_back_later_path)
+ expect(page).to have_current_path(idv_letter_enqueued_path)
# Confirm that user cannot visit other IdV pages while unverified
visit idv_agreement_path
- expect(page).to have_current_path(idv_gpo_verify_path)
+ expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
visit idv_ssn_url
- expect(page).to have_current_path(idv_gpo_verify_path)
+ expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
visit idv_verify_info_url
- expect(page).to have_current_path(idv_gpo_verify_path)
+ expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
# complete verification: end to end gpo test
complete_gpo_verification(user)
@@ -93,7 +93,7 @@
complete_idv_and_sign_out
travel_to(days_passed.days.from_now) do
sign_in_live_with_2fa(user)
- expect(page).to have_current_path(idv_gpo_verify_path)
+ expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend'))
end
end
@@ -102,8 +102,8 @@
complete_idv_and_sign_out
travel_to(days_passed.days.from_now) do
sign_in_live_with_2fa(user)
- visit idv_gpo_path
- expect(page).to have_current_path(idv_gpo_verify_path)
+ visit idv_request_letter_path
+ expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
expect(page).not_to have_css('.usa-button', text: t('idv.buttons.mail.resend'))
end
end
@@ -114,7 +114,7 @@
click_doc_auth_back_link
expect(page).to have_content(t('idv.gpo.title'))
- expect(page).to have_current_path(idv_gpo_verify_path)
+ expect(page).to have_current_path(idv_verify_by_mail_enter_code_path)
expect_user_to_be_unverified(user)
end
diff --git a/spec/features/idv/steps/review_step_spec.rb b/spec/features/idv/steps/review_step_spec.rb
index 31db9cf7aa2..8bbc051ea2b 100644
--- a/spec/features/idv/steps/review_step_spec.rb
+++ b/spec/features/idv/steps/review_step_spec.rb
@@ -31,7 +31,7 @@
click_continue
expect(page).to have_content(t('idv.titles.come_back_later'))
- expect(current_path).to eq idv_come_back_later_path
+ expect(current_path).to eq idv_letter_enqueued_path
end
context 'with an sp' do
diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb
index 137b2af20bd..748b3e111a0 100644
--- a/spec/features/saml/ial2_sso_spec.rb
+++ b/spec/features/saml/ial2_sso_spec.rb
@@ -98,17 +98,17 @@ def sign_out_user
visit account_path
click_link(t('account.index.verification.reactivate_button'))
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
click_link(t('idv.messages.gpo.resend'))
expect(user.events.account_verified.size).to be(0)
- expect(current_path).to eq(idv_gpo_path)
+ expect(current_path).to eq(idv_request_letter_path)
click_button(t('idv.buttons.mail.resend'))
expect(user.events.gpo_mail_sent.size).to eq 2
- expect(current_path).to eq(idv_come_back_later_path)
+ expect(current_path).to eq(idv_letter_enqueued_path)
end
it 'after signing out' do
@@ -120,16 +120,16 @@ def sign_out_user
sign_in_live_with_2fa(user)
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
click_link(t('idv.messages.gpo.resend'))
expect(user.events.account_verified.size).to be(0)
- expect(current_path).to eq(idv_gpo_path)
+ expect(current_path).to eq(idv_request_letter_path)
click_button(t('idv.buttons.mail.resend'))
- expect(current_path).to eq(idv_come_back_later_path)
+ expect(current_path).to eq(idv_letter_enqueued_path)
end
end
end
diff --git a/spec/features/users/verify_profile_spec.rb b/spec/features/users/verify_profile_spec.rb
index 9788a2428e1..b201f4db785 100644
--- a/spec/features/users/verify_profile_spec.rb
+++ b/spec/features/users/verify_profile_spec.rb
@@ -43,7 +43,7 @@
click_button t('idv.gpo.form.submit')
expect(page).to have_content t('errors.messages.gpo_otp_expired')
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
end
scenario 'wrong OTP used' do
@@ -51,7 +51,7 @@
fill_in t('idv.gpo.form.otp_label'), with: 'the wrong code'
click_button t('idv.gpo.form.submit')
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_content(t('errors.messages.confirmation_code_incorrect'))
expect(page.body).to_not match('the wrong code')
end
diff --git a/spec/lib/reporting/identity_verification_report_spec.rb b/spec/lib/reporting/identity_verification_report_spec.rb
index 825040cd9cd..49c899bcfd3 100644
--- a/spec/lib/reporting/identity_verification_report_spec.rb
+++ b/spec/lib/reporting/identity_verification_report_spec.rb
@@ -117,6 +117,15 @@
expect(result).to_not include('filter properties.service_provider')
end
end
+
+ it 'includes GPO submission events with old name' do
+ expected = <<~FRAGMENT
+ | filter (name in ["IdV: enter verify by mail code submitted","IdV: GPO verification submitted"] and properties.event_properties.success = 1 and !properties.event_properties.pending_in_person_enrollment and !properties.event_properties.fraud_check_failed)
+ or (name not in ["IdV: enter verify by mail code submitted","IdV: GPO verification submitted"])
+ FRAGMENT
+
+ expect(subject.query).to include(expected)
+ end
end
describe '#cloudwatch_client' do
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
index 7e2d1c0b7f7..344f2db5be1 100644
--- a/spec/mailers/user_mailer_spec.rb
+++ b/spec/mailers/user_mailer_spec.rb
@@ -924,14 +924,14 @@ def expect_email_body_to_have_help_and_contact_links
it 'renders the finish link' do
expect(mail.html_part.body).to have_link(
t('idv.messages.gpo_reminder.finish'),
- href: idv_gpo_verify_url,
+ href: idv_verify_by_mail_enter_code_url,
)
end
it 'renders the did not get it link' do
expect(mail.html_part.body).to have_link(
t('idv.messages.gpo_reminder.sign_in_and_request_another_letter'),
- href: idv_gpo_verify_url(did_not_receive_letter: 1),
+ href: idv_verify_by_mail_enter_code_url(did_not_receive_letter: 1),
)
end
diff --git a/spec/presenters/idv/gpo_presenter_spec.rb b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb
similarity index 97%
rename from spec/presenters/idv/gpo_presenter_spec.rb
rename to spec/presenters/idv/by_mail/request_letter_presenter_spec.rb
index 6a36c0358c2..6f2d9ce0cb4 100644
--- a/spec/presenters/idv/gpo_presenter_spec.rb
+++ b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-RSpec.describe Idv::GpoPresenter do
+RSpec.describe Idv::ByMail::RequestLetterPresenter do
let(:user) { create(:user) }
subject(:decorator) do
diff --git a/spec/support/idv_examples/clearing_and_restarting.rb b/spec/support/idv_examples/clearing_and_restarting.rb
index f63c5afe6e8..92277910e01 100644
--- a/spec/support/idv_examples/clearing_and_restarting.rb
+++ b/spec/support/idv_examples/clearing_and_restarting.rb
@@ -33,7 +33,7 @@
gpo_confirmation = GpoConfirmation.order(created_at: :desc).first
expect(page).to have_content(t('idv.titles.come_back_later'))
- expect(page).to have_current_path(idv_come_back_later_path)
+ expect(page).to have_current_path(idv_letter_enqueued_path)
expect(user.reload.identity_verified?).to eq(false)
expect(User.find(user.id).pending_profile?).to eq(true)
expect(gpo_confirmation.entry[:address1]).to eq('1 FAKE RD')
diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb
index 60bce85ef35..f7a303f6380 100644
--- a/spec/support/idv_examples/gpo_otp_verification.rb
+++ b/spec/support/idv_examples/gpo_otp_verification.rb
@@ -4,7 +4,7 @@
it 'prompts for one-time code at sign in' do
sign_in_live_with_2fa(user)
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_content t('idv.messages.gpo.resend')
gpo_confirmation_code
@@ -35,7 +35,7 @@
fill_in t('idv.gpo.form.otp_label'), with: otp
click_button t('idv.gpo.form.submit')
- expect(current_path).to eq idv_gpo_verify_path
+ expect(current_path).to eq idv_verify_by_mail_enter_code_path
expect(page).to have_content t('errors.messages.gpo_otp_expired')
user.reload
@@ -59,7 +59,7 @@
expect(GpoConfirmation.count).to eq(1)
expect(GpoConfirmationCode.count).to eq(1)
- expect(current_path).to eq idv_come_back_later_path
+ expect(current_path).to eq idv_letter_enqueued_path
confirmation_code = GpoConfirmationCode.first
otp_fingerprint = Pii::Fingerprinter.fingerprint(otp)
diff --git a/spec/views/accounts/show.html.erb_spec.rb b/spec/views/accounts/show.html.erb_spec.rb
index 1c03c9a708f..eca323bc36b 100644
--- a/spec/views/accounts/show.html.erb_spec.rb
+++ b/spec/views/accounts/show.html.erb_spec.rb
@@ -51,7 +51,7 @@
render
expect(rendered).to_not have_link(
- t('account.index.verification.reactivate_button'), href: idv_gpo_verify_path
+ t('account.index.verification.reactivate_button'), href: idv_verify_by_mail_enter_code_path
)
end
end
@@ -71,7 +71,10 @@
render
expect(rendered).
- to have_link(t('account.index.verification.reactivate_button'), href: idv_gpo_verify_path)
+ to have_link(
+ t('account.index.verification.reactivate_button'),
+ href: idv_verify_by_mail_enter_code_path,
+ )
end
end
diff --git a/spec/views/idv/gpo_verify/index.html.erb_spec.rb b/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb
similarity index 91%
rename from spec/views/idv/gpo_verify/index.html.erb_spec.rb
rename to spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb
index 454a1e3097a..a33c50c7484 100644
--- a/spec/views/idv/gpo_verify/index.html.erb_spec.rb
+++ b/spec/views/idv/by_mail/enter_code/index.html.erb_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-RSpec.describe 'idv/gpo_verify/index.html.erb' do
+RSpec.describe 'idv/by_mail/enter_code/index.html.erb' do
let(:user) do
create(:user)
end
@@ -30,14 +30,14 @@
context 'user is allowed to request another GPO letter' do
it 'includes the send another letter link' do
- expect(rendered).to have_link(t('idv.messages.gpo.resend'), href: idv_gpo_path)
+ expect(rendered).to have_link(t('idv.messages.gpo.resend'), href: idv_request_letter_path)
end
end
context 'user is NOT allowed to request another GPO letter' do
let(:should_prompt_user_to_request_another_letter) { false }
it 'does not include the send another letter link' do
- expect(rendered).not_to have_link(t('idv.messages.gpo.resend'), href: idv_gpo_path)
+ expect(rendered).not_to have_link(t('idv.messages.gpo.resend'), href: idv_request_letter_path)
end
end
@@ -66,7 +66,7 @@
it 'links to requesting a new letter' do
expect(rendered).to have_link(
t('idv.gpo.did_not_receive_letter.intro.request_new_letter_link'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
@@ -79,7 +79,7 @@
it 'does not link to requesting a new letter at the bottom of the page' do
expect(rendered).not_to have_link(
t('idv.messages.gpo.resend'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
@@ -95,7 +95,7 @@
it 'does not link to requesting a new letter' do
expect(rendered).not_to have_link(
t('idv.gpo.did_not_receive_letter.intro.request_new_letter_link'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
end
diff --git a/spec/views/idv/come_back_later/show.html.erb_spec.rb b/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb
similarity index 96%
rename from spec/views/idv/come_back_later/show.html.erb_spec.rb
rename to spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb
index c44b40bd767..bdac0574397 100644
--- a/spec/views/idv/come_back_later/show.html.erb_spec.rb
+++ b/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb
@@ -1,6 +1,6 @@
require 'rails_helper'
-RSpec.describe 'idv/come_back_later/show.html.erb' do
+RSpec.describe 'idv/by_mail/letter_enqueued/show.html.erb' do
let(:sp_name) { '🔒🌐💻' }
let(:step_indicator_steps) { Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS_GPO }
diff --git a/spec/views/idv/gpo/index.html.erb_spec.rb b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb
similarity index 87%
rename from spec/views/idv/gpo/index.html.erb_spec.rb
rename to spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb
index c1ded0acb05..68cb59df75f 100644
--- a/spec/views/idv/gpo/index.html.erb_spec.rb
+++ b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb
@@ -1,13 +1,13 @@
require 'rails_helper'
-RSpec.describe 'idv/gpo/index.html.erb' do
+RSpec.describe 'idv/by_mail/request_letter/index.html.erb' do
let(:resend_requested) { false }
let(:user_needs_address_otp_verification) { false }
let(:go_back_path) { nil }
let(:step_indicator_steps) { Idv::StepIndicatorConcern::STEP_INDICATOR_STEPS }
let(:presenter) do
user = build_stubbed(:user, :fully_registered)
- Idv::GpoPresenter.new(user, {})
+ Idv::ByMail::RequestLetterPresenter.new(user, {})
end
before do
@@ -52,7 +52,10 @@
let(:user_needs_address_otp_verification) { true }
it 'renders fallback link to return to verify path' do
- expect(rendered).to have_link('‹ ' + t('forms.buttons.back'), href: idv_gpo_verify_path)
+ expect(rendered).to have_link(
+ '‹ ' + t('forms.buttons.back'),
+ href: idv_verify_by_mail_enter_code_path,
+ )
end
end
end
diff --git a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb
index a9ea0c0039a..4341e6c3102 100644
--- a/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb
+++ b/spec/views/idv/phone_errors/jobfail.html.erb_spec.rb
@@ -35,7 +35,7 @@
)
expect(rendered).not_to have_link(
t('idv.troubleshooting.options.verify_by_mail'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
end
@@ -50,7 +50,7 @@
)
expect(rendered).to have_link(
t('idv.troubleshooting.options.verify_by_mail'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
end
diff --git a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb
index d31edb9271b..f34f5fb7668 100644
--- a/spec/views/idv/phone_errors/timeout.html.erb_spec.rb
+++ b/spec/views/idv/phone_errors/timeout.html.erb_spec.rb
@@ -35,7 +35,7 @@
)
expect(rendered).not_to have_link(
t('idv.troubleshooting.options.verify_by_mail'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
end
@@ -50,7 +50,7 @@
)
expect(rendered).to have_link(
t('idv.troubleshooting.options.verify_by_mail'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
end
diff --git a/spec/views/idv/phone_errors/warning.html.erb_spec.rb b/spec/views/idv/phone_errors/warning.html.erb_spec.rb
index f89daa0eb00..e8587aac8ba 100644
--- a/spec/views/idv/phone_errors/warning.html.erb_spec.rb
+++ b/spec/views/idv/phone_errors/warning.html.erb_spec.rb
@@ -79,7 +79,7 @@
it 'does not render link to gpo flow' do
expect(rendered).not_to have_link(
t('idv.troubleshooting.options.verify_by_mail'),
- href: idv_gpo_path,
+ href: idv_request_letter_path,
)
end
end
@@ -105,7 +105,10 @@
end
it 'has a secondary cta' do
- expect(rendered).to have_link(t('idv.failure.phone.warning.gpo.button'), href: idv_gpo_path)
+ expect(rendered).to have_link(
+ t('idv.failure.phone.warning.gpo.button'),
+ href: idv_request_letter_path,
+ )
end
end
From 52d600f473399028e411fea8b631b92b0d5169e8 Mon Sep 17 00:00:00 2001
From: Kevin Masters <135744319+kevinsmaster5@users.noreply.github.com>
Date: Mon, 11 Sep 2023 07:49:07 -0400
Subject: [PATCH 25/28] LG-10858 Improve tappable area of LDP footer for mobile
users (#9156)
* changelog: Big Fixes, Accessibility, Improve tappable area of footer links
* slight adjustment to footer_links styles
* refigure cascading order to prefer mobile
* remove vertical padding on tablet
* reset footer font size to original
* reset footer icon size
* remove unneeded size override
---
app/assets/stylesheets/components/_footer.scss | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/app/assets/stylesheets/components/_footer.scss b/app/assets/stylesheets/components/_footer.scss
index fe1bb21e5f0..e00be9a86db 100644
--- a/app/assets/stylesheets/components/_footer.scss
+++ b/app/assets/stylesheets/components/_footer.scss
@@ -24,9 +24,11 @@ body {
}
a {
+ @include u-padding-y(1);
text-decoration: none;
@include at-media('tablet') {
+ @include u-padding-y(0);
&,
&:visited {
color: color($theme-link-reverse-color);
@@ -59,6 +61,12 @@ body {
}
.footer__links {
- @include u-padding-y(1);
+ @include u-padding-x(1);
display: flex;
+ flex-wrap: wrap;
+
+ @include at-media('tablet') {
+ @include u-padding-y(1);
+ @include u-padding-x(0);
+ }
}
From 3387b614147008dc3ca9d0e3397e79ea64888df4 Mon Sep 17 00:00:00 2001
From: Andrew Duthie
Date: Mon, 11 Sep 2023 08:24:25 -0400
Subject: [PATCH 26/28] Fix behavior for PIV/CAC declined setup from sign-in
(#9146)
changelog: Bug Fixes, PIV CAC Sign-In, Fix issue preventing user from being redirected to partner after declined PIV/CAC setup from sign-in
---
.../piv_cac_setup_from_sign_in/prompt.html.erb | 15 ++++++++++-----
spec/features/users/sign_in_spec.rb | 18 +++++++++++++++---
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb b/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
index 348b068e81f..cbcd456be03 100644
--- a/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
+++ b/app/views/users/piv_cac_setup_from_sign_in/prompt.html.erb
@@ -25,11 +25,16 @@
<%= f.submit t('forms.piv_cac_setup.submit') %>
-
- <%= link_to t('forms.piv_cac_setup.no_thanks'),
- new_user_session_url,
- class: 'usa-button usa-button--wide usa-button--big usa-button--outline' %>
-
<% end %>
+<%= render ButtonComponent.new(
+ action: ->(**tag_options, &block) do
+ button_to(login_add_piv_cac_prompt_path, **tag_options, method: :post, &block)
+ end,
+ big: true,
+ wide: true,
+ outline: true,
+ class: 'margin-top-2',
+ ).with_content(t('forms.piv_cac_setup.no_thanks')) %>
+
<%= render 'shared/cancel', link: new_user_session_url %>
diff --git a/spec/features/users/sign_in_spec.rb b/spec/features/users/sign_in_spec.rb
index 6b8c57b068b..6b4a16b0c18 100644
--- a/spec/features/users/sign_in_spec.rb
+++ b/spec/features/users/sign_in_spec.rb
@@ -59,7 +59,15 @@
scenario 'user opts to not add piv/cac card' do
perform_steps_to_get_to_add_piv_cac_during_sign_up
click_on t('forms.piv_cac_setup.no_thanks')
- expect(current_path).to eq account_path
+ expect(current_path).to eq sign_up_completed_path
+ end
+
+ context 'without an associated service provider' do
+ scenario 'user opts to not add piv/cac card' do
+ perform_steps_to_get_to_add_piv_cac_during_sign_up(sp: nil)
+ click_on t('forms.piv_cac_setup.no_thanks')
+ expect(current_path).to eq account_path
+ end
end
scenario 'user is suspended, gets show please call page after 2fa' do
@@ -974,9 +982,13 @@
end
end
- def perform_steps_to_get_to_add_piv_cac_during_sign_up
+ def perform_steps_to_get_to_add_piv_cac_during_sign_up(sp: :oidc)
user = create(:user, :fully_registered, :with_phone)
- visit_idp_from_sp_with_ial1(:oidc)
+ if sp
+ visit_idp_from_sp_with_ial1(sp)
+ else
+ visit new_user_session_path
+ end
click_on t('account.login.piv_cac')
allow(FeatureManagement).to receive(:development_and_identity_pki_disabled?).and_return(false)
From 607f6c49c8985066da0b7517c79a65906e51d770 Mon Sep 17 00:00:00 2001
From: Jonathan Hooper
Date: Mon, 11 Sep 2023 09:03:45 -0400
Subject: [PATCH 27/28] LG-10347 Make the key ID the session encryptor uses
configurable (#9171)
* LG-10347 Make the key ID the session encryptor uses configurable
We are currently migrating from a single-region KMS key to a multi-region capable KMS key.
This commit modifies the SessionEncryptor and BackgroundArgsEncryptor to have to use a configurable key for their KMS client. These encryptors are used in 3 contexts:
1. Encryption of sessions (SessionEncryptor)
2. Encryption of GPO confirmation entries (SessionEncryptor)
3. Encryption of arguments to background jobs (BackgroundArgsEncryptor)
The KMS client's for these encryptors will now use the configured key ID for encryptions. For decryption the client allows KMS to select the key. This means that decryption will not be affected by this change as long as KMS still has access to the keys referenced by the KeyID used for encryption.
Since all of the encryption operations done with these encryptors produce ephemeral ciphertexts there is not need to worry about holding onto old keys after this has been deployed with the multi-region key configured for a while.
changelog: Internal, Multi-region KMS migration, The SessionEncryptor and BackgroundArgsEncryptor were change to have a configurable KMS key ID that is used for encryption in order to facilitate a migration to a multi-region key ID.
---
.../encryptors/background_proofing_arg_encryptor.rb | 8 ++++++--
.../encryption/encryptors/session_encryptor.rb | 8 ++++++--
config/application.yml.default | 1 +
lib/identity_config.rb | 1 +
lib/session_encryptor.rb | 10 ++++++----
.../background_proofing_arg_encryptor_spec.rb | 8 ++++++--
.../encryption/encryptors/session_encryptor_spec.rb | 8 ++++++--
7 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/app/services/encryption/encryptors/background_proofing_arg_encryptor.rb b/app/services/encryption/encryptors/background_proofing_arg_encryptor.rb
index d7364cf0ddf..eb012994157 100644
--- a/app/services/encryption/encryptors/background_proofing_arg_encryptor.rb
+++ b/app/services/encryption/encryptors/background_proofing_arg_encryptor.rb
@@ -6,12 +6,12 @@ class BackgroundProofingArgEncryptor
def encrypt(plaintext)
aes_ciphertext = AesEncryptor.new.encrypt(plaintext, aes_encryption_key)
- kms_ciphertext = KmsClient.new.encrypt(aes_ciphertext, 'context' => 'session-encryption')
+ kms_ciphertext = kms_client.encrypt(aes_ciphertext, 'context' => 'session-encryption')
encode(kms_ciphertext)
end
def decrypt(ciphertext)
- aes_ciphertext = KmsClient.new.decrypt(
+ aes_ciphertext = kms_client.decrypt(
decode(ciphertext), 'context' => 'session-encryption'
)
aes_encryptor.decrypt(aes_ciphertext, aes_encryption_key)
@@ -27,6 +27,10 @@ def aes_encryption_key
IdentityConfig.store.session_encryption_key[0...32]
end
+ def kms_client
+ @kms_client ||= KmsClient.new(kms_key_id: IdentityConfig.store.aws_kms_session_key_id)
+ end
+
add_method_tracer :encrypt, "Custom/#{name}/encrypt"
add_method_tracer :decrypt, "Custom/#{name}/decrypt"
end
diff --git a/app/services/encryption/encryptors/session_encryptor.rb b/app/services/encryption/encryptors/session_encryptor.rb
index 34b226d1067..42002bb2352 100644
--- a/app/services/encryption/encryptors/session_encryptor.rb
+++ b/app/services/encryption/encryptors/session_encryptor.rb
@@ -6,12 +6,12 @@ class SessionEncryptor
def encrypt(plaintext)
aes_ciphertext = AesEncryptor.new.encrypt(plaintext, aes_encryption_key)
- kms_ciphertext = KmsClient.new.encrypt(aes_ciphertext, 'context' => 'session-encryption')
+ kms_ciphertext = kms_client.encrypt(aes_ciphertext, 'context' => 'session-encryption')
encode(kms_ciphertext)
end
def decrypt(ciphertext)
- aes_ciphertext = KmsClient.new.decrypt(
+ aes_ciphertext = kms_client.decrypt(
decode(ciphertext), 'context' => 'session-encryption'
)
aes_encryptor.decrypt(aes_ciphertext, aes_encryption_key)
@@ -27,6 +27,10 @@ def aes_encryption_key
IdentityConfig.store.session_encryption_key[0...32]
end
+ def kms_client
+ @kms_client ||= KmsClient.new(kms_key_id: IdentityConfig.store.aws_kms_session_key_id)
+ end
+
add_method_tracer :encrypt, "Custom/#{name}/encrypt"
add_method_tracer :decrypt, "Custom/#{name}/decrypt"
end
diff --git a/config/application.yml.default b/config/application.yml.default
index 2cda212387f..d95b9ab29a1 100644
--- a/config/application.yml.default
+++ b/config/application.yml.default
@@ -52,6 +52,7 @@ aws_kms_client_contextless_pool_size: 5
aws_kms_client_multi_pool_size: 5
aws_kms_multi_region_key_id: alias/login-dot-gov-keymaker-multi-region
aws_kms_multi_region_read_enabled: false
+aws_kms_session_key_id: alias/login-dot-gov-test-keymaker
aws_logo_bucket: ''
aws_region: 'us-west-2'
backup_code_cost: '2000$8$1$'
diff --git a/lib/identity_config.rb b/lib/identity_config.rb
index d1a00684be3..79645c6d376 100644
--- a/lib/identity_config.rb
+++ b/lib/identity_config.rb
@@ -139,6 +139,7 @@ def self.build_store(config_map)
config.add(:aws_kms_key_id, type: :string)
config.add(:aws_kms_multi_region_key_id, type: :string)
config.add(:aws_kms_multi_region_read_enabled, type: :boolean)
+ config.add(:aws_kms_session_key_id, type: :string)
config.add(:aws_logo_bucket, type: :string)
config.add(:aws_region, type: :string)
config.add(:backup_code_cost, type: :string)
diff --git a/lib/session_encryptor.rb b/lib/session_encryptor.rb
index 0f09f540940..22c9ff3f488 100644
--- a/lib/session_encryptor.rb
+++ b/lib/session_encryptor.rb
@@ -84,13 +84,15 @@ def dump(value)
end
def kms_encrypt(text)
- Base64.encode64(Encryption::KmsClient.new.encrypt(text, 'context' => 'session-encryption'))
+ Base64.encode64(kms_client.encrypt(text, 'context' => 'session-encryption'))
end
def kms_decrypt(text)
- Encryption::KmsClient.new.decrypt(
- Base64.decode64(text), 'context' => 'session-encryption'
- )
+ kms_client.decrypt(Base64.decode64(text), 'context' => 'session-encryption')
+ end
+
+ def kms_client
+ Encryption::KmsClient.new(kms_key_id: IdentityConfig.store.aws_kms_session_key_id)
end
def outer_encrypt(plaintext)
diff --git a/spec/services/encryption/encryptors/background_proofing_arg_encryptor_spec.rb b/spec/services/encryption/encryptors/background_proofing_arg_encryptor_spec.rb
index 0c93606e525..12cb4f27bc0 100644
--- a/spec/services/encryption/encryptors/background_proofing_arg_encryptor_spec.rb
+++ b/spec/services/encryption/encryptors/background_proofing_arg_encryptor_spec.rb
@@ -14,7 +14,9 @@
with('aes output', 'context' => 'session-encryption').
and_return('kms output')
allow(Encryption::Encryptors::AesEncryptor).to receive(:new).and_return(aes_encryptor)
- allow(Encryption::KmsClient).to receive(:new).and_return(kms_client)
+ allow(Encryption::KmsClient).to receive(:new).with(
+ kms_key_id: IdentityConfig.store.aws_kms_session_key_id,
+ ).and_return(kms_client)
expected_ciphertext = Base64.strict_encode64('kms output')
@@ -28,7 +30,9 @@
expect(client).to receive(:encrypt).with(
instance_of(String), 'context' => 'session-encryption'
).and_return('kms_ciphertext')
- allow(Encryption::KmsClient).to receive(:new).and_return(client)
+ allow(Encryption::KmsClient).to receive(:new).with(
+ kms_key_id: IdentityConfig.store.aws_kms_session_key_id,
+ ).and_return(client)
subject.encrypt(plaintext)
end
diff --git a/spec/services/encryption/encryptors/session_encryptor_spec.rb b/spec/services/encryption/encryptors/session_encryptor_spec.rb
index eb61573dc3e..204d77c0649 100644
--- a/spec/services/encryption/encryptors/session_encryptor_spec.rb
+++ b/spec/services/encryption/encryptors/session_encryptor_spec.rb
@@ -14,7 +14,9 @@
with('aes output', 'context' => 'session-encryption').
and_return('kms output')
allow(Encryption::Encryptors::AesEncryptor).to receive(:new).and_return(aes_encryptor)
- allow(Encryption::KmsClient).to receive(:new).and_return(kms_client)
+ allow(Encryption::KmsClient).to receive(:new).with(
+ kms_key_id: IdentityConfig.store.aws_kms_session_key_id,
+ ).and_return(kms_client)
expected_ciphertext = Base64.strict_encode64('kms output')
@@ -28,7 +30,9 @@
expect(client).to receive(:encrypt).with(
instance_of(String), 'context' => 'session-encryption'
).and_return('kms_ciphertext')
- allow(Encryption::KmsClient).to receive(:new).and_return(client)
+ allow(Encryption::KmsClient).to receive(:new).with(
+ kms_key_id: IdentityConfig.store.aws_kms_session_key_id,
+ ).and_return(client)
subject.encrypt(plaintext)
end
From f4bcac35a1f2514ba12b68fb3d4acc02e2324542 Mon Sep 17 00:00:00 2001
From: Tomas Apodaca
Date: Mon, 11 Sep 2023 08:32:33 -0700
Subject: [PATCH 28/28] LG-10300: Add optional info alert to in person proofing
location search (#9172)
Make it possible to display an info alert above the in person proofing location search results telling the user that they must enroll before visiting the Post Office. The alert will be shown when the user is searching for locations in the help center.
changelog: User-Facing Improvements, In-person Proofing, Add info alert for users searching locations in help center
---
.../packages/address-search/README.md | 11 +--
.../components/address-search.tsx | 12 ++--
.../components/in-person-locations.spec.tsx | 70 +++++++++++++++++++
.../components/in-person-locations.tsx | 12 +++-
.../packages/address-search/index.tsx | 10 +--
.../packages/address-search/package.json | 2 +-
.../packages/address-search/types.d.ts | 12 +++-
...erson-location-post-office-search-step.tsx | 8 +--
8 files changed, 114 insertions(+), 23 deletions(-)
create mode 100644 app/javascript/packages/address-search/components/in-person-locations.spec.tsx
diff --git a/app/javascript/packages/address-search/README.md b/app/javascript/packages/address-search/README.md
index 50696187eae..39213a0f503 100644
--- a/app/javascript/packages/address-search/README.md
+++ b/app/javascript/packages/address-search/README.md
@@ -26,12 +26,13 @@ import AddressSearch from '@18f/identity-address-search';
return(
<>
>
);
diff --git a/app/javascript/packages/address-search/components/address-search.tsx b/app/javascript/packages/address-search/components/address-search.tsx
index ac6d82fce1e..4d116f48705 100644
--- a/app/javascript/packages/address-search/components/address-search.tsx
+++ b/app/javascript/packages/address-search/components/address-search.tsx
@@ -3,16 +3,17 @@ import { Alert, PageHeading } from '@18f/identity-components';
import { t } from '@18f/identity-i18n';
import InPersonLocations from './in-person-locations';
import AddressInput from './address-input';
-import type { LocationQuery, FormattedLocation } from '../types';
+import type { AddressSearchProps, LocationQuery, FormattedLocation } from '../types';
function AddressSearch({
- registerField,
- locationsURL,
addressSearchURL,
- handleLocationSelect,
disabled,
+ handleLocationSelect,
+ locationsURL,
onFoundLocations,
-}) {
+ registerField,
+ resultsHeaderComponent,
+}: AddressSearchProps) {
const [apiError, setApiError] = useState(null);
const [foundAddress, setFoundAddress] = useState(null);
const [locationResults, setLocationResults] = useState(
@@ -47,6 +48,7 @@ function AddressSearch({
locations={locationResults}
onSelect={handleLocationSelect}
address={foundAddress?.address || ''}
+ resultsHeaderComponent={resultsHeaderComponent}
/>
)}
>
diff --git a/app/javascript/packages/address-search/components/in-person-locations.spec.tsx b/app/javascript/packages/address-search/components/in-person-locations.spec.tsx
new file mode 100644
index 00000000000..fe95f52ac22
--- /dev/null
+++ b/app/javascript/packages/address-search/components/in-person-locations.spec.tsx
@@ -0,0 +1,70 @@
+import { render } from '@testing-library/react';
+import { Alert } from '@18f/identity-components';
+import type { FormattedLocation } from './in-person-locations';
+import InPersonLocations from './in-person-locations';
+
+describe('InPersonLocations', () => {
+ const locations: FormattedLocation[] = [
+ {
+ formattedCityStateZip: 'one',
+ distance: 'one',
+ id: 1,
+ name: 'one',
+ saturdayHours: 'one',
+ streetAddress: 'one',
+ sundayHours: 'one',
+ weekdayHours: 'one',
+ isPilot: false,
+ },
+ {
+ formattedCityStateZip: 'two',
+ distance: 'two',
+ id: 2,
+ name: 'two',
+ saturdayHours: 'two',
+ streetAddress: 'two',
+ sundayHours: 'two',
+ weekdayHours: 'two',
+ isPilot: false,
+ },
+ ];
+
+ const onSelect = () => {};
+
+ const address = '123 Fake St, Hollywood, CA 90210';
+
+ it('renders a component at the top of results when passed', () => {
+ const alertText = 'hello world';
+ const alertComponent = () => {alertText};
+
+ const { getByText } = render(
+ ,
+ );
+
+ // the alert text
+ expect(getByText(alertText)).to.exist();
+ });
+
+ it('renders results instructions when onSelect is passed', () => {
+ const { getByText } = render(
+ ,
+ );
+
+ expect(getByText('in_person_proofing.body.location.po_search.results_instructions')).to.exist();
+ });
+
+ it('does not render results instructions when onSelect is not passed', () => {
+ const { queryByText } = render(
+ ,
+ );
+
+ expect(
+ queryByText('in_person_proofing.body.location.po_search.results_instructions'),
+ ).to.not.exist();
+ });
+});
diff --git a/app/javascript/packages/address-search/components/in-person-locations.tsx b/app/javascript/packages/address-search/components/in-person-locations.tsx
index f4dd19f7af5..737f1d79adc 100644
--- a/app/javascript/packages/address-search/components/in-person-locations.tsx
+++ b/app/javascript/packages/address-search/components/in-person-locations.tsx
@@ -1,3 +1,4 @@
+import { ComponentType } from 'react';
import { t } from '@18f/identity-i18n';
import LocationCollection from './location-collection';
import LocationCollectionItem from './location-collection-item';
@@ -19,9 +20,15 @@ interface InPersonLocationsProps {
locations: FormattedLocation[] | null | undefined;
onSelect;
address: string;
+ resultsHeaderComponent?: ComponentType;
}
-function InPersonLocations({ locations, onSelect, address }: InPersonLocationsProps) {
+function InPersonLocations({
+ locations,
+ onSelect,
+ address,
+ resultsHeaderComponent: HeaderComponent,
+}: InPersonLocationsProps) {
const isPilot = locations?.some((l) => l.isPilot);
if (locations?.length === 0) {
@@ -37,7 +44,8 @@ function InPersonLocations({ locations, onSelect, address }: InPersonLocationsPr
count: locations?.length,
})}
- {t('in_person_proofing.body.location.po_search.results_instructions')}
+ {HeaderComponent && }
+ {onSelect && {t('in_person_proofing.body.location.po_search.results_instructions')} }
{(locations || []).map((item, index) => (
Promise) | null | undefined;
+ resultsHeaderComponent?: ComponentType;
+ locationsURL: string;
+ onFoundLocations: Dispatch>;
+ registerField: RegisterFieldCallback;
+}
+
interface InPersonLocationsProps {
locations: FormattedLocation[] | null | undefined;
onSelect;
diff --git a/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx b/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx
index c256eb18f25..237003d2dac 100644
--- a/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx
+++ b/app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx
@@ -94,12 +94,12 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist
return (
<>
>
|