2020-10-08 11:08:17 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects
|
|
|
|
class TracingsController < Projects::ApplicationController
|
|
|
|
content_security_policy do |p|
|
|
|
|
next if p.directives.blank?
|
|
|
|
|
|
|
|
global_frame_src = p.frame_src
|
|
|
|
|
|
|
|
p.frame_src -> { frame_src_csp_policy(global_frame_src) }
|
|
|
|
end
|
|
|
|
|
|
|
|
before_action :authorize_update_environment!
|
|
|
|
|
2020-10-08 14:08:32 -04:00
|
|
|
feature_category :tracing
|
|
|
|
|
2020-10-08 11:08:17 -04:00
|
|
|
def show
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def frame_src_csp_policy(global_frame_src)
|
|
|
|
external_url = @project&.tracing_setting&.external_url
|
|
|
|
|
|
|
|
external_url.presence || global_frame_src
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|