pub struct IpcSecurityPipeline { /* private fields */ }Expand description
Assembled IPC security pipeline holding all control point instances.
Implementations§
Source§impl IpcSecurityPipeline
impl IpcSecurityPipeline
Sourcepub fn new(config: IpcSecurityConfig, audit_config: AuditConfig) -> Self
pub fn new(config: IpcSecurityConfig, audit_config: AuditConfig) -> Self
Creates a new pipeline from configuration.
§Arguments
config: IPC security configuration.audit_config: Root audit persistence configuration.
§Returns
Returns an initialized IpcSecurityPipeline with all control
points ready.
Sourcepub fn check(
&mut self,
method: &str,
request_id: &str,
raw_body_len: usize,
peer_identity: &PeerIdentity,
connection_id: &str,
) -> CheckOutcome
pub fn check( &mut self, method: &str, request_id: &str, raw_body_len: usize, peer_identity: &PeerIdentity, connection_id: &str, ) -> CheckOutcome
Runs pre-dispatch security checks.
Execution order (per contract): C6 → C5 → C2 → C4 → C3
C1 (socket owner) runs at bind time and is not in the per-request pipeline. C9 (allowlist) runs at extension points.
§Arguments
method: IPC method name.request_id: Request identifier (for C4 replay check and C8 cache).raw_body_len: Byte length of the raw request body (for C5).peer_identity: Extracted peer identity snapshot (for C2/C3).connection_id: Opaque connection identifier (for per-connection C6).
§Returns
Returns CheckOutcome::Passed when all checks pass, or
CheckOutcome::Denied(error) with the denial error. The caller
must write audit records and execute the actual dispatch.
Sourcepub fn check_idempotency(&self, request_id: &str) -> Option<String>
pub fn check_idempotency(&self, request_id: &str) -> Option<String>
Sourcepub fn cache_result(&mut self, request_id: &str, response_json: &str)
pub fn cache_result(&mut self, request_id: &str, response_json: &str)
Caches a dispatch result for idempotency (C8).
§Arguments
request_id: Request identifier.response_json: Serialized response to cache.
Sourcepub fn write_audit(
&mut self,
method: &str,
peer_identity: &PeerIdentity,
allowed: bool,
denial_error: Option<&DashboardError>,
denial_control_point: &str,
) -> Result<(), DashboardError>
pub fn write_audit( &mut self, method: &str, peer_identity: &PeerIdentity, allowed: bool, denial_error: Option<&DashboardError>, denial_control_point: &str, ) -> Result<(), DashboardError>
Writes an audit record after dispatch (C7).
Returns Ok(()) on success or Err(DashboardError) when the audit
backend is unwritable. The caller should fail closed for high-risk
commands.
§Arguments
method: IPC method name.peer_identity: Peer identity snapshot.allowed: Whether the request was allowed.denial_error: The denial error if denied.denial_control_point: Which control point denied (C1-C9 or “dispatch”).
§Returns
Returns Ok(()) when the audit record was written, or
Err(DashboardError) when the backend is unwritable.
Auto Trait Implementations§
impl Freeze for IpcSecurityPipeline
impl RefUnwindSafe for IpcSecurityPipeline
impl Send for IpcSecurityPipeline
impl Sync for IpcSecurityPipeline
impl Unpin for IpcSecurityPipeline
impl UnsafeUnpin for IpcSecurityPipeline
impl UnwindSafe for IpcSecurityPipeline
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);