Skip to content

Commit 0fbc6bd

Browse files
authored
Definition of "Standard Identifier Format" (#3171)
Spec for #2758
1 parent 4b866ad commit 0fbc6bd

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

content/appendices.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,38 @@ Some identifiers are specific to given room versions, please refer to
387387
the [room versions specification](/rooms) for more
388388
information.
389389

390+
### Common Namespaced Identifier Grammar
391+
392+
The specification defines some identifiers to use the *Common Namespaced
393+
Identifier Grammar*. This is a common grammar intended for non-user-visible
394+
identifiers, with a defined mechanism for implementations to create new
395+
identifiers.
396+
397+
The grammar is defined as follows:
398+
399+
* An identifier must be at least one character and at most 255 characters
400+
in length.
401+
* Identifiers must start with one of the characters `[a-z]`, and be entirely
402+
composed of the characters `[a-z]`, `[0-9]`, `-`, `_` and `.`.
403+
* Identifiers starting with the characters `m.` are reserved for use by the
404+
official Matrix specification.
405+
* Identifiers which are not described in the specification should follow the
406+
Java Package Naming Convention to namespace their identifier. This is typically
407+
a reverse DNS format, such as `com.example.identifier`.
408+
409+
{{% boxes/note %}}
410+
Identifiers can and do inherit grammar from this specification. For example, "this
411+
identifier uses the Common Namespaced Identifier Grammar, though without the namespacing
412+
requirements" - this means that `m.` is still reserved, but that implementations
413+
do not have to use the reverse DNS scheme to namespace their custom identifier.
414+
{{% /boxes/note %}}
415+
416+
{{% boxes/rationale %}}
417+
ASCII characters do not have issues with homoglyphs or alternative encodings which
418+
might interfere with the identifier's purpose. Additionally, using lowercase
419+
characters prevents concerns about case sensitivity.
420+
{{% /boxes/rationale %}}
421+
390422
### Server Name
391423

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

data/api/client-server/definitions/sso_login_flow.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ properties:
5959
example: "mxc://example.org/abc123"
6060
brand:
6161
type: string
62-
# TODO @@TR: Actually link to "common identifier format" section when it exists.
6362
description: |-
6463
Optional UI hint for what kind of common SSO provider is being
6564
described in this IdP. Matrix maintains a registry of identifiers
@@ -71,7 +70,7 @@ properties:
7170
including those in the registry, though are expected to be able to
7271
present any IdP based off the `name`/`icon` to the user regardless.
7372
74-
Unregistered brands are permitted using the Standard Identifier Format,
73+
Unregistered brands are permitted using the [Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar),
7574
though excluding the namespace requirements. For example, `examplesso`
7675
is a valid brand which is not in the registry but still permitted.
7776
Servers should be mindful that clients might not support their unregistered

0 commit comments

Comments
 (0)