In #15616 we implemented masking of sensitive fields in common.MapStr objects. This implementation relies on cloning the object so masks may applied to the clone while preserving the original as-is.
Depending on the size of the object being cloned, the cloning could be expensive in terms of memory allocations. Ideally we could replace this implementation with a streaming one, perhaps using https://github.com/elastic/go-structform, to save on memory allocations. The masking would be done via a transformer on the stream.
In #15616 we implemented masking of sensitive fields in
common.MapStrobjects. This implementation relies on cloning the object so masks may applied to the clone while preserving the original as-is.Depending on the size of the object being cloned, the cloning could be expensive in terms of memory allocations. Ideally we could replace this implementation with a streaming one, perhaps using https://github.com/elastic/go-structform, to save on memory allocations. The masking would be done via a transformer on the stream.