smart_proxy_dynflow_core 0.3.2 → 0.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae61c912ffbb4027b1445e41995bbe66a97089c6f498c612b180da1ac91b248b
4
- data.tar.gz: 7ce93f5bde709fab044af950c9b6b8664e60f2d173b3147a1beabd3da694fa32
3
+ metadata.gz: 8c8d92f97c019f9624f042ba66a48f3121b341b1c5f9cfdb3fe5a35a4f83f074
4
+ data.tar.gz: 9707da718ef1d2d042dd4bade34e2b6d869236058bd9bf0bfcea07011862cf16
5
5
  SHA512:
6
- metadata.gz: 40f546771cd25e48148fe50041544f663799f757d2aedf0635cc41de0a8b540228d8e116fa81b1d5cfe24913d2e75ac5a9912e9bac2813b8b2506ff894458d54
7
- data.tar.gz: 00167adcc5eb1f24f65efa798fa00875bf0db221ba8aa1515d512a168e2c67c407391237f0a6770a1747b3519c5e632cbbb746d0eb1e797e65b967642e4a19d5
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
- else
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
@@ -1,3 +1,3 @@
1
1
  module SmartProxyDynflowCore
2
- VERSION = '0.3.2'.freeze
2
+ VERSION = '0.3.3'.freeze
3
3
  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.2
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: 1980-01-01 00:00:00.000000000 Z
11
+ date: 2021-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler