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 +4 -4
- data/lib/txgh-queue/version.rb +1 -1
- data/spec/application_spec.rb +13 -4
- data/spec/webhooks/transifex/request_handler_spec.rb +2 -2
- data/txgh-queue.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0eeeea710b8fe7c6d1272b8e7431e245ec424f0
|
4
|
+
data.tar.gz: 273e6fb2341cd9cf1a0ed206fb9e387d2103e0ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e2f8e78daf5d14342100433525c3f85be02fd7cfa66d54f539d16748366675074e508c2c081bcefbe0f51c6a1c6303e44a50b78b58f2dd8c4f397d224d973f1
|
7
|
+
data.tar.gz: 2143754bbaf2fd26f8af013d856366207db6113fc71e533f41bfc747e2657a294033b93588ebedb86f443d079ffd231b8d02c045578029f012b2f0d30e26933c
|
data/lib/txgh-queue/version.rb
CHANGED
data/spec/application_spec.rb
CHANGED
@@ -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.
|
27
|
-
|
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 =
|
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.
|
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) {
|
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(
|
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', '~>
|
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:
|
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:
|
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: '
|
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: '
|
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.
|
170
|
+
rubygems_version: 2.6.13
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Queue worker for processing Txgh webhooks.
|