File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
lib/smart_proxy_dynflow_core Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11require 'sinatra/base'
22require 'multi_json'
33
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+
413module SmartProxyDynflowCore
514 class Api < ::Sinatra ::Base
615 TASK_UPDATE_REGEXP_PATH = %r{/tasks/(\S +)/(update|done)}
716 helpers Helpers
817
18+ include ::Sinatra ::Authorization ::Helpers if defined? ( ::Sinatra ::Authorization ::Helpers )
19+
920 configure do
1021 if Settings . instance . standalone
1122 ::Sinatra ::Base . set :logging , false
@@ -19,8 +30,10 @@ class Api < ::Sinatra::Base
1930 task_id = match [ 1 ]
2031 action = match [ 2 ]
2132 authorize_with_token ( task_id : task_id , clear : action == 'done' )
22- else
33+ elsif Settings . instance . standalone
2334 authorize_with_ssl_client
35+ else
36+ do_authorize_any
2437 end
2538 content_type :json
2639 end
You can’t perform that action at this time.
0 commit comments