No commit activity in last 3 years
No release in over 3 years
Sidekiq middleware that encrypts your job data into and out of Redis.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.0
~> 3.0
 Project Readme

Sidekiq::Encryptor

Build Status Dependency Status

Sidekiq::Encryptor is a middleware set for Sidekiq that encrypts your job data when enqueuing a job and decrypts that data when running a job.

Compatibility

Sidekiq::Encryptor is actively tested against MRI versions 2.0.0 and 1.9.3.

Installation

Add this line to your application's Gemfile:

gem 'sidekiq-encryptor'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sidekiq-encryptor

Configuration

In a Rails initializer or wherever you've configured Sidekiq, add the relevant Sidekiq::Encryptor middlewares as follows:

key = ENV['SIDEKIQ_ENCRYPTION_KEY']

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add Sidekiq::Encryptor::Server, key: key
  end
  config.client_middleware do |chain|
    chain.add Sidekiq::Encryptor::Client, key: key
  end
end

Sidekiq.configure_client do |config|
  config.client_middleware do |chain|
    chain.add Sidekiq::Encryptor::Client, key: key
  end
end

You should also set SIDEKIQ_ENCRYPTION_KEY to something sufficiently random. The openssl tool is a good choice for this:

echo SIDEKIQ_ENCRYPTION_KEY=$(openssl rand -base64 32) >>.env
heroku config:set SIDEKIQ_ENCRYPTION_KEY=$(openssl rand -base64 32)

Contributing

Pull requests gladly accepted. Please write tests for any code changes, though I'll admit my test coverage is completely awful right now.

License

MIT Licensed. See LICENSE.txt for details.