diff --git a/Gemfile b/Gemfile index 1e3bb4c36..a2d532c92 100644 --- a/Gemfile +++ b/Gemfile @@ -1,47 +1,47 @@ source 'https://rubygems.org' -gem 'bcrypt', '~> 3.1.0' -gem 'bootsnap', '~> 1.12.0' -gem 'browser', '~> 5.3.0' -gem 'devise', '~>4.8.0' -gem 'devise-i18n', '~>1.10.0' +gem 'bcrypt', '~> 3.1.18' +gem 'bootsnap', '~> 1.16.0' +gem 'browser', '~> 5.3.1' +gem 'devise', '~>4.9.2' +gem 'devise-i18n', '~>1.11.0' gem 'factory_bot_rails', '~> 6.2.0' -gem 'faker', '~> 3.1.1' -gem 'font-awesome-rails', '~> 4.7.0.0' -gem 'http', '~> 5.0.0' -gem 'jbuilder', '~> 2.11.0' -gem 'jquery-rails', '~> 4.5.0' -gem 'kaminari', '~> 1.2.0' -gem 'mini_racer', '~> 0.6.0' -gem 'mollie-api-ruby', '~> 4.7.0' +gem 'faker', '~> 3.2.0' +gem 'font-awesome-rails', '~> 4.7.0.8' +gem 'http', '~> 5.1.1' +gem 'jbuilder', '~> 2.11.5' +gem 'jquery-rails', '~> 4.5.1' +gem 'kaminari', '~> 1.2.2' +gem 'mini_racer', '~> 0.6.3' +gem 'mollie-api-ruby', '~> 4.7.1' gem 'net-imap', require: false gem 'net-pop', require: false gem 'net-smtp', require: false -gem 'omniauth', '~> 2.0.0' -gem 'omniauth-oauth2', '~> 1.7.0' -gem 'omniauth-rails_csrf_protection', '~> 1.0' +gem 'omniauth', '~> 2.1.1' +gem 'omniauth-oauth2', '~> 1.8.0' +gem 'omniauth-rails_csrf_protection', '~> 1.0', '>= 1.0.1' gem 'paper_trail', '~> 16.0.0' gem 'paranoia', '~> 3.0.0' -gem 'pg', '~> 1.3.0' +gem 'pg', '~> 1.5.3' gem 'puma', '~> 6.4.0' -gem 'pundit', '~> 2.2.0' -gem 'rack-attack', '~> 6.6.0' +gem 'pundit', '~> 2.3.0' +gem 'rack-attack', '~> 6.6.1' gem 'rails', '~> 7.0.4', '>= 7.0.4.3' -gem 'rails-i18n', '~> 7.0.0' -gem 'redis-rails', '~> 5.0.0' +gem 'rails-i18n', '~> 7.0.6' +gem 'redis-rails', '~> 5.0.2' gem 'rest-client', '~> 2.1.0' -gem 'sassc-rails', '~> 2.1.0' -gem 'sentry-rails', '~> 5.5' -gem 'sentry-ruby', '~> 5.5' -gem 'sentry-sidekiq', '~> 5.5' +gem 'sassc-rails', '~> 2.1.2' +gem 'sentry-rails', '~> 5.9' +gem 'sentry-ruby', '~> 5.9' +gem 'sentry-sidekiq', '~> 5.9' gem 'sidekiq', '~> 7.1.0' gem 'sidekiq-scheduler', '~> 5.0.2' -gem 'simple_form', '~> 5.1.0' +gem 'simple_form', '~> 5.2.0' gem 'slack-notifier', '~> 2.4.0' -gem 'turbolinks', '~> 5.2.0' +gem 'turbolinks', '~> 5.2.1' gem 'uglifier', '~> 4.2.0' gem 'validates_timeliness', '~> 7.0.0.beta2' -gem 'webpacker', '~> 5.4.0' +gem 'webpacker', '~> 5.4.4' gem 'wicked_pdf' gem 'wkhtmltopdf-binary' @@ -52,8 +52,8 @@ group :development, :test do gem 'bullet' gem 'colorize' gem 'consistency_fail' - gem 'dotenv-rails', '~> 2.7.0' - gem 'guard-livereload', '~> 2.5.0' + gem 'dotenv-rails', '~> 2.8.1' + gem 'guard-livereload', '~> 2.5.2' gem 'guard-rspec', require: false gem 'pry-byebug' gem 'pry-rails' @@ -65,7 +65,7 @@ group :development do gem 'capistrano-sidekiq' gem 'foreman', require: false gem 'listen' - gem 'mina', '~> 1.2.0' + gem 'mina', '~> 1.2.4' gem 'spring', require: false gem 'spring-commands-rspec', require: false gem 'spring-watcher-listen', require: false @@ -73,8 +73,8 @@ group :development do end group :test do - gem 'rails-controller-testing', '~> 1.0.0' - gem 'rubocop', '~> 1.30.0', require: false + gem 'rails-controller-testing', '~> 1.0.5' + gem 'rubocop', '~> 1.50.2', require: false gem 'rubocop-performance' gem 'rubocop-rails' gem 'rubocop-rspec' diff --git a/Gemfile.lock b/Gemfile.lock index 906c9aa56..9bbb35a3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,8 +66,8 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) ast (2.4.2) @@ -78,7 +78,7 @@ GEM erubi (>= 1.0.0) rack (>= 0.9.0) bindex (0.8.1) - bootsnap (1.12.0) + bootsnap (1.16.0) msgpack (~> 1.2) brakeman (5.2.3) browser (5.3.1) @@ -104,22 +104,22 @@ GEM connection_pool (2.4.1) consistency_fail (0.3.7) crass (1.0.6) - devise (4.8.1) + devise (4.9.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.10.2) - devise (>= 4.8.0) + devise-i18n (1.11.0) + devise (>= 4.9.0) diff-lcs (1.5.0) digest (3.1.1) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) - dotenv-rails (2.7.6) - dotenv (= 2.7.6) + dotenv (2.8.1) + dotenv-rails (2.8.1) + dotenv (= 2.8.1) railties (>= 3.2) em-websocket (0.5.3) eventmachine (>= 0.12.9) @@ -134,12 +134,12 @@ GEM factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - faker (3.1.1) + faker (3.2.0) i18n (>= 1.8.11, < 2) - faraday (2.3.0) - faraday-net_http (~> 2.0) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-net_http (2.0.3) + faraday-net_http (3.0.2) ffi (1.15.5) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -173,7 +173,7 @@ GEM guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) hashie (5.0.0) - http (5.0.4) + http (5.1.1) addressable (~> 2.8) http-cookie (~> 1.0) http-form_data (~> 2.2) @@ -188,11 +188,11 @@ GEM jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) - jquery-rails (4.5.0) + jquery-rails (4.5.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jwt (2.4.1) + jwt (2.7.0) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -232,11 +232,11 @@ GEM rake mini_mime (1.1.5) mini_portile2 (2.8.8) - mini_racer (0.6.2) + mini_racer (0.6.3) libv8-node (~> 16.10.0.0) minitest (5.25.2) mollie-api-ruby (4.7.1) - msgpack (1.5.2) + msgpack (1.7.0) multi_json (1.15.0) multi_xml (0.6.0) nenv (0.3.0) @@ -263,19 +263,20 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - oauth2 (1.4.9) + oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) - multi_json (~> 1.3) multi_xml (~> 0.5) - rack (>= 1.2, < 3) - omniauth (2.0.4) + rack (>= 1.2, < 4) + snaky_hash (~> 2.0) + version_gem (~> 1.1) + omniauth (2.1.1) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) + rack (>= 2.2.3) rack-protection - omniauth-oauth2 (1.7.2) - oauth2 (~> 1.4) - omniauth (>= 1.9, < 3) + omniauth-oauth2 (1.8.0) + oauth2 (>= 1.4, < 3) + omniauth (~> 2.0) omniauth-rails_csrf_protection (1.0.1) actionpack (>= 4.2) omniauth (~> 2.0) @@ -284,12 +285,12 @@ GEM paper_trail (16.0.0) activerecord (>= 6.1) request_store (~> 1.4) - parallel (1.22.1) + parallel (1.23.0) paranoia (3.0.0) activerecord (>= 6, < 8.1) - parser (3.1.2.0) + parser (3.2.2.1) ast (~> 2.4.1) - pg (1.3.5) + pg (1.5.3) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -298,19 +299,19 @@ GEM pry (>= 0.13, < 0.15) pry-rails (0.3.9) pry (>= 0.10.4) - public_suffix (4.0.7) + public_suffix (5.0.1) puma (6.4.3) nio4r (~> 2.0) - pundit (2.2.0) + pundit (2.3.0) activesupport (>= 3.0.0) raabro (1.4.0) racc (1.6.2) rack (2.2.10) rack-attack (6.6.1) rack (>= 1.0, < 3) - rack-protection (3.0.2) + rack-protection (3.0.6) rack - rack-proxy (0.7.2) + rack-proxy (0.7.6) rack rack-test (2.1.0) rack (>= 1.3) @@ -337,7 +338,7 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - rails-i18n (7.0.3) + rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) railties (7.0.8.6) @@ -372,12 +373,12 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.9.1) redis (>= 4, < 5) - regexp_parser (2.5.0) + regexp_parser (2.8.0) request_store (1.7.0) rack (>= 1.4) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) + responders (3.1.0) + actionpack (>= 5.2) + railties (>= 5.2) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) @@ -405,17 +406,18 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.0) - rubocop (1.30.1) + rubocop (1.50.2) + json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.18.0, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.18.0) - parser (>= 3.1.1.0) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.28.1) + parser (>= 3.2.1.0) rubocop-performance (1.14.2) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) @@ -425,7 +427,7 @@ GEM rubocop (>= 1.7.0, < 2.0) rubocop-rspec (2.11.1) rubocop (~> 1.19) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rufus-scheduler (3.8.2) fugit (~> 1.1, >= 1.1.6) @@ -438,13 +440,13 @@ GEM sprockets-rails tilt semantic_range (3.0.0) - sentry-rails (5.5.0) + sentry-rails (5.9.0) railties (>= 5.0) - sentry-ruby (~> 5.5.0) - sentry-ruby (5.5.0) + sentry-ruby (~> 5.9.0) + sentry-ruby (5.9.0) concurrent-ruby (~> 1.0, >= 1.0.2) - sentry-sidekiq (5.5.0) - sentry-ruby (~> 5.5.0) + sentry-sidekiq (5.9.0) + sentry-ruby (~> 5.9.0) sidekiq (>= 3.0) shellany (0.0.1) sidekiq (7.1.6) @@ -456,7 +458,7 @@ GEM rufus-scheduler (~> 3.2) sidekiq (>= 6, < 8) tilt (>= 1.4.0) - simple_form (5.1.0) + simple_form (5.2.0) actionpack (>= 5.2) activemodel (>= 5.2) simplecov (0.21.2) @@ -467,6 +469,9 @@ GEM simplecov-lcov (0.8.0) simplecov_json_formatter (0.1.4) slack-notifier (2.4.0) + snaky_hash (2.0.1) + hashie + version_gem (~> 1.1, >= 1.1.1) spring (2.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) @@ -500,11 +505,12 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.1.0) + unicode-display_width (2.4.2) uniform_notifier (1.16.0) validates_timeliness (7.0.0.beta2) activemodel (>= 7.0.0, < 8) timeliness (>= 0.3.10, < 1) + version_gem (1.1.2) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.0) @@ -512,7 +518,7 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webpacker (5.4.3) + webpacker (5.4.4) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) @@ -531,64 +537,64 @@ PLATFORMS DEPENDENCIES awesome_print - bcrypt (~> 3.1.0) + bcrypt (~> 3.1.18) better_errors - bootsnap (~> 1.12.0) + bootsnap (~> 1.16.0) brakeman - browser (~> 5.3.0) + browser (~> 5.3.1) bullet capistrano-sidekiq colorize consistency_fail - devise (~> 4.8.0) - devise-i18n (~> 1.10.0) - dotenv-rails (~> 2.7.0) + devise (~> 4.9.2) + devise-i18n (~> 1.11.0) + dotenv-rails (~> 2.8.1) factory_bot_rails (~> 6.2.0) - faker (~> 3.1.1) - font-awesome-rails (~> 4.7.0.0) + faker (~> 3.2.0) + font-awesome-rails (~> 4.7.0.8) foreman - guard-livereload (~> 2.5.0) + guard-livereload (~> 2.5.2) guard-rspec - http (~> 5.0.0) - jbuilder (~> 2.11.0) - jquery-rails (~> 4.5.0) - kaminari (~> 1.2.0) + http (~> 5.1.1) + jbuilder (~> 2.11.5) + jquery-rails (~> 4.5.1) + kaminari (~> 1.2.2) listen - mina (~> 1.2.0) - mini_racer (~> 0.6.0) - mollie-api-ruby (~> 4.7.0) + mina (~> 1.2.4) + mini_racer (~> 0.6.3) + mollie-api-ruby (~> 4.7.1) net-imap net-pop net-smtp - omniauth (~> 2.0.0) - omniauth-oauth2 (~> 1.7.0) - omniauth-rails_csrf_protection (~> 1.0) + omniauth (~> 2.1.1) + omniauth-oauth2 (~> 1.8.0) + omniauth-rails_csrf_protection (~> 1.0, >= 1.0.1) paper_trail (~> 16.0.0) paranoia (~> 3.0.0) - pg (~> 1.3.0) + pg (~> 1.5.3) pry-byebug pry-rails puma (~> 6.4.0) - pundit (~> 2.2.0) - rack-attack (~> 6.6.0) + pundit (~> 2.3.0) + rack-attack (~> 6.6.1) rails (~> 7.0.4, >= 7.0.4.3) - rails-controller-testing (~> 1.0.0) - rails-i18n (~> 7.0.0) + rails-controller-testing (~> 1.0.5) + rails-i18n (~> 7.0.6) rb-readline - redis-rails (~> 5.0.0) + redis-rails (~> 5.0.2) rest-client (~> 2.1.0) rspec-rails - rubocop (~> 1.30.0) + rubocop (~> 1.50.2) rubocop-performance rubocop-rails rubocop-rspec - sassc-rails (~> 2.1.0) - sentry-rails (~> 5.5) - sentry-ruby (~> 5.5) - sentry-sidekiq (~> 5.5) + sassc-rails (~> 2.1.2) + sentry-rails (~> 5.9) + sentry-ruby (~> 5.9) + sentry-sidekiq (~> 5.9) sidekiq (~> 7.1.0) sidekiq-scheduler (~> 5.0.2) - simple_form (~> 5.1.0) + simple_form (~> 5.2.0) simplecov simplecov-lcov (~> 0.8.0) slack-notifier (~> 2.4.0) @@ -597,12 +603,12 @@ DEPENDENCIES spring-watcher-listen terminal-notifier-guard timecop - turbolinks (~> 5.2.0) + turbolinks (~> 5.2.1) tzinfo-data uglifier (~> 4.2.0) validates_timeliness (~> 7.0.0.beta2) web-console (~> 4.2.0) - webpacker (~> 5.4.0) + webpacker (~> 5.4.4) wicked_pdf wkhtmltopdf-binary diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 298cc4118..7577e83b0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ class ApplicationController < ActionController::Base - include Pundit + include Pundit::Authorization before_action :set_sentry_context before_action :set_paper_trail_whodunnit diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ba7e6d785..dadde077c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -120,7 +120,7 @@ def send_slack_users_refresh_notification return unless Rails.env.production? || Rails.env.staging? || Rails.env.luxproduction? # :nocov: - SlackMessageJob.perform_later("User ##{current_user.id} (#{current_user.name}) "\ + SlackMessageJob.perform_later("User ##{current_user.id} (#{current_user.name}) " \ "is importing users from Amber (#{Rails.application.config.x.amber_api_host})") # :nocov: end diff --git a/app/jobs/credit_insufficient_notification_job.rb b/app/jobs/credit_insufficient_notification_job.rb index 74b26728b..fe99065b4 100644 --- a/app/jobs/credit_insufficient_notification_job.rb +++ b/app/jobs/credit_insufficient_notification_job.rb @@ -32,8 +32,8 @@ def send_notification_delivery_reports(success_count, unnotifyable_users) # rubo return unless Rails.env.production? || Rails.env.staging? || Rails.env.luxproduction? - SlackMessageJob.perform_later("Er is voor #{Rails.application.config.x.amber_api_host} een saldomail "\ - "verstuurd naar #{success_count} mensen, en #{unnotifyable_users.count} saldomail(s) kon(den) niet "\ + SlackMessageJob.perform_later("Er is voor #{Rails.application.config.x.amber_api_host} een saldomail " \ + "verstuurd naar #{success_count} mensen, en #{unnotifyable_users.count} saldomail(s) kon(den) niet " \ 'verzonden worden door het ontbreken van een e-mail adres.') HealthCheckJob.perform_later('credit_insufficient') diff --git a/config/environments/production.rb b/config/environments/production.rb index ddbcd9648..6ade5d8ed 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -77,7 +77,7 @@ config.active_support.deprecation = :notify # Use default logging formatter so that PID and timestamp are not suppressed. - config.log_formatter = ::Logger::Formatter.new + config.log_formatter = Logger::Formatter.new # Use a different logger for distributed setups. # require 'syslog/logger' diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index f55e65a10..8866ea435 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -33,7 +33,7 @@ config.include Devise::Test::ControllerHelpers, type: :controller # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_path = Rails.root.join('spec', 'fixtures') # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false