aboutsummaryrefslogtreecommitdiff
path: root/lib/sasl.ml
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-06-29 15:31:26 +0200
committerClombrong <cromblong@egregore.fun>2025-06-29 15:31:26 +0200
commit954239ed796367027c49a8b0808e596c1b68d2d7 (patch)
tree73528e5d9f52cc48391897997ebe9b5fe056665b /lib/sasl.ml
parent9ab1efc4625133264e805929ab024d80faf350dd (diff)
style(sasl): rename sasl_error to error
Diffstat (limited to 'lib/sasl.ml')
-rw-r--r--lib/sasl.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml
index 4498fec..3cd1220 100644
--- a/lib/sasl.ml
+++ b/lib/sasl.ml
@@ -10,7 +10,7 @@ type config = {
preferred_mechanisms : mechanism list;
}
-type sasl_error =
+type error =
| NotAuthorized
| MalformedRequest
@@ -22,12 +22,12 @@ let parse_mechanism = function
| "PLAIN" -> PLAIN
| other -> Unknown other
-let parse_sasl_error = function
+let parse_error = function
| "not-authorized" -> NotAuthorized
| "malformed-request" -> MalformedRequest
| _ -> failwith "Unsupported SASL error returned by the server."
-type sasl_auth = (string option, sasl_error * (string * string) option) result
+type sasl_auth = (string option, error * (string * string) option) result
let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
let gen_auth = function
@@ -50,7 +50,7 @@ let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
| ("success", []) -> Ok None
| ("success", [Right rest]) -> Ok (Some rest)
| ("failure", [Left {local_name=error; children; _}]) ->
- Error (parse_sasl_error error, parse_descriptive_text children)
+ Error (parse_error error, parse_descriptive_text children)
| _ -> raise (Xml.InvalidStanza (Xml.element_to_string stanza))
in let stanza_list = [`Start_element
((Xmlns.sasl, "auth"),