skadi 0.4.0.beta.5 → 0.4.0.beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/app/models/skadi/dashboard_query.rb +11 -0
- data/app/models/skadi/dashboard_validator.rb +5 -3
- data/lib/skadi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8fad66500a6f01a326ce57479a300747813664e1f4beb14b5304a50b85336ae3
|
|
4
|
+
data.tar.gz: 66ca1b5bec688d00bdd1be67d19cc22675c26c77aac5378f9260c55e2c9afb8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f00ce9d81afada960d03be0ba7c3b54b362d66dd616cb35b35dc19e29bc5c029da485e0e06993940d0f33582132b59a495b7f1c5b388ca26b2ecf26078897c99
|
|
7
|
+
data.tar.gz: 742cc0ae411e0c3c5bba2fb72f6d0831b72d1840309f8a9b6ecbffa4d671515aae49ccb5c65410c5d334c554a62949d170de1a06026eba0dbb408663961aff87
|
data/CHANGELOG.md
CHANGED
|
@@ -71,6 +71,17 @@ module Skadi
|
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
private def build_sql_query(dataset, chart, untrusted_param_filters)
|
|
74
|
+
# The table chart can display arbitrary data so we allow any columns
|
|
75
|
+
if chart["type"] == "table"
|
|
76
|
+
# We still wrap in a subquery to prevent data modification
|
|
77
|
+
return "
|
|
78
|
+
SELECT
|
|
79
|
+
*
|
|
80
|
+
FROM
|
|
81
|
+
(#{dataset["sql"]}) AS t
|
|
82
|
+
"
|
|
83
|
+
end
|
|
84
|
+
|
|
74
85
|
model = Skadi::Visit
|
|
75
86
|
|
|
76
87
|
safe_group = [ "t.split" ]
|
|
@@ -137,10 +137,10 @@ module Skadi
|
|
|
137
137
|
return @types
|
|
138
138
|
end
|
|
139
139
|
|
|
140
|
-
Context = Struct.new(:record, :allowed_sql_strings, :dataset_ids)
|
|
140
|
+
Context = Struct.new(:record, :allowed_sql_strings, :dataset_ids, :chart_type)
|
|
141
141
|
|
|
142
142
|
def validate(record)
|
|
143
|
-
context = Context.new(record, nil, [])
|
|
143
|
+
context = Context.new(record, nil, [], nil)
|
|
144
144
|
|
|
145
145
|
validate_type(ArrayOf.new(:DashboardTabConfig, 1), record.configuration, "configuration", context:)
|
|
146
146
|
end
|
|
@@ -262,7 +262,7 @@ module Skadi
|
|
|
262
262
|
return add_error(path, "must be a string", context:)
|
|
263
263
|
end
|
|
264
264
|
|
|
265
|
-
unless [ "date", "split", "count" ].all? { |it| value.include?(it) }
|
|
265
|
+
unless context.chart_type == "table" || [ "date", "split", "count" ].all? { |it| value.include?(it) }
|
|
266
266
|
add_error(path, "must include the fields date, split and count", context:)
|
|
267
267
|
end
|
|
268
268
|
end
|
|
@@ -314,6 +314,8 @@ module Skadi
|
|
|
314
314
|
return add_error(path, "Unknown type #{type.inspect}", context:) unless self.class.types.key?(type)
|
|
315
315
|
|
|
316
316
|
if type == :ChartConfig && value.is_a?(Hash)
|
|
317
|
+
context.chart_type = value["type"]
|
|
318
|
+
|
|
317
319
|
context.dataset_ids = []
|
|
318
320
|
|
|
319
321
|
if value["datasets"].is_a?(Array)
|
data/lib/skadi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: skadi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.0.beta.
|
|
4
|
+
version: 0.4.0.beta.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Simon J
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-09-
|
|
10
|
+
date: 2026-09-29 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|