faktory_worker_ruby 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changes.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/faktory/client.rb +13 -8
- data/lib/faktory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a613d7ced7f98e8ec3112b9be6a31b367b1ce4bf
|
4
|
+
data.tar.gz: 71a106dc660e67ecd0833a1e1815148de8022fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 657cce3245c5c4dd8d790b041d212a20d2cb477dfcf54176040450df6ee7634da443f79b0e2076c5ab372176f8dda18a4dc2329c6a35b91bd94c47bba0236285
|
7
|
+
data.tar.gz: 132a39b2db88d47f5b7e770f125b612326a34183982eb3231dea407cbaae16207601ddd580c7a7440ed9e388c3c066650b5b6c76bbc75cabb563d5a043a4462f
|
data/Changes.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/faktory/client.rb
CHANGED
@@ -10,6 +10,16 @@ module Faktory
|
|
10
10
|
class Client
|
11
11
|
@@random_process_wid = ""
|
12
12
|
|
13
|
+
HASHER = proc do |iter, pwd, salt|
|
14
|
+
sha = Digest::SHA256.new
|
15
|
+
hashing = pwd + salt
|
16
|
+
iter.times do
|
17
|
+
hashing = sha.digest(hashing)
|
18
|
+
end
|
19
|
+
Digest.hexencode(hashing)
|
20
|
+
end
|
21
|
+
|
22
|
+
|
13
23
|
# Called when booting the worker process to signal that this process
|
14
24
|
# will consume jobs and send BEAT.
|
15
25
|
def self.worker!
|
@@ -158,16 +168,10 @@ module Faktory
|
|
158
168
|
if !pwd
|
159
169
|
raise ArgumentError, "Server requires password, but none has been configured"
|
160
170
|
end
|
161
|
-
iter = hash["i"] || 1
|
171
|
+
iter = (hash["i"] || 1).to_i
|
162
172
|
raise ArgumentError, "Invalid hashing" if iter < 1
|
163
173
|
|
164
|
-
|
165
|
-
hashing = pwd + salt
|
166
|
-
iter.times do
|
167
|
-
sha.update(hashing)
|
168
|
-
hashing = sha.digest
|
169
|
-
end
|
170
|
-
payload["pwdhash"] = sha.hexdigest
|
174
|
+
payload["pwdhash"] = HASHER.(iter, pwd, salt)
|
171
175
|
end
|
172
176
|
end
|
173
177
|
|
@@ -175,6 +179,7 @@ module Faktory
|
|
175
179
|
ok!
|
176
180
|
end
|
177
181
|
|
182
|
+
|
178
183
|
def command(*args)
|
179
184
|
cmd = args.join(" ")
|
180
185
|
@sock.puts(cmd)
|
data/lib/faktory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faktory_worker_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Perham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|