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: 6c82d43db3028f9c593d113b9b78c9cbf2d9b144
4
- data.tar.gz: c9fdbf5b69d296f36e25307388e58c3a17a4e7c3
3
+ metadata.gz: 22d80d840d81aa008bae7534058b8d71787b31e2
4
+ data.tar.gz: 2aef0ef8f50b9b6ac25af43672610c8490192887
5
5
  SHA512:
6
- metadata.gz: a4587d84adb818984808c88a3e4f3d11ef71323812420208dd3d158fa1f414eb27f918712233f174f05b9749978f8d9e955eda267a1cd05610377b9980bed4fe
7
- data.tar.gz: 22150ab73c5b89668e0c86bed36e0248d8c0f403379a56363971d937ee21b60c583ceeae0750661f60b97faf3b4ffaf1b5e51a953ef99364c783c4b51e017dd6
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?'[^']*'/, " = '[REDACTED]'"),
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]'"),
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module SqlAnalyzer
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
5
5
  end
@@ -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.6
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-03-22 00:00:00.000000000 Z
12
+ date: 2016-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord