diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-29 13:41:40 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-29 13:41:40 +0200 |
commit | 3c0557e0a502866d2fbf0f7c391c43a7bbc6d3a4 (patch) | |
tree | 582333a1df9a7b50039cc612b051abf05e1b8a25 /lib/sasl.ml | |
parent | cd1108ed1b2c403f05daaf91889751f8a6730e1e (diff) |
style(sasl): rename auth_mechanism to mechanism
Diffstat (limited to 'lib/sasl.ml')
-rw-r--r-- | lib/sasl.ml | 10 |
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 |