aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-29 15:25:01 +0200
committerClombrong <cromblong@egregore.fun>2025-06-29 15:30:06 +0200
commit9ab1efc4625133264e805929ab024d80faf350dd (patch)
tree82b84c0830ee5bc76de75bd0d8eaa0380796c72a
parente08f1d433eca92f170876778b70b3c4483232022 (diff)
style(sasl): rename auth_config to config
-rw-r--r--lib/sasl.ml4
-rw-r--r--lib/stream.ml4
-rw-r--r--test/hello.ml2
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml
index 5ec6989..4498fec 100644
--- a/lib/sasl.ml
+++ b/lib/sasl.ml
@@ -4,7 +4,7 @@ type mechanism =
| PLAIN
| Unknown of string [@@deriving show { with_path = false }]
-type auth_config = {
+type config = {
jid : string;
password : string;
preferred_mechanisms : mechanism list;
@@ -64,7 +64,7 @@ let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
let authenticate
(portal : Portal.t)
- ({jid; password; preferred_mechanisms} : auth_config)
+ ({jid; password; preferred_mechanisms} : config)
(sasl_mechanisms : mechanism list) =
(* Probably not exactly compliant with https://xmpp.org/extensions/xep-0029.html,
but it's just for simplicity's sake in alpha. *)
diff --git a/lib/stream.ml b/lib/stream.ml
index 60f86a0..a71d662 100644
--- a/lib/stream.ml
+++ b/lib/stream.ml
@@ -60,7 +60,7 @@ let negotiate
?(prefer_starttls = true)
(domain : string)
(portal : Portal.t)
- (auth : Sasl.auth_config) : features Lwt.t =
+ (auth : Sasl.config) : features Lwt.t =
(* Test if a specific features mandates a restart of the stream. *)
let needs_restart = function
| Mechanisms _ | STARTTLS -> true
@@ -111,7 +111,7 @@ let negotiate
Once [None] is pushed into the stream, the receiving stream is drained and the
socket is closed. *)
-let initiate (domain : string) (auth : Sasl.auth_config) : (Portal.t * features) Lwt.t =
+let initiate (domain : string) (auth : Sasl.config) : (Portal.t * features) Lwt.t =
let open Portal in
let* p = connect domain
in let+ features = negotiate domain p auth
diff --git a/test/hello.ml b/test/hello.ml
index df5d865..097e750 100644
--- a/test/hello.ml
+++ b/test/hello.ml
@@ -3,7 +3,7 @@ open! Lwt.Infix
open! Flesh
let main =
- let config : Sasl.auth_config = {
+ let config : Sasl.config = {
jid = (Sys.getenv "FLESH_JID");
password = (Sys.getenv "FLESH_PASSWORD");
preferred_mechanisms = [Sasl.PLAIN]