blob: ce81f337e47638d4d565e4e233be8e24f7e4dbf5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# frozen_string_literal: true
# Acts as a pass-through to allow embeddable dashboards to be
# generated based on external data, but still processed with the
# required attributes that allow the FE to render them appropriately.
#
# Use Gitlab::Metrics::Dashboard::Finder to retrive dashboards.
module Metrics
module Dashboard
class TransientEmbedService < ::Metrics::Dashboard::BaseEmbedService
extend ::Gitlab::Utils::Override
class << self
def valid_params?(params)
[
embedded?(params[:embedded]),
params[:embed_json]
].all?
end
end
private
override :get_raw_dashboard
def get_raw_dashboard
JSON.parse(params[:embed_json])
end
override :sequence
def sequence
[STAGES::EndpointInserter]
end
override :identifiers
def identifiers
Digest::SHA256.hexdigest(params[:embed_json])
end
end
end
end
|