From 732f2de342ffa37f092003642910a5930472cd9f Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 5 Oct 2023 12:31:56 -0500 Subject: [PATCH 01/11] fix otp missing translations --- app/forms/otp_verification_form.rb | 10 ++-------- .../otp_verification_controller_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/forms/otp_verification_form.rb b/app/forms/otp_verification_form.rb index 88ad6f34a80..5ed03160791 100644 --- a/app/forms/otp_verification_form.rb +++ b/app/forms/otp_verification_form.rb @@ -1,8 +1,7 @@ class OtpVerificationForm include ActiveModel::Model - validates :code, presence: true - validate :validate_code_length + validates :code, presence: true, length: { is: TwoFactorAuthenticatable::DIRECT_OTP_LENGTH } validate :validate_code_matches_format validate :validate_user_otp_presence validate :validate_user_otp_expiration @@ -31,11 +30,6 @@ def submit attr_reader :code, :user, :phone_configuration - def validate_code_length - return if code.blank? || code.size == TwoFactorAuthenticatable::DIRECT_OTP_LENGTH - errors.add(:code, :incorrect_length, type: :incorrect_length) - end - def validate_code_matches_format return if code.blank? || code.match?(/^[0-9]+/i) errors.add(:code, :pattern_mismatch, type: :pattern_mismatch) @@ -55,7 +49,7 @@ def validate_code_equals_user_otp return if code.blank? || user.direct_otp.blank? || ActiveSupport::SecurityUtils.secure_compare(user.direct_otp, code) - errors.add(:code, :incorrect, type: :incorrect) + errors.add(:code, :invalid, type: :invalid) end def otp_expired? diff --git a/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb b/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb index 3ee0b6446dd..65bb89934e7 100644 --- a/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb +++ b/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb @@ -133,7 +133,7 @@ properties = { success: false, - error_details: { code: [:incorrect_length, :incorrect] }, + error_details: { code: [:wrong_length, :invalid] }, confirmation_for_add_phone: false, context: 'authentication', multi_factor_auth_method: 'sms', @@ -204,7 +204,7 @@ properties = { success: false, - error_details: { code: [:incorrect_length, :incorrect] }, + error_details: { code: [:wrong_length, :invalid] }, confirmation_for_add_phone: false, context: 'authentication', multi_factor_auth_method: 'sms', @@ -546,7 +546,7 @@ properties = { success: false, errors: nil, - error_details: { code: [:incorrect_length, :incorrect] }, + error_details: { code: [:wrong_length, :invalid] }, confirmation_for_add_phone: true, context: 'confirmation', multi_factor_auth_method: 'sms', From f13a2253f572000026cf6c31835d9182727bb2b5 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 5 Oct 2023 12:33:34 -0500 Subject: [PATCH 02/11] rails 7.1 changelog: Internal, Dependencies, Upgrade to Rails 7.1 --- Gemfile | 2 +- Gemfile.lock | 162 ++++++++++++++++-------------- config/application.rb | 1 - config/environments/production.rb | 2 +- 4 files changed, 91 insertions(+), 76 deletions(-) diff --git a/Gemfile b/Gemfile index ec26b54fad6..09bd371c97a 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" } ruby "~> #{File.read(File.join(__dir__, '.ruby-version')).strip}" -gem 'rails', '~> 7.0.0' +gem 'rails', '~> 7.1.0' gem 'activerecord-postgis-adapter' gem 'ahoy_matey', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 8e3e2ab218a..7a6a22bd62c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,73 +60,78 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.7.2) - actionpack (= 7.0.7.2) - activesupport (= 7.0.7.2) + actioncable (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.7.2) - actionpack (= 7.0.7.2) - activejob (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + zeitwerk (~> 2.6) + actionmailbox (7.1.0) + actionpack (= 7.1.0) + activejob (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.7.2) - actionpack (= 7.0.7.2) - actionview (= 7.0.7.2) - activejob (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionmailer (7.1.0) + actionpack (= 7.1.0) + actionview (= 7.1.0) + activejob (= 7.1.0) + activesupport (= 7.1.0) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.7.2) - actionview (= 7.0.7.2) - activesupport (= 7.0.7.2) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.0) + actionview (= 7.1.0) + activesupport (= 7.1.0) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.7.2) - actionpack (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.0) + actionpack (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.7.2) - activesupport (= 7.0.7.2) + actionview (7.1.0) + activesupport (= 7.1.0) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.7.2) - activesupport (= 7.0.7.2) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.0) + activesupport (= 7.1.0) globalid (>= 0.3.6) - activemodel (7.0.7.2) - activesupport (= 7.0.7.2) - activerecord (7.0.7.2) - activemodel (= 7.0.7.2) - activesupport (= 7.0.7.2) - activerecord-postgis-adapter (8.0.2) - activerecord (~> 7.0.0) - rgeo-activerecord (~> 7.0.0) - activestorage (7.0.7.2) - actionpack (= 7.0.7.2) - activejob (= 7.0.7.2) - activerecord (= 7.0.7.2) - activesupport (= 7.0.7.2) + activemodel (7.1.0) + activesupport (= 7.1.0) + activerecord (7.1.0) + activemodel (= 7.1.0) + activesupport (= 7.1.0) + timeout (>= 0.4.0) + activestorage (7.1.0) + actionpack (= 7.1.0) + activejob (= 7.1.0) + activerecord (= 7.1.0) + activesupport (= 7.1.0) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.7.2) + activesupport (7.1.0) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) @@ -185,6 +190,7 @@ GEM thread_safe (~> 0.3, >= 0.3.1) barby (0.6.8) base32-crockford (0.1.0) + base64 (0.1.1) bcrypt (3.1.16) benchmark-ips (2.12.0) better_errors (2.10.1) @@ -198,13 +204,14 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties + bigdecimal (3.1.4) bindata (2.4.14) bootsnap (1.16.0) msgpack (~> 1.2) brakeman (6.0.1) browser (5.3.1) builder (3.2.4) - bullet (7.0.7) + bullet (7.1.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) bundler-audit (0.9.1) @@ -231,7 +238,7 @@ GEM coercible (1.0.0) descendants_tracker (~> 0.0.1) concurrent-ruby (1.2.2) - connection_pool (2.4.0) + connection_pool (2.4.1) cose (1.3.0) cbor (~> 0.5.9) openssl-signature_algorithm (~> 1.0) @@ -270,6 +277,8 @@ GEM dotiw (5.3.2) activesupport i18n + drb (2.1.1) + ruby2_keywords dumb_delegator (1.0.0) email_spec (2.2.2) htmlentities (~> 4.3.3) @@ -398,7 +407,8 @@ GEM minitest (5.20.0) msgpack (1.7.2) multiset (0.5.3) - net-imap (0.3.7) + mutex_m (0.1.2) + net-imap (0.4.0) date net-protocol net-pop (0.1.2) @@ -407,7 +417,7 @@ GEM timeout net-sftp (3.0.0) net-ssh (>= 5.0.0, < 7.0.0) - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol net-ssh (6.1.0) newrelic_rpm (9.5.0) @@ -442,7 +452,7 @@ GEM activesupport (>= 7.0.0) rack railties (>= 7.0.0) - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.10.1) @@ -469,26 +479,31 @@ GEM rack (>= 1.2.0) rack-proxy (0.7.4) rack + rack-session (1.0.1) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) rack-timeout (0.6.0) rack_session_access (0.2.0) builder (>= 2.0.0) rack (>= 1.0.0) - rails (7.0.7.2) - actioncable (= 7.0.7.2) - actionmailbox (= 7.0.7.2) - actionmailer (= 7.0.7.2) - actionpack (= 7.0.7.2) - actiontext (= 7.0.7.2) - actionview (= 7.0.7.2) - activejob (= 7.0.7.2) - activemodel (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.0) + actioncable (= 7.1.0) + actionmailbox (= 7.1.0) + actionmailer (= 7.1.0) + actionpack (= 7.1.0) + actiontext (= 7.1.0) + actionview (= 7.1.0) + activejob (= 7.1.0) + activemodel (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) bundler (>= 1.15.0) - railties (= 7.0.7.2) + railties (= 7.1.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -503,13 +518,14 @@ GEM rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.7.2) - actionpack (= 7.0.7.2) - activesupport (= 7.0.7.2) - method_source + railties (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.2) @@ -783,7 +799,7 @@ DEPENDENCIES rack-test (>= 1.1.0) rack-timeout rack_session_access (>= 0.2.0) - rails (~> 7.0.0) + rails (~> 7.1.0) rails-controller-testing (>= 1.0.4) redacted_struct redis (>= 3.2.0) diff --git a/config/application.rb b/config/application.rb index 00ac6b48093..efb9e11c73f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -56,7 +56,6 @@ class Application < Rails::Application config.load_defaults '7.0' config.active_record.belongs_to_required_by_default = false - config.active_record.legacy_connection_handling = false config.active_job.queue_adapter = :good_job FileUtils.mkdir_p(Rails.root.join('log')) diff --git a/config/environments/production.rb b/config/environments/production.rb index a586dd41076..5ab38b27dfd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,6 +1,6 @@ Rails.application.configure do config.cache_classes = true - config.cache_store = :redis_cache_store, { url: IdentityConfig.store.redis_url } + config.cache_store = :redis_cache_store, { url: IdentityConfig.store.redis_url, pool: false } config.eager_load = true config.consider_all_requests_local = false config.action_controller.perform_caching = true From 662535a329f4402076403cdf98e3b0490695c2ac Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 5 Oct 2023 12:51:38 -0500 Subject: [PATCH 03/11] fix untranslated webauthn verification --- Gemfile | 2 +- Gemfile.lock | 7 +++++-- app/forms/otp_verification_form.rb | 13 ++++++++----- app/forms/webauthn_verification_form.rb | 2 +- app/jobs/risc_delivery_job.rb | 4 ++-- config/i18n-tasks.yml | 2 ++ config/initializers/rack_attack.rb | 1 + config/locales/datetime/en.yml | 2 ++ config/locales/datetime/es.yml | 2 ++ config/locales/datetime/fr.yml | 2 ++ lib/identity_job_log_subscriber.rb | 4 ++-- .../otp_verification_controller_spec.rb | 6 +++--- .../webauthn_verification_controller_spec.rb | 2 +- spec/forms/otp_verification_form_spec.rb | 10 +++++----- spec/forms/webauthn_verification_form_spec.rb | 12 ++++++------ spec/i18n_spec.rb | 4 ++++ spec/jobs/usps_auth_token_refresh_job_spec.rb | 5 ++++- .../usps_in_person_proofing/proofer_spec.rb | 5 ++++- spec/views/users/totp_setup/new.html.erb_spec.rb | 2 +- 19 files changed, 56 insertions(+), 31 deletions(-) diff --git a/Gemfile b/Gemfile index 09bd371c97a..474074b6521 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ ruby "~> #{File.read(File.join(__dir__, '.ruby-version')).strip}" gem 'rails', '~> 7.1.0' -gem 'activerecord-postgis-adapter' +gem 'activerecord-postgis-adapter', '~> 9.0' gem 'ahoy_matey', '~> 3.0' gem 'aws-sdk-kms', '~> 1.4' gem 'aws-sdk-cloudwatchlogs', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 7a6a22bd62c..e3af5597577 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,6 +117,9 @@ GEM activemodel (= 7.1.0) activesupport (= 7.1.0) timeout (>= 0.4.0) + activerecord-postgis-adapter (9.0.1) + activerecord (~> 7.1.0) + rgeo-activerecord (~> 7.0.0) activestorage (7.1.0) actionpack (= 7.1.0) activejob (= 7.1.0) @@ -723,7 +726,7 @@ PLATFORMS ruby DEPENDENCIES - activerecord-postgis-adapter + activerecord-postgis-adapter (~> 9.0) ahoy_matey (~> 3.0) aws-sdk-cloudwatchlogs aws-sdk-kms (~> 1.4) @@ -846,4 +849,4 @@ RUBY VERSION ruby 3.2.2p53 BUNDLED WITH - 2.4.4 + 2.4.20 diff --git a/app/forms/otp_verification_form.rb b/app/forms/otp_verification_form.rb index 5ed03160791..8a5a5efd490 100644 --- a/app/forms/otp_verification_form.rb +++ b/app/forms/otp_verification_form.rb @@ -1,6 +1,9 @@ +# frozen_string_literal: true + class OtpVerificationForm include ActiveModel::Model + CODE_REGEX = /\A[0-9]+\z/ validates :code, presence: true, length: { is: TwoFactorAuthenticatable::DIRECT_OTP_LENGTH } validate :validate_code_matches_format validate :validate_user_otp_presence @@ -31,25 +34,25 @@ def submit attr_reader :code, :user, :phone_configuration def validate_code_matches_format - return if code.blank? || code.match?(/^[0-9]+/i) - errors.add(:code, :pattern_mismatch, type: :pattern_mismatch) + return if code.blank? || code.match?(CODE_REGEX) + errors.add(:code, 'pattern_mismatch', type: :pattern_mismatch) end def validate_user_otp_presence return if user.direct_otp.present? - errors.add(:code, :user_otp_missing, type: :user_otp_missing) + errors.add(:code, 'user_otp_missing', type: :user_otp_missing) end def validate_user_otp_expiration return if !otp_expired? - errors.add(:code, :user_otp_expired, type: :user_otp_expired) + errors.add(:code, 'user_otp_expired', type: :user_otp_expired) end def validate_code_equals_user_otp return if code.blank? || user.direct_otp.blank? || ActiveSupport::SecurityUtils.secure_compare(user.direct_otp, code) - errors.add(:code, :invalid, type: :invalid) + errors.add(:code, 'incorrect', type: :incorrect) end def otp_expired? diff --git a/app/forms/webauthn_verification_form.rb b/app/forms/webauthn_verification_form.rb index 70a6a49b9e5..fa51beca58a 100644 --- a/app/forms/webauthn_verification_form.rb +++ b/app/forms/webauthn_verification_form.rb @@ -64,7 +64,7 @@ def self.domain_name def validate_assertion_response return if webauthn_error.present? || webauthn_configuration.blank? || valid_assertion_response? - errors.add(:authenticator_data, :invalid_authenticator_data, type: :invalid_authenticator_data) + errors.add(:authenticator_data, 'invalid_authenticator_data', type: :invalid_authenticator_data) end def validate_webauthn_error diff --git a/app/jobs/risc_delivery_job.rb b/app/jobs/risc_delivery_job.rb index feffaceea2e..28aa6379957 100644 --- a/app/jobs/risc_delivery_job.rb +++ b/app/jobs/risc_delivery_job.rb @@ -10,11 +10,11 @@ class RiscDeliveryJob < ApplicationJob retry_on( *NETWORK_ERRORS, - wait: :exponentially_longer, + wait: :polynomially_longer, attempts: 2, ) retry_on RedisRateLimiter::LimitError, - wait: :exponentially_longer, + wait: :polynomially_longer, attempts: 10 def self.warning_error_classes diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index cc22f286a0d..1c387b82619 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -100,6 +100,8 @@ ignore_unused: - 'errors.messages.*' - 'simple_form.*' - 'time.*' + - 'datetime.dotiw.words_connector' + - 'datetime.dotiw.last_word_connector' ## Exclude these keys from the `i18n-tasks eq-base' report: # ignore_eq_base: # all: diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index e9614e97124..02cfe6d9707 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -36,6 +36,7 @@ def headers namespace: 'rack-attack', redis: REDIS_THROTTLE_POOL, expires_in: 2.weeks.to_i, + pool: false, ) ### Configure Safelisting ### diff --git a/config/locales/datetime/en.yml b/config/locales/datetime/en.yml index be3ed892d61..acee87fb95c 100644 --- a/config/locales/datetime/en.yml +++ b/config/locales/datetime/en.yml @@ -2,6 +2,7 @@ en: datetime: dotiw: + last_word_connector: ' and ' minutes: one: 1 minute other: '%{count} minutes' @@ -9,3 +10,4 @@ en: one: 1 second other: '%{count} seconds' two_words_connector: ' and ' + words_connector: ', ' diff --git a/config/locales/datetime/es.yml b/config/locales/datetime/es.yml index c25f25c573d..bf504fd8cfd 100644 --- a/config/locales/datetime/es.yml +++ b/config/locales/datetime/es.yml @@ -2,6 +2,7 @@ es: datetime: dotiw: + last_word_connector: ' y ' minutes: one: un minuto other: '%{count} minutos' @@ -9,3 +10,4 @@ es: one: un segundo other: '%{count} segundos' two_words_connector: ' y ' + words_connector: ', ' diff --git a/config/locales/datetime/fr.yml b/config/locales/datetime/fr.yml index 1e89198f741..c3bceb566b2 100644 --- a/config/locales/datetime/fr.yml +++ b/config/locales/datetime/fr.yml @@ -2,6 +2,7 @@ fr: datetime: dotiw: + last_word_connector: ' et ' minutes: one: 1 minute other: '%{count} minutes' @@ -9,3 +10,4 @@ fr: one: 1 seconde other: '%{count} secondes' two_words_connector: ' et ' + words_connector: ', ' diff --git a/lib/identity_job_log_subscriber.rb b/lib/identity_job_log_subscriber.rb index 53e7d9b6635..b7eeb3b9682 100644 --- a/lib/identity_job_log_subscriber.rb +++ b/lib/identity_job_log_subscriber.rb @@ -186,11 +186,11 @@ def queue_name(event) def queued_duration(job) return if job.enqueued_at.blank? - (Time.zone.now - Time.zone.parse(job.enqueued_at)).in_milliseconds + (Time.zone.now - job.enqueued_at).in_milliseconds end def scheduled_at(event) - Time.zone.at(event.payload[:job].scheduled_at).utc + event.payload[:job].scheduled_at.utc end def trace_id(job) diff --git a/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb b/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb index 65bb89934e7..f62578349b0 100644 --- a/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb +++ b/spec/controllers/two_factor_authentication/otp_verification_controller_spec.rb @@ -133,7 +133,7 @@ properties = { success: false, - error_details: { code: [:wrong_length, :invalid] }, + error_details: { code: [:wrong_length, 'incorrect'] }, confirmation_for_add_phone: false, context: 'authentication', multi_factor_auth_method: 'sms', @@ -204,7 +204,7 @@ properties = { success: false, - error_details: { code: [:wrong_length, :invalid] }, + error_details: { code: [:wrong_length, 'incorrect'] }, confirmation_for_add_phone: false, context: 'authentication', multi_factor_auth_method: 'sms', @@ -546,7 +546,7 @@ properties = { success: false, errors: nil, - error_details: { code: [:wrong_length, :invalid] }, + error_details: { code: [:wrong_length, 'incorrect'] }, confirmation_for_add_phone: true, context: 'confirmation', multi_factor_auth_method: 'sms', diff --git a/spec/controllers/two_factor_authentication/webauthn_verification_controller_spec.rb b/spec/controllers/two_factor_authentication/webauthn_verification_controller_spec.rb index 1152a33361c..5fd496581a1 100644 --- a/spec/controllers/two_factor_authentication/webauthn_verification_controller_spec.rb +++ b/spec/controllers/two_factor_authentication/webauthn_verification_controller_spec.rb @@ -223,7 +223,7 @@ result = { context: 'authentication', multi_factor_auth_method: 'webauthn', success: false, - error_details: { authenticator_data: [:invalid_authenticator_data] }, + error_details: { authenticator_data: ['invalid_authenticator_data'] }, webauthn_configuration_id: webauthn_configuration.id, multi_factor_auth_method_created_at: webauthn_configuration.created_at. strftime('%s%L') } diff --git a/spec/forms/otp_verification_form_spec.rb b/spec/forms/otp_verification_form_spec.rb index aa8a1de1bc1..c4ec4fdd12c 100644 --- a/spec/forms/otp_verification_form_spec.rb +++ b/spec/forms/otp_verification_form_spec.rb @@ -45,7 +45,7 @@ expect(result.to_h).to eq( success: false, error_details: { - code: [:blank], + code: [:blank, :wrong_length], }, multi_factor_auth_method: 'otp_code', multi_factor_auth_method_created_at: phone_configuration.created_at.strftime('%s%L'), @@ -67,7 +67,7 @@ expect(result.to_h).to eq( success: false, error_details: { - code: [:user_otp_missing], + code: ['user_otp_missing'], }, multi_factor_auth_method: 'otp_code', multi_factor_auth_method_created_at: phone_configuration.created_at.strftime('%s%L'), @@ -89,7 +89,7 @@ expect(result.to_h).to eq( success: false, error_details: { - code: [:incorrect_length, :incorrect], + code: [:wrong_length, 'incorrect'], }, multi_factor_auth_method: 'otp_code', multi_factor_auth_method_created_at: phone_configuration.created_at.strftime('%s%L'), @@ -111,7 +111,7 @@ expect(result.to_h).to eq( success: false, error_details: { - code: [:pattern_mismatch, :incorrect], + code: ['pattern_mismatch', 'incorrect'], }, multi_factor_auth_method: 'otp_code', multi_factor_auth_method_created_at: phone_configuration.created_at.strftime('%s%L'), @@ -136,7 +136,7 @@ expect(result.to_h).to eq( success: false, error_details: { - code: [:user_otp_expired], + code: ['user_otp_expired'], }, multi_factor_auth_method: 'otp_code', multi_factor_auth_method_created_at: phone_configuration.created_at.strftime('%s%L'), diff --git a/spec/forms/webauthn_verification_form_spec.rb b/spec/forms/webauthn_verification_form_spec.rb index 3dcabd0d7ea..2843d0cd3c4 100644 --- a/spec/forms/webauthn_verification_form_spec.rb +++ b/spec/forms/webauthn_verification_form_spec.rb @@ -83,7 +83,7 @@ success: false, error_details: { challenge: [:blank], - authenticator_data: [:invalid_authenticator_data], + authenticator_data: ['invalid_authenticator_data'], }, multi_factor_auth_method: 'webauthn', webauthn_configuration_id: webauthn_configuration.id, @@ -98,7 +98,7 @@ expect(result.to_h).to eq( success: false, error_details: { - authenticator_data: [:blank, :invalid_authenticator_data], + authenticator_data: [:blank, 'invalid_authenticator_data'], }, multi_factor_auth_method: 'webauthn', webauthn_configuration_id: webauthn_configuration.id, @@ -114,7 +114,7 @@ success: false, error_details: { client_data_json: [:blank], - authenticator_data: [:invalid_authenticator_data], + authenticator_data: ['invalid_authenticator_data'], }, multi_factor_auth_method: 'webauthn', webauthn_configuration_id: webauthn_configuration.id, @@ -130,7 +130,7 @@ success: false, error_details: { signature: [:blank], - authenticator_data: [:invalid_authenticator_data], + authenticator_data: ['invalid_authenticator_data'], }, multi_factor_auth_method: 'webauthn', webauthn_configuration_id: webauthn_configuration.id, @@ -172,7 +172,7 @@ it 'returns unsuccessful result' do expect(result.to_h).to eq( success: false, - error_details: { authenticator_data: [:invalid_authenticator_data] }, + error_details: { authenticator_data: ['invalid_authenticator_data'] }, multi_factor_auth_method: 'webauthn', webauthn_configuration_id: webauthn_configuration.id, ) @@ -188,7 +188,7 @@ it 'returns unsucessful result' do expect(result.to_h).to eq( success: false, - error_details: { authenticator_data: [:invalid_authenticator_data] }, + error_details: { authenticator_data: ['invalid_authenticator_data'] }, multi_factor_auth_method: 'webauthn', webauthn_configuration_id: webauthn_configuration.id, ) diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index babc834a833..5eb08ed6c24 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -29,6 +29,10 @@ class BaseTask { key: 'time.am' }, # "AM" is "AM" in French and Spanish { key: 'time.formats.sms_date' }, # for us date format { key: 'time.pm' }, # "PM" is "PM" in French and Spanish + { key: 'datetime.dotiw.minutes.one' }, # "minute is minute" in French and English + { key: 'datetime.dotiw.minutes.other' }, # "minute is minute" in French and English + { key: 'mailer.logo' }, # "logo is logo" in English, French and Spanish + { key: 'datetime.dotiw.words_connector' }, # " , " is only punctuation and not translated ].freeze def untranslated_keys diff --git a/spec/jobs/usps_auth_token_refresh_job_spec.rb b/spec/jobs/usps_auth_token_refresh_job_spec.rb index e9f4ecc670c..02fb6bd0d6b 100644 --- a/spec/jobs/usps_auth_token_refresh_job_spec.rb +++ b/spec/jobs/usps_auth_token_refresh_job_spec.rb @@ -24,7 +24,10 @@ context 'when using redis as a backing store' do before do |ex| allow(Rails).to receive(:cache).and_return( - ActiveSupport::Cache::RedisCacheStore.new(url: IdentityConfig.store.redis_throttle_url), + ActiveSupport::Cache::RedisCacheStore.new( + url: IdentityConfig.store.redis_throttle_url, + pool: false, + ), ) end diff --git a/spec/services/usps_in_person_proofing/proofer_spec.rb b/spec/services/usps_in_person_proofing/proofer_spec.rb index 36a6f449a8a..1a7e89afc97 100644 --- a/spec/services/usps_in_person_proofing/proofer_spec.rb +++ b/spec/services/usps_in_person_proofing/proofer_spec.rb @@ -78,7 +78,10 @@ def expect_facility_fields_to_be_present(facility) context 'when using redis as a backing store' do before do |ex| allow(Rails).to receive(:cache).and_return( - ActiveSupport::Cache::RedisCacheStore.new(url: IdentityConfig.store.redis_throttle_url), + ActiveSupport::Cache::RedisCacheStore.new( + url: IdentityConfig.store.redis_throttle_url, + pool: false, + ), ) end diff --git a/spec/views/users/totp_setup/new.html.erb_spec.rb b/spec/views/users/totp_setup/new.html.erb_spec.rb index 9f38718b8ae..ee72c928b39 100644 --- a/spec/views/users/totp_setup/new.html.erb_spec.rb +++ b/spec/views/users/totp_setup/new.html.erb_spec.rb @@ -28,7 +28,7 @@ it 'renders the QR code image with useful alt text' do render - page = Capybara.string(rendered) + page = Capybara.string(rendered.html) image_tag = page.find_css('img[src^="/images/qrcode.png"]').first expect(image_tag).to be expect(image_tag['alt']).to eq(I18n.t('image_description.totp_qrcode')) From f353a0dfd721ce0f67951ceb663bb07aebc56c45 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Wed, 11 Oct 2023 17:12:10 -0500 Subject: [PATCH 04/11] update simple_form --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index e3af5597577..095471b94c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -634,7 +634,7 @@ GEM websocket (~> 1.0) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - simple_form (5.1.0) + simple_form (5.3.0) actionpack (>= 5.2) activemodel (>= 5.2) simple_xlsx_reader (5.0.0) From 83317534c66682e666686e3d0867aa0553278019 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Fri, 27 Oct 2023 08:10:33 -0500 Subject: [PATCH 05/11] upgrade to rails 7.1.1 --- Gemfile.lock | 121 ++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 095471b94c9..5c1d484939c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,73 +60,73 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + actioncable (7.1.1) + actionpack (= 7.1.1) + activesupport (= 7.1.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + actionmailbox (7.1.1) + actionpack (= 7.1.1) + activejob (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.0) - actionpack (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activesupport (= 7.1.0) + actionmailer (7.1.1) + actionpack (= 7.1.1) + actionview (= 7.1.1) + activejob (= 7.1.1) + activesupport (= 7.1.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.0) - actionview (= 7.1.0) - activesupport (= 7.1.0) + actionpack (7.1.1) + actionview (= 7.1.1) + activesupport (= 7.1.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.0) - actionpack (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + actiontext (7.1.1) + actionpack (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.0) - activesupport (= 7.1.0) + actionview (7.1.1) + activesupport (= 7.1.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.0) - activesupport (= 7.1.0) + activejob (7.1.1) + activesupport (= 7.1.1) globalid (>= 0.3.6) - activemodel (7.1.0) - activesupport (= 7.1.0) - activerecord (7.1.0) - activemodel (= 7.1.0) - activesupport (= 7.1.0) + activemodel (7.1.1) + activesupport (= 7.1.1) + activerecord (7.1.1) + activemodel (= 7.1.1) + activesupport (= 7.1.1) timeout (>= 0.4.0) activerecord-postgis-adapter (9.0.1) activerecord (~> 7.1.0) rgeo-activerecord (~> 7.0.0) - activestorage (7.1.0) - actionpack (= 7.1.0) - activejob (= 7.1.0) - activerecord (= 7.1.0) - activesupport (= 7.1.0) + activestorage (7.1.1) + actionpack (= 7.1.1) + activejob (= 7.1.1) + activerecord (= 7.1.1) + activesupport (= 7.1.1) marcel (~> 1.0) - activesupport (7.1.0) + activesupport (7.1.1) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -355,8 +355,9 @@ GEM terminal-table (>= 1.5.1) ice_nine (0.11.2) io-console (0.6.0) - irb (1.7.4) - reline (>= 0.3.6) + irb (1.8.3) + rdoc + reline (>= 0.3.8) jmespath (1.6.2) jsbundling-rails (1.1.2) railties (>= 6.0.0) @@ -406,12 +407,12 @@ GEM method_source (1.0.0) mini_histogram (0.3.1) mini_mime (1.1.5) - mini_portile2 (2.8.4) + mini_portile2 (2.8.5) minitest (5.20.0) msgpack (1.7.2) multiset (0.5.3) mutex_m (0.1.2) - net-imap (0.4.0) + net-imap (0.4.2) date net-protocol net-pop (0.1.2) @@ -493,20 +494,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.0) - actioncable (= 7.1.0) - actionmailbox (= 7.1.0) - actionmailer (= 7.1.0) - actionpack (= 7.1.0) - actiontext (= 7.1.0) - actionview (= 7.1.0) - activejob (= 7.1.0) - activemodel (= 7.1.0) - activerecord (= 7.1.0) - activestorage (= 7.1.0) - activesupport (= 7.1.0) + rails (7.1.1) + actioncable (= 7.1.1) + actionmailbox (= 7.1.1) + actionmailer (= 7.1.1) + actionpack (= 7.1.1) + actiontext (= 7.1.1) + actionview (= 7.1.1) + activejob (= 7.1.1) + activemodel (= 7.1.1) + activerecord (= 7.1.1) + activestorage (= 7.1.1) + activesupport (= 7.1.1) bundler (>= 1.15.0) - railties (= 7.1.0) + railties (= 7.1.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -521,9 +522,9 @@ GEM rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.0) - actionpack (= 7.1.0) - activesupport (= 7.1.0) + railties (7.1.1) + actionpack (= 7.1.1) + activesupport (= 7.1.1) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -534,6 +535,8 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) + rdoc (6.5.0) + psych (>= 4.0.0) redacted_struct (1.1.0) redcarpet (3.6.0) redis (5.0.6) @@ -541,7 +544,7 @@ GEM redis-client (0.14.1) connection_pool regexp_parser (2.8.1) - reline (0.3.7) + reline (0.3.9) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) @@ -659,7 +662,7 @@ GEM tableparser (1.0.1) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.2.2) + thor (1.3.0) thread_safe (0.3.6) timeout (0.4.0) tpm-key_attestation (0.11.0) From c50720bd40824398ccf5ed65ff45d1204e4dbd7a Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Mon, 30 Oct 2023 12:20:35 -0500 Subject: [PATCH 06/11] update newrelic --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5c1d484939c..4906c8ba6ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -424,7 +424,8 @@ GEM net-smtp (0.4.0) net-protocol net-ssh (6.1.0) - newrelic_rpm (9.5.0) + newrelic_rpm (9.6.0) + base64 nio4r (2.5.9) nokogiri (1.14.5) mini_portile2 (~> 2.8.0) From c1c39cb122ed3575fb548367777dbb4512c07eda Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Tue, 31 Oct 2023 10:02:02 -0500 Subject: [PATCH 07/11] update bcrypt --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4906c8ba6ba..8bc1f8f5408 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -194,7 +194,7 @@ GEM barby (0.6.8) base32-crockford (0.1.0) base64 (0.1.1) - bcrypt (3.1.16) + bcrypt (3.1.19) benchmark-ips (2.12.0) better_errors (2.10.1) erubi (>= 1.0.0) From 5779b86ae17753a2fb21d0fdbc71dfd7713751fe Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Tue, 31 Oct 2023 10:02:18 -0500 Subject: [PATCH 08/11] update bootsnap --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8bc1f8f5408..0acaf155c07 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -209,7 +209,7 @@ GEM smart_properties bigdecimal (3.1.4) bindata (2.4.14) - bootsnap (1.16.0) + bootsnap (1.17.0) msgpack (~> 1.2) brakeman (6.0.1) browser (5.3.1) From 7b4915f8a3207968934442c90d5edf3027e7d1d2 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Tue, 31 Oct 2023 10:02:23 -0500 Subject: [PATCH 09/11] update pg --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0acaf155c07..a4556d492a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -438,7 +438,7 @@ GEM parser (3.2.2.3) ast (~> 2.4.1) racc - pg (1.5.3) + pg (1.5.4) pg_query (4.2.3) google-protobuf (>= 3.22.3) phonelib (0.8.4) From 01231274724015c3c71ceb85c54a6ebc2f02fe8f Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Tue, 31 Oct 2023 10:15:34 -0500 Subject: [PATCH 10/11] update google-protobuf and bindata --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a4556d492a8..13b118e91f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -208,7 +208,7 @@ GEM parser (>= 2.4) smart_properties bigdecimal (3.1.4) - bindata (2.4.14) + bindata (2.4.15) bootsnap (1.17.0) msgpack (~> 1.2) brakeman (6.0.1) @@ -331,7 +331,7 @@ GEM fugit (>= 1.1) railties (>= 6.0.0) thor (>= 0.14.1) - google-protobuf (3.24.0) + google-protobuf (3.24.4) hashdiff (1.0.1) hashie (4.1.0) heapy (0.2.0) From ab4fed5e56c59573662a88fbf200d05ed2872894 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Tue, 31 Oct 2023 10:16:23 -0500 Subject: [PATCH 11/11] update strong_migrations --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 13b118e91f0..ddcd0c97e8c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -657,7 +657,7 @@ GEM unf (~> 0.1.4) smart_properties (1.17.0) stringex (2.8.5) - strong_migrations (1.6.0) + strong_migrations (1.6.4) activerecord (>= 5.2) subprocess (1.5.5) tableparser (1.0.1)