aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-10 00:33:07 +0200
committerClombrong <cromblong@egregore.fun>2025-06-10 00:33:07 +0200
commit0b14c14284c8235008810ffed6e3028023d2e0e2 (patch)
tree029e7aeeb810f496943d9e6972c6ddae4a9b7ed4 /lib
parentd2fc73f4aaecab25201bcf9860c4e6d934fb2772 (diff)
feat(auth): gen auth parameter
Diffstat (limited to 'lib')
-rw-r--r--lib/auth.ml3
-rw-r--r--lib/dune1
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/auth.ml b/lib/auth.ml
index 509f2d1..851db40 100644
--- a/lib/auth.ml
+++ b/lib/auth.ml
@@ -3,6 +3,9 @@ open Lwt.Syntax
type auth_mechanism = PLAIN [@@deriving show]
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
diff --git a/lib/dune b/lib/dune
index 6f37f9d..645b8b9 100644
--- a/lib/dune
+++ b/lib/dune
@@ -2,5 +2,6 @@
(public_name flesh)
(libraries
lwt
+ base64
portal)
(preprocess (pps ppx_deriving.show)))