Skip to content
Permalink
1 contributor

Users who have contributed to this file

167 lines (132 sloc) 3.88 KB
-*- 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:<LF>
# foo@example.org/resource<RS><LF>
# foo<US>example.org<US>resource<RS><LF>
Note that the motivation for the final <RS> 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 <RS> and <US> 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:
juliet@example.com
julietexample.com
A "bare JID"
jid:
juliet@example.com/foo
julietexample.comfoo
A "full JID"
jid:
juliet@example.com/foo bar
julietexample.comfoo bar
Single space in resourcepart
jid:
juliet@example.com/foo@bar
julietexample.comfoo@bar
"At" sign in resourcepart
jid:
foo\20bar@example.com
foo\20barexample.com
Single space in localpart, as optionally escaped using the XMPP JID
Escaping extension.
jid:
fussball@example.com
fussballexample.com
Another bare JID
jid:
fußball@example.com
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:
king@example.com/♚
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/b@example.net
a.example.comb@example.net
A domainpart followed by an resourcepart that contains an "at" sign.
Prosody Util Jid Spec
=====================
<https://hg.prosody.im/trunk/file/tip/spec/util_jid_spec.lua> (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:
user@192.168.1.1
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.
End Of Corpus
You can’t perform that action at this time.