logasm 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/benchmark/whitelisting.rb +52 -0
- data/lib/logasm/preprocessors/json_pointer_trie.rb +40 -0
- data/lib/logasm/preprocessors/whitelist.rb +24 -80
- data/logasm.gemspec +3 -1
- data/spec/preprocessors/json_pointer_trie.rb +36 -0
- data/spec/preprocessors/whitelist_spec.rb +63 -79
- metadata +35 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c09d965be2c9ada94a7ee35d4b7518f411b9a81
|
4
|
+
data.tar.gz: d3442723ac39e8661ac4d789b159aca7f2152895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a896dc77965ca1b6022ec65918327b8a94435d85ae592e6a516bed903f2588f4b1257e692c7e5915f5431af2564ec14fe9e73b6627d689b0f8f2b4a035df48d
|
7
|
+
data.tar.gz: 32deab6ec961e0ffdc123ec6065fa09eabf4a604740c98a9782aeaaf7927f6c5e0160bc99574a94018dcff667aec84eeab62f2de8349af46d84f7a6add776354
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.1
|
1
|
+
ruby-2.4.1
|
data/Gemfile
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'logasm/preprocessors/whitelist'
|
3
|
+
require 'benchmark/ips'
|
4
|
+
|
5
|
+
pointers = %w[
|
6
|
+
/scalar
|
7
|
+
/flat_hash/~
|
8
|
+
/nested_hash/~/deep_hash/~
|
9
|
+
/flat_array/~
|
10
|
+
/nested_array/~/deep_array/~
|
11
|
+
]
|
12
|
+
|
13
|
+
preprocessor = Logasm::Preprocessors::Whitelist.new(pointers: pointers)
|
14
|
+
|
15
|
+
|
16
|
+
Benchmark.ips do |x|
|
17
|
+
x.config(time: 5, warmup: 2)
|
18
|
+
|
19
|
+
x.report('Scalar value whitelisting') do
|
20
|
+
preprocessor.process(scalar: 'value', bad_scalar: 'value', hash: {})
|
21
|
+
end
|
22
|
+
|
23
|
+
x.report('Flat hash whitelisting') do
|
24
|
+
preprocessor.process(flat_hash: { scalar: 'value', array: [1, 2], hash: {} })
|
25
|
+
end
|
26
|
+
|
27
|
+
x.report('Nested hash whitelisting') do
|
28
|
+
preprocessor.process(
|
29
|
+
nested_hash: {
|
30
|
+
next_level_hash: {
|
31
|
+
deep_hash: { scalar: 'value', array: [1, 2] }
|
32
|
+
},
|
33
|
+
next_level_hash2: {
|
34
|
+
deep_hash: { scalar: 'value', array: [1, 2] }
|
35
|
+
},
|
36
|
+
next_level_hash3: {
|
37
|
+
deep_hash: { scalar: 'value', array: [1, 2] }
|
38
|
+
}
|
39
|
+
}
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
x.report('Flat array whitelisting') do
|
44
|
+
preprocessor.process(
|
45
|
+
nested_array: [
|
46
|
+
{ deep_array: [1, 2, 3] },
|
47
|
+
{ deep_array: [1, 2, 3] },
|
48
|
+
{ deep_array: [1, 2, 3] }
|
49
|
+
]
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'lru_redux'
|
2
|
+
|
3
|
+
class Logasm
|
4
|
+
module Preprocessors
|
5
|
+
class JSONPointerTrie
|
6
|
+
SEPARATOR = '/'.freeze
|
7
|
+
WILDCARD = '~'.freeze
|
8
|
+
DEFAULT_CACHE_SIZE = 100
|
9
|
+
|
10
|
+
def initialize(cache_size: DEFAULT_CACHE_SIZE, **)
|
11
|
+
@root_node = {}
|
12
|
+
@cache = LruRedux::Cache.new(cache_size)
|
13
|
+
end
|
14
|
+
|
15
|
+
def insert(pointer)
|
16
|
+
split_path(pointer).reduce(@root_node) do |tree, key|
|
17
|
+
tree[key] ||= {}
|
18
|
+
end
|
19
|
+
|
20
|
+
self
|
21
|
+
end
|
22
|
+
|
23
|
+
def include?(path)
|
24
|
+
@cache.getset(path) { traverse_path(path) }
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def traverse_path(path)
|
30
|
+
split_path(path).reduce(@root_node) do |node, key|
|
31
|
+
node[key] || node[WILDCARD] || (break false)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def split_path(path)
|
36
|
+
path.split(SEPARATOR).reject(&:empty?)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -1,28 +1,23 @@
|
|
1
|
+
require 'logasm/preprocessors/json_pointer_trie'
|
2
|
+
|
1
3
|
class Logasm
|
2
4
|
module Preprocessors
|
3
5
|
class Whitelist
|
4
|
-
|
5
|
-
|
6
|
-
MASK_SYMBOL = '*'
|
6
|
+
DEFAULT_WHITELIST = %w[/id /message /correlation_id /queue].freeze
|
7
|
+
MASK_SYMBOL = '*'.freeze
|
7
8
|
MASKED_VALUE = MASK_SYMBOL * 5
|
8
|
-
WILDCARD = '~'
|
9
9
|
|
10
10
|
class InvalidPointerFormatException < Exception
|
11
11
|
end
|
12
12
|
|
13
13
|
def initialize(config = {})
|
14
14
|
pointers = (config[:pointers] || []) + DEFAULT_WHITELIST
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
|
16
|
+
@trie = pointers.reduce(JSONPointerTrie.new(config)) do |trie, pointer|
|
17
|
+
validate_pointer(pointer)
|
18
|
+
|
19
|
+
trie.insert(decode(pointer))
|
20
20
|
end
|
21
|
-
@wildcards = decoded_pointers
|
22
|
-
.select(&method(:has_wildcard?))
|
23
|
-
.inject({}) do |mem, pointer|
|
24
|
-
mem.merge(get_wildcard_roots_of(pointer))
|
25
|
-
end
|
26
21
|
end
|
27
22
|
|
28
23
|
def process(data)
|
@@ -31,38 +26,9 @@ class Logasm
|
|
31
26
|
|
32
27
|
private
|
33
28
|
|
34
|
-
|
35
|
-
def has_wildcard?(pointer)
|
36
|
-
pointer.include?("/#{WILDCARD}/") || pointer.end_with?("/#{WILDCARD}")
|
37
|
-
end
|
38
|
-
|
39
|
-
# From a pointer with wildcards builds a hash with roots that contains a wildcard. Hash is used to easily match
|
40
|
-
# find if hash element matches the pointer while processing the log.
|
41
|
-
#
|
42
|
-
# Example:
|
43
|
-
#
|
44
|
-
# Input:
|
45
|
-
# "/array/~/nested_array/~/fields"
|
46
|
-
#
|
47
|
-
# Output:
|
48
|
-
# {
|
49
|
-
# "/array/~/nested_array/~" => true,
|
50
|
-
# "/array/~" => true
|
51
|
-
# }
|
52
|
-
#
|
53
|
-
def get_wildcard_roots_of(pointer)
|
54
|
-
if (index = pointer.rindex("/#{WILDCARD}/"))
|
55
|
-
wildcard_root = pointer.slice(0, index + 2)
|
56
|
-
wildcard_path = pointer.end_with?(WILDCARD) ? pointer : wildcard_root
|
57
|
-
get_wildcard_roots_of(wildcard_root).merge(wildcard_path => true)
|
58
|
-
else
|
59
|
-
{pointer => true}
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
29
|
def validate_pointer(pointer)
|
64
30
|
if pointer.slice(-1) == '/'
|
65
|
-
raise InvalidPointerFormatException
|
31
|
+
raise InvalidPointerFormatException, 'Pointer should not contain trailing slash'
|
66
32
|
end
|
67
33
|
end
|
68
34
|
|
@@ -73,52 +39,30 @@ class Logasm
|
|
73
39
|
end
|
74
40
|
|
75
41
|
def process_data(parent_pointer, data)
|
76
|
-
|
77
|
-
|
42
|
+
return MASKED_VALUE unless @trie.include?(parent_pointer)
|
43
|
+
|
44
|
+
case data
|
45
|
+
when Hash
|
46
|
+
process_hash(parent_pointer, data)
|
47
|
+
|
48
|
+
when Array
|
49
|
+
process_array(parent_pointer, data)
|
78
50
|
|
79
|
-
def get_type(data)
|
80
|
-
if data.is_a? Hash
|
81
|
-
'hash'
|
82
|
-
elsif data.is_a? Array
|
83
|
-
'array'
|
84
51
|
else
|
85
|
-
|
52
|
+
data
|
86
53
|
end
|
87
54
|
end
|
88
55
|
|
89
56
|
def process_hash(parent_pointer, hash)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
else
|
94
|
-
lambda { |key| "#{parent_pointer}/#{key}" }
|
95
|
-
end
|
96
|
-
hash.inject({}) do |mem, (key, value)|
|
97
|
-
pointer = create_child_pointer.call(key)
|
98
|
-
processed_value = process_data(pointer, value)
|
99
|
-
mem.merge(key => processed_value)
|
57
|
+
hash.each_with_object({}) do |(key, value), result|
|
58
|
+
processed = process_data("#{parent_pointer}/#{key}", value)
|
59
|
+
result[key] = processed
|
100
60
|
end
|
101
61
|
end
|
102
62
|
|
103
63
|
def process_array(parent_pointer, array)
|
104
|
-
|
105
|
-
|
106
|
-
lambda { |_| "#{parent_pointer}/~" }
|
107
|
-
else
|
108
|
-
lambda { |index| "#{parent_pointer}/#{index}" }
|
109
|
-
end
|
110
|
-
array.each_with_index.inject([]) do |mem, (value, index)|
|
111
|
-
pointer = create_child_pointer.call(index)
|
112
|
-
processed_value = process_data(pointer, value)
|
113
|
-
mem + [processed_value]
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def process_value(parent_pointer, value)
|
118
|
-
if @fields_to_include[parent_pointer]
|
119
|
-
value
|
120
|
-
else
|
121
|
-
MASKED_VALUE
|
64
|
+
array.each_with_index.map do |value, index|
|
65
|
+
process_data("#{parent_pointer}/#{index}", value)
|
122
66
|
end
|
123
67
|
end
|
124
68
|
end
|
data/logasm.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "logasm"
|
7
|
-
gem.version = '0.
|
7
|
+
gem.version = '0.9.0'
|
8
8
|
gem.authors = ["Salemove"]
|
9
9
|
gem.email = ["support@salemove.com"]
|
10
10
|
gem.description = %q{It's logasmic}
|
@@ -17,8 +17,10 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
|
19
19
|
gem.add_dependency 'inflecto'
|
20
|
+
gem.add_dependency 'lru_redux'
|
20
21
|
|
21
22
|
gem.add_development_dependency "bundler", "~> 1.3"
|
22
23
|
gem.add_development_dependency "rake"
|
23
24
|
gem.add_development_dependency "bunny"
|
25
|
+
gem.add_development_dependency "benchmark-ips"
|
24
26
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'logasm/preprocessors/json_pointer_trie'
|
3
|
+
|
4
|
+
RSpec.describe Logasm::Preprocessors::JSONPointerTrie do
|
5
|
+
let(:trie) { described_class.new }
|
6
|
+
|
7
|
+
describe '#includes?' do
|
8
|
+
it 'returns true for empty prefix' do
|
9
|
+
expect(trie).to include('')
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'returns true if trie contains requested prefix or value itself' do
|
13
|
+
trie.insert('/data/nested/key')
|
14
|
+
|
15
|
+
expect(trie).to include('/data')
|
16
|
+
expect(trie).to include('/data/nested')
|
17
|
+
expect(trie).to include('/data/nested/key')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'returns false if trie does not contain requested prefix or value' do
|
21
|
+
trie.insert('/data/nested/key')
|
22
|
+
|
23
|
+
expect(trie).to_not include('/bad_data')
|
24
|
+
expect(trie).to_not include('/data/bad_nested')
|
25
|
+
expect(trie).to_not include('/data/nested/bad_key')
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'returns true if trie contains requested prefix under wildcard' do
|
29
|
+
trie.insert('/data/~/key')
|
30
|
+
|
31
|
+
expect(trie).to include('/data/arbitrary_key/key')
|
32
|
+
expect(trie).to include('/data/another_key/key')
|
33
|
+
expect(trie).to_not include('/data/arbitrary_key/bad_nested_key')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -4,24 +4,24 @@ require_relative '../../lib/logasm/preprocessors/whitelist'
|
|
4
4
|
describe Logasm::Preprocessors::Whitelist do
|
5
5
|
subject(:processed_data) { described_class.new(config).process(data) }
|
6
6
|
|
7
|
-
let(:config) { {pointers: pointers} }
|
7
|
+
let(:config) { { pointers: pointers } }
|
8
8
|
let(:pointers) { [] }
|
9
|
-
let(:data)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
let(:data) do
|
10
|
+
{
|
11
|
+
field: 'secret',
|
12
|
+
data: {
|
13
|
+
field: 'secret'
|
14
|
+
},
|
15
|
+
array: [{ field: 'secret' }]
|
16
|
+
}
|
17
|
+
end
|
16
18
|
|
17
19
|
it 'masks all non-whitelisted fields' do
|
18
|
-
expect(processed_data).to eq(
|
20
|
+
expect(processed_data).to eq(
|
19
21
|
field: '*****',
|
20
|
-
data:
|
21
|
-
|
22
|
-
|
23
|
-
array: [{field: '*****'}]
|
24
|
-
})
|
22
|
+
data: '*****',
|
23
|
+
array: '*****'
|
24
|
+
)
|
25
25
|
end
|
26
26
|
|
27
27
|
context 'when pointer has trailing slash' do
|
@@ -36,13 +36,11 @@ describe Logasm::Preprocessors::Whitelist do
|
|
36
36
|
let(:pointers) { ['/field'] }
|
37
37
|
|
38
38
|
it 'includes the field' do
|
39
|
-
expect(processed_data).to eq(
|
39
|
+
expect(processed_data).to eq(
|
40
40
|
field: 'secret',
|
41
|
-
data:
|
42
|
-
|
43
|
-
|
44
|
-
array: [{field: '*****'}]
|
45
|
-
})
|
41
|
+
data: '*****',
|
42
|
+
array: '*****'
|
43
|
+
)
|
46
44
|
end
|
47
45
|
end
|
48
46
|
|
@@ -50,13 +48,13 @@ describe Logasm::Preprocessors::Whitelist do
|
|
50
48
|
let(:pointers) { ['/data/field'] }
|
51
49
|
|
52
50
|
it 'includes nested field' do
|
53
|
-
expect(processed_data).to eq(
|
51
|
+
expect(processed_data).to eq(
|
54
52
|
field: '*****',
|
55
53
|
data: {
|
56
54
|
field: 'secret'
|
57
55
|
},
|
58
|
-
array:
|
59
|
-
|
56
|
+
array: '*****'
|
57
|
+
)
|
60
58
|
end
|
61
59
|
end
|
62
60
|
|
@@ -64,62 +62,70 @@ describe Logasm::Preprocessors::Whitelist do
|
|
64
62
|
let(:pointers) { ['/array/0/field'] }
|
65
63
|
|
66
64
|
it 'includes array element' do
|
67
|
-
expect(processed_data).to eq(
|
65
|
+
expect(processed_data).to eq(
|
68
66
|
field: '*****',
|
69
|
-
data:
|
70
|
-
|
71
|
-
|
72
|
-
array: [{field: 'secret'}]
|
73
|
-
})
|
67
|
+
data: '*****',
|
68
|
+
array: [{ field: 'secret' }]
|
69
|
+
)
|
74
70
|
end
|
75
71
|
end
|
76
72
|
|
77
73
|
context 'with whitelisted hash' do
|
78
74
|
it 'includes all whitelisted hash elements' do
|
79
|
-
source = {foo: {bar: 'baz'}}
|
80
|
-
target = {foo: {bar: 'baz'}}
|
75
|
+
source = { foo: { bar: 'baz' } }
|
76
|
+
target = { foo: { bar: 'baz' } }
|
81
77
|
expect(process(['/foo/~'], source)).to eq(target)
|
82
78
|
end
|
83
79
|
|
84
80
|
it 'does not include nested elements' do
|
85
|
-
source = {foo: {bar: {baz: 'asd'}}}
|
86
|
-
target = {foo: {bar: {baz: '*****'}}}
|
81
|
+
source = { foo: { bar: { baz: 'asd' } } }
|
82
|
+
target = { foo: { bar: { baz: '*****' } } }
|
87
83
|
expect(process(['/foo/~'], source)).to eq(target)
|
88
84
|
end
|
89
85
|
end
|
90
86
|
|
91
87
|
context 'with whitelisted array elements field with wildcard' do
|
92
|
-
let(:data)
|
93
|
-
|
94
|
-
|
88
|
+
let(:data) do
|
89
|
+
{
|
90
|
+
array: [
|
91
|
+
{ field: 'data1', secret: 'secret1' },
|
92
|
+
{ field: 'data2', secret: 'secret2' }
|
93
|
+
]
|
94
|
+
}
|
95
|
+
end
|
95
96
|
let(:pointers) { ['/array/~/field'] }
|
96
97
|
|
97
98
|
it 'includes array elements field' do
|
98
99
|
expect(processed_data).to include(
|
99
|
-
array: [
|
100
|
+
array: [
|
101
|
+
{ field: 'data1', secret: '*****' },
|
102
|
+
{ field: 'data2', secret: '*****' }
|
103
|
+
]
|
100
104
|
)
|
101
105
|
end
|
102
106
|
end
|
103
107
|
|
104
108
|
context 'with whitelisted string array elements with wildcard' do
|
105
|
-
let(:data)
|
106
|
-
array: [
|
107
|
-
|
109
|
+
let(:data) do
|
110
|
+
{ array: %w[secret secret] }
|
111
|
+
end
|
108
112
|
let(:pointers) { ['/array/~'] }
|
109
113
|
|
110
114
|
it 'includes array elements' do
|
111
|
-
expect(processed_data).to include(array: [
|
115
|
+
expect(processed_data).to include(array: %w[secret secret])
|
112
116
|
end
|
113
117
|
end
|
114
118
|
|
115
119
|
context 'with whitelisted string array elements in an array with wildcard' do
|
116
|
-
let(:data)
|
117
|
-
|
118
|
-
|
120
|
+
let(:data) do
|
121
|
+
{
|
122
|
+
nested: [{ array: %w[secret secret] }]
|
123
|
+
}
|
124
|
+
end
|
119
125
|
let(:pointers) { ['/nested/~/array/~'] }
|
120
126
|
|
121
127
|
it 'includes array elements' do
|
122
|
-
expect(processed_data).to include(nested: [{array: [
|
128
|
+
expect(processed_data).to include(nested: [{ array: %w[secret secret] }])
|
123
129
|
end
|
124
130
|
end
|
125
131
|
|
@@ -128,7 +134,7 @@ describe Logasm::Preprocessors::Whitelist do
|
|
128
134
|
let(:pointers) { ['/array/0'] }
|
129
135
|
|
130
136
|
it 'masks array element' do
|
131
|
-
expect(processed_data).to include(array: [{field: '*****'}])
|
137
|
+
expect(processed_data).to include(array: [{ field: '*****' }])
|
132
138
|
end
|
133
139
|
end
|
134
140
|
|
@@ -136,7 +142,7 @@ describe Logasm::Preprocessors::Whitelist do
|
|
136
142
|
let(:pointers) { ['/array'] }
|
137
143
|
|
138
144
|
it 'masks array' do
|
139
|
-
expect(processed_data).to include(array: [
|
145
|
+
expect(processed_data).to include(array: ['*****'])
|
140
146
|
end
|
141
147
|
end
|
142
148
|
|
@@ -144,12 +150,12 @@ describe Logasm::Preprocessors::Whitelist do
|
|
144
150
|
let(:pointers) { ['/data'] }
|
145
151
|
|
146
152
|
it 'masks hash' do
|
147
|
-
expect(processed_data).to include(data: {field: '*****'})
|
153
|
+
expect(processed_data).to include(data: { field: '*****' })
|
148
154
|
end
|
149
155
|
end
|
150
156
|
|
151
157
|
context 'when boolean present' do
|
152
|
-
let(:data) { {bool: true} }
|
158
|
+
let(:data) { { bool: true } }
|
153
159
|
|
154
160
|
it 'masks it with asteriks' do
|
155
161
|
expect(processed_data).to eq(bool: '*****')
|
@@ -157,31 +163,9 @@ describe Logasm::Preprocessors::Whitelist do
|
|
157
163
|
end
|
158
164
|
|
159
165
|
context 'when field has slash in the name' do
|
160
|
-
let(:data)
|
161
|
-
'field_with_/' => 'secret'
|
162
|
-
}}
|
163
|
-
let(:pointers) { ['/field_with_~1'] }
|
164
|
-
|
165
|
-
it 'includes field' do
|
166
|
-
expect(processed_data).to include('field_with_/'=> 'secret')
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
context 'when field has tilde in the name' do
|
171
|
-
let(:data) {{
|
172
|
-
'field_with_~' => 'secret'
|
173
|
-
}}
|
174
|
-
let(:pointers) { ['/field_with_~0'] }
|
175
|
-
|
176
|
-
it 'includes field' do
|
177
|
-
expect(processed_data).to include('field_with_~'=> 'secret')
|
166
|
+
let(:data) do
|
167
|
+
{ 'field_with_/' => 'secret' }
|
178
168
|
end
|
179
|
-
end
|
180
|
-
|
181
|
-
context 'when field has slash in the name' do
|
182
|
-
let(:data) {{
|
183
|
-
'field_with_/' => 'secret'
|
184
|
-
}}
|
185
169
|
let(:pointers) { ['/field_with_~1'] }
|
186
170
|
|
187
171
|
it 'includes field' do
|
@@ -190,9 +174,9 @@ describe Logasm::Preprocessors::Whitelist do
|
|
190
174
|
end
|
191
175
|
|
192
176
|
context 'when field has tilde in the name' do
|
193
|
-
let(:data)
|
194
|
-
'field_with_~' => 'secret'
|
195
|
-
|
177
|
+
let(:data) do
|
178
|
+
{ 'field_with_~' => 'secret' }
|
179
|
+
end
|
196
180
|
let(:pointers) { ['/field_with_~0'] }
|
197
181
|
|
198
182
|
it 'includes field' do
|
@@ -201,9 +185,9 @@ describe Logasm::Preprocessors::Whitelist do
|
|
201
185
|
end
|
202
186
|
|
203
187
|
context 'when field has tilde and 1' do
|
204
|
-
let(:data)
|
205
|
-
'field_with_~1' => 'secret'
|
206
|
-
|
188
|
+
let(:data) do
|
189
|
+
{ 'field_with_~1' => 'secret' }
|
190
|
+
end
|
207
191
|
let(:pointers) { ['/field_with_~01'] }
|
208
192
|
|
209
193
|
it 'includes field' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salemove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inflecto
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lru_redux
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,20 @@ dependencies:
|
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: benchmark-ips
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
description: It's logasmic
|
70
98
|
email:
|
71
99
|
- support@salemove.com
|
@@ -80,6 +108,7 @@ files:
|
|
80
108
|
- Gemfile
|
81
109
|
- README.md
|
82
110
|
- Rakefile
|
111
|
+
- benchmark/whitelisting.rb
|
83
112
|
- lib/logasm.rb
|
84
113
|
- lib/logasm/adapters.rb
|
85
114
|
- lib/logasm/adapters/logstash_adapter.rb
|
@@ -90,6 +119,7 @@ files:
|
|
90
119
|
- lib/logasm/null_logger.rb
|
91
120
|
- lib/logasm/preprocessors.rb
|
92
121
|
- lib/logasm/preprocessors/blacklist.rb
|
122
|
+
- lib/logasm/preprocessors/json_pointer_trie.rb
|
93
123
|
- lib/logasm/preprocessors/whitelist.rb
|
94
124
|
- lib/logasm/utils.rb
|
95
125
|
- logasm.gemspec
|
@@ -100,6 +130,7 @@ files:
|
|
100
130
|
- spec/adapters/stdout_json_adapter_spec.rb
|
101
131
|
- spec/logasm_spec.rb
|
102
132
|
- spec/preprocessors/blacklist_spec.rb
|
133
|
+
- spec/preprocessors/json_pointer_trie.rb
|
103
134
|
- spec/preprocessors/whitelist_spec.rb
|
104
135
|
- spec/spec_helper.rb
|
105
136
|
- spec/support/implement_interface.rb
|
@@ -124,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
155
|
version: '0'
|
125
156
|
requirements: []
|
126
157
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.6.11
|
128
159
|
signing_key:
|
129
160
|
specification_version: 4
|
130
161
|
summary: What description said
|
@@ -136,6 +167,7 @@ test_files:
|
|
136
167
|
- spec/adapters/stdout_json_adapter_spec.rb
|
137
168
|
- spec/logasm_spec.rb
|
138
169
|
- spec/preprocessors/blacklist_spec.rb
|
170
|
+
- spec/preprocessors/json_pointer_trie.rb
|
139
171
|
- spec/preprocessors/whitelist_spec.rb
|
140
172
|
- spec/spec_helper.rb
|
141
173
|
- spec/support/implement_interface.rb
|