liminal-server 0.25.4

Standalone server for the liminal messaging bus
Documentation
//! Device peers require the holder's own Lys pass at the ordinary admission boundary.

use super::{ConnectionRuntime, Frame};
use liminal_protocol::credential::WireCredential;

pub(in crate::server::connection) fn own_device_connect_refusal(
    runtime: &ConnectionRuntime,
    credential: &[u8],
) -> Option<Frame> {
    let host = runtime.link_host()?;
    host.peers()?;
    if matches!(
        WireCredential::classify(credential),
        Ok(WireCredential::LysPass(_))
    ) {
        None
    } else {
        Some(Frame::ConnectError {
            flags: 0,
            reason_code: 0xFFFF,
            message: Some("own_device_requires_lys_pass".into()),
        })
    }
}