Skip to content

Commit 714cb67

Browse files
committed
Definition of "Standard Identifier Format"
Spec for #2758
1 parent 315f36c commit 714cb67

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

content/appendices.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,46 @@ Some identifiers are specific to given room versions, please refer to
366366
the [room versions specification](/#room-versions) for more
367367
information.
368368

369+
### Standard Identifier Format
370+
371+
Throughout the specification some identifiers will mention they use the
372+
"Standard Identifier Format", which is a common definition for how
373+
identifiers are to be represented. Identifiers which are not explicitly
374+
listed in this specification or do not use the Standard Identifier Format
375+
have undefined grammar.
376+
377+
The requirements of identifiers using this format are:
378+
379+
* An identifier may not be less than one character or more than 255 characters
380+
in length.
381+
* Identifiers must start with one of the characters `[a-z]`, and be entirely
382+
composed of the characters `[a-z]`, `[0-9]`, `-`, `_` and `.`.
383+
* Identifiers starting with the characters `m.` are reserved.
384+
* Identifiers which are not described in the specification should follow the
385+
Java Package Naming Convention to namespace their identifier. This is typically
386+
a reverse DNS format, such as `com.example.identifier`.
387+
388+
This identifier format is intended for solely non-user-visible identifiers.
389+
390+
{{% boxes/note %}}
391+
Identifiers which are accepted into the specification through the proposal process
392+
are assumed to use this Standard Identifier Format unless explicitly mentioned
393+
otherwise in the proposal.
394+
{{% /boxes/note %}}
395+
396+
{{% boxes/note %}}
397+
Identifiers can and do inherit grammar from this specification. For example, "this
398+
identifier uses the Standard Identifier Format, though without the namespacing
399+
requirements" - this means that `m.` is still reserved, but that implementations
400+
do not have to use the reverse DNS scheme to namespace their custom identifier.
401+
{{% /boxes/note %}}
402+
403+
{{% boxes/rationale %}}
404+
ASCII characters do not have issues with homoglyphs or alternative encodings which
405+
might interfere with the identifier's purpose. Additionally, using lowercase
406+
characters prevents concerns about case sensitivity.
407+
{{% /boxes/rationale %}}
408+
369409
### Server Name
370410

371411
A homeserver is uniquely identified by its server name. This value is

0 commit comments

Comments
 (0)