pub enum IpcConnection {
Secured {
conn: Box<TransportConnection>,
crypto: SessionCrypto,
},
Plain {
conn: Box<TransportConnection>,
},
}Expand description
One negotiated IPC connection.
Variants§
Secured
v1 session: every envelope frame is sealed (WBS-509/510).
Plain
Legacy plaintext envelopes — migration window only, accepted
server-side ONLY while SENTINELPASS_ALLOW_PLAIN_IPC=1 is set and
announced per connection (ADR-007; WBS-911 F3). Refused otherwise.
Fields
conn: Box<TransportConnection>Implementations§
Source§impl IpcConnection
impl IpcConnection
Sourcepub async fn connect_client(
conn: TransportConnection,
token: &str,
) -> TransportResult<Self>
pub async fn connect_client( conn: TransportConnection, token: &str, ) -> TransportResult<Self>
Client-side negotiation (WBS-509): send SessionHello, read SessionAccept, derive the directional session keys.
Sourcepub async fn accept_server(
conn: TransportConnection,
token: &str,
) -> TransportResult<(Self, Option<Vec<u8>>)>
pub async fn accept_server( conn: TransportConnection, token: &str, ) -> TransportResult<(Self, Option<Vec<u8>>)>
Server-side negotiation: peek the first frame. A SessionHello →
SECURED (reply SessionAccept, derive keys). Anything else → the
legacy PLAIN envelope protocol, ONLY while the operator has re-opened
the migration window with SENTINELPASS_ALLOW_PLAIN_IPC=1 (WBS-911
F3: the bearer-token envelope crosses the socket in cleartext, so the
default is refuse); the first frame is handed back to the caller for
normal processing.
Sourcepub async fn send_frame(&mut self, envelope_bytes: &[u8]) -> TransportResult<()>
pub async fn send_frame(&mut self, envelope_bytes: &[u8]) -> TransportResult<()>
Send one envelope frame (sealed in secured mode), write-bounded by the session deadline (WBS-511).
Sourcepub async fn recv_frame(&mut self) -> TransportResult<Vec<u8>>
pub async fn recv_frame(&mut self) -> TransportResult<Vec<u8>>
Receive one envelope frame (opened in secured mode), bounded by the read deadline (WBS-511).