diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-26 17:12:31 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-26 21:40:53 +0200 |
commit | 30f002289ef6f5dd544f25bc4965fa8f1761a199 (patch) | |
tree | 519e1b3c60715de82d1f95c6b136476c3dbc8a2b /lib/stream.ml | |
parent | 38b332a6c3940c3156b27b88e15e9735bebce718 (diff) |
refactor(sasl): move all auth-related types from Stream to Sasl
Diffstat (limited to 'lib/stream.ml')
-rw-r--r-- | lib/stream.ml | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/stream.ml b/lib/stream.ml index 607319d..e3ed62f 100644 --- a/lib/stream.ml +++ b/lib/stream.ml @@ -1,15 +1,7 @@ exception ClosedStream -type auth_mechanism = - | PLAIN - | Unknown of string [@@deriving show { with_path = false }] - -let parse_auth_mechanism = function - | "PLAIN" -> PLAIN - | other -> Unknown other - type features = { - mechanisms : auth_mechanism list; + mechanisms : Sasl.auth_mechanism list; starttls : [`Required | `Optional | `None]; unknown : Xml.element list; } @@ -21,7 +13,7 @@ let parse_features (el : Xml.element) : features = let open Either in let parse_mechanism_stanza = function | Left {local_name = "mechanism"; children = [Right mechanism]; _} -> - Some (parse_auth_mechanism mechanism) + Some (Sasl.parse_auth_mechanism mechanism) | _ -> None in let parse_feature (acc : features) (feature : Xml.element) : features = |