2021-01-03 14:25:43 +05:30
|
|
|
# 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!
|
|
|
|
|
|
|
|
feature_category :tracing
|
2022-07-23 23:45:48 +05:30
|
|
|
urgency :low
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
def show
|
2022-07-16 23:28:13 +05:30
|
|
|
render_404 unless Feature.enabled?(:monitor_tracing, @project)
|
2021-01-03 14:25:43 +05:30
|
|
|
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
|