diff options
-rw-r--r-- | lib/sasl.ml | 1 | ||||
-rw-r--r-- | lib/stream.ml | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml index 800d02e..8fbb8b2 100644 --- a/lib/sasl.ml +++ b/lib/sasl.ml @@ -21,6 +21,7 @@ type sasl_auth = (string option, sasl_error * (string * string) option) result let send_auth_stanza (stream, push) localpart pass mechanism = let gen_auth = function | PLAIN -> Base64.encode_exn ("\x00" ^ localpart ^ "\x00" ^ pass) + | Unknown s -> failwith "Unsupported authentication mechanism" ^ s and parse_sasl_response (stanza : Markup.signal list) = let open Markup in let string_stanza = stanza |> of_list |> write_xml |> to_string in diff --git a/lib/stream.ml b/lib/stream.ml index 5743318..adf852c 100644 --- a/lib/stream.ml +++ b/lib/stream.ml @@ -4,7 +4,9 @@ open Markup exception ClosedStream exception InvalidStanza of string -type auth_mechanism = PLAIN [@@deriving show { with_path = false }] +type auth_mechanism = + | PLAIN + | Unknown of string [@@deriving show { with_path = false }] let get (stream : (signal, async) stream) : (signal, sync) stream Lwt.t = (** [stanza stream] is a promise containing a full stanza of the fragments of [stream].*) |