json2sql 1.0.13 → 1.0.15
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/lib/json2sql/query_policy.rb +6 -4
- data/lib/json2sql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 698df3c08077bb25df5b606c6cc419891dad06698053d5af5e5fb451d33a9c1c
|
|
4
|
+
data.tar.gz: 5e7469e5e323e7226f7a200fbd60daaedc92d1cefdcac7efd78ba8cfd1680897
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 685484a3bc90af693415f4d9bc20321b256e1279b52edcb5abe554195532f205076f3ca5c7e54c627e757f69a1029f9d5acb4eb1f479755503d9eb0208813c25
|
|
7
|
+
data.tar.gz: 4558dc87daef35b1b26805fb8d49f35ad1bc67d80395f94fa52ef13ffa1a9c474bb7842a878275e611aafe157496529ff59b1f625537b13f949a6973efe827cc
|
|
@@ -5,7 +5,7 @@ module Json2sql
|
|
|
5
5
|
# Parameters:
|
|
6
6
|
# mode: :allow (default) — only tables listed in `tables:` are accessible.
|
|
7
7
|
# Tables absent from `tables:` are blocked entirely.
|
|
8
|
-
# Empty `tables:` =
|
|
8
|
+
# Empty `tables:` = all tables blocked.
|
|
9
9
|
# :deny — all tables pass. After column filtering, tables
|
|
10
10
|
# with no remaining accessible columns are removed.
|
|
11
11
|
# Same rule applies to children and parents.
|
|
@@ -95,7 +95,11 @@ module Json2sql
|
|
|
95
95
|
|
|
96
96
|
def empty_columns?(params)
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
return false unless params.is_a?(Hash)
|
|
99
|
+
|
|
100
|
+
cols = params["columns"]
|
|
101
|
+
|
|
102
|
+
(cols.is_a?(Array) || cols.is_a?(Hash)) && cols.empty?
|
|
99
103
|
end
|
|
100
104
|
|
|
101
105
|
def filter_tables(params, config)
|
|
@@ -106,8 +110,6 @@ module Json2sql
|
|
|
106
110
|
|
|
107
111
|
tables = config.is_a?(Hash) ? config : {}
|
|
108
112
|
|
|
109
|
-
return if tables.empty?
|
|
110
|
-
|
|
111
113
|
params.select! { |table, _| tables.key?(table) }
|
|
112
114
|
end
|
|
113
115
|
|
data/lib/json2sql/version.rb
CHANGED