smart_proxy_dynflow_core 0.3.2 → 0.3.3
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c8d92f97c019f9624f042ba66a48f3121b341b1c5f9cfdb3fe5a35a4f83f074
|
4
|
+
data.tar.gz: 9707da718ef1d2d042dd4bade34e2b6d869236058bd9bf0bfcea07011862cf16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45ced7ab76fefbdbea72fceee20b9b7c77c9394464045d7bff56cccb2882a9fa89f2d01a858e9b2aecd6a29c09f20388b3775873b8bcd65bfdb836a540b0a848
|
7
|
+
data.tar.gz: 4a08ac7bf67111e7644071d2627d341d741496282b13ae134014a8b74956ac1310f397124ea49a9468fc00bf051fd524cba244feae7fc17b050b91cfa14e3048
|
@@ -1,11 +1,22 @@
|
|
1
1
|
require 'sinatra/base'
|
2
2
|
require 'multi_json'
|
3
3
|
|
4
|
+
# rubocop:disable Lint/HandleExceptions
|
5
|
+
begin
|
6
|
+
require 'proxy/log'
|
7
|
+
require 'proxy/helpers'
|
8
|
+
require 'sinatra/authorization'
|
9
|
+
rescue LoadError
|
10
|
+
end
|
11
|
+
# rubocop:enable Lint/HandleExceptions
|
12
|
+
|
4
13
|
module SmartProxyDynflowCore
|
5
14
|
class Api < ::Sinatra::Base
|
6
15
|
TASK_UPDATE_REGEXP_PATH = %r{/tasks/(\S+)/(update|done)}
|
7
16
|
helpers Helpers
|
8
17
|
|
18
|
+
include ::Sinatra::Authorization::Helpers if defined?(::Sinatra::Authorization::Helpers)
|
19
|
+
|
9
20
|
configure do
|
10
21
|
if Settings.instance.standalone
|
11
22
|
::Sinatra::Base.set :logging, false
|
@@ -19,8 +30,10 @@ module SmartProxyDynflowCore
|
|
19
30
|
task_id = match[1]
|
20
31
|
action = match[2]
|
21
32
|
authorize_with_token(task_id: task_id, clear: action == 'done')
|
22
|
-
|
33
|
+
elsif Settings.instance.standalone
|
23
34
|
authorize_with_ssl_client
|
35
|
+
else
|
36
|
+
do_authorize_any
|
24
37
|
end
|
25
38
|
content_type :json
|
26
39
|
end
|
@@ -76,7 +76,7 @@ module SmartProxyDynflowCore
|
|
76
76
|
settings = YAML.load_file(path)
|
77
77
|
name = File.basename(path).gsub(/\.yml$/, '')
|
78
78
|
if SETTINGS.plugins.key? name
|
79
|
-
settings = SETTINGS.plugins[name].to_h.merge(settings)
|
79
|
+
settings = SETTINGS.plugins[name].to_h.merge(settings || {})
|
80
80
|
end
|
81
81
|
SETTINGS.plugins[name] = OpenStruct.new settings
|
82
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_dynflow_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|