Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rails from 7.0.8 to 7.1.1 #1635

Merged
merged 6 commits into from
Oct 26, 2023
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 Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source "https://rubygems.org"

ruby "~> 3.2.0"

gem "rails", "7.0.8"
gem "rails", "7.1.1"

gem "bootsnap", require: false
gem "gds-api-adapters"
Expand Down
162 changes: 96 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,74 +1,84 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
actioncable (7.1.1)
actionpack (= 7.1.1)
activesupport (= 7.1.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
zeitwerk (~> 2.6)
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.0.8)
actionpack (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activesupport (= 7.0.8)
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.0)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
rails-dom-testing (~> 2.2)
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.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8)
actionpack (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
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.0.8)
activesupport (= 7.0.8)
actionview (7.1.1)
activesupport (= 7.1.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8)
activesupport (= 7.0.8)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.1)
activesupport (= 7.1.1)
globalid (>= 0.3.6)
activemodel (7.0.8)
activesupport (= 7.0.8)
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activestorage (7.0.8)
actionpack (= 7.0.8)
activejob (= 7.0.8)
activerecord (= 7.0.8)
activesupport (= 7.0.8)
activemodel (7.1.1)
activesupport (= 7.1.1)
activerecord (7.1.1)
activemodel (= 7.1.1)
activesupport (= 7.1.1)
timeout (>= 0.4.0)
activestorage (7.1.1)
actionpack (= 7.1.1)
activejob (= 7.1.1)
activerecord (= 7.1.1)
activesupport (= 7.1.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8)
activesupport (7.1.1)
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)
ast (2.4.2)
base64 (0.1.1)
bigdecimal (3.1.4)
bootsnap (1.16.0)
msgpack (~> 1.2)
brakeman (6.0.1)
Expand All @@ -95,6 +105,8 @@ GEM
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
drb (2.1.1)
ruby2_keywords
erubi (1.12.0)
execjs (2.8.1)
ffi (1.15.5)
Expand Down Expand Up @@ -148,6 +160,10 @@ GEM
domain_name (~> 0.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.6.0)
irb (1.8.3)
rdoc
reline (>= 0.3.8)
json (2.6.3)
json-schema (4.1.1)
addressable (>= 2.8)
Expand Down Expand Up @@ -177,6 +193,7 @@ GEM
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.6.0)
mutex_m (0.1.2)
net-imap (0.4.2)
date
net-protocol
Expand Down Expand Up @@ -405,55 +422,67 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
psych (5.1.1.1)
stringio
public_suffix (5.0.3)
puma (6.4.0)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
rack (3.0.8)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8)
actioncable (= 7.0.8)
actionmailbox (= 7.0.8)
actionmailer (= 7.0.8)
actionpack (= 7.0.8)
actiontext (= 7.0.8)
actionview (= 7.0.8)
activejob (= 7.0.8)
activemodel (= 7.0.8)
activerecord (= 7.0.8)
activestorage (= 7.0.8)
activesupport (= 7.0.8)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
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.0.8)
railties (= 7.1.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
railties (7.1.1)
actionpack (= 7.1.1)
activesupport (= 7.1.1)
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)
ratelimit (1.0.4)
redis (>= 3.0.0)
redis-namespace (>= 1.0.0)
rdoc (6.5.0)
psych (>= 4.0.0)
redis (5.0.5)
redis-client (>= 0.9.0)
redis-client (0.12.0)
connection_pool
redis-namespace (1.10.0)
redis (>= 4)
regexp_parser (2.8.1)
reline (0.3.9)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
rest-client (2.1.0)
Expand Down Expand Up @@ -554,6 +583,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
statsd-ruby (1.5.0)
stringio (3.0.8)
thor (1.3.0)
tilt (2.0.10)
timecop (0.9.8)
Expand Down Expand Up @@ -598,7 +628,7 @@ DEPENDENCIES
jwt
plek
pry-byebug
rails (= 7.0.8)
rails (= 7.1.1)
ratelimit
rspec-rails
rubocop-govuk
Expand Down
2 changes: 1 addition & 1 deletion app/models/auth_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ def read_token
end

def secret
Rails.application.secrets.email_alert_auth_token
Rails.application.credentials.email_alert_auth_token
end
end
8 changes: 8 additions & 0 deletions config/initializers/secrets_to_credentials.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Rails 7 has begun to deprecate Rails.application.secrets in favour
# of Rails.application.credentials, but that adds the burden of master key
# adminstration without giving us any benefit (because our production
# secrets are handled as env vars, not committed to our repo. Here we
# loads the config/secrets.YML values into Rails.application.credentials,
# retaining the existing behaviour while dropping deprecated references.

Rails.application.credentials.merge!(Rails.application.config_for(:secrets))
2 changes: 1 addition & 1 deletion spec/support/token_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module TokenHelper
def encrypt_and_sign_token(data: {}, expiry: 5.minutes, hash_digest_class: OpenSSL::Digest::SHA256)
len = ActiveSupport::MessageEncryptor.key_len(AuthToken::CIPHER)
secret = Rails.application.secrets.email_alert_auth_token
secret = Rails.application.credentials.email_alert_auth_token
key = ActiveSupport::KeyGenerator.new(secret, hash_digest_class:).generate_key("", len)
crypt = ActiveSupport::MessageEncryptor.new(key, **AuthToken::OPTIONS)
crypt.encrypt_and_sign(data, expires_in: expiry)
Expand Down