sidekiq-encryptor 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c175a256a6726c340d48ccb0704677653e471ae5
4
- data.tar.gz: 36d9581f0d514e8c01d0a847d4d45bc9f69c3ea7
3
+ metadata.gz: 9c4eae4dac82d09c171f73a20828270ffb64874c
4
+ data.tar.gz: 5e8b14d8f21b738bb14bf386240573674fa19579
5
5
  SHA512:
6
- metadata.gz: 0ec5c5ed9c43c7875648e78be9005fc6ff6eafd5c600882a609666d10255a11cdbe91a3ac97907e390d4ee51428eb7c29742ccc2d87430273d860de5231416e2
7
- data.tar.gz: e2f42f5542574d4c74a57db139756a1ba73c2475bac18bf0e017e3b3ab229e2dd7ff31b4403ae76dbf4f2f9209ad4aa74dadecb813ec3cea834d81008c4bf2b2
6
+ metadata.gz: 528c5fa17f07d5fe4b0c8dee6f3aa30ab1bb1141bd759cdc7a913a79a0a44f3e87d9482034273907e6fb50dd6bf4657be62645f2a0a22693d8f740bbcd316b52
7
+ data.tar.gz: 34dd1fbeb5d07e26d23c73e53a12e349861bf878ff29cebe04daf7b7e1a3eb1ac7106274a5ab9c4b76033d237fa85ed2d0848747a52b860764776a02ca8a5ada
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # sidekiq-encryptor changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ Upgrade to Fernet 2.0rc2.
6
+
3
7
  ## 0.1.1
4
8
 
5
9
  Fix bug with processing unencrypted jobs.
@@ -4,7 +4,7 @@ module Sidekiq
4
4
  module Version
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- PATCH = 1
7
+ PATCH = 2
8
8
  SUFFIX = ""
9
9
  end
10
10
 
@@ -1,6 +1,3 @@
1
- # stdlib
2
- require 'base64'
3
-
4
1
  # gems
5
2
  require 'sidekiq'
6
3
  require 'fernet'
@@ -17,13 +14,13 @@ module Sidekiq
17
14
 
18
15
  module FernetAdapter
19
16
  def self.encrypt(key, data)
20
- Fernet.generate(Base64.urlsafe_encode64(key), data)
17
+ Fernet.generate(key, data)
21
18
  end
22
19
 
23
20
  def self.decrypt(key, data)
24
21
  verifier = Fernet::Verifier.new(
25
22
  token: data,
26
- secret: Base64.urlsafe_encode64(key),
23
+ secret: key,
27
24
  enforce_ttl: false)
28
25
  verifier.valid? ? verifier.message : nil
29
26
  rescue OpenSSL::Cipher::CipherError
@@ -69,10 +66,10 @@ module Sidekiq
69
66
  def validate_key(key)
70
67
  if key.nil?
71
68
  $stderr.puts '[sidekiq-encryptor] ERROR: no key provided, encryption disabled'
72
- elsif key.length < 32
69
+ elsif key.bytesize < 32
73
70
  $stderr.puts '[sidekiq-encryptor] ERROR: key length less than 256 bits, encryption disabled'
74
71
  else
75
- key[0,32]
72
+ key.bytes[0,32].pack('C*')
76
73
  end
77
74
  end
78
75
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ['lib']
20
20
 
21
- gem.add_dependency 'fernet', '>= 2.0rc1', '< 3.0'
21
+ gem.add_dependency 'fernet', '>= 2.0rc2', '< 3.0'
22
22
  gem.add_dependency 'sidekiq', '>= 2.5', '< 3.0'
23
23
 
24
24
  gem.add_development_dependency 'rake'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-encryptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Dance
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-24 00:00:00.000000000 Z
11
+ date: 2013-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fernet
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0rc1
19
+ version: 2.0rc2
20
20
  - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: '3.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 2.0rc1
29
+ version: 2.0rc2
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.0'