faktory_worker_ruby 0.6.0 → 0.6.1

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: 746a9be3c60d6dda246d9bfadc0cbb5364635928
4
- data.tar.gz: 8b7647102cf7e973c3927b95c1a2e6f8d000aeb6
3
+ metadata.gz: a613d7ced7f98e8ec3112b9be6a31b367b1ce4bf
4
+ data.tar.gz: 71a106dc660e67ecd0833a1e1815148de8022fb8
5
5
  SHA512:
6
- metadata.gz: 76013e6dc045ceb3cdb178815869271e9b6c89250dac467058c087834abb6c666a28f15989023c054e6b692d90dd0f1ce07a0b856da9e992145e9fab9f0830dd
7
- data.tar.gz: a478076c6058f919b18828ee08c6855ad89e3ca80dcd3d91fd5fe75259c411a5494dcd48d6857aaf52171ccc023f607348320f27a0b91ed50e6554c78cb626e5
6
+ metadata.gz: 657cce3245c5c4dd8d790b041d212a20d2cb477dfcf54176040450df6ee7634da443f79b0e2076c5ab372176f8dda18a4dc2329c6a35b91bd94c47bba0236285
7
+ data.tar.gz: 132a39b2db88d47f5b7e770f125b612326a34183982eb3231dea407cbaae16207601ddd580c7a7440ed9e388c3c066650b5b6c76bbc75cabb563d5a043a4462f
data/Changes.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 0.6.1
4
+
5
+ - Fix password hashing
6
+
3
7
  ## 0.6.0
4
8
 
5
9
  - Updates for Faktory 0.6.0 and protocol V2.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faktory_worker_ruby (0.6.0)
4
+ faktory_worker_ruby (0.6.1)
5
5
  connection_pool (~> 2.2, >= 2.2.1)
6
6
 
7
7
  GEM
@@ -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
- sha = Digest::SHA256.new
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)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Faktory
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
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.0
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-09 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool