Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5a9f5fe
LG-9459: Accessing phone error screens should redirect you if you hav…
amirbey Aug 1, 2023
4d5f58f
Jmax/lg 9296 updates to phone rate limit screen (#8547)
jmax-gsa Aug 1, 2023
f832b25
Show troubleshooting options consistently across all MFA verification…
aduth Aug 1, 2023
0defc7f
LG-10286: Allow AAL2-restricted sign in to choose another option (#8837)
aduth Aug 1, 2023
4af463d
LG-10314: Add test coverage for BackupCodeVerificationForm (#8891)
jc-gsa Aug 1, 2023
b9a98f4
LG-9837, LG-10380 - Add confirm password to reset & edit (#8862)
jc-gsa Aug 1, 2023
3a5b568
Upgrade Rubocop to latest version (#8910)
aduth Aug 1, 2023
0449ebb
LG-10511: Update copy for banner that notifies user they already trie…
amirbey Aug 1, 2023
b492532
Remove old skip_upload parameter (#8885)
matthinz Aug 1, 2023
234e7fc
LG-10385 Add new columns for in-person proofing pending (#8899)
theabrad Aug 1, 2023
fe7336c
Add logging of PKCE usage (#8919)
Aug 1, 2023
eb1ae6e
Change /verify/session/errors/throttled route to /rate_limited (#8908)
soniaconnolly Aug 1, 2023
096da80
Remove sm-left-align custom CSS utility class (#8917)
aduth Aug 2, 2023
6fe145b
LG-10441: Dont allow Skipping when Webauthn Platform (#8867)
mdiarra3 Aug 2, 2023
0a81b7d
LG-10080 Update es translations on state-issued id page (#8920)
svalexander Aug 2, 2023
d81440b
LG-10439 Read barcode read error values form the session (#8918)
jmhooper Aug 2, 2023
e2bb2bb
LG-10456: Update loading content for Face/Touch setup (#8909)
aduth Aug 2, 2023
2dd4d6c
LG 10372 Shorten Fieldset for MFA option setup (#8912)
kevinsmaster5 Aug 2, 2023
98bd2ef
Add logging of PKCE configuration (#8925)
Aug 2, 2023
72f8c28
LG-10479 FSM/SSN - Check redirect for SSN Step (#8913)
gina-yamada Aug 2, 2023
aa99c88
LG-10373: Assistive technology reads "two" twice in authentication me…
jmdembe Aug 2, 2023
1a56640
Only use postgis adapter for primary database (#8914)
Aug 2, 2023
66ae57c
Fix merge conflicts
Aug 3, 2023
5ba3ded
Update phonelib dependencies to add support for newer area codes (#8932)
Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ Style/AndOr:
- conditionals

Style/ArgumentsForwarding:
UseAnonymousForwarding: false
Enabled: true

Style/ArrayJoin:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ group :development, :test do
gem 'pry-rails'
gem 'psych'
gem 'rspec-rails', '~> 6.0'
gem 'rubocop', '~> 1.43.0', require: false
gem 'rubocop', '~> 1.55.1', require: false
gem 'rubocop-performance', '~> 1.15.0', require: false
gem 'rubocop-rails', '>= 2.5.2', require: false
end
Expand Down
21 changes: 12 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ GEM
jwt (2.7.1)
knapsack (4.0.0)
rake
language_server-protocol (3.17.0.3)
launchy (2.5.0)
addressable (~> 2.7)
letter_opener (1.8.1)
Expand Down Expand Up @@ -439,13 +440,14 @@ GEM
openssl-signature_algorithm (1.2.1)
openssl (> 2.0, < 3.1)
orm_adapter (0.5.0)
parallel (1.22.1)
parser (3.2.2.0)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pg (1.4.5)
pg_query (2.2.0)
google-protobuf (>= 3.19.2)
phonelib (0.6.54)
phonelib (0.8.2)
pkcs11 (0.3.4)
premailer (1.21.0)
addressable
Expand Down Expand Up @@ -589,18 +591,19 @@ GEM
rspec-support (3.12.0)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.43.0)
rubocop (1.55.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-performance (1.15.2)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
Expand Down Expand Up @@ -819,7 +822,7 @@ DEPENDENCIES
rspec-rails (~> 6.0)
rspec-retry
rspec_junit_formatter
rubocop (~> 1.43.0)
rubocop (~> 1.55.1)
rubocop-performance (~> 1.15.0)
rubocop-rails (>= 2.5.2)
ruby-progressbar
Expand Down
Binary file added app/assets/images/loading-badge.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/spinner.gif
Binary file not shown.
Binary file removed app/assets/images/spinner@2x.gif
Binary file not shown.
12 changes: 0 additions & 12 deletions app/assets/stylesheets/utilities/_util.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,3 @@ html.js .no-js {
backface-visibility: hidden;
transform: scale(0.7);
}

@include at-media('tablet') {
.sm-left-align {
text-align: left;
}
}

.half-center {
margin: 0 auto;
text-align: center;
width: 300px;
}
6 changes: 4 additions & 2 deletions app/components/block_link_component.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class BlockLinkComponent < BaseComponent
attr_reader :url, :action, :new_tab, :tag_options

alias_method :new_tab?, :new_tab

def initialize(url:, action: tag.method(:a), new_tab: false, **tag_options)
@action = action
@url = url
Expand All @@ -10,12 +12,12 @@ def initialize(url:, action: tag.method(:a), new_tab: false, **tag_options)

def css_class
classes = ['usa-link', 'block-link', *tag_options[:class]]
classes << 'usa-link--external' if new_tab
classes << 'usa-link--external' if new_tab?
classes
end

def target
'_blank' if new_tab
'_blank' if new_tab?
end

def wrapper(&block)
Expand Down
4 changes: 2 additions & 2 deletions app/components/password_confirmation_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
form: form,
name: :password,
type: :password,
label: t('forms.password'),
label: password_label,
required: true,
**field_options,
input_html: field_options[:input_html].to_h.merge(
Expand All @@ -16,7 +16,7 @@
form: form,
name: :password_confirmation,
type: :password_confirmation,
label: t('components.password_confirmation.confirm_label'),
label: confirmation_label,
required: true,
**field_options,
input_html: field_options[:input_html].to_h.merge(
Expand Down
12 changes: 12 additions & 0 deletions app/components/password_confirmation_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ class PasswordConfirmationComponent < BaseComponent

def initialize(
form:,
password_label: nil,
confirmation_label: nil,
field_options: {},
**tag_options
)
@form = form
@password_label = password_label
@confirmation_label = confirmation_label
@field_options = field_options
@tag_options = tag_options
end

def password_label
@password_label || t('forms.password')
end

def confirmation_label
@confirmation_label || t('components.password_confirmation.confirm_label')
end

def toggle_id
"password-confirmation-toggle-#{unique_id}"
end
Expand Down
11 changes: 10 additions & 1 deletion app/components/troubleshooting_options_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ class TroubleshootingOptionsComponent < BaseComponent

attr_reader :tag_options

def initialize(**tag_options)
def initialize(options: [], **tag_options)
@options_from_constructor = options
@tag_options = tag_options.dup
end

def options
@options_from_constructor.map(&method(:render)) + get_slot(:options)
end

def options?
options.present?
end

def render?
options?
end
Expand Down
3 changes: 1 addition & 2 deletions app/components/webauthn_verify_button_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
) do %>
<div class="webauthn-verify-button__spinner text-center" hidden>
<%= image_tag(
asset_url('spinner.gif'),
srcset: asset_url('spinner@2x.gif'),
asset_url('loading-badge.gif'),
height: 144,
width: 144,
alt: '',
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def flow_path
private

def confirm_ssn_step_complete
if IdentityConfig.store.in_person_ssn_info_controller_enabled
# mark ssn step as complete for FSM
flow_session['Idv::Steps::InPerson::SsnStep'] = true if flow_session.dig(:pii_from_user, :ssn)
end
return if pii.present? && pii[:ssn].present?
redirect_to prev_url
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/rate_limit_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def rate_limited_redirect(rate_limit_type)
when :idv_resolution
redirect_to idv_session_errors_failure_url
when :idv_doc_auth
redirect_to idv_session_errors_throttled_url
redirect_to idv_session_errors_rate_limited_url
when :proof_address
redirect_to idv_phone_errors_failure_url
when :proof_ssn
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/agreement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def show
end

def update
skip_to_capture if params[:skip_hybrid_handoff] || params[:skip_upload]
skip_to_capture if params[:skip_hybrid_handoff]

result = Idv::ConsentForm.new.submit(consent_form_params)

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/idv/capture_doc_status_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def redirect_url
return unless flow_session && document_capture_session

if rate_limiter.limited?
idv_session_errors_throttled_url
idv_session_errors_rate_limited_url
elsif user_has_establishing_in_person_enrollment?
idv_in_person_url
end
Expand Down Expand Up @@ -85,7 +85,7 @@ def had_barcode_attention_result?
idv_session.had_barcode_attention_error = session_result.attention_with_barcode?
end

flow_session[:had_barcode_attention_error]
idv_session.had_barcode_attention_error
end

def idv_session
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/getting_started_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def show
end

def update
skip_to_capture if params[:skip_hybrid_handoff] || params[:skip_upload]
skip_to_capture if params[:skip_hybrid_handoff]

result = Idv::ConsentForm.new.submit(consent_form_params)

Expand Down
5 changes: 5 additions & 0 deletions app/controllers/idv/phone_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class PhoneErrorsController < ApplicationController

before_action :confirm_two_factor_authenticated
before_action :confirm_idv_phone_step_needed
before_action :confirm_idv_phone_step_submitted
before_action :set_gpo_letter_available
before_action :ignore_form_step_wait_requests

Expand Down Expand Up @@ -45,6 +46,10 @@ def confirm_idv_phone_step_needed
redirect_to idv_review_url if idv_session.user_phone_confirmation == true
end

def confirm_idv_phone_step_submitted
redirect_to idv_phone_url if idv_session.previous_phone_step_params.nil?
end

def ignore_form_step_wait_requests
head(:no_content) if request.headers['HTTP_X_FORM_STEPS_WAIT']
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def show
Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]).
call('verify', :view, true)

@had_barcode_read_failure = flow_session[:had_barcode_read_failure]
@had_barcode_read_failure = idv_session.had_barcode_read_failure
process_async_state(load_async_state)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sign_up/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def process_successful_password_creation
end

def password_form
@password_form ||= PasswordForm.new(@user, validate_confirmation: true)
@password_form ||= PasswordForm.new(@user)
end

def process_unsuccessful_password_creation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ def render_show_after_invalid
end

def piv_cac_view_data
{
two_factor_authentication_method: 'piv_cac',
hide_fallback_question: service_provider_mfa_policy.piv_cac_required?,
}.merge(generic_data)
{ two_factor_authentication_method: 'piv_cac' }.merge(generic_data)
end

def piv_cac_verification_form
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def capture_password_if_pii_requested_but_locked
end

def user_params
params.require(:update_user_password_form).permit(:password)
params.require(:update_user_password_form).permit(:password, :password_confirmation)
end

def handle_valid_password
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/reset_passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def create_reset_event_and_send_notification

def user_params
params.require(:reset_password_form).
permit(:password, :reset_password_token)
permit(:password, :password_confirmation, :reset_password_token)
end

def assert_reset_token_passed
Expand Down
1 change: 1 addition & 0 deletions app/forms/openid_connect_authorize_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def extra_analytics_attributes
unauthorized_scope: @unauthorized_scope,
code_digest: code ? Digest::SHA256.hexdigest(code) : nil,
code_challenge_present: code_challenge.present?,
service_provider_pkce: service_provider&.pkce,
}
end

Expand Down
1 change: 1 addition & 0 deletions app/forms/openid_connect_token_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def extra_analytics_attributes
user_id: identity&.user&.uuid,
code_digest: code ? Digest::SHA256.hexdigest(code) : nil,
code_verifier_present: code_verifier.present?,
service_provider_pkce: service_provider&.pkce,
}
end

Expand Down
4 changes: 2 additions & 2 deletions app/forms/password_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ class PasswordForm
include ActiveModel::Model
include FormPasswordValidator

def initialize(user, options = {})
def initialize(user)
@user = user
@validate_confirmation = options.fetch(:validate_confirmation, false)
@validate_confirmation = true
end

def submit(params)
Expand Down
7 changes: 4 additions & 3 deletions app/forms/reset_password_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ class ResetPasswordForm

def initialize(user)
@user = user
@reset_password_token = @user.reset_password_token
@validate_confirmation = true
@active_profile = user.active_profile
@pending_profile = user.pending_profile

self.reset_password_token = @user.reset_password_token
end

def submit(params)
self.password = params[:password]
@password = params[:password]
@password_confirmation = params[:password_confirmation]

@success = valid?

Expand Down
8 changes: 7 additions & 1 deletion app/forms/two_factor_options_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ def has_no_configured_mfa?
mfa_user.enabled_mfa_methods_count == 0
end

def platform_auth_only_option?
mfa_user.enabled_mfa_methods_count == 1 &&
mfa_user.webauthn_platform_configurations.count == 1
end

def has_no_mfa_or_in_required_flow?
has_no_configured_mfa? || in_phishing_resistant_or_piv_cac_required_flow?
has_no_configured_mfa? || in_phishing_resistant_or_piv_cac_required_flow? ||
platform_auth_only_option?
end
end
4 changes: 3 additions & 1 deletion app/forms/update_user_password_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ class UpdateUserPasswordForm
def initialize(user, user_session = nil)
@user = user
@user_session = user_session
@validate_confirmation = true
end

def submit(params)
self.password = params[:password]
@password = params[:password]
@password_confirmation = params[:password_confirmation]
success = valid?
process_valid_submission if success
FormResponse.new(success: success, errors: errors)
Expand Down
Loading