apisonator 2.100.1 → 2.100.2.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Gemfile.on_prem.lock +1 -1
- data/lib/3scale/backend/listener.rb +43 -39
- data/lib/3scale/backend/version.rb +1 -1
- data/lib/3scale/backend/worker_metrics.rb +2 -1
- data/lib/3scale/tasks/swagger.rake +11 -29
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b94cc75d6c390281dd0bd610708dd395dbff74275cead465ca59d9742cb3cedf
|
4
|
+
data.tar.gz: 499e2bdb91ee859d20857b1ab863a4b722e9a578a781e71617f4364b9a0b0c7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '005718b444db78ebd7cf83b6e3892353af4fbf2d36dca6cc37e8bd5573d62290ad25dc2219cdf666018cfb5b71584a58ad77988e98ec64069ea3619191de6532'
|
7
|
+
data.tar.gz: e5f4c817c100e83aa8daeee63250dde6940fe96efe5820ba454df47ee55aef67cb575f7e40e133f8db79a9f289f36dff05df6061a4cd8258dacb32324ccf1cdf
|
data/Gemfile.lock
CHANGED
data/Gemfile.on_prem.lock
CHANGED
@@ -12,9 +12,9 @@ module ThreeScale
|
|
12
12
|
include Logging
|
13
13
|
|
14
14
|
## ------------ DOCS --------------
|
15
|
-
##~ namespace =
|
15
|
+
##~ namespace = "Service Management API"
|
16
16
|
##~ sapi = source2swagger.namespace(namespace)
|
17
|
-
##~ sapi.basePath = "
|
17
|
+
##~ sapi.basePath = ""
|
18
18
|
##~ sapi.swaggerVersion = "0.1a"
|
19
19
|
##~ sapi.apiVersion = "1.0"
|
20
20
|
##
|
@@ -190,7 +190,7 @@ module ThreeScale
|
|
190
190
|
private :do_api_method
|
191
191
|
|
192
192
|
## ------------ DOCS --------------
|
193
|
-
##~ namespace =
|
193
|
+
##~ namespace = "Service Management API"
|
194
194
|
##~ sapi = source2swagger.namespace(namespace)
|
195
195
|
##~ a = sapi.apis.add
|
196
196
|
##~ a.set "path" => "/transactions/authorize.xml", "format" => "xml"
|
@@ -243,7 +243,7 @@ module ThreeScale
|
|
243
243
|
end
|
244
244
|
|
245
245
|
## ------------ DOCS --------------
|
246
|
-
##~ namespace =
|
246
|
+
##~ namespace = "Service Management API"
|
247
247
|
##~ sapi = source2swagger.namespace(namespace)
|
248
248
|
##~ a = sapi.apis.add
|
249
249
|
##~ a.set "path" => "/transactions/oauth_authorize.xml", "format" => "xml"
|
@@ -276,7 +276,7 @@ module ThreeScale
|
|
276
276
|
end
|
277
277
|
|
278
278
|
## ------------ DOCS --------------
|
279
|
-
##~ namespace =
|
279
|
+
##~ namespace = "Service Management API"
|
280
280
|
##~ sapi = source2swagger.namespace(namespace)
|
281
281
|
##~ a = sapi.apis.add
|
282
282
|
##~ a.set "path" => "/transactions/authrep.xml", "format" => "xml"
|
@@ -323,7 +323,7 @@ module ThreeScale
|
|
323
323
|
end
|
324
324
|
|
325
325
|
## ------------ DOCS --------------
|
326
|
-
##~ namespace =
|
326
|
+
##~ namespace = "Service Management API"
|
327
327
|
##~ sapi = source2swagger.namespace(namespace)
|
328
328
|
##~ a = sapi.apis.add
|
329
329
|
##~ a.set "path" => "/transactions/oauth_authrep.xml", "format" => "xml"
|
@@ -351,7 +351,7 @@ module ThreeScale
|
|
351
351
|
end
|
352
352
|
|
353
353
|
## ------------ DOCS --------------
|
354
|
-
##~ namespace =
|
354
|
+
##~ namespace = "Service Management API"
|
355
355
|
##~ sapi = source2swagger.namespace(namespace)
|
356
356
|
##~ a = sapi.apis.add
|
357
357
|
##~ a.set "path" => "/transactions.xml", "format" => "xml"
|
@@ -432,54 +432,58 @@ module ThreeScale
|
|
432
432
|
|
433
433
|
## OAUTH ACCESS TOKENS
|
434
434
|
|
435
|
-
|
436
|
-
|
437
|
-
|
435
|
+
# These endpoints are deprecated and are going to be removed. For now,
|
436
|
+
# let's disable them.
|
437
|
+
if Backend.test?
|
438
|
+
post '/services/:service_id/oauth_access_tokens.xml' do
|
439
|
+
check_post_content_type!
|
440
|
+
require_params! :service_id, :token
|
438
441
|
|
439
|
-
|
440
|
-
|
442
|
+
service_id = params[:service_id]
|
443
|
+
ensure_authenticated!(params[:provider_key], params[:service_token], service_id)
|
441
444
|
|
442
|
-
|
443
|
-
|
445
|
+
app_id = params[:app_id]
|
446
|
+
raise ApplicationNotFound, app_id unless Application.exists?(service_id, app_id)
|
444
447
|
|
445
|
-
|
446
|
-
|
448
|
+
OAuth::Token::Storage.create(params[:token], service_id, app_id, params[:ttl])
|
449
|
+
end
|
447
450
|
|
448
|
-
|
449
|
-
|
451
|
+
delete '/services/:service_id/oauth_access_tokens/:token.xml' do
|
452
|
+
require_params! :service_id, :token
|
450
453
|
|
451
|
-
|
452
|
-
|
454
|
+
service_id = params[:service_id]
|
455
|
+
ensure_authenticated!(params[:provider_key], params[:service_token], service_id)
|
453
456
|
|
454
|
-
|
457
|
+
token = params[:token]
|
455
458
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
+
# TODO: perhaps improve this to list the deleted tokens?
|
460
|
+
raise AccessTokenInvalid, token unless OAuth::Token::Storage.delete(token, service_id)
|
461
|
+
end
|
459
462
|
|
460
|
-
|
461
|
-
|
463
|
+
get '/services/:service_id/applications/:app_id/oauth_access_tokens.xml' do
|
464
|
+
require_params! :service_id, :app_id
|
462
465
|
|
463
|
-
|
464
|
-
|
466
|
+
service_id = params[:service_id]
|
467
|
+
ensure_authenticated!(params[:provider_key], params[:service_token], service_id)
|
465
468
|
|
466
|
-
|
469
|
+
app_id = params[:app_id]
|
467
470
|
|
468
|
-
|
471
|
+
raise ApplicationNotFound, app_id unless Application.exists?(service_id, app_id)
|
469
472
|
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
+
@tokens = OAuth::Token::Storage.all_by_service_and_app service_id, app_id
|
474
|
+
builder :oauth_access_tokens
|
475
|
+
end
|
473
476
|
|
474
|
-
|
475
|
-
|
477
|
+
get '/services/:service_id/oauth_access_tokens/:token.xml' do
|
478
|
+
require_params! :service_id, :token
|
476
479
|
|
477
|
-
|
478
|
-
|
480
|
+
service_id = params[:service_id]
|
481
|
+
ensure_authenticated!(params[:provider_key], params[:service_token], service_id)
|
479
482
|
|
480
|
-
|
483
|
+
@token_to_app_id = OAuth::Token::Storage.get_credentials(params[:token], service_id)
|
481
484
|
|
482
|
-
|
485
|
+
builder :oauth_app_id_by_token
|
486
|
+
end
|
483
487
|
end
|
484
488
|
|
485
489
|
get '/check.txt' do
|
@@ -11,7 +11,8 @@ Yabeda.configure do
|
|
11
11
|
comment "How long jobs take to run"
|
12
12
|
unit :seconds
|
13
13
|
tags %i[type]
|
14
|
-
|
14
|
+
# Most requests will be under 100ms, so use a higher granularity from there
|
15
|
+
buckets [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.25, 0.5, 0.75, 1]
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
@@ -1,46 +1,28 @@
|
|
1
|
+
SPEC_FILE = 'docs/active_docs/Service Management API.json'
|
2
|
+
|
1
3
|
def run_command cmd
|
2
4
|
puts "--> executing: #{cmd}"
|
3
5
|
puts "--> Remember to commit the resulting specs to the Porta repo."
|
4
6
|
system cmd
|
5
7
|
end
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
res = 'docs/active_docs/Service Management API'
|
10
|
-
res << ' (on-premises)' if type == :on_prem
|
11
|
-
"#{res}.json"
|
12
|
-
end
|
13
|
-
|
14
|
-
def generate_docs(type)
|
15
|
-
spec = spec_file(type)
|
16
|
-
cmd = type == :saas ? 'SAAS_SWAGGER=1' : 'SAAS_SWAGGER=0'
|
17
|
-
cmd << ' bundle exec source2swagger -f lib/3scale/backend/listener.rb -c "##~" -o docs/active_docs/.'
|
9
|
+
def generate_docs
|
10
|
+
cmd = 'bundle exec source2swagger -f lib/3scale/backend/listener.rb -c "##~" -o docs/active_docs/.'
|
18
11
|
run_command cmd
|
19
12
|
# source2swagger is really bad at generating readable JSON
|
20
13
|
require 'json'
|
21
|
-
File.write(
|
14
|
+
File.write(SPEC_FILE, JSON.pretty_generate(JSON.parse(File.read(SPEC_FILE))) << "\n")
|
22
15
|
end
|
23
16
|
|
24
17
|
namespace :docs do
|
25
18
|
namespace :swagger do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
# (Service Management API (on-premises).json and Service Management
|
30
|
-
# API.json)
|
31
|
-
|
32
|
-
desc "Generates all swagger docs"
|
33
|
-
task all: [:saas, :on_prem]
|
34
|
-
|
35
|
-
desc "Generates swagger docs for SaaS"
|
36
|
-
task :saas do
|
37
|
-
generate_docs(:saas)
|
38
|
-
end
|
19
|
+
# The swagger specs generated by these tasks need to be committed to the
|
20
|
+
# Porta repo: https://github.com/3scale/porta/tree/master/doc/active_docs
|
21
|
+
# (Service Management API.json)
|
39
22
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
23
|
+
desc "Generates swagger docs"
|
24
|
+
task :generate do
|
25
|
+
generate_docs
|
44
26
|
end
|
45
27
|
end
|
46
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apisonator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.100.
|
4
|
+
version: 2.100.2.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Ciganek
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2020-
|
19
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
20
20
|
dependencies: []
|
21
21
|
description: This gem provides a daemon that handles authorization and reporting of
|
22
22
|
web services managed by 3scale.
|