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
2 changes: 1 addition & 1 deletion app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def rate_limited_failure
throttle_type: :idv_send_link,
)
message = I18n.t(
'errors.doc_auth.send_link_throttle',
'errors.doc_auth.send_link_limited',
timeout: distance_of_time_in_words(
Time.zone.now,
[rate_limiter.expires_at, Time.zone.now].compact.max,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def webauthn_params

def handle_too_many_confirmation_sends
flash[:error] = t(
'errors.messages.phone_confirmation_throttled',
'errors.messages.phone_confirmation_limited',
timeout: distance_of_time_in_words(
Time.zone.now,
[phone_confirmation_rate_limiter.expires_at, Time.zone.now].compact.max,
Expand Down
2 changes: 1 addition & 1 deletion app/forms/idv/api_image_upload_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def limit_if_rate_limited
return unless document_capture_session
return unless rate_limited?

errors.add(:limit, t('errors.doc_auth.throttled_heading'), type: :throttled)
errors.add(:limit, t('errors.doc_auth.rate_limited_heading'), type: :throttled)
end

def track_rate_limited
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function DocumentCapture({ onStepChange = () => {} }: DocumentCaptureProps) {
pii: submissionError.pii,
})(ReviewIssuesStep)
: ReviewIssuesStep,
title: t('errors.doc_auth.throttled_heading'),
title: t('errors.doc_auth.rate_limited_heading'),
},
] as FormStep[]
).concat(inPersonSteps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function ReviewIssuesStep({
return (
<>
<Warning
heading={t('errors.doc_auth.throttled_heading')}
heading={t('errors.doc_auth.rate_limited_heading')}
actionText={t('idv.failure.button.warning')}
actionOnClick={onWarningPageDismissed}
location="doc_auth_review_issues"
Expand Down Expand Up @@ -137,7 +137,7 @@ function ReviewIssuesStep({

return (
<Warning
heading={t('errors.doc_auth.throttled_heading')}
heading={t('errors.doc_auth.rate_limited_heading')}
actionText={t('idv.failure.button.try_online')}
actionOnClick={onWarningPageDismissed}
location="doc_auth_review_issues"
Expand All @@ -150,7 +150,7 @@ function ReviewIssuesStep({
/>
}
>
<h2>{t('errors.doc_auth.throttled_subheading')}</h2>
<h2>{t('errors.doc_auth.rate_limited_subheading')}</h2>
{!!unknownFieldErrors &&
unknownFieldErrors
.filter((error) => !['front', 'back'].includes(error.field!))
Expand Down
2 changes: 1 addition & 1 deletion app/services/idv/steps/doc_auth_base_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def rate_limited_response
redirect_to rate_limited_url
DocAuth::Response.new(
success: false,
errors: { limit: I18n.t('errors.doc_auth.throttled_heading') },
errors: { limit: I18n.t('errors.doc_auth.rate_limited_heading') },
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/gpo_verify/throttled.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p>
<%= t(
'errors.verify_profile.throttled',
'errors.verify_profile.rate_limited',
timeout: distance_of_time_in_words(
Time.zone.now,
[@expires_at, Time.zone.now].compact.max,
Expand Down
4 changes: 2 additions & 2 deletions app/views/idv/session_errors/throttled.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= render(
'idv/shared/error',
heading: t('errors.doc_auth.throttled_heading'),
heading: t('errors.doc_auth.rate_limited_heading'),
options: [
{
url: MarketingSite.contact_url,
Expand All @@ -11,7 +11,7 @@
) do %>
<p>
<%= t(
'errors.doc_auth.throttled_text_html',
'errors.doc_auth.rate_limited_text_html',
timeout: distance_of_time_in_words(
Time.zone.now,
[@expires_at, Time.zone.now].compact.max,
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/verify_personal_key/throttled.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p>
<%= t(
'errors.verify_personal_key.throttled',
'errors.verify_personal_key.rate_limited',
timeout: distance_of_time_in_words(
Time.zone.now,
[@expires_at, Time.zone.now].compact.max,
Expand Down
16 changes: 8 additions & 8 deletions config/locales/errors/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ en:
document_capture_cancelled: You have cancelled uploading photos of your ID on your phone.
phone_step_incomplete: You must go to your phone and upload photos of your ID
before continuing. We sent you a link with instructions.
send_link_throttle: You tried too many times, please try again in %{timeout}.
You can also go back and choose to use your computer instead.
throttled_heading: We couldn’t verify your ID
throttled_subheading: Try taking new pictures
throttled_text_html: 'For your security, we limit the number of times you can
rate_limited_heading: We couldn’t verify your ID
rate_limited_subheading: Try taking new pictures
rate_limited_text_html: 'For your security, we limit the number of times you can
attempt to verify a document online. <strong>Try again in
%{timeout}.</strong>'
send_link_limited: You tried too many times, please try again in %{timeout}. You
can also go back and choose to use your computer instead.
general: Oops, something went wrong. Please try again.
invalid_totp: Invalid code. Please try again.
max_password_attempts_reached: You’ve entered too many incorrect passwords. You
Expand Down Expand Up @@ -71,7 +71,7 @@ en:
personal_key_incorrect: Incorrect personal key
phone_carrier: Sorry, we are unable to support that phone carrier at this time.
Please select a different number and try again.
phone_confirmation_throttled: You tried too many times, please try again in %{timeout}.
phone_confirmation_limited: You tried too many times, please try again in %{timeout}.
phone_duplicate: This account is already using the phone number you entered as
an authenticator. Please use a different phone number.
phone_required: Phone number is required
Expand Down Expand Up @@ -110,9 +110,9 @@ en:
must_select_additional_option: Select an additional authentication method.
must_select_option: Select an authentication method.
verify_personal_key:
throttled: You tried too many times, please try again in %{timeout}.
rate_limited: You tried too many times, please try again in %{timeout}.
verify_profile:
throttled: You tried too many times, please try again in %{timeout}.
rate_limited: You tried too many times, please try again in %{timeout}.
webauthn_platform_setup:
account_setup_error: We were unable to add face or touch unlock. Please try again or %{link}.
already_registered: Face or touch unlock is already registered on this device.
Expand Down
18 changes: 9 additions & 9 deletions config/locales/errors/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ es:
document_capture_cancelled: Ha cancelado la carga de fotos de su identificación en este teléfono.
phone_step_incomplete: Debe ir a su teléfono y cargar fotos de su identificación
antes de continuar. Te enviamos un enlace con instrucciones.
send_link_throttle: Ha intentado demasiadas veces, por favor, inténtelo de nuevo
rate_limited_heading: No pudimos verificar la identificación
rate_limited_subheading: Intente tomar nuevas fotografías.
rate_limited_text_html: 'Por su seguridad, limitamos el número de veces que
puede intentar verificar un documento en línea. <strong>Inténtelo de
nuevo en %{timeout}.</strong>'
send_link_limited: Ha intentado demasiadas veces, por favor, inténtelo de nuevo
en %{timeout}. También puede retroceder y elegir utilizar su computadora
como alternativa.
throttled_heading: No pudimos verificar la identificación
throttled_subheading: Intente tomar nuevas fotografías.
throttled_text_html: 'Por su seguridad, limitamos el número de veces que puede
intentar verificar un documento en línea. <strong>Inténtelo de nuevo en
%{timeout}.</strong>'
general: '¡Oops! Algo salió mal. Inténtelo de nuevo.'
invalid_totp: El código es inválido. Vuelva a intentarlo.
max_password_attempts_reached: Ha ingresado demasiadas contraseñas incorrectas.
Expand Down Expand Up @@ -75,7 +75,7 @@ es:
personal_key_incorrect: La clave personal es incorrecta
phone_carrier: Lo sentimos, no podemos admitir ese operador telefónico en este
momento. Por favor, seleccione un número diferente e inténtelo de nuevo.
phone_confirmation_throttled: Lo intentaste muchas veces, vuelve a intentarlo en %{timeout}.
phone_confirmation_limited: Lo intentaste muchas veces, vuelve a intentarlo en %{timeout}.
phone_duplicate: Esta cuenta ya está utilizando el número de teléfono que
ingresó como autenticador. Por favor, use un número de teléfono
diferente.
Expand Down Expand Up @@ -116,9 +116,9 @@ es:
must_select_additional_option: Seleccione un método de autenticación adicional.
must_select_option: Seleccione un método de autenticación.
verify_personal_key:
throttled: Lo intentaste muchas veces, vuelve a intentarlo en %{timeout}.
rate_limited: Lo intentaste muchas veces, vuelve a intentarlo en %{timeout}.
verify_profile:
throttled: Lo intentaste muchas veces, vuelve a intentarlo en %{timeout}.
rate_limited: Lo intentaste muchas veces, vuelve a intentarlo en %{timeout}.
webauthn_platform_setup:
account_setup_error: No pudimos agregar el desbloqueo con la cara o con la
huella digital. Inténtelo de nuevo o %{link}.
Expand Down
18 changes: 9 additions & 9 deletions config/locales/errors/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ fr:
phone_step_incomplete: Vous devez aller sur votre téléphone et télécharger des
photos de votre identifiant avant de continuer. Nous vous avons envoyé
un lien avec des instructions.
send_link_throttle: Vous avez essayé trop de fois, veuillez réessayer dans
%{timeout}. Vous pouvez également revenir en arrière et choisir
d’utiliser votre ordinateur à la place.
throttled_heading: Nous n’avons pas pu vérifier votre identité
throttled_subheading: Essayez de prendre de nouvelles photos.
throttled_text_html: 'Pour votre sécurité, nous limitons le nombre de fois où
rate_limited_heading: Nous n’avons pas pu vérifier votre identité
rate_limited_subheading: Essayez de prendre de nouvelles photos.
rate_limited_text_html: 'Pour votre sécurité, nous limitons le nombre de fois où
vous pouvez tenter de vérifier un document en ligne. <strong>Veuillez
réessayer dans %{timeout}.</strong>'
send_link_limited: Vous avez essayé trop de fois, veuillez réessayer dans
%{timeout}. Vous pouvez également revenir en arrière et choisir
d’utiliser votre ordinateur à la place.
general: Oups, une erreur s’est produite. Veuillez essayer de nouveau.
invalid_totp: Code non valide. Veuillez essayer de nouveau.
max_password_attempts_reached: Vous avez inscrit des mots de passe incorrects un
Expand Down Expand Up @@ -83,7 +83,7 @@ fr:
phone_carrier: Nous nous excusons, car nous ne pouvons pas prendre en charge cet
opérateur téléphonique pour le moment. Veuillez sélectionner un autre
numéro puis réessayer.
phone_confirmation_throttled: Vous avez essayé plusieurs fois, essayez à nouveau dans %{timeout}.
phone_confirmation_limited: Vous avez essayé plusieurs fois, essayez à nouveau dans %{timeout}.
phone_duplicate: Ce compte utilise déjà le numéro de téléphone que vous avez
entré en tant qu’authentificateur. Veuillez utiliser un numéro de
téléphone différent.
Expand Down Expand Up @@ -126,9 +126,9 @@ fr:
must_select_additional_option: Sélectionnez une méthode d’authentification supplémentaire.
must_select_option: Sélectionnez une méthode d’authentification.
verify_personal_key:
throttled: Vous avez essayé plusieurs fois, essayez à nouveau dans %{timeout}.
rate_limited: Vous avez essayé plusieurs fois, essayez à nouveau dans %{timeout}.
verify_profile:
throttled: Vous avez essayé plusieurs fois, essayez à nouveau dans %{timeout}.
rate_limited: Vous avez essayé plusieurs fois, essayez à nouveau dans %{timeout}.
webauthn_platform_setup:
account_setup_error: Nous n’avons pas pu ajouter le déverrouillage facial ni le
déverrouillage tactile. Veuillez réessayer ou %{link}.
Expand Down
4 changes: 2 additions & 2 deletions config/locales/telephony/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ en:
invalid_phone_number: The phone number entered is not valid.
opt_out: The phone number entered has opted out of text messages.
permanent_failure: The phone number entered is not valid.
rate_limited: That number is experiencing high message volume. Please try again
later.
sms_unsupported: The phone number entered doesn’t support text messaging. Try
the Phone call option.
temporary_failure: We are experiencing technical difficulties. Please try again later.
throttled: That number is experiencing high message volume. Please try again
later.
timeout: The server took too long to respond. Please try again.
unknown_failure: We are experiencing technical difficulties. Please try again later.
voice_unsupported: Invalid phone number. Check that you’ve entered the correct
Expand Down
4 changes: 2 additions & 2 deletions config/locales/telephony/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ es:
opt_out: El número de teléfono ingresado ha sido excluido de los mensajes de
texto.
permanent_failure: El número de teléfono ingresado no es válido.
rate_limited: Ese número está experimentando un alto volumen de mensajes. Por
favor, inténtelo de nuevo más tarde.
sms_unsupported: El número de teléfono ingresado no admite mensajes de texto.
Pruebe la opción de llamada telefónica.
temporary_failure: Estamos experimentando dificultades técnicas. Por favor,
inténtelo de nuevo más tarde.
throttled: Ese número está experimentando un alto volumen de mensajes. Por
favor, inténtelo de nuevo más tarde.
timeout: El servidor tardó demasiado en responder. Inténtalo de nuevo.
unknown_failure: Estamos experimentando dificultades técnicas. Por favor,
inténtelo de nuevo más tarde.
Expand Down
4 changes: 2 additions & 2 deletions config/locales/telephony/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ fr:
invalid_phone_number: Le numéro de téléphone saisi n’est pas valide.
opt_out: Le numéro de téléphone entré a désactivé les messages texte.
permanent_failure: Le numéro de téléphone entré n’est pas valide.
rate_limited: Ce nombre connaît un volume de messages élevé. Veuillez réessayer
plus tard.
sms_unsupported: Le numéro de téléphone saisi ne prend pas en charge les
messages textuels. Veuillez essayer l’option d’appel téléphonique.
temporary_failure: Nous rencontrons des difficultés techniques. Veuillez
réessayer plus tard.
throttled: Ce nombre connaît un volume de messages élevé. Veuillez réessayer
plus tard.
timeout: Le serveur a pris trop de temps pour répondre. Veuillez réessayer.
unknown_failure: Nous rencontrons des difficultés techniques. Veuillez réessayer
plus tard.
Expand Down
6 changes: 3 additions & 3 deletions lib/telephony/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def friendly_error_message_key
end
end

class ThrottledError < TelephonyError
class RateLimitedError < TelephonyError
def friendly_error_message_key
# i18n-tasks-use t('telephony.error.friendly_message.throttled')
'telephony.error.friendly_message.throttled'
# i18n-tasks-use t('telephony.error.friendly_message.rate_limited')
'telephony.error.friendly_message.rate_limited'
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/telephony/pinpoint/sms_sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SmsSender
'OPT_OUT' => OptOutError,
'PERMANENT_FAILURE' => PermanentFailureError,
'TEMPORARY_FAILURE' => TemporaryFailureError,
'THROTTLED' => ThrottledError,
'THROTTLED' => RateLimitedError,
'TIMEOUT' => TimeoutError,
'UNKNOWN_FAILURE' => UnknownFailureError,
}.freeze
Expand Down
2 changes: 1 addition & 1 deletion lib/telephony/pinpoint/voice_sender.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def handle_pinpoint_error(err)

error_message = "#{err.class}: #{err.message}"
error_class = if err.is_a? Aws::PinpointSMSVoice::Errors::LimitExceededException
Telephony::ThrottledError
Telephony::RateLimitedError
elsif err.is_a? Aws::PinpointSMSVoice::Errors::TooManyRequestsException
Telephony::DailyLimitReachedError
else
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/idv/image_uploads_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@
'IdV: doc auth image upload form submitted',
success: false,
errors: {
limit: [I18n.t('errors.doc_auth.throttled_heading')],
limit: [I18n.t('errors.doc_auth.rate_limited_heading')],
},
error_details: {
limit: [I18n.t('errors.doc_auth.throttled_heading')],
limit: [I18n.t('errors.doc_auth.rate_limited_heading')],
},
user_id: user.uuid,
attempts: IdentityConfig.store.doc_auth_max_attempts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def index

expect(flash[:error]).to eq(
I18n.t(
'errors.messages.phone_confirmation_throttled',
'errors.messages.phone_confirmation_limited',
timeout: timeout,
),
)
Expand Down Expand Up @@ -676,7 +676,7 @@ def index

expect(flash[:error]).to eq(
I18n.t(
'errors.messages.phone_confirmation_throttled',
'errors.messages.phone_confirmation_limited',
timeout: timeout,
),
)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/document_capture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
timeout = distance_of_time_in_words(
RateLimiter.attempt_window_in_minutes(:idv_doc_auth).minutes,
)
message = strip_tags(t('errors.doc_auth.throttled_text_html', timeout: timeout))
message = strip_tags(t('errors.doc_auth.rate_limited_text_html', timeout: timeout))
expect(page).to have_content(message)
expect(page).to have_current_path(idv_session_errors_throttled_path)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/idv/doc_auth/hybrid_handoff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
freeze_time do
idv_send_link_max_attempts.times do
expect(page).to_not have_content(
I18n.t('errors.doc_auth.send_link_throttle', timeout: timeout),
I18n.t('errors.doc_auth.send_link_limited', timeout: timeout),
)

fill_in :doc_auth_phone, with: '415-555-0199'
Expand All @@ -161,7 +161,7 @@
expect(page).to have_current_path(idv_hybrid_handoff_path, ignore_query: true)
expect(page).to have_content(
I18n.t(
'errors.doc_auth.send_link_throttle',
'errors.doc_auth.send_link_limited',
timeout: timeout,
),
)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/users/sign_up_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
# whether it says '9 minutes' or '10 minutes' depends on how
# slowly the test runs.
throttled_message = I18n.t(
'errors.messages.phone_confirmation_throttled',
'errors.messages.phone_confirmation_limited',
timeout: '(10|9) minutes',
)

Expand Down
2 changes: 1 addition & 1 deletion spec/forms/idv/api_image_upload_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
form.submit

expect(form.valid?).to eq(false)
expect(form.errors[:limit]).to eq([I18n.t('errors.doc_auth.throttled_heading')])
expect(form.errors[:limit]).to eq([I18n.t('errors.doc_auth.rate_limited_heading')])
end
end
end
Expand Down
Loading