Skip to main content

authenticate_machine

Function authenticate_machine 

Source
pub async fn authenticate_machine<S>(
    ws: &mut S,
    id: &str,
    key: &MachineKey,
) -> Result<Vec<KeyRotation>>
where S: Sink<Message, Error = Error> + Stream<Item = Result<Message, Error>> + Unpin,
Expand description

Authenticates machine id with key on ws, a fresh /backend connection (#86, #130): machine_hello, the relay’s challenge, the signature of it. The only way a backend gets in. The account’s key rotations the challenge carries (#89), for the machine to follow.

§Errors

A lost connection, or the relay refusing the machine (unknown, removed, or registered with another relay).