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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sidekiq/encryptor/version.rb +1 -1
- data/lib/sidekiq/encryptor.rb +4 -7
- data/sidekiq-encryptor.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4eae4dac82d09c171f73a20828270ffb64874c
|
4
|
+
data.tar.gz: 5e8b14d8f21b738bb14bf386240573674fa19579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528c5fa17f07d5fe4b0c8dee6f3aa30ab1bb1141bd759cdc7a913a79a0a44f3e87d9482034273907e6fb50dd6bf4657be62645f2a0a22693d8f740bbcd316b52
|
7
|
+
data.tar.gz: 34dd1fbeb5d07e26d23c73e53a12e349861bf878ff29cebe04daf7b7e1a3eb1ac7106274a5ab9c4b76033d237fa85ed2d0848747a52b860764776a02ca8a5ada
|
data/CHANGELOG.md
CHANGED
data/lib/sidekiq/encryptor.rb
CHANGED
@@ -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(
|
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:
|
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.
|
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
|
|
data/sidekiq-encryptor.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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.
|
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.
|
29
|
+
version: 2.0rc2
|
30
30
|
- - <
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3.0'
|