Skip to content

Commit 2e7f30c

Browse files
committed
Fixes #32513 - Properly check certs when running running in proxy
1 parent 8bef272 commit 2e7f30c

File tree

1 file changed

+14
-1
lines changed
  • lib/smart_proxy_dynflow_core

1 file changed

+14
-1
lines changed

lib/smart_proxy_dynflow_core/api.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
require 'sinatra/base'
22
require '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+
413
module 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

0 commit comments

Comments
 (0)