pub struct PiiAttachmentsProcessor<'a> { /* private fields */ }
Expand description
A PII processor for attachment files.
Implementations§
Source§impl<'a> PiiAttachmentsProcessor<'a>
impl<'a> PiiAttachmentsProcessor<'a>
Sourcepub fn new(compiled_config: &'a CompiledPiiConfig) -> Self
pub fn new(compiled_config: &'a CompiledPiiConfig) -> Self
Creates a new PiiAttachmentsProcessor
from the given PII config.
Sourcepub fn scrub_attachment(&self, filename: &str, data: &mut [u8]) -> bool
pub fn scrub_attachment(&self, filename: &str, data: &mut [u8]) -> bool
Applies PII scrubbing rules to a plain attachment.
Returns true
, if the attachment was modified.
Sourcepub fn scrub_utf8_filepath(
&self,
path: &mut str,
state: &ProcessingState<'_>,
) -> bool
pub fn scrub_utf8_filepath( &self, path: &mut str, state: &ProcessingState<'_>, ) -> bool
Scrub a filepath, preserving the basename.
Sourcepub fn scrub_utf16_filepath(
&self,
path: &mut WStr<LittleEndian>,
state: &ProcessingState<'_>,
) -> bool
pub fn scrub_utf16_filepath( &self, path: &mut WStr<LittleEndian>, state: &ProcessingState<'_>, ) -> bool
Scrub a filepath, preserving the basename.
Sourcepub fn scrub_json(&self, payload: &[u8]) -> Result<Vec<u8>, JsonScrubError>
pub fn scrub_json(&self, payload: &[u8]) -> Result<Vec<u8>, JsonScrubError>
Applies PII rules to the given JSON.
This function will perform PII scrubbing using serde_transcode
, which means that it
does not have to read the entire document in memory but will rather perform in on a
per-item basis using a streaming approach.
Returns a scrubbed copy of the JSON document.
Source§impl PiiAttachmentsProcessor<'_>
impl PiiAttachmentsProcessor<'_>
Sourcepub fn scrub_minidump(
&self,
filename: &str,
data: &mut [u8],
) -> Result<bool, ScrubMinidumpError>
pub fn scrub_minidump( &self, filename: &str, data: &mut [u8], ) -> Result<bool, ScrubMinidumpError>
Applies PII rules to the given minidump.
This function selectively opens minidump streams in order to avoid destroying the stack memory required for minidump processing. It visits:
- All stack memory regions with
ValueType::StackMemory
- All other memory regions with
ValueType::HeapMemory
- Linux auxiliary streams with
ValueType::Binary
Returns true
, if the minidump was modified.