Skip to content

Commit

Permalink
Add checks to allow logging only specific datatypes
Browse files Browse the repository at this point in the history
Currently, it allows logging of objects and the whitelisting does not
apply to the fields of that object.

This change adds data type checks and allows logging of only specific
types so that data that is not whitelisted or that is blacklisted does
not go through. This means it will be either masked or pruned.

MSG-709, IN-299
  • Loading branch information
HallikiM committed Dec 12, 2023
1 parent 48bd258 commit ac2438f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/lenjador/preprocessors/strategies/mask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ def process(data, pointer = '')
when Array
process_array(data, pointer)

else
when String, Numeric, Symbol, Date, Time, TrueClass, FalseClass, NilClass
data

else
MASKED_VALUE
end
end

Expand Down
5 changes: 4 additions & 1 deletion lib/lenjador/preprocessors/strategies/prune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ def process(data, pointer = '')
when Array
process_array(data, pointer)

else
when String, Numeric, Symbol, Date, Time, TrueClass, FalseClass, NilClass
data

else
nil
end
end

Expand Down

0 comments on commit ac2438f

Please sign in to comment.