aboutsummaryrefslogtreecommitdiff
path: root/lib/auth.ml
blob: 0e5d77c3f4771a050f016db621d59a645564bb44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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