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.
Auto Trait Implementations§
impl<'a> Freeze for PiiAttachmentsProcessor<'a>
impl<'a> RefUnwindSafe for PiiAttachmentsProcessor<'a>
impl<'a> Send for PiiAttachmentsProcessor<'a>
impl<'a> Sync for PiiAttachmentsProcessor<'a>
impl<'a> Unpin for PiiAttachmentsProcessor<'a>
impl<'a> UnwindSafe for PiiAttachmentsProcessor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request