jid: Validate domains against idna

The idna crate validates against UTS 46, which supports domains using
either IDNA2003 or IDNA2008.  This allows us to support both old and
new internationalized domain names.

This dependency isn’t a new one in the tree, as hickory-proto, url and
tokio-xmpp all were already depending on it.

There are a bunch of other checks that have to be performed, this is
inspired by slixmpp’s JID implementation.
This commit is contained in:
Emmanuel Gil Peyrot 2025-02-05 18:26:48 +01:00
commit 2a2f532c80
5 changed files with 95 additions and 28 deletions

View file

@ -24,6 +24,7 @@ serde = { version = "1.0", features = ["derive"], optional = true }
stringprep = "0.1.3"
quote = { version = "1.0", optional = true }
proc-macro2 = { version = "1.0", optional = true }
idna = "1"
# same repository dependencies
minidom = { version = "0.16", path = "../minidom", optional = true }