txgh-queue 1.1.0 → 2.0.0

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: 94ea310fa6024cfec2a3633a3c490ee43c62a90a
4
- data.tar.gz: 9488d256485ccaa83187f46fbe92151050fcae19
3
+ metadata.gz: d0eeeea710b8fe7c6d1272b8e7431e245ec424f0
4
+ data.tar.gz: 273e6fb2341cd9cf1a0ed206fb9e387d2103e0ee
5
5
  SHA512:
6
- metadata.gz: 370826c97e654c5a9f7b760d9f83144a5ff986cb00d40a3dd872eaaa3f670b96275148cd5d2e622b05bca085373c8a7478aac0c4da790089387c4a04b85ab95c
7
- data.tar.gz: 69cc8497763d439b3256dd00e91427ec4618f827290f18264c307930766d422e38882ddad2d4037fdf458ad1bab4e375606a1679bb70ba10d774470a39754903
6
+ metadata.gz: 7e2f8e78daf5d14342100433525c3f85be02fd7cfa66d54f539d16748366675074e508c2c081bcefbe0f51c6a1c6303e44a50b78b58f2dd8c4f397d224d973f1
7
+ data.tar.gz: 2143754bbaf2fd26f8af013d856366207db6113fc71e533f41bfc747e2657a294033b93588ebedb86f443d079ffd231b8d02c045578029f012b2f0d30e26933c
@@ -1,3 +1,3 @@
1
1
  module TxghQueue
2
- VERSION = '1.1.0'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -21,10 +21,19 @@ describe TxghQueue::WebhookEndpoints, auto_configure: true do
21
21
 
22
22
  describe '/transifex/enqueue' do
23
23
  def sign_with(body)
24
+ date_str = Time.now.strftime('%a, %d %b %Y %H:%M:%S GMT')
25
+
26
+ header('Date', date_str)
27
+ header('X-Tx-Url', 'http://example.org/transifex')
28
+
24
29
  header(
25
30
  TxghServer::TransifexRequestAuth::TRANSIFEX_HEADER,
26
- TxghServer::TransifexRequestAuth.header_value(
27
- body, config.transifex_project.webhook_secret
31
+ TxghServer::TransifexRequestAuth.compute_signature(
32
+ http_verb: 'POST',
33
+ url: 'http://example.org/transifex',
34
+ date_str: date_str,
35
+ content: body,
36
+ secret: config.transifex_project.webhook_secret
28
37
  )
29
38
  )
30
39
  end
@@ -40,7 +49,7 @@ describe TxghQueue::WebhookEndpoints, auto_configure: true do
40
49
  end
41
50
 
42
51
  it 'enqueues a new job' do
43
- payload = URI.encode_www_form(params.to_a)
52
+ payload = params.to_json
44
53
  sign_with payload
45
54
 
46
55
  expect { post '/transifex/enqueue', payload }.to(
@@ -64,7 +73,7 @@ describe TxghQueue::WebhookEndpoints, auto_configure: true do
64
73
  def sign_with(body)
65
74
  header(
66
75
  TxghServer::GithubRequestAuth::GITHUB_HEADER,
67
- TxghServer::GithubRequestAuth.header_value(
76
+ TxghServer::GithubRequestAuth.compute_signature(
68
77
  body, config.github_repo.webhook_secret
69
78
  )
70
79
  )
@@ -10,7 +10,7 @@ describe Transifex::RequestHandler, auto_configure: true do
10
10
  include StandardTxghSetup
11
11
 
12
12
  let(:logger) { NilLogger.new }
13
- let(:body) { URI.encode_www_form(payload.to_a) }
13
+ let(:body) { payload.to_json }
14
14
  let(:request) { TestRequest.new(body: body) }
15
15
  let(:handler) { described_class.new(request, logger) }
16
16
  let(:payload) do
@@ -42,7 +42,7 @@ describe Transifex::RequestHandler, auto_configure: true do
42
42
  end
43
43
 
44
44
  let(:backend) { TxghQueue::Config.backend }
45
- let(:producer) { backend.producer_for("transifex.hook") }
45
+ let(:producer) { backend.producer_for('transifex.hook') }
46
46
 
47
47
  it 'does not enqueue if unauthorized' do
48
48
  expect { handler.handle_request }.to_not(
data/txgh-queue.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency 'aws-sdk', '~> 2.0'
17
17
  s.add_dependency 'txgh', '~> 6.0'
18
- s.add_dependency 'txgh-server', '~> 2.2'
18
+ s.add_dependency 'txgh-server', '~> 3.0'
19
19
  s.add_dependency 'sinatra', '~> 1.4'
20
20
  s.add_dependency 'sinatra-contrib', '~> 1.4'
21
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txgh-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-02 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.2'
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.2'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sinatra
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.5.1
170
+ rubygems_version: 2.6.13
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Queue worker for processing Txgh webhooks.