Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 0 additions & 19 deletions app/assets/stylesheets/_uswds-core.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Prevent USWDS from rendering `@font-face` in every stylesheet. One stylesheet should override
// this to ensure that the `@font-face` is defined at least once.
$render-font-face: false !default;

@forward '@18f/identity-design-system/packages/uswds-core' with (
$theme-body-font-size: 'sm',
$theme-font-path: '',
Expand All @@ -12,21 +8,6 @@ $render-font-face: false !default;
$theme-header-min-width: 'tablet',
$theme-link-visited-color: 'primary',
$theme-style-body-element: true,
$theme-typeface-tokens:
if(
$render-font-face,
(),
(
'roboto-mono': (
cap-height: 380px,
src: false,
),
'public-sans': (
cap-height: 362px,
src: false,
),
)
),
$output-these-utilities: (
'add-list-reset',
'align-items',
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/_uswds-fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This stylesheet stubs the default uswds-fonts package to prevent USWDS from rendering all fonts
// declarations in all stylesheets. They are rendered once by removing the contents of the common
// root import, and referencing the source files in the main application stylesheet.
1 change: 0 additions & 1 deletion app/assets/stylesheets/_uswds-form-controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@forward 'usa-input';
@forward 'usa-label';
@forward 'usa-legend';
@forward 'usa-memorable-date';
@forward 'usa-radio';
@forward 'usa-select';
@forward 'usa-success-message';
5 changes: 2 additions & 3 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@forward 'uswds-core' with (
$render-font-face: true
);
@forward 'uswds-core';
@forward 'uswds-fonts/src/styles';
@forward 'uswds';
@forward 'design-system-waiting-room';
@forward 'components';
Expand Down
6 changes: 0 additions & 6 deletions app/assets/stylesheets/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@forward 'btn';
@forward 'card';
@forward 'code';
@forward 'click-observer';
@forward 'file-input';
@forward 'form-steps';
@forward 'footer';
Expand All @@ -16,15 +15,10 @@
@forward 'icon';
@forward 'language-picker';
@forward 'list';
@forward 'modal';
@forward 'nav';
@forward 'one-time-code-input';
@forward 'page-heading';
@forward 'phone-input';
@forward 'password';
@forward 'password-toggle';
@forward 'profile-section';
@forward 'recaptcha-badge';
@forward 'personal-key';
@forward 'spinner-button';
@forward 'spinner-dots';
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/email.css.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@use 'uswds-core' as *;
@use 'variables/app' as *;
@use 'variables/email' as *;
@import 'foundation-emails/scss/foundation-emails';

.gray {
&:active,
Expand Down
93 changes: 93 additions & 0 deletions app/assets/stylesheets/variables/_email.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,96 @@ $thumbnail-shadow: 0 0 0 1px rgba($black, 0.2);
$thumbnail-shadow-hover: 0 0 6px 1px rgba($primary-color, 0.5);
$thumbnail-transition: box-shadow 200ms ease-out;
$thumbnail-radius: $global-radius;

@forward 'foundation-emails/scss/foundation-emails' with (
$primary-color: $primary-color,
$secondary-color: $secondary-color,
$success-color: $success-color,
$warning-color: $warning-color,
$alert-color: $alert-color,
$light-gray: $light-gray,
$black: $black,
$white: $white,
$medium-gray: $medium-gray,
$dark-gray: $dark-gray,
$pre-color: $pre-color,
$global-width: $global-width,
$global-width-small: $global-width-small,
$global-gutter: $global-gutter,
$global-gutter-small: $global-gutter-small,
$body-background: $body-background,
$container-background: $container-background,
$global-padding: $global-padding,
$global-margin: $global-margin,
$global-radius: $global-radius,
$global-rounded: $global-rounded,
$global-breakpoint: $global-breakpoint,
$grid-column-count: $grid-column-count,
$column-padding-bottom: $column-padding-bottom,
$container-radius: $container-radius,
$block-grid-max: $block-grid-max,
$block-grid-gutter: $block-grid-gutter,
$global-font-color: $global-font-color,
$body-font-family: $body-font-family,
$global-font-weight: $global-font-weight,
$header-color: $header-color,
$global-line-height: $global-line-height,
$global-font-size: $global-font-size,
$body-line-height: $body-line-height,
$header-font-family: $header-font-family,
$header-font-weight: $header-font-weight,
$h1-font-size: $h1-font-size,
$h2-font-size: $h2-font-size,
$h3-font-size: $h3-font-size,
$h4-font-size: $h4-font-size,
$h5-font-size: $h5-font-size,
$h6-font-size: $h6-font-size,
$header-margin-bottom: $header-margin-bottom,
$paragraph-margin-bottom: $paragraph-margin-bottom,
$small-font-size: $small-font-size,
$small-font-color: $small-font-color,
$lead-font-size: $lead-font-size,
$lead-line-height: $lead-line-height,
$text-padding: $text-padding,
$subheader-lineheight: $subheader-lineheight,
$subheader-color: $subheader-color,
$subheader-font-weight: $subheader-font-weight,
$subheader-margin-top: $subheader-margin-top,
$subheader-margin-bottom: $subheader-margin-bottom,
$hr-width: $hr-width,
$hr-border: $hr-border,
$hr-margin: $hr-margin,
$anchor-text-decoration: $anchor-text-decoration,
$anchor-color: $anchor-color,
$anchor-color-visited: $anchor-color-visited,
$anchor-color-hover: $anchor-color-hover,
$anchor-color-active: $anchor-color-active,
$stat-font-size: $stat-font-size,
$button-padding: $button-padding,
$button-font-size: $button-font-size,
$button-color: $button-color,
$button-color-alt: $button-color-alt,
$button-font-weight: $button-font-weight,
$button-margin: $button-margin,
$button-background: $button-background,
$button-border: $button-border,
$button-radius: $button-radius,
$button-rounded: $button-rounded,
$callout-background-fade: $callout-background-fade,
$callout-padding: $callout-padding,
$callout-margin-bottom: $callout-margin-bottom,
$callout-border: $callout-border,
$callout-border-secondary: $callout-border-secondary,
$callout-border-success: $callout-border-success,
$callout-border-warning: $callout-border-warning,
$callout-border-alert: $callout-border-alert,
$menu-item-padding: $menu-item-padding,
$menu-item-gutter: $menu-item-gutter,
$menu-item-color: $menu-item-color,
$thumbnail-border: $thumbnail-border,
$thumbnail-margin-bottom: $thumbnail-margin-bottom,
$thumbnail-shadow: $thumbnail-shadow,
$thumbnail-shadow-hover: $thumbnail-shadow-hover,
$thumbnail-transition: $thumbnail-transition,
$thumbnail-radius: $thumbnail-radius
);
3 changes: 3 additions & 0 deletions app/components/memorable_date_component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@use 'uswds-core' as *;

@forward 'usa-memorable-date';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use 'uswds-core' as *;
@use '../variables/app' as *;
@use 'variables/app' as *;

.usa-modal-overlay {
// Temporary styles to avoid inheriting too much of the USWDS opinionated modal styling until
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/accounts/personal_keys_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PersonalKeysController < ApplicationController

before_action :confirm_two_factor_authenticated
before_action :prompt_for_password_if_pii_locked
before_action :confirm_recently_authenticated
before_action :confirm_recently_authenticated_2fa

def new
analytics.profile_personal_key_visit
Expand Down
1 change: 0 additions & 1 deletion app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def show
user: current_user,
locked_for_session: pii_locked_for_session?(current_user),
)
@use_reauthentication_route = FeatureManagement.use_reauthentication_route?
end

# This action is used to re-authenticate when PII on the account page is locked on `show` action
Expand Down
44 changes: 22 additions & 22 deletions app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def shared_update
pii[:uuid_prefix] = ServiceProvider.find_by(issuer: sp_session[:issuer])&.app_id
set_state_id_type

ssn_throttle.increment!
ssn_rate_limiter.increment!

document_capture_session = DocumentCaptureSession.create(
user_id: current_user.id,
Expand Down Expand Up @@ -61,17 +61,17 @@ def aamva_disallowed_for_service_provider?
banlist.include?(sp_session[:issuer])
end

def resolution_throttle
@resolution_throttle ||= Throttle.new(
def resolution_rate_limiter
@resolution_rate_limiter ||= RateLimiter.new(
user: current_user,
throttle_type: :idv_resolution,
rate_limit_type: :idv_resolution,
)
end

def ssn_throttle
@ssn_throttle ||= Throttle.new(
def ssn_rate_limiter
@ssn_rate_limiter ||= RateLimiter.new(
target: Pii::Fingerprinter.fingerprint(pii[:ssn]),
throttle_type: :proof_ssn,
rate_limit_type: :proof_ssn,
)
end

Expand All @@ -85,14 +85,14 @@ def idv_failure(result)
:mva_exception,
)

resolution_throttle.increment! if proofing_results_exception.blank?
resolution_rate_limiter.increment! if proofing_results_exception.blank?

if ssn_throttle.throttled?
idv_failure_log_throttled(:proof_ssn)
if ssn_rate_limiter.limited?
idv_failure_log_rate_limited(:proof_ssn)
redirect_to idv_session_errors_ssn_failure_url
elsif resolution_throttle.throttled?
idv_failure_log_throttled(:idv_resolution)
redirect_to throttled_url
elsif resolution_rate_limiter.limited?
idv_failure_log_rate_limited(:idv_resolution)
redirect_to rate_limited_url
elsif proofing_results_exception.present? && is_mva_exception
idv_failure_log_warning
redirect_to state_id_warning_url
Expand All @@ -105,14 +105,14 @@ def idv_failure(result)
end
end

def idv_failure_log_throttled(throttle_type)
if throttle_type == :proof_ssn
def idv_failure_log_rate_limited(rate_limit_type)
if rate_limit_type == :proof_ssn
irs_attempts_api_tracker.idv_verification_rate_limited(throttle_context: 'multi-session')
analytics.throttler_rate_limit_triggered(
throttle_type: :proof_ssn,
step_name: STEP_NAME,
)
elsif throttle_type == :idv_resolution
elsif rate_limit_type == :idv_resolution
irs_attempts_api_tracker.idv_verification_rate_limited(throttle_context: 'single-session')
analytics.throttler_rate_limit_triggered(
throttle_type: :idv_resolution,
Expand All @@ -124,18 +124,18 @@ def idv_failure_log_throttled(throttle_type)
def idv_failure_log_error
analytics.idv_doc_auth_exception_visited(
step_name: STEP_NAME,
remaining_attempts: resolution_throttle.remaining_count,
remaining_attempts: resolution_rate_limiter.remaining_count,
)
end

def idv_failure_log_warning
analytics.idv_doc_auth_warning_visited(
step_name: STEP_NAME,
remaining_attempts: resolution_throttle.remaining_count,
remaining_attempts: resolution_rate_limiter.remaining_count,
)
end

def throttled_url
def rate_limited_url
idv_session_errors_failure_url
end

Expand Down Expand Up @@ -203,7 +203,7 @@ def async_state_done(current_async_state)
)

form_response = form_response.merge(check_ssn) if form_response.success?
summarize_result_and_throttle_failures(form_response)
summarize_result_and_rate_limit_failures(form_response)
delete_async

if form_response.success?
Expand Down Expand Up @@ -231,10 +231,10 @@ def save_threatmetrix_status(form_response)
idv_session.threatmetrix_review_status = review_status
end

def summarize_result_and_throttle_failures(summary_result)
def summarize_result_and_rate_limit_failures(summary_result)
if summary_result.success?
add_proofing_components
ssn_throttle.reset!
ssn_rate_limiter.reset!
else
idv_failure(summary_result)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def pii_from_doc

# copied from doc_auth_controller
def flow_path
flow_session[:flow_path]
idv_session.flow_path || flow_session[:flow_path]
end

private
Expand Down
Loading