semian 0.20.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/semian/activerecord_trilogy_adapter.rb +1 -5
- data/lib/semian/mysql2.rb +2 -6
- data/lib/semian/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: bf43c5c57553b9262a1c1c4ef782fe92483480c1793604c9d0c7b328b907de53
|
4
|
+
data.tar.gz: c8d73c47247f10cdac57053356f61e65bdb5f38c134b2122f030e42dc175b26d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6c96130e5c56f963e7ab63f1d561c843a8d3ff93593981bfe819d034dcf3c3e88a4a3a00b35c8779b8529629ea8fa29cd06e73acec0233ec1b909bd32184057
|
7
|
+
data.tar.gz: 589794eedc49e355705f82271743346a289f10aba2089d80a89a9eade0fa4a221d5476142e3c20aee3a501139ceb6c82217bed378842e6f91cc6f5cb54fc5636
|
@@ -91,11 +91,7 @@ module Semian
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# TODO: share this with Mysql2
|
94
|
-
QUERY_ALLOWLIST =
|
95
|
-
%r{\A(?:/\*.*?\*/)?\s*ROLLBACK}i,
|
96
|
-
%r{\A(?:/\*.*?\*/)?\s*COMMIT}i,
|
97
|
-
%r{\A(?:/\*.*?\*/)?\s*RELEASE\s+SAVEPOINT}i,
|
98
|
-
)
|
94
|
+
QUERY_ALLOWLIST = %r{\A(?:/\*.*?\*/)?\s*(ROLLBACK|COMMIT|RELEASE\s+SAVEPOINT)}i
|
99
95
|
|
100
96
|
def query_allowlisted?(sql, *)
|
101
97
|
QUERY_ALLOWLIST.match?(sql)
|
data/lib/semian/mysql2.rb
CHANGED
@@ -37,11 +37,7 @@ module Semian
|
|
37
37
|
DEFAULT_HOST = "localhost"
|
38
38
|
DEFAULT_PORT = 3306
|
39
39
|
|
40
|
-
|
41
|
-
%r{\A(?:/\*.*?\*/)?\s*ROLLBACK}i,
|
42
|
-
%r{\A(?:/\*.*?\*/)?\s*COMMIT}i,
|
43
|
-
%r{\A(?:/\*.*?\*/)?\s*RELEASE\s+SAVEPOINT}i,
|
44
|
-
)
|
40
|
+
QUERY_ALLOWLIST = %r{\A(?:/\*.*?\*/)?\s*(ROLLBACK|COMMIT|RELEASE\s+SAVEPOINT)}i
|
45
41
|
|
46
42
|
class << self
|
47
43
|
# The naked methods are exposed as `raw_query` and `raw_connect` for instrumentation purpose
|
@@ -114,7 +110,7 @@ module Semian
|
|
114
110
|
end
|
115
111
|
|
116
112
|
def query_whitelisted?(sql, *)
|
117
|
-
|
113
|
+
QUERY_ALLOWLIST =~ sql
|
118
114
|
rescue ArgumentError
|
119
115
|
# The above regexp match can fail if the input SQL string contains binary
|
120
116
|
# data that is not recognized as a valid encoding, in which case we just
|
data/lib/semian/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Francis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-10-
|
13
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: |2
|
16
16
|
A Ruby C extention that is used to control access to shared resources
|