aboutsummaryrefslogtreecommitdiff
path: root/lib/sasl.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sasl.ml')
-rw-r--r--lib/sasl.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml
index 81c4476..5ec6989 100644
--- a/lib/sasl.ml
+++ b/lib/sasl.ml
@@ -1,13 +1,13 @@
open Lwt.Infix
-type auth_mechanism =
+type mechanism =
| PLAIN
| Unknown of string [@@deriving show { with_path = false }]
type auth_config = {
jid : string;
password : string;
- preferred_mechanisms : auth_mechanism list;
+ preferred_mechanisms : mechanism list;
}
type sasl_error =
@@ -18,7 +18,7 @@ let unrecoverable = function
| NotAuthorized -> true
| _ -> false
-let parse_auth_mechanism = function
+let parse_mechanism = function
| "PLAIN" -> PLAIN
| other -> Unknown other
@@ -55,7 +55,7 @@ let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
in let stanza_list = [`Start_element
((Xmlns.sasl, "auth"),
[(("", "xmlns"), Xmlns.sasl);
- (("", "mechanism"), show_auth_mechanism mechanism)]);
+ (("", "mechanism"), show_mechanism mechanism)]);
`Text [gen_auth mechanism];
`End_element]
in Some (Markup.of_list stanza_list) |> push;
@@ -65,7 +65,7 @@ let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
let authenticate
(portal : Portal.t)
({jid; password; preferred_mechanisms} : auth_config)
- (sasl_mechanisms : auth_mechanism list) =
+ (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. *)
let localpart = match String.split_on_char '@' jid with