apress-api 1.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.drone.yml +30 -0
- data/.gitignore +15 -0
- data/.rspec +4 -0
- data/Appraisals +31 -0
- data/CHANGELOG.md +227 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/app/controllers/apress/api/deprecated_versions_controller.rb +15 -0
- data/app/controllers/apress/api/v1/callbacks_controller.rb +30 -0
- data/app/controllers/apress/api/v1/tokens_controller.rb +24 -0
- data/app/docs/schema/api/v1/types/apress/api/link.rb +29 -0
- data/app/docs/schema/api/v1/types/apress/api/links.rb +24 -0
- data/app/docs/swagger/v1/controllers/apress/api/tokens_controller.rb +64 -0
- data/app/docs/swagger/v1/default_responses/bad_request.rb +16 -0
- data/app/docs/swagger/v1/default_responses/not_found.rb +16 -0
- data/app/docs/swagger/v1/default_responses/unauthenticated.rb +16 -0
- data/app/docs/swagger/v1/default_responses/unauthorized.rb +16 -0
- data/app/docs/swagger/v1/default_responses/unprocessable.rb +16 -0
- data/app/docs/swagger/v1/default_responses/updates_locked.rb +13 -0
- data/app/docs/swagger/v1/models/apress/api/client.rb +53 -0
- data/app/docs/swagger/v1/models/apress/api/simple_error.rb +27 -0
- data/app/docs/swagger/v1/models/apress/api/unproccesable_error.rb +16 -0
- data/app/docs/swagger/v1/models/apress/api/unprocessable_error.rb +37 -0
- data/app/docs/swagger/v1/root.rb +28 -0
- data/app/interactors/apress/api/callbacks/base_callback.rb +42 -0
- data/app/interactors/apress/api/delayed_fire_callback.rb +25 -0
- data/app/jobs/apress/api/event_handler_enqueueing_job.rb +19 -0
- data/app/jobs/apress/api/fire_callback_job.rb +25 -0
- data/app/models/apress/api/client.rb +60 -0
- data/app/policies/apress/api/callback_policy.rb +15 -0
- data/app/services/apress/api/auth_service.rb +37 -0
- data/app/views/apress/api/shared/_exception.json.jbuilder +4 -0
- data/app/views/apress/api/shared/error.json.jbuilder +5 -0
- data/app/views/apress/api/shared/parameter_missing_errors.json.jbuilder +9 -0
- data/app/views/apress/api/shared/unprocessable_errors.json.jbuilder +9 -0
- data/app/views/apress/api/v1/clients/_client.json.jbuilder +2 -0
- data/app/views/apress/api/v1/tokens/create.json.jbuilder +4 -0
- data/apress-api.gemspec +46 -0
- data/config/routes.rb +17 -0
- data/db/migrate/20150716000000_create_api_clients.rb +38 -0
- data/dip.yml +48 -0
- data/docker-compose.development.yml +18 -0
- data/docker-compose.drone.yml +7 -0
- data/docker-compose.yml +20 -0
- data/lib/apress-api.rb +1 -0
- data/lib/apress/api.rb +25 -0
- data/lib/apress/api/api_controller/authentification.rb +33 -0
- data/lib/apress/api/api_controller/base.rb +63 -0
- data/lib/apress/api/api_controller/compatibility.rb +26 -0
- data/lib/apress/api/api_controller/pagination.rb +60 -0
- data/lib/apress/api/api_controller/pagination_helper.rb +55 -0
- data/lib/apress/api/api_controller/rescue.rb +89 -0
- data/lib/apress/api/api_controller/responds.rb +25 -0
- data/lib/apress/api/callbacks/config.rb +56 -0
- data/lib/apress/api/callbacks/fire_callback_error.rb +12 -0
- data/lib/apress/api/callbacks/integration.rb +28 -0
- data/lib/apress/api/callbacks/repeat_callback_error.rb +12 -0
- data/lib/apress/api/engine.rb +33 -0
- data/lib/apress/api/extensions/jbuilder/jbuilder_template.rb +41 -0
- data/lib/apress/api/rspec.rb +48 -0
- data/lib/apress/api/rspec/utils.rb +17 -0
- data/lib/apress/api/testing/json_matcher.rb +9 -0
- data/lib/apress/api/version.rb +5 -0
- data/lib/tasks/docs.rake +12 -0
- data/spec/controllers/api_controller/authentification_spec.rb +79 -0
- data/spec/controllers/api_controller/pagination_spec.rb +199 -0
- data/spec/controllers/api_controller/rescue_spec.rb +167 -0
- data/spec/controllers/deprecated_versions_controller_spec.rb +10 -0
- data/spec/controllers/v1/callbacks_controller_spec.rb +50 -0
- data/spec/controllers/v1/tokens_controller_spec.rb +53 -0
- data/spec/factories/client_factory.rb +4 -0
- data/spec/helpers/paginating_cache_spec.rb +72 -0
- data/spec/interactors/apress/api/delayed_fire_callback_spec.rb +43 -0
- data/spec/internal/app/integrations/error_client/fire_callback.rb +14 -0
- data/spec/internal/app/integrations/service_client/fire_callback.rb +7 -0
- data/spec/internal/app/jobs/handler_job.rb +5 -0
- data/spec/internal/app/jobs/second_handler_job.rb +5 -0
- data/spec/internal/app/models/dummy_model.rb +15 -0
- data/spec/internal/config/database.yml +5 -0
- data/spec/internal/config/environments/test.rb +5 -0
- data/spec/internal/config/initializers/api.rb +10 -0
- data/spec/internal/config/routes.rb +3 -0
- data/spec/internal/db/schema.rb +5 -0
- data/spec/internal/log/.gitignore +1 -0
- data/spec/jobs/apress/api/event_handler_equeueing_job_spec.rb +31 -0
- data/spec/jobs/apress/api/fire_callback_job_spec.rb +34 -0
- data/spec/lib/apress/api/callbacks/integration_spec.rb +24 -0
- data/spec/models/client_spec.rb +25 -0
- data/spec/services/auth_service_spec.rb +64 -0
- data/spec/spec_helper.rb +34 -0
- metadata +518 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
class DummyModel < ActiveRecord::Base
|
2
|
+
include Apress::Api::Callbacks::Integration
|
3
|
+
|
4
|
+
notify_services event: 'some_event',
|
5
|
+
params: [:name],
|
6
|
+
at: [:after_save, if: :name_empty?]
|
7
|
+
|
8
|
+
notify_services event: 'dynamic_params_event',
|
9
|
+
params: ->(model) { {name: model.name + " stuff"} },
|
10
|
+
at: [:before_update]
|
11
|
+
|
12
|
+
def name_empty?
|
13
|
+
name.blank?
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Apress::Api::Callbacks::Config.add_client('service_access_id')
|
2
|
+
|
3
|
+
Apress::Api::Callbacks::Config.add_service(service: 'service', event: 'some_event')
|
4
|
+
Apress::Api::Callbacks::Config.add_service(service: 'error', event: 'some_error_event')
|
5
|
+
Apress::Api::Callbacks::Config.add_service(service: 'error', event: 'repeat_error')
|
6
|
+
Apress::Api::Callbacks::Config.add_service(service: 'service', event: 'dynamic_params_event')
|
7
|
+
Apress::Api::Callbacks::Config.add_handler(service: 'external_service', event: 'other_event', handler: 'handler_job')
|
8
|
+
Apress::Api::Callbacks::Config.add_handler(service: 'external_service',
|
9
|
+
event: 'other_event',
|
10
|
+
handler: 'second_handler_job')
|
@@ -0,0 +1 @@
|
|
1
|
+
*.log
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Apress::Api::EventHandlerEnqueueingJob, type: :job do
|
4
|
+
describe '#perform' do
|
5
|
+
let(:handler) { 'handler_job' }
|
6
|
+
let(:event_params) { {id: 100_500} }
|
7
|
+
|
8
|
+
it 'enqueues specified handler job' do
|
9
|
+
expect(Resque).to receive(:enqueue).with(HandlerJob, event_params)
|
10
|
+
|
11
|
+
described_class.perform(handler, event_params)
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'with unknown handler job class' do
|
15
|
+
let(:handler) { 'unknown_handler_job' }
|
16
|
+
|
17
|
+
it do
|
18
|
+
expect { described_class.perform(handler, event_params) }.to raise_error(NameError)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when handler job responds to enqueue method' do
|
23
|
+
it 'enqueues specified handler job' do
|
24
|
+
expect(HandlerJob).to receive(:enqueue).with(event_params)
|
25
|
+
expect(Resque).to_not receive(:enqueue).with(HandlerJob, event_params)
|
26
|
+
|
27
|
+
described_class.perform(handler, event_params)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Apress::Api::FireCallbackJob, type: :job do
|
4
|
+
let(:params) { {test: 1} }
|
5
|
+
|
6
|
+
describe '#perform' do
|
7
|
+
let(:event) { 'some_event' }
|
8
|
+
context 'when all goind well' do
|
9
|
+
it 'calls correct service' do
|
10
|
+
expect(ServiceClient::FireCallback).to receive(:call!).with(event: event, params: params)
|
11
|
+
|
12
|
+
described_class.perform("service", event, params)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'in case of retry error' do
|
17
|
+
let(:event) { 'some_error_event' }
|
18
|
+
it 'throws Callbacks::FireCallbackError' do
|
19
|
+
expect do
|
20
|
+
described_class.perform("error", event, params)
|
21
|
+
end.to raise_error(Apress::Api::Callbacks::FireCallbackError)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'in case of repeat error' do
|
26
|
+
let(:event) { 'repeat_error' }
|
27
|
+
it 'throws Callbacks::RepeatCallbackError' do
|
28
|
+
expect do
|
29
|
+
described_class.perform("error", event, params)
|
30
|
+
end.to raise_error(Apress::Api::Callbacks::RepeatCallbackError)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Apress::Api::Callbacks::Integration, type: :mixin do
|
4
|
+
describe '#notify_service' do
|
5
|
+
context 'when callback is set' do
|
6
|
+
let(:model) { DummyModel.new }
|
7
|
+
it 'calls delayed interactor' do
|
8
|
+
expect(Apress::Api::DelayedFireCallback).to receive(:call!).with(event: 'some_event', params: {name: nil})
|
9
|
+
|
10
|
+
model.save
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when params are lambda' do
|
15
|
+
let(:model) { DummyModel.create!(name: 'test') }
|
16
|
+
it 'calls delayed interactor' do
|
17
|
+
expect(Apress::Api::DelayedFireCallback).to \
|
18
|
+
receive(:call!).with(event: 'dynamic_params_event', params: {name: 'test_2 stuff'})
|
19
|
+
|
20
|
+
model.update_attributes(name: 'test_2')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Apress::Api::Client do
|
4
|
+
let(:client) { create "api/client" }
|
5
|
+
|
6
|
+
describe "#regenerate_tokens" do
|
7
|
+
it "regenerates secret and refresh tokens" do
|
8
|
+
client.regenerate_tokens
|
9
|
+
|
10
|
+
expect(client.changed).
|
11
|
+
to match_array %w(secret_token secret_token_expire_at refresh_token refresh_token_expire_at)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#regenerate_tokens!" do
|
16
|
+
it "regenerates secret and refresh tokens and save" do
|
17
|
+
attrs_names = %w(secret_token secret_token_expire_at refresh_token refresh_token_expire_at)
|
18
|
+
was_attrs = client.attributes.slice(*attrs_names).values
|
19
|
+
client.regenerate_tokens!
|
20
|
+
|
21
|
+
expect(client.attributes.slice(*attrs_names).values).to_not include(was_attrs)
|
22
|
+
expect(client.changed?).to be false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "rack/request"
|
3
|
+
require "rack/mock"
|
4
|
+
|
5
|
+
describe Apress::Api::AuthService do
|
6
|
+
let(:request) { Rack::Request.new(Rack::MockRequest.env_for("/", "HTTP_HOST" => "ex.com")) }
|
7
|
+
let(:service) { described_class.new(request) }
|
8
|
+
let(:client) { create "api/client" }
|
9
|
+
let(:params) { {} }
|
10
|
+
|
11
|
+
before do
|
12
|
+
allow(request).to receive(:query_parameters).and_return(params)
|
13
|
+
end
|
14
|
+
|
15
|
+
context "when client not found" do
|
16
|
+
it { expect(service.call).to be false }
|
17
|
+
end
|
18
|
+
|
19
|
+
context "when find client from headers" do
|
20
|
+
it do
|
21
|
+
ApiAuth.sign!(request, client.access_id, client.secret_token)
|
22
|
+
service.call
|
23
|
+
expect(service.client).to eq client
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "when find client from query params" do
|
28
|
+
let(:params) { {access_id: client.access_id} }
|
29
|
+
|
30
|
+
it do
|
31
|
+
service.call
|
32
|
+
expect(service.client).to eq client
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "when secret token expired" do
|
37
|
+
it do
|
38
|
+
client
|
39
|
+
Timecop.freeze(1.year.since)
|
40
|
+
ApiAuth.sign!(request, client.access_id, client.secret_token)
|
41
|
+
|
42
|
+
expect(service.call).to be false
|
43
|
+
|
44
|
+
Timecop.return
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "when not check signature" do
|
49
|
+
let(:params) { {access_id: client.access_id, check_signature: 0} }
|
50
|
+
|
51
|
+
context "when rails env production" do
|
52
|
+
it do
|
53
|
+
allow(Rails.env).to receive(:production?).and_return(true)
|
54
|
+
expect(service.call).to be false
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "when rails env not production" do
|
59
|
+
it do
|
60
|
+
expect(service.call).to be true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "bundler/setup"
|
2
|
+
require 'pry-byebug'
|
3
|
+
|
4
|
+
require "simplecov"
|
5
|
+
SimpleCov.start "rails" do
|
6
|
+
minimum_coverage 95
|
7
|
+
add_filter "/lib/apress/api/rspec"
|
8
|
+
add_filter "/lib/apress/api/testing/"
|
9
|
+
add_filter "/lib/apress/api/swagger/"
|
10
|
+
add_filter "/app/docs"
|
11
|
+
end
|
12
|
+
|
13
|
+
require "apress/api"
|
14
|
+
|
15
|
+
require 'mock_redis'
|
16
|
+
redis = MockRedis.new
|
17
|
+
Resque.redis = redis
|
18
|
+
|
19
|
+
require "factory_girl_rails"
|
20
|
+
require "timecop"
|
21
|
+
require "combustion"
|
22
|
+
|
23
|
+
Combustion.initialize! :all do
|
24
|
+
config.cache_store = :null_store if defined?(ActiveSupport::Cache::NullStore)
|
25
|
+
end
|
26
|
+
|
27
|
+
require "rails-controller-testing" if Rails::VERSION::MAJOR > 4
|
28
|
+
require "rspec/rails"
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
config.include FactoryGirl::Syntax::Methods
|
32
|
+
|
33
|
+
config.use_transactional_fixtures = true
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,518 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: apress-api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.22.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- merkushin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-08-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.1.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 6.0.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.1.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 6.0.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: pg
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: api-auth
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.3.1
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.3.1
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: oj
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 2.9.9
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 2.9.9
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: multi_json
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.11.2
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.11.2
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: jbuilder
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 2.3.1
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 2.3.1
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: attr_extras
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 4.4.0
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 4.4.0
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: swagger-core
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.3.0
|
124
|
+
type: :runtime
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 0.3.0
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: interactor
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :runtime
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: pundit
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
type: :runtime
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: resque-integration
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :runtime
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: apress-documentation
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: 0.2.0
|
180
|
+
type: :runtime
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: 0.2.0
|
187
|
+
- !ruby/object:Gem::Dependency
|
188
|
+
name: bundler
|
189
|
+
requirement: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - "~>"
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '1.7'
|
194
|
+
type: :development
|
195
|
+
prerelease: false
|
196
|
+
version_requirements: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - "~>"
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '1.7'
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: rake
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - "~>"
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '10.0'
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - "~>"
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '10.0'
|
215
|
+
- !ruby/object:Gem::Dependency
|
216
|
+
name: rspec
|
217
|
+
requirement: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '3.2'
|
222
|
+
type: :development
|
223
|
+
prerelease: false
|
224
|
+
version_requirements: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '3.2'
|
229
|
+
- !ruby/object:Gem::Dependency
|
230
|
+
name: rspec-rails
|
231
|
+
requirement: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ">="
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '3.2'
|
236
|
+
type: :development
|
237
|
+
prerelease: false
|
238
|
+
version_requirements: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - ">="
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: '3.2'
|
243
|
+
- !ruby/object:Gem::Dependency
|
244
|
+
name: combustion
|
245
|
+
requirement: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - ">="
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: 0.5.4
|
250
|
+
type: :development
|
251
|
+
prerelease: false
|
252
|
+
version_requirements: !ruby/object:Gem::Requirement
|
253
|
+
requirements:
|
254
|
+
- - ">="
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: 0.5.4
|
257
|
+
- !ruby/object:Gem::Dependency
|
258
|
+
name: appraisal
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: '0'
|
264
|
+
type: :development
|
265
|
+
prerelease: false
|
266
|
+
version_requirements: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - ">="
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0'
|
271
|
+
- !ruby/object:Gem::Dependency
|
272
|
+
name: timecop
|
273
|
+
requirement: !ruby/object:Gem::Requirement
|
274
|
+
requirements:
|
275
|
+
- - ">="
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '0'
|
278
|
+
type: :development
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
requirements:
|
282
|
+
- - ">="
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
version: '0'
|
285
|
+
- !ruby/object:Gem::Dependency
|
286
|
+
name: simplecov
|
287
|
+
requirement: !ruby/object:Gem::Requirement
|
288
|
+
requirements:
|
289
|
+
- - ">="
|
290
|
+
- !ruby/object:Gem::Version
|
291
|
+
version: '0.9'
|
292
|
+
type: :development
|
293
|
+
prerelease: false
|
294
|
+
version_requirements: !ruby/object:Gem::Requirement
|
295
|
+
requirements:
|
296
|
+
- - ">="
|
297
|
+
- !ruby/object:Gem::Version
|
298
|
+
version: '0.9'
|
299
|
+
- !ruby/object:Gem::Dependency
|
300
|
+
name: factory_girl_rails
|
301
|
+
requirement: !ruby/object:Gem::Requirement
|
302
|
+
requirements:
|
303
|
+
- - ">="
|
304
|
+
- !ruby/object:Gem::Version
|
305
|
+
version: '4.5'
|
306
|
+
type: :development
|
307
|
+
prerelease: false
|
308
|
+
version_requirements: !ruby/object:Gem::Requirement
|
309
|
+
requirements:
|
310
|
+
- - ">="
|
311
|
+
- !ruby/object:Gem::Version
|
312
|
+
version: '4.5'
|
313
|
+
- !ruby/object:Gem::Dependency
|
314
|
+
name: json-schema
|
315
|
+
requirement: !ruby/object:Gem::Requirement
|
316
|
+
requirements:
|
317
|
+
- - ">="
|
318
|
+
- !ruby/object:Gem::Version
|
319
|
+
version: '0'
|
320
|
+
type: :development
|
321
|
+
prerelease: false
|
322
|
+
version_requirements: !ruby/object:Gem::Requirement
|
323
|
+
requirements:
|
324
|
+
- - ">="
|
325
|
+
- !ruby/object:Gem::Version
|
326
|
+
version: '0'
|
327
|
+
- !ruby/object:Gem::Dependency
|
328
|
+
name: test-unit
|
329
|
+
requirement: !ruby/object:Gem::Requirement
|
330
|
+
requirements:
|
331
|
+
- - ">="
|
332
|
+
- !ruby/object:Gem::Version
|
333
|
+
version: '0'
|
334
|
+
type: :development
|
335
|
+
prerelease: false
|
336
|
+
version_requirements: !ruby/object:Gem::Requirement
|
337
|
+
requirements:
|
338
|
+
- - ">="
|
339
|
+
- !ruby/object:Gem::Version
|
340
|
+
version: '0'
|
341
|
+
- !ruby/object:Gem::Dependency
|
342
|
+
name: mock_redis
|
343
|
+
requirement: !ruby/object:Gem::Requirement
|
344
|
+
requirements:
|
345
|
+
- - ">="
|
346
|
+
- !ruby/object:Gem::Version
|
347
|
+
version: '0'
|
348
|
+
type: :development
|
349
|
+
prerelease: false
|
350
|
+
version_requirements: !ruby/object:Gem::Requirement
|
351
|
+
requirements:
|
352
|
+
- - ">="
|
353
|
+
- !ruby/object:Gem::Version
|
354
|
+
version: '0'
|
355
|
+
- !ruby/object:Gem::Dependency
|
356
|
+
name: pry-byebug
|
357
|
+
requirement: !ruby/object:Gem::Requirement
|
358
|
+
requirements:
|
359
|
+
- - ">="
|
360
|
+
- !ruby/object:Gem::Version
|
361
|
+
version: '0'
|
362
|
+
type: :development
|
363
|
+
prerelease: false
|
364
|
+
version_requirements: !ruby/object:Gem::Requirement
|
365
|
+
requirements:
|
366
|
+
- - ">="
|
367
|
+
- !ruby/object:Gem::Version
|
368
|
+
version: '0'
|
369
|
+
description:
|
370
|
+
email:
|
371
|
+
- merkushin.m.s@gmail.com
|
372
|
+
executables: []
|
373
|
+
extensions: []
|
374
|
+
extra_rdoc_files: []
|
375
|
+
files:
|
376
|
+
- ".drone.yml"
|
377
|
+
- ".gitignore"
|
378
|
+
- ".rspec"
|
379
|
+
- Appraisals
|
380
|
+
- CHANGELOG.md
|
381
|
+
- Gemfile
|
382
|
+
- LICENSE.txt
|
383
|
+
- README.md
|
384
|
+
- Rakefile
|
385
|
+
- app/controllers/apress/api/deprecated_versions_controller.rb
|
386
|
+
- app/controllers/apress/api/v1/callbacks_controller.rb
|
387
|
+
- app/controllers/apress/api/v1/tokens_controller.rb
|
388
|
+
- app/docs/schema/api/v1/types/apress/api/link.rb
|
389
|
+
- app/docs/schema/api/v1/types/apress/api/links.rb
|
390
|
+
- app/docs/swagger/v1/controllers/apress/api/tokens_controller.rb
|
391
|
+
- app/docs/swagger/v1/default_responses/bad_request.rb
|
392
|
+
- app/docs/swagger/v1/default_responses/not_found.rb
|
393
|
+
- app/docs/swagger/v1/default_responses/unauthenticated.rb
|
394
|
+
- app/docs/swagger/v1/default_responses/unauthorized.rb
|
395
|
+
- app/docs/swagger/v1/default_responses/unprocessable.rb
|
396
|
+
- app/docs/swagger/v1/default_responses/updates_locked.rb
|
397
|
+
- app/docs/swagger/v1/models/apress/api/client.rb
|
398
|
+
- app/docs/swagger/v1/models/apress/api/simple_error.rb
|
399
|
+
- app/docs/swagger/v1/models/apress/api/unproccesable_error.rb
|
400
|
+
- app/docs/swagger/v1/models/apress/api/unprocessable_error.rb
|
401
|
+
- app/docs/swagger/v1/root.rb
|
402
|
+
- app/interactors/apress/api/callbacks/base_callback.rb
|
403
|
+
- app/interactors/apress/api/delayed_fire_callback.rb
|
404
|
+
- app/jobs/apress/api/event_handler_enqueueing_job.rb
|
405
|
+
- app/jobs/apress/api/fire_callback_job.rb
|
406
|
+
- app/models/apress/api/client.rb
|
407
|
+
- app/policies/apress/api/callback_policy.rb
|
408
|
+
- app/services/apress/api/auth_service.rb
|
409
|
+
- app/views/apress/api/shared/_exception.json.jbuilder
|
410
|
+
- app/views/apress/api/shared/error.json.jbuilder
|
411
|
+
- app/views/apress/api/shared/parameter_missing_errors.json.jbuilder
|
412
|
+
- app/views/apress/api/shared/unprocessable_errors.json.jbuilder
|
413
|
+
- app/views/apress/api/v1/clients/_client.json.jbuilder
|
414
|
+
- app/views/apress/api/v1/tokens/create.json.jbuilder
|
415
|
+
- apress-api.gemspec
|
416
|
+
- config/routes.rb
|
417
|
+
- db/migrate/20150716000000_create_api_clients.rb
|
418
|
+
- dip.yml
|
419
|
+
- docker-compose.development.yml
|
420
|
+
- docker-compose.drone.yml
|
421
|
+
- docker-compose.yml
|
422
|
+
- lib/apress-api.rb
|
423
|
+
- lib/apress/api.rb
|
424
|
+
- lib/apress/api/api_controller/authentification.rb
|
425
|
+
- lib/apress/api/api_controller/base.rb
|
426
|
+
- lib/apress/api/api_controller/compatibility.rb
|
427
|
+
- lib/apress/api/api_controller/pagination.rb
|
428
|
+
- lib/apress/api/api_controller/pagination_helper.rb
|
429
|
+
- lib/apress/api/api_controller/rescue.rb
|
430
|
+
- lib/apress/api/api_controller/responds.rb
|
431
|
+
- lib/apress/api/callbacks/config.rb
|
432
|
+
- lib/apress/api/callbacks/fire_callback_error.rb
|
433
|
+
- lib/apress/api/callbacks/integration.rb
|
434
|
+
- lib/apress/api/callbacks/repeat_callback_error.rb
|
435
|
+
- lib/apress/api/engine.rb
|
436
|
+
- lib/apress/api/extensions/jbuilder/jbuilder_template.rb
|
437
|
+
- lib/apress/api/rspec.rb
|
438
|
+
- lib/apress/api/rspec/utils.rb
|
439
|
+
- lib/apress/api/testing/json_matcher.rb
|
440
|
+
- lib/apress/api/version.rb
|
441
|
+
- lib/tasks/docs.rake
|
442
|
+
- spec/controllers/api_controller/authentification_spec.rb
|
443
|
+
- spec/controllers/api_controller/pagination_spec.rb
|
444
|
+
- spec/controllers/api_controller/rescue_spec.rb
|
445
|
+
- spec/controllers/deprecated_versions_controller_spec.rb
|
446
|
+
- spec/controllers/v1/callbacks_controller_spec.rb
|
447
|
+
- spec/controllers/v1/tokens_controller_spec.rb
|
448
|
+
- spec/factories/client_factory.rb
|
449
|
+
- spec/helpers/paginating_cache_spec.rb
|
450
|
+
- spec/interactors/apress/api/delayed_fire_callback_spec.rb
|
451
|
+
- spec/internal/app/integrations/error_client/fire_callback.rb
|
452
|
+
- spec/internal/app/integrations/service_client/fire_callback.rb
|
453
|
+
- spec/internal/app/jobs/handler_job.rb
|
454
|
+
- spec/internal/app/jobs/second_handler_job.rb
|
455
|
+
- spec/internal/app/models/dummy_model.rb
|
456
|
+
- spec/internal/config/database.yml
|
457
|
+
- spec/internal/config/environments/test.rb
|
458
|
+
- spec/internal/config/initializers/api.rb
|
459
|
+
- spec/internal/config/routes.rb
|
460
|
+
- spec/internal/db/schema.rb
|
461
|
+
- spec/internal/log/.gitignore
|
462
|
+
- spec/jobs/apress/api/event_handler_equeueing_job_spec.rb
|
463
|
+
- spec/jobs/apress/api/fire_callback_job_spec.rb
|
464
|
+
- spec/lib/apress/api/callbacks/integration_spec.rb
|
465
|
+
- spec/models/client_spec.rb
|
466
|
+
- spec/services/auth_service_spec.rb
|
467
|
+
- spec/spec_helper.rb
|
468
|
+
homepage: https://github.com/abak-press/apress-api
|
469
|
+
licenses:
|
470
|
+
- MIT
|
471
|
+
metadata: {}
|
472
|
+
post_install_message:
|
473
|
+
rdoc_options: []
|
474
|
+
require_paths:
|
475
|
+
- lib
|
476
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
477
|
+
requirements:
|
478
|
+
- - ">="
|
479
|
+
- !ruby/object:Gem::Version
|
480
|
+
version: '0'
|
481
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
482
|
+
requirements:
|
483
|
+
- - ">="
|
484
|
+
- !ruby/object:Gem::Version
|
485
|
+
version: '0'
|
486
|
+
requirements: []
|
487
|
+
rubyforge_project:
|
488
|
+
rubygems_version: 2.6.1
|
489
|
+
signing_key:
|
490
|
+
specification_version: 4
|
491
|
+
summary: Apress-Api
|
492
|
+
test_files:
|
493
|
+
- spec/controllers/api_controller/authentification_spec.rb
|
494
|
+
- spec/controllers/api_controller/pagination_spec.rb
|
495
|
+
- spec/controllers/api_controller/rescue_spec.rb
|
496
|
+
- spec/controllers/deprecated_versions_controller_spec.rb
|
497
|
+
- spec/controllers/v1/callbacks_controller_spec.rb
|
498
|
+
- spec/controllers/v1/tokens_controller_spec.rb
|
499
|
+
- spec/factories/client_factory.rb
|
500
|
+
- spec/helpers/paginating_cache_spec.rb
|
501
|
+
- spec/interactors/apress/api/delayed_fire_callback_spec.rb
|
502
|
+
- spec/internal/app/integrations/error_client/fire_callback.rb
|
503
|
+
- spec/internal/app/integrations/service_client/fire_callback.rb
|
504
|
+
- spec/internal/app/jobs/handler_job.rb
|
505
|
+
- spec/internal/app/jobs/second_handler_job.rb
|
506
|
+
- spec/internal/app/models/dummy_model.rb
|
507
|
+
- spec/internal/config/database.yml
|
508
|
+
- spec/internal/config/environments/test.rb
|
509
|
+
- spec/internal/config/initializers/api.rb
|
510
|
+
- spec/internal/config/routes.rb
|
511
|
+
- spec/internal/db/schema.rb
|
512
|
+
- spec/internal/log/.gitignore
|
513
|
+
- spec/jobs/apress/api/event_handler_equeueing_job_spec.rb
|
514
|
+
- spec/jobs/apress/api/fire_callback_job_spec.rb
|
515
|
+
- spec/lib/apress/api/callbacks/integration_spec.rb
|
516
|
+
- spec/models/client_spec.rb
|
517
|
+
- spec/services/auth_service_spec.rb
|
518
|
+
- spec/spec_helper.rb
|