active_record-sql_analyzer 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22d80d840d81aa008bae7534058b8d71787b31e2
|
4
|
+
data.tar.gz: 2aef0ef8f50b9b6ac25af43672610c8490192887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d93f8be856da7c946ec186b0a33dc907a9f1d28658178af83ac8e1cc6702666256bad93fa44fa6507f31ff0b0c0a2e2223351c2d4f366b9d977c9f61f3a5535e
|
7
|
+
data.tar.gz: bad03e7907bb1b8be071aac83cbf313b138cf45ad7a43d3805dc01ed20985e130dd4b8b5303f0202ee1968116fe3f3e935f5d03c2faa21b4bd65df0924c2e585
|
@@ -150,7 +150,7 @@ module ActiveRecord
|
|
150
150
|
Redactor.new(/\n/, " "),
|
151
151
|
Redactor.new(/\s+/, " "),
|
152
152
|
Redactor.new(/(\s|\b|`)(=|!=|>=|>|<=|<) ?(BINARY )?-?\d+(\.\d+)?/, " = [REDACTED]"),
|
153
|
-
Redactor.new(/(\s|\b|`)(=|!=|>=|>|<=|<) ?(BINARY )?x?'[
|
153
|
+
Redactor.new(/(\s|\b|`)(=|!=|>=|>|<=|<) ?(BINARY )?x?'.*?[^\\]'/, " = '[REDACTED]'"),
|
154
154
|
Redactor.new(/VALUES \(.+\)$/, "VALUES ([REDACTED])"),
|
155
155
|
Redactor.new(/IN \([^)]+\)/, "IN ([REDACTED])"),
|
156
156
|
Redactor.new(/BETWEEN '[^']*' AND '[^']*'/, "BETWEEN '[REDACTED]' AND '[REDACTED]'"),
|
@@ -51,6 +51,19 @@ RSpec.describe ActiveRecord::SqlAnalyzer::RedactedLogger do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
context "sql quoted" do
|
55
|
+
let(:event) do
|
56
|
+
{
|
57
|
+
caller: [""],
|
58
|
+
sql: "SELECT * FROM foo WHERE name = 'hello\\'s name'"
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
it "redacts" do
|
63
|
+
expect(filter_event[:sql]).to eq("SELECT * FROM foo WHERE name = '[REDACTED]'")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
54
67
|
context "sql" do
|
55
68
|
let(:event) do
|
56
69
|
{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record-sql_analyzer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Anker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|