logstop 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: 507f5f0dacbcc84697ddf439ae337831de41afd79b759313016efbdd4a771eaf
4
- data.tar.gz: 0d4e4d5410380c126a26bd58a7631ee31338d2ea1079ee16585b88310e5e4642
3
+ metadata.gz: 93f5e4b3e017604cc89a5f5cbf9760c58fc620f07a212771604a1f7e87782457
4
+ data.tar.gz: 6f5e11712af3bf0fc6f8b38f2783ec9f9df2fb4efe415c726f8e64433ceacfc9
5
5
  SHA512:
6
- metadata.gz: 9765f5a87b415c9033fca438bd38fb968f9f5584fc50811dd65da5f8336a5e573e961c8b48bf432dc0d5a482ec04b94c9d13ec3ef0f09509892696b7a6c36780
7
- data.tar.gz: d160bbd129b8be46222fc6a52ff656628571e12fed0c54a431924a36461d406a3943234d84a4f2a2026830c9a1f64c2fbc508eb380e0481659acc35e8292cf22
6
+ metadata.gz: cc638ced43a86d26b3f777cd3e52d8cc22d42b1ed390c691751db88871aa618dba5df657909b328e6fbecbfcf0a424623d7ee544ec56879abeb93db4f8615f38
7
+ data.tar.gz: 9b32e7b7fce161e2b39c4c62f79f8a2efcb1bf4eab0d917df5e2a804e6419c2681ff21c22ca8d6819c1c83dbcfa5f0db17baa98a41506eb6436bd42a99963a2e
@@ -1,31 +1,35 @@
1
- ## 0.2.5
1
+ ## 0.2.6 (2020-04-10)
2
+
3
+ - Reduced allocations
4
+
5
+ ## 0.2.5 (2019-10-27)
2
6
 
3
7
  - Fixed filtering UUIDs
4
8
 
5
- ## 0.2.4
9
+ ## 0.2.4 (2018-12-11)
6
10
 
7
11
  - Added `scubber` option for custom rules
8
12
  - Scrub URL-encoded data
9
13
 
10
- ## 0.2.3
14
+ ## 0.2.3 (2018-05-16)
11
15
 
12
16
  - Fixed tagged logging
13
17
 
14
- ## 0.2.2
18
+ ## 0.2.2 (2018-05-15)
15
19
 
16
20
  - Added `guard` method
17
21
 
18
- ## 0.2.1
22
+ ## 0.2.1 (2018-05-15)
19
23
 
20
24
  - Fix for log broadcaster in Rails console
21
25
  - Fix for URL password filtering
22
26
 
23
- ## 0.2.0
27
+ ## 0.2.0 (2018-04-03)
24
28
 
25
29
  - Less aggressive filtering on numbers
26
30
  - Filter passwords in URLs
27
31
  - Added `Logstop.scrub` method
28
32
 
29
- ## 0.1.0
33
+ ## 0.1.0 (2018-03-31)
30
34
 
31
35
  - First release
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2019 Andrew Kane
3
+ Copyright (c) 2018-2020 Andrew Kane
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -102,11 +102,11 @@ Everyone is encouraged to help improve this project. Here are a few ways you can
102
102
  - Write, clarify, or fix documentation
103
103
  - Suggest or add new features
104
104
 
105
- To get started with development and testing:
105
+ To get started with development:
106
106
 
107
107
  ```sh
108
108
  git clone https://github.com/ankane/logstop.git
109
109
  cd logstop
110
110
  bundle install
111
- rake test
111
+ bundle exec rake test
112
112
  ```
@@ -15,18 +15,17 @@ module Logstop
15
15
  URL_PASSWORD_REGEX = /((\/\/|%2F%2F)\S+(:|%3A))\S+(@|%40)/
16
16
 
17
17
  def self.scrub(msg, ip: false, scrubber: nil)
18
- msg = msg.to_s
18
+ msg = msg.to_s.dup
19
19
 
20
20
  # order filters are applied is important
21
- msg = msg
22
- .gsub(URL_PASSWORD_REGEX, FILTERED_URL_STR)
23
- .gsub(EMAIL_REGEX, FILTERED_STR)
24
- .gsub(CREDIT_CARD_REGEX, FILTERED_STR)
25
- .gsub(CREDIT_CARD_REGEX_DELIMITERS, FILTERED_STR)
26
- .gsub(PHONE_REGEX, FILTERED_STR)
27
- .gsub(SSN_REGEX, FILTERED_STR)
28
-
29
- msg = msg.gsub(IP_REGEX, FILTERED_STR) if ip
21
+ msg.gsub!(URL_PASSWORD_REGEX, FILTERED_URL_STR)
22
+ msg.gsub!(EMAIL_REGEX, FILTERED_STR)
23
+ msg.gsub!(CREDIT_CARD_REGEX, FILTERED_STR)
24
+ msg.gsub!(CREDIT_CARD_REGEX_DELIMITERS, FILTERED_STR)
25
+ msg.gsub!(PHONE_REGEX, FILTERED_STR)
26
+ msg.gsub!(SSN_REGEX, FILTERED_STR)
27
+
28
+ msg.gsub!(IP_REGEX, FILTERED_STR) if ip
30
29
 
31
30
  msg = scrubber.call(msg) if scrubber
32
31
 
@@ -1,3 +1,3 @@
1
1
  module Logstop
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-28 00:00:00.000000000 Z
11
+ date: 2020-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.0.3
129
+ rubygems_version: 3.1.2
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Keep personally identifiable information (PII) out of your logs