pub struct RedactPathsMiddleware { /* private fields */ }Expand description
Redact absolute filesystem paths from tool output. Applies each
(pattern, replacement) pair in order to every string leaf in the
result. Default construction via with_home_default() redacts
$HOME/... paths — a low-effort demonstration of the pattern, not a
comprehensive PII scrubber.
Implementations§
Trait Implementations§
Source§impl Middleware for RedactPathsMiddleware
impl Middleware for RedactPathsMiddleware
Source§fn on_error(
&self,
_tool_id: &str,
_tool_def: &ToolDefinition,
message: &mut String,
details: &mut Option<Value>,
)
fn on_error( &self, _tool_id: &str, _tool_def: &ToolDefinition, message: &mut String, details: &mut Option<Value>, )
SP-observability-completeness-v1 Axis A — the $HOME/path scrub is
as relevant to error text as to success results (a failure message
can echo an absolute path). Apply the same patterns to the bare
message string and walk the optional details value.
fn name(&self) -> &'static str
fn on_result( &self, _tool_id: &str, _tool_def: &ToolDefinition, result: &mut Value, )
Auto Trait Implementations§
impl Freeze for RedactPathsMiddleware
impl RefUnwindSafe for RedactPathsMiddleware
impl Send for RedactPathsMiddleware
impl Sync for RedactPathsMiddleware
impl Unpin for RedactPathsMiddleware
impl UnsafeUnpin for RedactPathsMiddleware
impl UnwindSafe for RedactPathsMiddleware
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
Mutably borrows from an owned value. Read more