open Lwt.Syntax type auth_mechanism = PLAIN [@@deriving show { with_path = false }] let authenticate (stream, _push) = let _gen_auth jid pass = function | PLAIN -> Base64.encode_exn ("\x00" ^ jid ^ "\x00" ^ pass) in let+ features = Lwt_stream.get stream in Option.get features