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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26e484cfbf6df5f66d12b5564e657a2cdf41d78c833dae12bde108eaff328823
4
- data.tar.gz: 3d0280b22ab68f9dc6f625a6cc8d4b135a69d63d96d5e5d7e01d5f67353e61a1
3
+ metadata.gz: 8fad66500a6f01a326ce57479a300747813664e1f4beb14b5304a50b85336ae3
4
+ data.tar.gz: 66ca1b5bec688d00bdd1be67d19cc22675c26c77aac5378f9260c55e2c9afb8c
5
5
  SHA512:
6
- metadata.gz: e47cc2275373be9eb23bb58748efcf24a95b3124ff636dc9f48a7d7328413705241ce6116fc012efcfc32c441ed605f7ce0613fd311ff220505aec37757fbd93
7
- data.tar.gz: 34b2d8ce650b3795af5b4edcc92532dfecfca8d3737426b3ebd038f3aed15adddf57584d5de0b99bc8c9c2537db8b31bd7a40c5eb5b058221e21e948837cae88
6
+ metadata.gz: f00ce9d81afada960d03be0ba7c3b54b362d66dd616cb35b35dc19e29bc5c029da485e0e06993940d0f33582132b59a495b7f1c5b388ca26b2ecf26078897c99
7
+ data.tar.gz: 742cc0ae411e0c3c5bba2fb72f6d0831b72d1840309f8a9b6ecbffa4d671515aae49ccb5c65410c5d334c554a62949d170de1a06026eba0dbb408663961aff87
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.4.0.beta.6 [2026-09-29]
2
+ - Remove restrictions on SQL for table datasets
3
+
1
4
  ## 0.4.0.beta.5 [2026-09-21]
2
5
  - Fix inconsistent ordering of SQL datasets
3
6
  - Add CI
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Skadi
2
- VERSION = "0.4.0.beta.5"
2
+ VERSION = "0.4.0.beta.6"
3
3
  end
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.5
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-21 00:00:00.000000000 Z
10
+ date: 2026-09-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails