5.2.23
12/09/2023

[#283] Detailed validation of JID
Summary Detailed validation of JID
Queue gloox
Queue Version 1.0.22
Type Enhancement
State Unconfirmed
Priority 1. Low
Owners js (at) camaya (dot) net
Requester pulkomandy (at) pulkomandy (dot) tk
Created 07/13/2019 (1610 days ago)
Due
Updated 12/08/2019 (1462 days ago)
Assigned
Resolved

History
12/08/2019 07:45:30 PM Jakob Schröter Comment #2
Assigned to Jakob Schröter
Reply to this comment
Just some quick feedback...
I looked into this (a while ago) and there doesn't seem to be a way to 
do such validation with libidn. If any other prep-lib is capable of 
doing it, gloox would need to be ported there.
07/13/2019 12:28:46 PM pulkomandy (at) pulkomandy (dot) tk Comment #1
State ⇒ Unconfirmed
Queue ⇒ gloox
Summary ⇒ Detailed validation of JID
Type ⇒ Enhancement
Priority ⇒ 1. Low
Reply to this comment
I'm writing a client based on gloox and I would like to provide 
precise feedback to users when their JID is invald or may be modified 
by the string prep algorithms. Currently I can only check if the JID 
is valid using the bool cast operator, and maybe check if the string 
representation is identical to what I passed to the constructor.

I would like to know:
- If the string is really not looking like a JID (for example, no @)
- If the username is too long (I think the limit is 1023 characters)
- If there are unprintable characters, spaces or control characters in it
- If a reserved character is used (my current code checks for :@<>'"& 
but I don't know if that's appropriate)

Could gloox provide somthing of that level of detail when validating a JID?