asyncapi-client 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +11 -4
- data/app/controllers/asyncapi/client/v1/jobs_controller.rb +1 -2
- data/app/services/asyncapi/client/update_job.rb +1 -1
- data/app/workers/asyncapi/client/job_status_worker.rb +1 -1
- data/lib/asyncapi/client/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f0c459111eb7270486b2b9cd41c811d6ec8fda
|
4
|
+
data.tar.gz: 2bd5e7375adc86a910b63832c7d702f4a03e1c70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a317e387d9c38c7f0fa2ad1f7e6aebcbf2b4c40c37ee8828ac5ebf4b7ede618bf2070d69c4997e0c91edb4137674136928149f119005e40fdd42256103f5a877
|
7
|
+
data.tar.gz: 44f4b7b73c6c1bf28aad6ea32b414183225d9ee7779d7c38783dd892bfe94c24fc9da036175616f9d883dbaad0865d85945525a97f16572b11bea0518a86de2b
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -36,7 +36,7 @@ class DoOnQueue < Asyncapi::Client::CallbackRunner
|
|
36
36
|
end
|
37
37
|
|
38
38
|
class DoOnSuccess < Asyncapi::Client::CallbackRunner
|
39
|
-
def
|
39
|
+
def call
|
40
40
|
Rails.logger.info "Job##{job.id} is done. The server's response: #{job.message}"
|
41
41
|
end
|
42
42
|
end
|
@@ -135,13 +135,20 @@ If you use FactoryGirl, you can require the factories for easy testing and stubb
|
|
135
135
|
require "asyncapi/client/factories"
|
136
136
|
```
|
137
137
|
|
138
|
-
|
138
|
+
# Security
|
139
139
|
|
140
140
|
`asyncapi-client` generates a secret for the job using `SecureRandom.uuid`, and sends this to the app using `asyncapi-server`. The server app, using the latest compatible gem, will reply with the secret in the params. `asyncapi-client` will make sure the job id matches with the given secret.
|
141
141
|
|
142
|
-
|
142
|
+
# Development
|
143
|
+
|
144
|
+
```
|
145
|
+
rake app:db:schema:load
|
146
|
+
rspec spec
|
147
|
+
```
|
148
|
+
|
149
|
+
# License
|
143
150
|
|
144
|
-
Copyright (c)
|
151
|
+
Copyright (c) 2016 G5
|
145
152
|
|
146
153
|
MIT License
|
147
154
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Asyncapi::Client
|
2
2
|
module V1
|
3
3
|
class JobsController < Asyncapi::Client.parent_controller
|
4
|
-
respond_to :json
|
5
4
|
|
6
5
|
def index
|
7
6
|
jobs = Job.all
|
@@ -11,7 +10,7 @@ module Asyncapi::Client
|
|
11
10
|
def update
|
12
11
|
if job = Job.find_by(id: params[:id], secret: params[:job][:secret])
|
13
12
|
UpdateJob.execute(job: job, params: job_params)
|
14
|
-
|
13
|
+
render json: job
|
15
14
|
else
|
16
15
|
render nothing: true, status: 403
|
17
16
|
end
|
@@ -15,7 +15,7 @@ module Asyncapi::Client
|
|
15
15
|
def perform(job_id)
|
16
16
|
job = Job.find(job_id)
|
17
17
|
callback_method = STATUS_CALLBACK_MAP[job.status]
|
18
|
-
return
|
18
|
+
return if callback_method.nil?
|
19
19
|
class_name = job.send(callback_method)
|
20
20
|
begin
|
21
21
|
callback_class = class_name.constantize
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asyncapi-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- G5
|
@@ -10,22 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - "
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 4.
|
21
|
+
version: '4.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - "
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 4.
|
28
|
+
version: '4.0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: sidekiq
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
280
|
version: '0'
|
281
281
|
requirements: []
|
282
282
|
rubyforge_project:
|
283
|
-
rubygems_version: 2.
|
283
|
+
rubygems_version: 2.5.1
|
284
284
|
signing_key:
|
285
285
|
specification_version: 4
|
286
286
|
summary: Asynchronous API communication
|