Skip to content

Commit

Permalink
Merge pull request #1598 from projectblacklight/bump_versions
Browse files Browse the repository at this point in the history
Bump tested version of Ruby and Rails
  • Loading branch information
mejackreed committed Dec 28, 2016
2 parents 291d0c0 + d3f7326 commit 5bb0be6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ notifications:
email: false

rvm:
- 2.3.1
- 2.4.0

matrix:
include:
- rvm: 2.3.1
- rvm: 2.3.3
env: "RAILS_VERSION=4.2.7.1"
- rvm: 2.2.5
env: "RAILS_VERSION=5.0.0.1"
- rvm: jruby-9.1.5.0
env: "RAILS_VERSION=4.2.7.1 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
- rvm: 2.4.0
env: "RAILS_VERSION=5.0.1"
- rvm: jruby-9.1.6.0
env: "RAILS_VERSION=5.0.11 JRUBY_OPTS=\"-J-Xms512m -J-Xmx1024m\""
allow_failures:
- rvm: jruby-9.1.5.0
- rvm: jruby-9.1.6.0
fast_finish: true

before_install:
- gem install bundler

env:
- "RAILS_VERSION=5.0.0.1"
- "RAILS_VERSION=5.0.1"

notifications:
irc: "irc.freenode.org#blacklight"
Expand Down
13 changes: 12 additions & 1 deletion app/controllers/concerns/blacklight/token_based_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,21 @@ def encrypt_user_id(user_id, current_time = nil)
end

def export_secret_token
ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base).generate_key('encrypted user session key')
ActiveSupport::KeyGenerator.new(Rails.application.secrets.secret_key_base).generate_key('encrypted user session key')[0..(key_len - 1)]
end

def message_encryptor
ActiveSupport::MessageEncryptor.new(export_secret_token)
end

private

# Ruby 2.4 requires keys of very particular lengths
def key_len
if ActiveSupport::MessageEncryptor.respond_to? :key_len
ActiveSupport::MessageEncryptor.key_len
else
0
end
end
end

0 comments on commit 5bb0be6

Please sign in to comment.