
xmpp-strings.jids.valid.main Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jxmpp-strings-testframework Show documentation
Show all versions of jxmpp-strings-testframework Show documentation
A testframework for XMPP addresses (JIDs) and other XMPP strings.
-*- coding: utf-8; -*-
Corpus of Valid JIDs (XMPP Addresses)
=====================================
The corpus layout was designed with two goals in mind:
1. Being easy to parse
2. Being directly editable
Parsing Expression Grammar
--------------------------
Corpus → Entry*
Entry → Jid* | CommentLine*
CommentLine → EveryNonCtrlChar* '\n'
Jid → JidHeader UnnormalizedJid NormalizedJid
JidHeader → 'jid:\n'
UnnormalizedJid → NoCtrlCharText 'RS' '\n'
NormalizedJid → NoCtrlCharText 'US' NoCtrlCharText 'US' NoCtrlCharText 'RS' \n
NoCtrlCharText → *!('US' | 'RS' | '\n')
LF: ASCII Line Feed '\n' (new line) 0x00OA (Oct: 012, Dec: 10)
RS: ASCII Record Separator 0x001E (Oct: 036, Dec 30)
US: ASCII Unit Separator 0x001F (Oct 037, Dec 31)
# jid:
# [email protected]/resource
# fooexample.orgresource
Note that the motivation for the final is to make empty
resourceparts clearly visible. We use ASCII control characters as
separator mark because they are not valid in any XMPP address part
(although they would be valid in XML 1.1). TODO: Present the rules
why they are not valid in local- domain- and resourceparts.
Emacs
You can enter the required control characters and using
RS: C-x 8 RET #x1e
US: C-x 8 RET #x1f
or smiply copy and paste a previous entry and then edit it.
RFC 7622 Table 1
================
https://tools.ietf.org/html/rfc7622#section-3.5
Simplified BSD License
jid:
[email protected]
julietexample.com
A "bare JID"
jid:
[email protected]/foo
julietexample.comfoo
A "full JID"
jid:
[email protected]/foo bar
julietexample.comfoo bar
Single space in resourcepart
jid:
[email protected]/foo@bar
julietexample.comfoo@bar
"At" sign in resourcepart
jid:
foo\[email protected]
foo\20barexample.com
Single space in localpart, as optionally escaped using the XMPP JID
Escaping extension.
jid:
[email protected]
fussballexample.com
Another bare JID
jid:
fuß[email protected]
fußballexample.com
The third character is LATIN SMALL LETTER SHARP S (U+00DF)
jid:
π@example.com
πexample.com
A localpart of GREEK SMALL LETTER PI (U+03C0)
jid:
Σ@example.com
σexample.com
A localpart of GREEK SMALL LETTER SIGMA (U+03C3)
jid:
ς@example.com
σexample.com
A localpart of GREEK SMALL FINAL SIGMA (U+03C2)
TODO: Is the mapping in the localpart correct?
jid:
[email protected]/♚
kingexample.com♚
A resourcepart of the Unicode character BLACK CHESS KING (U+265A)
jid:
example.com
example.com
A domainpart
jid:
example.com/foobar
example.comfoobar
A domainpart and resourcepart
jid:
a.example.com/[email protected]
a.example.com[email protected]
A domainpart followed by an resourcepart that contains an "at" sign.
Prosody Util Jid Spec
=====================
(MIT)
local jid = require "util.jid";
jid:
server/resource@foo
serverresource@foo
jid:
server/resource@foo/bar
serverresource@foo/bar
Valid Domainparts
=================
See:
- https://tools.ietf.org/html/rfc7622#section-3.2
- https://www.rfc-editor.org/errata/eid5789
jid:
user@CaSe-InSeNsItIvE
usercase-insensitive
Domainparts are case-insensitive.
jid:
[email protected]
user192.168.1.1
IPv4 addresses are valid domainparts.
jid:
user@[2001:638:a000:4134::ffff:40]
user[2001:638:a000:4134::ffff:40]
IPv6 addresses are valid domainparts.
jid:
user@[2001:638:a000:4134::ffff:40%eno1]
user[2001:638:a000:4134::ffff:40%eno1]
IPv6 addresses with zone identifier are valid domainparts.
jid:
user@averylongdomainpartisstillvalideventhoughitexceedsthesixtyfourbytelimitofdnslabels
useraverylongdomainpartisstillvalideventhoughitexceedsthesixtyfourbytelimitofdnslabels
A very long text label (that is resolvable on a local network) is a
valid domainpart. Note that RFC7622 does not restrict the text label
in any form. Whereas DNS labels are restricted to 64 bytes.
Valid Resourceparts
===================
jid:
[email protected]/🍺
userexample.org🍺
A resourcepart of the Unicode character BEER MUG (U+1F37A)
End Of Corpus
© 2015 - 2025 Weber Informatics LLC | Privacy Policy