Compare commits

...

122 Commits
v1.8 ... main

Author SHA1 Message Date
Johannes Marbach 7d5b506555
Remove extra preposition in room version 11 description of redactions (#1848)
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
3 days ago
Johannes Marbach 5a86e384dd
Clarify that per-request UIA for /login/get_token is an RFC 2119 MUST requirement (#1846)
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
3 days ago
Kévin Commaille 1e303b3bbc
Do not require UIA when first uploading cross-signing keys (#1828)
As per MSC3967.
4 days ago
Matthew Hodgson e15a36b0a1
MSC4132: deprecate linking to events in rooms identified by alias (#1823) 6 days ago
Matthias Ahouansou 7ff785fc38
Clarify that the event field of the send_join is only required when performing a restricted join (#1834) 7 days ago
Johannes Marbach a17550648c
Fix typo in moderation policy lists spec (#1832) 1 week ago
Richard van der Hoff 722c2b1e9a
Clean up pull request template (#1831)
As far as I can tell, these header files only encourage people to create
badly-formatted PRs.

Also we only have one template so let's give it the default name.
1 week ago
Matthias Ahouansou 49765e0e0a
Clarify that redaction events are subject to auth rules (#1824)
Signed-off-by: Matthias Ahouansou <matthias@ahouansou.cz>
2 weeks ago
Kévin Commaille ea781ef7b2
Spec markup for mathematical messages (#1816)
* Spec markup for mathematical messages

As per MSC2191.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add warning box

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Improve warning

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add links

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 weeks ago
Sumner Evans 500e83b9b7
e2ee/qr: clarify that the device's Ed25519 signing key should be used (#1829)
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2 weeks ago
Kévin Commaille 3674985dd6
Factor out the common definitions of the content repo APIs and add new formats (#1822)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 weeks ago
Matthias Ahouansou 041be547d6
Fix typo of object being spelt as "obiect" (#1827) 2 weeks ago
Richard van der Hoff dac867dd6a
Rename "recovery key" to "backup decryption key" (#1819)
Also, some other editorial improvements, including factoring out our two definitions of the same key encoding algorithm.

Co-authored-by: Travis Ralston <travisr@matrix.org>
4 weeks ago
Kévin Commaille b0df8e7fb5
Use `patternProperties` in more places with supported formats (#1813)
Allows to have more places where the property name's type is better defined.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Richard van der Hoff df1e799c51
Spec terms of service at registration (MSC1692) (#1812)
Spec for matrix-org/matrix-spec-proposals#1692

Co-authored-by: Hubert Chathi <hubertc@matrix.org>
1 month ago
Andrew Morgan f4b34ba962
Note that whitespace around `Authorization` param commas is allowed (#1818) 1 month ago
Kévin Commaille 98d85cf421
Add support for rendering string formats (#1814)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Richard van der Hoff 48f4c4954f
Include information about additionalProperties in object tables (#1798)
Currently, if we have an object which has additionalProperties in addition to properties, that information gets lost. This PR seeks to address that.
1 month ago
Matthias Ahouansou eea3dfa969
Mention notifying AS for sender_localpart events (#1810)
Signed-off-by: Matthias Ahouansou <matthias@ahouansou.cz>
1 month ago
Kévin Commaille 2d18aac201
Use `OneTimeKeys` schema (#1800)
This was commented prior to the
port to OpenAPI 3.1 for technical reasons (#1127).
Now we can use it just fine.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille 1fc25d8d48
Do not use `title` for objects containing only `additionalProperties` or `patternProperties` (#1801)
Previously, titles would appear that do not link to a subchema definition.
It would also mean that named subschemas would appear without being clearly referenced.

Now, the type clearly shows the nesting of objects
and subschema definitions should be clearly referenced.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille 85ad0c767c
Render response headers (#1809)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille 625999a039
Deprecate authentication via a query string (#1808)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille ae70b5fcf3
Replace `set-output` with environment files in CI (#1806)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille d3eca87389
Set python version for the Towncrier CI job (#1805)
Otherwise the version might change depending on the runner.
We just use the same version as other jobs.

This removes a GitHub warning.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
1 month ago
Kévin Commaille d6b1d7300f
Update most CI actions (#1803)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille b0115a9613
Update typos CI action (#1804)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille a0bc6e7f83
Add anchors in `definition` shortcode (#1802)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Kévin Commaille 7201042894
Fix anchors for schemas under `oneOf` (#1799)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille 2edfb21d5d
Add support for pattern formats for `patternProperties` (#1796)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille 26ce3929b4
Clean up unecessary `allOf`s (#1797)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille 1095179374
Upgrade version of Hugo used to build the spec in CI (#1794)
* Upgrade version of Hugo used to build the spec in CI

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Escape HTML manually in property-type partial

The behavior of `delimit` changed,
so Hugo doesn't recognize "safe" HTML passed to it anymore, so it escapes nested HTML links.

To fix that we escape the schema data manually
and consider the output of the partial as "safe".

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Richard van der Hoff 2b5f990f60
Factor out common definition of `Tag` type (#1793)
... and remove spurious `additionalProperties: true`
2 months ago
Kévin Commaille e82829d4a2
Make resolve-allof partial recursive (#1787)
Makes it easier to use, like resolve-refs. It just needs to be called once.

Fixes an issue with m.call.* events not displaying the common fields

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2 months ago
Richard van der Hoff 073ce659df
Define opaque identifier grammar (#1791)
Since we already have three of these, and I'm about to add a fourth, let's pull
it out to a common definition.

We could, of course, keep defining the grammar each time it's used, but
defining it in an appendix helps us be consistent for future API design.
2 months ago
Kévin Commaille f4e7b2aa97
Fix property type resolution in render-object-table (#1789)
The split was not clear between property-type and type-or-title,
so it was not obvious which partial should be called for recursion.
That resulted in an error where type-or-title was only called for objects and array items, even if it also resolves
arrays of types.

This makes the split clearer. property-type must be called for any schema,
and object-type-or-title is only called for object schemas.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille 521e555cf6
Bump minimum Hugo version in README (#1788)
To match the one in config.toml

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille a81b720151
Upgrade CI scripts dependencies (#1786)
Will allow us to benefit from future fixes in JSON Schema validation.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Richard van der Hoff becc667672
Update github-labels.rst (#1781)
Fix formatting
2 months ago
Kévin Commaille 2678370f2c
Simplify uses of `resolve-refs` partial (#1773)
* Use the resolve-refs partial as soon as possible

Call it right after accessing the site.Data,
since it is recursing it will solve all references in the tree.
That way we don't need to wonder where to call it,
we trust the validators that the refs will be used in the right place.

* Enable strict $ref rule in OpenAPI validator

* Document use of $ref to compose examples

* Fix schema path in event-fields shortcode

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille 2ea8e0f514
Remove enum for `POST /login` `type` definition (#1776)
Since the enum is not exhaustive, improve the description of the property instead.
2 months ago
Kévin Commaille efe72d3b26
Fix security schemes in OpenAPI definitions (#1772) 2 months ago
Johannes Marbach ee1a169121
Arrange rows in .basic-info tables vertically when horizontal space is constrained (#1771)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2 months ago
Kévin Commaille e74c7c1540
Fix Hugo warnings (#1775) 2 months ago
Travis Ralston d547154c91
Spec `?animated` on `/thumbnail` (#1757)
* Spec `?animated` on `/thumbnail`

* v3*

* v1.11
2 months ago
Johannes Marbach 8ff3623e37
Reduce whitespace on mobile viewports (#1770)
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2 months ago
Kévin Commaille eb7ac353e2
Add support for muting in VoIP calls (#1755)
As per MSC3291.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Richard van der Hoff c25ff9e012
Formatting fixes in CONTRIBUTING.rst (#1769)
* Formatting fix in CONTRIBUTING.rst

* Fix link

* Create 1769.clarification
3 months ago
Michael Telatynski 083e6ef25d
Fix npm publishing being broken in CI (#1765)
* Fix `v` tag_name prefix sneaking into npm version

* Fix `yarn version` failing in CI due to no git global ident name

* Add changelog

* Rename 1765.misc to 1765.clarification
3 months ago
Travis Ralston bd122b35b0 Return to unstable 3 months ago
Travis Ralston 4e51970c55 Upgrade Hugo version on the historical spec 3 months ago
Travis Ralston f7452e2bad Matrix 1.10 3 months ago
Patrick Cloke 7c19d24e3a
Do not allow setting m.push_rules account data directly. (#1763)
* Do not allow setting m.push_rules account data directly.

* Newsfragment

* Update 1763.clarification

Co-authored-by: Travis Ralston <travpc@gmail.com>

* add change notice

Co-authored-by: Travis Ralston <travpc@gmail.com>

* clarify read status

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Fix link for push rules.

* Refer to the error response

---------

Co-authored-by: Travis Ralston <travpc@gmail.com>
3 months ago
Travis Ralston eb22fac5dc
Break out non-JSON request/response content types as tables (#1756)
* Break out non-JSON request/response content types as tables

Currently we display this as a table like "image/png|image/jpeg" and description on a single line, but we're using a table. This breaks the join out to individual rows.

* changelog
3 months ago
Kévin Commaille 6700f5ddd1
Disable smooth scrolling (#1762)
It was not enabled before the docsy update and it messes with
the TOC highlighting during the transition.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Will Hunt e5aa5235fe
MSC4041 - Add Retry-After header notice. (#1737) 3 months ago
Kévin Commaille 4247cff2fa
Deprecate the `font` HTML tag (#1739)
* Deprecate the `font` HTML tag

Rationale:
MSC4077 allows to deprecate HTML tags
that are deprecated in the WHATWG standard,
if they can be replaced by tags with the same feature.

`font` is deprecated and can be replaced by `span`
with the `data-mx-bg-color` and `data-mx-color` attributes.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add deprecation info box

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Travis Ralston 15663d405e Changelog normalization for Matrix 1.10 3 months ago
Kévin Commaille 44c16918fd
Add server support discovery endpoint (#1733)
* Add server support discovery endpoint

As per MSC1929.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Fix example indentation

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Apply suggestions from code review

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Fix line length

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add link to definiton of Matrix User ID

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Fix copyright

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Remove HTTP from supported protocols

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Travis Ralston <travpc@gmail.com>
3 months ago
Kévin Commaille 575c84d431
Fix `event-group` shortcode for changes in `resolve-refs` partial (#1754)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
David Baker 848c1e0348
Spec for MSC3981 (#1746)
* Spec for MSC3981

This writes up https://github.com/matrix-org/matrix-spec-proposals/pull/3981

Hopefully this is relatively straightforward, apart from having to add
the parameters and response field in all three places. I tried to factor
these out but it seems references just aren't supported in the right
places currently (see https://github.com/matrix-org/matrix-spec/pull/1745
for my efforts). Path parameters can't be optional, so it can't be done
that way either.

* Missed schemas

* newsfile

* Actually it clearly isn't going to support markdown, is it?

* grammar

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* grammar

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Clarity

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Clarity

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Typo

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* More clarity.

Note this is counter what the MSC actually proposed to add, but
I think it's clear that this is what it meant.

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
3 months ago
David Baker bb4003afa8
Factor out all the common parameters of the various /relations apis (#1745)
Contributed by @zecakeh bd54781052.

Co-authored-by: Richard van der Hoff <richard@matrix.org>
3 months ago
Kévin Commaille 38796de79a
Add support for multi-stream VoIP (#1735)
As per MSC3077.
3 months ago
Tulir Asokan 5c96f45556
Specify that appservice login and register fail on incorrect as_tokens (#1744)
Signed-off-by: Tulir Asokan <tulir@maunium.net>
3 months ago
Kévin Commaille 4d7e33ec26
Add support for `$ref` URIs containing fragments in OpenAPI definitions and JSON schemas (#1751)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Hubert Chathi 0b43b5a343
Add some clarifications around implementation requirements for MSCs (#1718)
* clarification around implementation requirement, and mention new label

* add changelog

* fix typo

* Fix typos

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
3 months ago
Johannes Marbach 6634f73bff
Add missing 'in' in SSO specification (#1748)
* Add missing 'in' in SSO specification

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>

* Use standard changelog entry for typos

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Co-authored-by: Hubert Chathi <hubert@uhoreg.ca>
3 months ago
Kévin Commaille 9068c336f4
Clarify that sdpMid and sdpMLineIndex are not required in `m.call.candidates` (#1742)
* Convert m.call.candidates schema to YAML

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Clarify that sdpMid and sdpMLineIndex are not required in `m.call.candidates`

MSC2746, merged in v1.17,
introduced the end-of-candidates candidate,
where only the `candidate` property is set to an empty string.

Besides, the [WebRTC specification](https://www.w3.org/TR/webrtc/)
says that only one of those fields is required in a normal candidate.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Link to the "End-of-candidates" section, and clarify what "empty" means

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Kévin Commaille 9fdc7ac38f
Disambiguate uses of PublicRoomsChunk` (#1740)
* Disambiguate uses of PublicRoomsChunk

Make sure that different objects don't share the same title.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Kévin Commaille a1210ff6d1
Clarify that extra fields of space hierarchy children are not required (#1741)
* Clarify that extra fields of space hierarchy children are not required

There is no `children_state` field,
the `room_type` is only set for spaces
and the description of `allowed_room_ids` says that the field can be omitted.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Kévin Commaille 542a219623
Allow `/versions` to optionally accept authentication (#1728)
* Allow /versions to optionally accept authentication

According to MSC2046.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Set "Requires Authentication: Optional"

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Kévin Commaille 4e1b364015
Document the deprecation policy of HTML tags. (#1732)
* Deprecate `strike` HTML tag

Replace it with `s` or `del`.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Remove strike deprecation and add added-in annotation

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add link to HTML standard

Co-authored-by: Hubert Chathi <hubertc@matrix.org>

* Update changelogs/client_server/newsfragments/1732.clarification

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Hubert Chathi <hubertc@matrix.org>
Co-authored-by: Travis Ralston <travpc@gmail.com>
3 months ago
Richard van der Hoff 976ebdca2f
Update HTML templates to link to object definitions (#1724) 3 months ago
Kévin Commaille afda8b8f74
Add local user erasure requests (#1730)
* Add local user erasure requests

As per MSC4025.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add default value

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
reivilibre 2cb70e6e3d
Use a POST request in Federation request signing example (#1721)
* Use a POST request in Federation request signing example

Otherwise the GET request having a body is confusing, since it is not valid HTTP

* Newsfile
3 months ago
Kévin Commaille 38260aabcc
Fix typo in secrets module (#1734)
* Fix typo in secrets module

Introduced in #1695.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Kévin Commaille b136b357e0
Update docsy to v0.8.0 (#1699)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Cadence Ember e2dc5a3826
strike element is deprecated, s replaces it (#1629)
* strike element is deprecated, s replaces it

* Add newsfragment
3 months ago
Kévin Commaille 4cfe2fbf8d
Use `body` field as media caption (#1731)
* Use `body` field as media caption

As per MSC2530.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Use `s` HTML tag in example

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Move changed-in annotation

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Sumner Evans 9a1f0ad532
sas: clarify ECDH process in step 12 (#1720)
Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
3 months ago
Sumner Evans 6096a28984
sas: clarify HKDF calculation uses base64-encoded keys (#1719) 3 months ago
kegsay c4e69d8cb1
Clarify that invite->knock is not a valid transition (#1717)
This reverts https://github.com/matrix-org/matrix-spec/pull/1175

See https://github.com/matrix-org/matrix-spec/issues/1710
4 months ago
Hubert Chathi 170626da67
clarify otk and fallback key types in examples (#1715)
* clarify otk and fallback key types in examples

- remove unsigned curve25519 keys from examples because we don't use those for
  otks and fallback keys
- add missing `device_unused_fallback_key_types` property, which is required

* add changelog
4 months ago
Michael Telatynski 650e691a22
Fix npm release script (#1713)
* Fix npm release script

* Create 1713.misc
5 months ago
Sumner Evans 9a5cacda90
Clarify that the key backup MAC is implemented incorrectly (#1712)
* Clarify that the key backup MAC is implemented incorrectly

Due to a bug in libolm, all implementations of the
m.megolm_backup.v1.curve25519-aes-sha2 key backup algorithm incorrectly
pass an empty string through HMAC-SHA-256 to generate the `mac` property
of the `session_data`.

It was intended for the entire raw encrypted data to be passed through
HMAC-SHA-256, but the issue was caught too late in the process, and thus
we are stuck with this until a new key backup algorithm is introduced.

This commit clarifies the real-world behavior of all current
implementations.

Signed-off-by: Sumner Evans <sumner@beeper.com>
5 months ago
Samuel Loury 1d35e7aac6
Make clearer in the example that the fallback prefix sequence should be repeated for each line (#1690)
Signed-off-by: Samuel Loury <konubinixweb@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
5 months ago
Richard van der Hoff 4a80df364a
Wording tweak in CONTRIBUTING.rst (#1697) 6 months ago
Richard van der Hoff 37ab151aad
Clarify secret storage format (#1695) 6 months ago
Andy Balaam a843cad285
Clarify that threads can be created based on replies (#1687)
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
6 months ago
Andy Balaam 3b2146c875
Batch receipts by thread as well as room (#1685) 6 months ago
Travis Ralston 59f8d632a3
Add step to release process to remind ourselves to reach out to Advocacy (#1680)
* Add step to release process to remind ourselves to reach out to Advocacy

* changelog
6 months ago
Travis Ralston d50929d46b Become unstable 6 months ago
Travis Ralston 0c099e3b79 Matrix 1.9 6 months ago
Hubert Chathi 62c377e19c
fallback keys should have a "fallback: true" property (#1676)
* fallback keys should have a "fallback: true" property

* add changelog
6 months ago
Andy Balaam 6fe2ff4fa7
Make clear the thread root is not in the thread (#1677)
* Make clear the thread root is not in the thread

Signed-off-by: Andy Balaam <andy.balaam@matrix.org>

* Changlog entry for thread PR 1677 - thread roots not in thread

* Fix typo

* Add formatting for code values.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>

* Reword main timeline ID paragraph

* Use close to the original wording for the 'recurse' part of the 'in the thread' definition

* Remove note about thread roots being displayed in a thread

* Define the thread root

---------

Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
6 months ago
Travis Ralston 634b24fb25 Normalize changelog for 1.9 7 months ago
No 25a9157f0a
Add event_property_is and event_property_contains props to PushConditions (#1673)
Signed-off-by: tusooa <tusooa@kazv.moe>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
7 months ago
Patrick Cloke 161a4a2cfb
Federation requests must be for local users. (#1672)
This is already mentioned for /user/devices, but is not mentioned for /query/profile, /user/keys/claim, or /user/keys/query.

See GHSA-mp92-3jfm-3575 for an issue found with this in Synapse.
7 months ago
Matthew Hodgson 7b72c42ba6 put the e back into erik 7 months ago
No 91724e4aef
Fix .m.rule.suppress_notices push rule not being valid JSON (#1671)
Signed-off-by: tusooa <tusooa@kazv.moe>
7 months ago
Val Lorentz 7c19500da7
server-server-api: Fix grammar in server discovery (#1665) 8 months ago
Kévin Commaille 9fe119370b
Update typos action and fix typos (#1661)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
Kévin Commaille 560d98ba9b
Add more CI checks for OpenAPI definitions and JSON Schemas (#1656)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
8 months ago
Kévin Commaille c71b528148
Upgrade GitHub actions (#1660)
* Upgrade most github actions

Gets rid of warning in CI complaining about those actions
using node 12.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Upgrade node version used to run scripts

Use the latest LTS

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
наб 7fb9e99071
annotion (#1658)
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
8 months ago
Kévin Commaille 72517c0f9c
Generate server-server OpenAPI definition (#1657)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
Kévin Commaille 242b62ed55
Fix `m.call.negotiate` schema and example (#1546)
* Fix m.call.negotiate schema and example

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add lifetime back

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Fix lifetime description

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
Kévin Commaille c3098cc55c
Remove required 'fieldname' in Protocol definition (#1646)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
Kévin Commaille 9a9221d8ef
Fix schemas used for account data and presence events in `GET /initialSync` (#1647)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
tsufeki 92cf662e3a
Fix typo in canonical JSON grammar (#1652)
Signed-off-by: Benedykt Błaszkiewicz <tsufeki@gmail.com>
8 months ago
Kévin Commaille e40d9ca186
Fix rendering of `m.receipt` event in Client-Server API (#1637)
... and other improvements

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
9 months ago
Kévin Commaille 5672bdbab7
Fix enum types in JSON schemas (#1634)
`type: enum` does not exist, as an enum can be of any type.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
9 months ago
Michael Telatynski f11c5600a2
Fix npm package release automation (#1648) 9 months ago
Kévin Commaille 99e2ff4927
Replace all mentions of Swagger by OpenAPI (#1633)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
9 months ago
Kévin Commaille df3f0af5d4
Fix schema of `m.mentions` object (#1635)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
9 months ago
Kévin Commaille 96f88e035c
Fix schema of `m.receipt` EDU (#1636)
It was missing a nesting level for the user ID -> user read receipt map.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
9 months ago
Mohit Kumar Patel 46447e0287
add "case sensitive" to `/publicRooms` (#1638) 9 months ago
Kévin Commaille 044a78730e
Clarify that an `m.room.name` event with an absent `name` field is not expected behavior (#1639)
Fixes #1632

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
9 months ago
Paarth Shah 838dec272c
Clarify that `via` is required for `m.space.parent` and `m.space.child` as per MSC1772. (#1618) 9 months ago
Patrick Cloke 5e938f2b83
Document .m.rule.suppress_edits push rule (MSC3958). (#1617) 9 months ago
heinrich5991 a1b832960c
Clarify that Unix timestamps disregard leap seconds since 1970 (#1627)
Fixes #1626.
10 months ago
Travis Ralston ca456a4f53 Reset for development 10 months ago

@ -16,6 +16,7 @@ Previous release: <!-- LINK TO LAST RELEASE'S CHECKLIST -->
Preflight checklist ([release steps](https://github.com/matrix-org/matrix-spec/blob/main/meta/releasing.md)): Preflight checklist ([release steps](https://github.com/matrix-org/matrix-spec/blob/main/meta/releasing.md)):
* [ ] Ensure the social media account holders are available for the release day.
* [ ] Blog post written * [ ] Blog post written
* [ ] Check for release blockers that may have been missed * [ ] Check for release blockers that may have been missed
* [ ] Review/fix the changelog * [ ] Review/fix the changelog

@ -10,3 +10,4 @@ au1ba7o = "au1ba7o"
[default.extend-words] [default.extend-words]
Appy = "Appy" Appy = "Appy"
fo = "fo" fo = "fo"
Iy = "Iy"

@ -1,11 +1,3 @@
---
name: Spec clarification/not a proposal
about: A change that's not a spec proposal, such as a clarification to the spec itself.
title: ''
labels: ''
assignees: ''
---
### Pull Request Checklist ### Pull Request Checklist

@ -10,7 +10,7 @@ jobs:
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- run: scripts/check-newsfragments - run: scripts/check-newsfragments

@ -18,23 +18,23 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: " Setup Node" - name: " Setup Node"
uses: actions/setup-node@v2 uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '20'
- name: "🔎 Run validator" - name: "🔎 Run validator"
run: | run: |
npx @redocly/cli@latest lint data/api/*/*.yaml npx @redocly/cli@latest lint data/api/*/*.yaml
check-examples: check-event-examples:
name: "🔎 Check Event schema examples" name: "🔎 Check Event schema examples"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: " Setup Python" - name: " Setup Python"
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: '3.9' python-version: '3.9'
cache: 'pip' cache: 'pip'
@ -45,7 +45,45 @@ jobs:
- name: "🔎 Run validator" - name: "🔎 Run validator"
run: | run: |
python scripts/check-event-schema-examples.py python scripts/check-event-schema-examples.py
check-openapi-examples:
name: "🔎 Check OpenAPI definitions examples"
runs-on: ubuntu-latest
steps:
- name: "📥 Source checkout"
uses: actions/checkout@v4
- name: " Setup Python"
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: scripts/requirements.txt
- name: " Install dependencies"
run: |
pip install -r scripts/requirements.txt
- name: "🔎 Run validator"
run: |
python scripts/check-openapi-sources.py
check-schemas-examples:
name: "🔎 Check JSON Schemas inline examples"
runs-on: ubuntu-latest
steps:
- name: "📥 Source checkout"
uses: actions/checkout@v4
- name: " Setup Python"
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: scripts/requirements.txt
- name: " Install dependencies"
run: |
pip install -r scripts/requirements.txt
- name: "🔎 Run validator"
run: |
python scripts/check-json-schemas.py
calculate-baseurl: calculate-baseurl:
name: "⚙️ Calculate baseURL for later jobs" name: "⚙️ Calculate baseURL for later jobs"
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -61,11 +99,11 @@ jobs:
# the asterisk matching behaviour, not the literal string. # the asterisk matching behaviour, not the literal string.
run: | run: |
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
echo ::set-output name=baseURL::/ echo "baseURL=/" >> "$GITHUB_OUTPUT"
elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo ::set-output name=baseURL::"/${GITHUB_REF/refs\/tags\//}" echo "baseURL=/${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"
else else
echo ::set-output name=baseURL::/unstable echo "baseURL=/unstable" >> "$GITHUB_OUTPUT"
fi fi
build-openapi: build-openapi:
@ -74,9 +112,9 @@ jobs:
needs: [calculate-baseurl] needs: [calculate-baseurl]
steps: steps:
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: " Setup Python" - name: " Setup Python"
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: '3.9' python-version: '3.9'
cache: 'pip' cache: 'pip'
@ -92,24 +130,29 @@ jobs:
export RELEASE="unstable" export RELEASE="unstable"
fi fi
# The output path matches the final deployment path at spec.matrix.org # The output path matches the final deployment path at spec.matrix.org
scripts/dump-swagger.py \ scripts/dump-openapi.py \
--base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \
--api application-service \ --api application-service \
-r "$RELEASE" \ -r "$RELEASE" \
-o spec/application-service-api/api.json -o spec/application-service-api/api.json
scripts/dump-swagger.py \ scripts/dump-openapi.py \
--base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \
--api client-server \ --api client-server \
-r "$RELEASE" \ -r "$RELEASE" \
-o spec/client-server-api/api.json -o spec/client-server-api/api.json
scripts/dump-swagger.py \ scripts/dump-openapi.py \
--base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \ --base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \
--api push-gateway \ --api push-gateway \
-r "$RELEASE" \ -r "$RELEASE" \
-o spec/push-gateway-api/api.json -o spec/push-gateway-api/api.json
scripts/dump-openapi.py \
--base-url "https://spec.matrix.org${{ needs.calculate-baseurl.outputs.baseURL }}" \
--api server-server \
-r "$RELEASE" \
-o spec/server-server-api/api.json
tar -czf openapi.tar.gz spec tar -czf openapi.tar.gz spec
- name: "📤 Artifact upload" - name: "📤 Artifact upload"
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: openapi-artifact name: openapi-artifact
path: openapi.tar.gz path: openapi.tar.gz
@ -121,15 +164,17 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: " Setup Python" - name: " Setup Python"
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: " Install towncrier" - name: " Install towncrier"
run: "pip install 'towncrier'" run: "pip install 'towncrier'"
- name: "Generate changelog" - name: "Generate changelog"
run: ./scripts/generate-changelog.sh vUNSTABLE run: ./scripts/generate-changelog.sh vUNSTABLE
- name: "📤 Artifact upload" - name: "📤 Artifact upload"
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: changelog-artifact name: changelog-artifact
path: content/changelog/vUNSTABLE.md path: content/changelog/vUNSTABLE.md
@ -142,23 +187,23 @@ jobs:
if: ${{ always() }} if: ${{ always() }}
steps: steps:
- name: " Setup Node" - name: " Setup Node"
uses: actions/setup-node@v2 uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '20'
- name: " Setup Hugo" - name: " Setup Hugo"
uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6 uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with: with:
hugo-version: '0.113.0' hugo-version: '0.113.0'
extended: true extended: true
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: "⚙️ npm" - name: "⚙️ npm"
run: | run: |
npm i npm i
npm run get-proposals npm run get-proposals
- name: "📥 Download generated changelog" - name: "📥 Download generated changelog"
if: "needs.generate-changelog.result == 'success'" if: "needs.generate-changelog.result == 'success'"
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: changelog-artifact name: changelog-artifact
path: content/changelog path: content/changelog
@ -169,7 +214,7 @@ jobs:
# https://spec.matrix.org/latest/client-server-api/api.json # https://spec.matrix.org/latest/client-server-api/api.json
# Works for /unstable/ and /v1.1/ as well. # Works for /unstable/ and /v1.1/ as well.
- name: "📥 Spec definition download" - name: "📥 Spec definition download"
uses: actions/download-artifact@v2 uses: actions/download-artifact@v4
with: with:
name: openapi-artifact name: openapi-artifact
- name: "📝 Unpack the OpenAPI definitions in the right location" - name: "📝 Unpack the OpenAPI definitions in the right location"
@ -179,7 +224,7 @@ jobs:
- name: "📦 Tarball creation" - name: "📦 Tarball creation"
run: tar -czf spec.tar.gz spec run: tar -czf spec.tar.gz spec
- name: "📤 Artifact upload" - name: "📤 Artifact upload"
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: spec-artifact name: spec-artifact
path: spec.tar.gz path: spec.tar.gz
@ -190,10 +235,10 @@ jobs:
needs: [calculate-baseurl, build-spec] needs: [calculate-baseurl, build-spec]
steps: steps:
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: "📥 Fetch built spec" - name: "📥 Fetch built spec"
uses: actions/download-artifact@v2 uses: actions/download-artifact@v4
with: with:
name: spec-artifact name: spec-artifact
@ -219,16 +264,17 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/') }} if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps: steps:
- name: " Setup Node" - name: " Setup Node"
uses: actions/setup-node@v2 uses: actions/setup-node@v4
with: with:
node-version: '14' node-version: '20'
- name: " Setup Hugo" - name: " Setup Hugo"
uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6 uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with: with:
hugo-version: '0.93.3' # Cannot build the spec with Hugo 0.125.0 because of https://github.com/google/docsy/issues/1930
hugo-version: '0.124.1'
extended: true extended: true
- name: "📥 Source checkout" - name: "📥 Source checkout"
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: "⚙️ npm" - name: "⚙️ npm"
run: | run: |
npm i npm i
@ -240,7 +286,7 @@ jobs:
hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec" hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
- name: "📥 Spec definition download" - name: "📥 Spec definition download"
uses: actions/download-artifact@v2 uses: actions/download-artifact@v4
with: with:
name: openapi-artifact name: openapi-artifact
- name: "📝 Unpack the OpenAPI definitions in the right location" - name: "📝 Unpack the OpenAPI definitions in the right location"
@ -250,7 +296,7 @@ jobs:
- name: "📦 Tarball creation" - name: "📦 Tarball creation"
run: tar -czf spec-historical.tar.gz spec run: tar -czf spec-historical.tar.gz spec
- name: "📤 Artifact upload" - name: "📤 Artifact upload"
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v4
with: with:
name: spec-historical-artifact name: spec-historical-artifact
path: spec-historical.tar.gz path: spec-historical.tar.gz

@ -32,10 +32,10 @@ jobs:
pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" | pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
jq -r '.[] | .number') jq -r '.[] | .number')
echo "PR number: $pr_number" echo "PR number: $pr_number"
echo "::set-output name=prnumber::$pr_number" echo "prnumber=$pr_number" >> "$GITHUB_OUTPUT"
- name: '📥 Download artifact' - name: '📥 Download artifact'
uses: dawidd6/action-download-artifact@af92a8455a59214b7b932932f2662fdefbd78126 # v2.15.0 uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with: with:
workflow: main.yaml workflow: main.yaml
run_id: ${{ github.event.workflow_run.id }} run_id: ${{ github.event.workflow_run.id }}
@ -46,8 +46,7 @@ jobs:
- name: "📤 Deploy to Netlify" - name: "📤 Deploy to Netlify"
id: netlify id: netlify
# v1.2.2 uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654 # v3.0.0
uses: nwtgck/actions-netlify@f517512ae75beec8896aa7b027c1c72f01816200
with: with:
publish-dir: spec publish-dir: spec
deploy-message: "Deploy from GitHub Actions" deploy-message: "Deploy from GitHub Actions"

@ -14,25 +14,27 @@ jobs:
working-directory: packages/npm working-directory: packages/npm
steps: steps:
- name: 🧮 Checkout code - name: 🧮 Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: 🔧 Yarn cache - name: 🔧 Yarn cache
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
cache: "yarn" cache: "yarn"
cache-dependency-path: packages/npm/yarn.lock
registry-url: "https://registry.npmjs.org" registry-url: "https://registry.npmjs.org"
- name: 🔨 Install dependencies - name: 🔨 Install dependencies
run: "yarn install --frozen-lockfile" run: "yarn install --frozen-lockfile"
# We bump the package.json version to git, we just need it for publish to do the right thing
- name: 🎖 Bump package.json version - name: 🎖 Bump package.json version
run: "yarn version $VERSION" run: "yarn version --new-version ${VERSION#v} --no-git-tag-version"
env: env:
VERSION: ${{ github.event.release.tag_name }}.0 VERSION: ${{ github.event.release.tag_name }}.0
- name: 🚀 Publish to npm - name: 🚀 Publish to npm
id: npm-publish id: npm-publish
uses: JS-DevTools/npm-publish@5a85faf05d2ade2d5b6682bfe5359915d5159c6c # v2.2.1 uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
with: with:
token: ${{ secrets.NPM_TOKEN }} token: ${{ secrets.NPM_TOKEN }}
package: packages/npm package: packages/npm

@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Actions Repository - name: Checkout Actions Repository
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Check spelling of proposals - name: Check spelling of proposals
uses: crate-ci/typos@9be36f97fdbe645ee9a12449fb13aca856c2516a uses: crate-ci/typos@f2c1f08a7b3c1b96050cb786baaa2a94797bdb7d # v1.20.10
with: with:
config: ${{github.workspace}}/.github/_typos.toml config: ${{github.workspace}}/.github/_typos.toml

2
.gitignore vendored

@ -2,7 +2,7 @@ node_modules
/data/msc /data/msc
/env* /env*
/resources /resources
/scripts/swagger /scripts/openapi
/scripts/tmp /scripts/tmp
/hugo-config.toml /hugo-config.toml
/public /public

7
.gitmodules vendored

@ -1,7 +0,0 @@
[submodule "themes/docsy"]
path = themes/docsy
# We use our own forked version of the Docsy theme,
# to avoid loading fonts from CDNs, which Docsy currently
# doesn't support (see https://github.com/google/docsy/issues/605).
url = https://github.com/matrix-org/docsy.git
branch = master

@ -12,7 +12,7 @@ The documentation style is described at
https://github.com/matrix-org/matrix-spec/blob/main/meta/documentation_style.rst. https://github.com/matrix-org/matrix-spec/blob/main/meta/documentation_style.rst.
Matrix-spec workflows Matrix-spec workflows
-------------------- ---------------------
Specification changes Specification changes
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
@ -72,7 +72,7 @@ ask.
Adding to the changelog Adding to the changelog
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
All API specifications require a changelog entry. Adding to the changelog can only All changes to the contents of this repository require a changelog entry. Adding to the changelog can only
be done after you've opened your pull request, so be sure to do that first. be done after you've opened your pull request, so be sure to do that first.
The changelog is managed by `Towncrier <https://github.com/twisted/towncrier>`_ in the The changelog is managed by `Towncrier <https://github.com/twisted/towncrier>`_ in the
@ -117,7 +117,7 @@ license - in our case, this is Apache Software License v2 (see LICENSE).
In order to have a concrete record that your contribution is intentional In order to have a concrete record that your contribution is intentional
and you agree to license it under the same terms as the project's license, we've adopted the and you agree to license it under the same terms as the project's license, we've adopted the
same lightweight approach used by the `Linux Kernel <https://www.kernel.org/doc/html/latest/process/submitting-patches.html>`_, same lightweight approach used by the `Linux Kernel <https://www.kernel.org/doc/html/latest/process/submitting-patches.html>`_,
`Docker <https://github.com/docker/docker/blob/master/CONTRIBUTING.md`_, and many other `Docker <https://github.com/docker/docker/blob/master/CONTRIBUTING.md>`_, and many other
projects: the `Developer Certificate of Origin <http://developercertificate.org/>`_ projects: the `Developer Certificate of Origin <http://developercertificate.org/>`_
(DCO). This is a simple declaration that you wrote (DCO). This is a simple declaration that you wrote
the contribution or otherwise have the right to contribute it to Matrix:: the contribution or otherwise have the right to contribute it to Matrix::

@ -22,7 +22,7 @@ The Matrix spec is compiled with [Hugo](https://gohugo.io/) (a static site gener
* `/data`: this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as * `/data`: this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as
[data objects](https://gohugo.io/templates/data-templates/), so templates don't need to load them from a file and [data objects](https://gohugo.io/templates/data-templates/), so templates don't need to load them from a file and
parse them. This is also where our Swagger/OpenAPI definitions and schemas are. parse them. This is also where our OpenAPI definitions and schemas are.
* `/layouts`: this contains [Hugo templates](https://gohugo.io/templates/). Some templates define the overall layout of * `/layouts`: this contains [Hugo templates](https://gohugo.io/templates/). Some templates define the overall layout of
a page: for example, whether it has header, footer, sidebar, and so on. a page: for example, whether it has header, footer, sidebar, and so on.
@ -52,7 +52,7 @@ Additionally, the following directories may be of interest:
* `/data-definitions`: Bits of structured data consumable by Matrix implementations. * `/data-definitions`: Bits of structured data consumable by Matrix implementations.
* `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc). * `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc).
* `/scripts`: Various scripts for generating the spec and validating its contents. * `/scripts`: Various scripts for generating the spec and validating its contents.
* `/packages`: Various packages for shipping spec files like OpenAPI/swagger bindings and data definitions. * `/packages`: Various packages for shipping spec files like OpenAPI bindings and data definitions.
## Authoring changes to the spec ## Authoring changes to the spec
@ -61,13 +61,12 @@ place after an MSC has been accepted, not as part of a proposal itself.
1. Install the extended version (often the OS default) of Hugo: 1. Install the extended version (often the OS default) of Hugo:
<https://gohugo.io/getting-started/installing>. Note that at least Hugo <https://gohugo.io/getting-started/installing>. Note that at least Hugo
v0.93.0 is required. v0.113.0 is required.
Alternatively, use the Docker image at Alternatively, use the Docker image at
https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required
to process the SCSS.) to process the SCSS.)
2. Run `npm i` to install the dependencies and fetch the docsy git submodule. 2. Run `npm i` to install the dependencies. Note that this will require NodeJS to be installed.
Note that this will require NodeJS to be installed.
3. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals" 3. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals"
page and is not required. page and is not required.
4. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313 4. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313
@ -87,13 +86,13 @@ steps for authoring changes to the specification and instead of `hugo serve` run
spec to `/spec`. If you'd like to serve the spec off a path instead of a domain root (eg: `/unstable`), add `--baseURL "/unstable"` spec to `/spec`. If you'd like to serve the spec off a path instead of a domain root (eg: `/unstable`), add `--baseURL "/unstable"`
to the `hugo -d "spec"` command. to the `hugo -d "spec"` command.
For building the swagger definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt` For building the OpenAPI definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt`
and finally `python ./scripts/dump-swagger.py` to generate it to `./scripts/swagger/api-docs.json`. To make use of the generated file, and finally `python ./scripts/dump-openapi.py` to generate it to `./scripts/openapi/api-docs.json`. To make use of the generated file,
there are a number of options: there are a number of options:
* You can open `./scripts/swagger-preview.html` in your browser, and then open the file by clicking on `Local JSON File`. * You can open `./scripts/openapi-preview.html` in your browser, and then open the file by clicking on `Local JSON File`.
* You can run a local HTTP server by running `./scripts/swagger-http-server.py`, and then view the documentation by * You can run a local HTTP server by running `./scripts/openapi-http-server.py`, and then view the documentation by
opening `./scripts/swagger-preview.html` in your browser. opening `./scripts/openapi-preview.html` in your browser.
## Issue tracking ## Issue tracking

@ -18,9 +18,6 @@ limitations under the License.
Custom SCSS for the Matrix spec Custom SCSS for the Matrix spec
*/ */
@import "variables_project";
@import "variables";
/* Import the CSS classes for the syntax highlighter. /* Import the CSS classes for the syntax highlighter.
* *
* This is generated with: * This is generated with:
@ -43,10 +40,17 @@ Custom SCSS for the Matrix spec
.navbar-brand { .navbar-brand {
font-size: 1.1rem; font-size: 1.1rem;
/* Allow the text to wrap if it is wider than the viewport */
text-align: center;
white-space: normal;
.navbar-version { .navbar-version {
color: $secondary; color: $secondary;
} }
}
.nav-link {
font-weight: normal;
} }
a { a {
@ -114,7 +118,7 @@ Custom SCSS for the Matrix spec
} }
} }
@media (min-width: 768px) { @include media-breakpoint-up(md) {
@supports (position: sticky) { @supports (position: sticky) {
.td-sidebar-nav { .td-sidebar-nav {
/* This overrides calc(100vh - 10rem);, which gives us a blank space at the bottom of the sidebar */ /* This overrides calc(100vh - 10rem);, which gives us a blank space at the bottom of the sidebar */
@ -171,6 +175,13 @@ footer {
} }
/* Remove some padding before the main content, when the sidebar is disabled */
.td-main main {
@include media-breakpoint-down(md) {
padding-top: 0;
}
}
/* Adjust the scroll margin for everything in the main content, so that /* Adjust the scroll margin for everything in the main content, so that
* it doesn't disappear behind the header bar */ * it doesn't disappear behind the header bar */
.td-content * { .td-content * {
@ -292,7 +303,7 @@ footer {
} }
/* Styles for sections that are rendered from data, such as HTTP APIs and event schemas */ /* Styles for sections that are rendered from data, such as HTTP APIs and event schemas */
.rendered-data { .td-content .rendered-data {
background-color: $secondary-lightest-background; background-color: $secondary-lightest-background;
padding: 0.85rem; padding: 0.85rem;
margin: 0.85rem 0; margin: 0.85rem 0;
@ -346,7 +357,7 @@ footer {
} }
p code, table code { p code, table code {
background-color: inherit; background-color: transparent;
} }
table { table {
@ -396,6 +407,7 @@ footer {
th, td, caption { th, td, caption {
padding: 1rem; padding: 1rem;
border-top: 1px $table-border-color solid;
} }
&.object-table, &.response-table, &.content-type-table { &.object-table, &.response-table, &.content-type-table {
@ -408,14 +420,12 @@ footer {
// ... but avoid double border between caption and table // ... but avoid double border between caption and table
border-bottom: 0; border-bottom: 0;
}
caption, tbody tr { background-color: $secondary-lighter-background;
background-color: $table-row-default;
} }
tbody tr:nth-child(even) { tbody tr {
background-color: $table-row-alternate; --bs-table-striped-bg: #{$secondary-lighter-background};
} }
} }
@ -427,6 +437,31 @@ footer {
&.basic-info th { &.basic-info th {
width: 15rem; width: 15rem;
} }
/* Arrange rows vertically when horizontal space is constrained to avoid overflowing */
@include media-breakpoint-down(sm) {
/* Make cells full width without vertical margin */
&.basic-info th, &.basic-info td {
width: 100%;
display: inline-block;
margin-top: 0;
margin-bottom: 0;
}
/* Remove border and padding between header & data cells to make them appear like a single cell */
&.basic-info td {
padding-top: 0;
border-top: none;
}
&.basic-info th {
border-bottom: none;
}
/* Remove top border on all but the first header cell to prevent double borders between rows */
&.basic-info tr + tr th {
border-top: none;
}
}
} }
pre { pre {
@ -471,12 +506,18 @@ of .td-content. This applies the same style to any blockquotes that descend from
Make padding symmetrical (this selector is used in the default styles to apply padding-left: 3rem) Make padding symmetrical (this selector is used in the default styles to apply padding-left: 3rem)
*/ */
.pl-md-5, .px-md-5 { .pl-md-5, .px-md-5 {
padding-right: 3rem; @include media-breakpoint-up(md) {
padding-right: 3rem;
}
} }
/* Adjust default styles for info banner */ /* Adjust default styles for info banner */
.pageinfo-primary { .pageinfo-primary {
max-width: 80%; @include media-breakpoint-up(lg) {
max-width: 80%;
}
margin-top: 0;
margin-right: 0;
margin-left: 0; margin-left: 0;
border: 0; border: 0;
border-left: solid 5px $secondary; border-left: solid 5px $secondary;
@ -517,3 +558,15 @@ dd {
border-radius: 0.25rem; // was $border-radius, but that var isn't accessible here. border-radius: 0.25rem; // was $border-radius, but that var isn't accessible here.
} }
} }
/* Style for breadcrumbs */
.td-breadcrumbs {
padding: .75rem 1rem;
background-color: #eee;
border-radius: .25rem;
margin-bottom: 1rem;
.breadcrumb {
margin: 0;
}
}

@ -20,7 +20,7 @@ $dark: #333;
$gray-100: #FBFBFB; $gray-100: #FBFBFB;
$secondary-background: #E5F5FB; $secondary-background: #E5F5FB;
$secondary-lighter-background: #F4FaFC; $secondary-lighter-background: #F4FAFC;
$secondary-lightest-background: #FBFDFD; $secondary-lightest-background: #FBFDFD;
@ -33,8 +33,7 @@ $warning-background: #FFE0E0;
// colours for definition tables. // colours for definition tables.
// the border colour matches that used for "highlight" divs // the border colour matches that used for "highlight" divs
$table-border-color: rgba(black, .125); $table-border-color: rgba(black, .125);
$table-row-alternate: $secondary-lightest-background; $table-bg: $secondary-lightest-background;
$table-row-default: $secondary-lighter-background;
/* Configure docsy to use the default system fonts instead of Google Fonts. /* Configure docsy to use the default system fonts instead of Google Fonts.
* See https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts */ * See https://www.docsy.dev/docs/adding-content/lookandfeel/#fonts */
@ -50,3 +49,6 @@ $td-enable-google-fonts: false;
* The font itself is loaded via stylesheet link layouts/partials/hooks/head-end.html. * The font itself is loaded via stylesheet link layouts/partials/hooks/head-end.html.
*/ */
$font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; $font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
// Disable smooth scrolling as it makes TOC highlighting jump during the transition.
$enable-smooth-scroll: false;

@ -0,0 +1 @@
Define 'Opaque Identifier Grammar'.

@ -0,0 +1 @@
Define common cryptographic key representation.

@ -0,0 +1 @@
Deprecate linking to events in rooms identified by alias, as per [MSC4132](https://github.com/matrix-org/matrix-spec-proposals/pull/4132).

@ -0,0 +1 @@
Fix the OpenAPI definition of the security schemes.

@ -0,0 +1 @@
Clarify that appservices should be notified of events relating to the sender_localpart user.

@ -0,0 +1 @@
Add support for muting in VoIP calls, as per [MSC3291](https://github.com/matrix-org/matrix-spec-proposals/pull/3291).

@ -0,0 +1 @@
Add optional `animated` query string option to `GET /_matrix/media/v3/thumbnail`, as per [MSC2705](https://github.com/matrix-org/matrix-spec-proposals/pull/2705).

@ -0,0 +1 @@
Fix the OpenAPI definition of the security schemes.

@ -0,0 +1 @@
Clarify that the `type` of the `POST /login` request must be one of the types returned by the `GET /login` response.

@ -0,0 +1 @@
Deprecate authentication via a query string, as per [MSC4126](https://github.com/matrix-org/matrix-spec-proposals/issues/4126).

@ -0,0 +1 @@
Specify terms of services at registration, as per [MSC1692](https://github.com/matrix-org/matrix-spec-proposals/pull/1692).

@ -0,0 +1 @@
Use `patternProperties` in more places with supported formats.

@ -0,0 +1 @@
Add support for mathematical messages, as per [MSC2191](https://github.com/matrix-org/matrix-spec-proposals/pull/2191).

@ -0,0 +1 @@
Rename "recovery key" to "backup decryption key".

@ -0,0 +1 @@
Refactor the OpenAPI definitions of the content repository endpoints.

@ -0,0 +1 @@
Do not require UIA when first uploading cross-signing keys, as per [MSC3967](https://github.com/matrix-org/matrix-spec-proposals/pull/3967).

@ -0,0 +1 @@
Clarify that the device's Ed25519 signing key should be used in QR code verification (as opposed to the device's Curve25519 identity key).

@ -0,0 +1 @@
Fix various typos throughout the specification.

@ -0,0 +1 @@
Clarify that per-request UIA for /login/get_token is an RFC 2119 MUST requirement.

@ -0,0 +1 @@
Fix the OpenAPI definition of the security schemes.

@ -0,0 +1 @@
Deprecate authentication via a query string, as per [MSC4126](https://github.com/matrix-org/matrix-spec-proposals/issues/4126).

@ -0,0 +1 @@
Fix npm release script for `@matrix-org/spec`.

@ -0,0 +1 @@
Formatting fixes in CONTRIBUTING.rst.

@ -0,0 +1 @@
Reduce whitespace on mobile viewports

@ -0,0 +1 @@
Arrange rows in `.basic-info` tables vertically when horizontal space is constrained.

@ -0,0 +1 @@
Simplify uses of `resolve-refs` partial.

@ -0,0 +1 @@
Upgrade jsonschema and python-jsonpath CI scripts dependencies.

@ -0,0 +1 @@
Solve `allOf` recursively in OpenAPI and JSON Schemas.

@ -0,0 +1 @@
Fix property type resolution in `render-object-table` partial.

@ -0,0 +1 @@
Factor out common definition of `Tag` type.

@ -0,0 +1 @@
Update the version of Hugo used to render the spec to v0.124.1.

@ -0,0 +1 @@
Add support for pattern formats for `patternProperties`.

@ -0,0 +1 @@
Clean up unnecessary `allOf`s in OpenAPI definitions.

@ -0,0 +1 @@
Show information about "Additional Properties" in object tables.

@ -0,0 +1 @@
Fix anchors for schemas under `oneOf`.

@ -0,0 +1 @@
Use reference to `OneTimeKeys` schema in OpenAPI definitions.

@ -0,0 +1 @@
Do not use the `title` of objects containing only `additionalProperties` or `patternProperties`.

@ -0,0 +1 @@
Add anchors in `definition` shortcode.

@ -0,0 +1 @@
Set python version for the Towncrier CI job.

@ -0,0 +1 @@
Replace `set-output` with environment files in CI.

@ -0,0 +1 @@
Add support for rendering string formats.

@ -0,0 +1 @@
Clean up pull request template.

@ -0,0 +1 @@
Clarify that redaction events are still subject to all applicable auth rules.

@ -0,0 +1 @@
Fix minor spelling mistake of object being spelt "obiect".

@ -0,0 +1 @@
Fix various typos throughout the specification.

@ -0,0 +1 @@
Fix the OpenAPI definition of the security schemes.

@ -0,0 +1 @@
Use `patternProperties` in more places with supported formats.

@ -0,0 +1 @@
Clarify that whitespace around commas is allowed in the `X-Matrix` `Authorization` header value params list.

@ -0,0 +1 @@
Clarify that the `event` field of the `/v2/send_join` response is only required when `join_authorised_via_users_server` was present in the `content` field of the request.

@ -7,21 +7,34 @@ canonifyURLs = true
enableRobotsTXT = true enableRobotsTXT = true
# Hugo allows theme composition (and inheritance). The precedence is from left to right.
theme = ["docsy"]
# We disable RSS, because (a) it's useless, (b) Hugo seems to generate broken # We disable RSS, because (a) it's useless, (b) Hugo seems to generate broken
# links to it when used with a --baseURL (for example, https://spec.matrix.org/v1.4/ # links to it when used with a --baseURL (for example, https://spec.matrix.org/v1.4/
# contains `<link rel="alternate" type="application/rss&#43;xml" href="/v1.4/v1.4/index.xml">`). # contains `<link rel="alternate" type="application/rss&#43;xml" href="/v1.4/v1.4/index.xml">`).
disableKinds = ["taxonomy", "taxonomyTerm", "RSS"] disableKinds = ["taxonomy", "RSS"]
[languages] [languages]
[languages.en] [languages.en]
title = "Matrix Specification" title = "Matrix Specification"
description = "Home of the Matrix specification for decentralised communication"
languageName ="English" languageName ="English"
# Weight used for sorting. # Weight used for sorting.
weight = 1 weight = 1
[languages.en.params]
description = "Home of the Matrix specification for decentralised communication"
# Entries in the main menu in the header.
[menus]
[[menus.main]]
name = 'Foundation'
url = 'https://matrix.org/foundation/'
weight = 10
[[menus.main]]
name = 'FAQs'
url = 'https://matrix.org/faq'
weight = 20
[[menus.main]]
name = 'Blog'
url = 'https://matrix.org/blog/posts'
weight = 30
[markup] [markup]
[markup.goldmark] [markup.goldmark]
@ -47,14 +60,14 @@ privacy_policy = "https://matrix.org/legal/privacy-notice"
[params.version] [params.version]
# must be one of "unstable", "current", "historical" # must be one of "unstable", "current", "historical"
# this is used to decide whether to show a banner pointing to the current release # this is used to decide whether to show a banner pointing to the current release
status = "stable" status = "unstable"
# A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner. # A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner.
current_version_url = "https://spec.matrix.org/latest" current_version_url = "https://spec.matrix.org/latest"
# The following is used when status = "stable", and is displayed in various UI elements on a released version # The following is used when status = "stable", and is displayed in various UI elements on a released version
# of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created. # of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created.
major = "1" # major = "1"
minor = "8" # minor = "10"
release_date = "August 23, 2023" # release_date = "March 22, 2024"
# User interface configuration # User interface configuration
[params.ui] [params.ui]
@ -111,3 +124,13 @@ sidebar_menu_compact = true
X-Frame-Options = "sameorigin" X-Frame-Options = "sameorigin"
Access-Control-Allow-Origin = "*" Access-Control-Allow-Origin = "*"
Access-Control-Allow-Methods = "GET" Access-Control-Allow-Methods = "GET"
# hugo module configuration
[module]
[module.hugoVersion]
extended = true
min = "0.113.0"
[[module.imports]]
path = "github.com/matrix-org/docsy"
disable = false

@ -419,9 +419,16 @@ into the `m.` namespace.
### Timestamps ### Timestamps
Unless otherwise stated, timestamps are measured as milliseconds since Unless otherwise stated, timestamps are the number of milliseconds
the Unix epoch. Throughout the specification this may be referred to as elapsed since the unix epoch (1970-01-01 00:00:00 UTC), but not counting
POSIX, Unix, or just "time in milliseconds". leap seconds, so that each day is precisely 86,400,000 milliseconds.
This means that timestamps can repeat during leap seconds. Most
programming languages provide timestamps in that format natively, e.g.
[ECMAScript](https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-time-values-and-time-range).
Throughout the specification this may be referred to as POSIX,
[Unix](https://en.wikipedia.org/wiki/Unix_time), or just "time in
milliseconds".
## Specification Versions ## Specification Versions

@ -136,12 +136,12 @@ removing insignificant whitespace, fractions, exponents and redundant
character escapes. character escapes.
value = false / null / true / object / array / number / string value = false / null / true / object / array / number / string
false = %x66.61.6c.73.65 false = %x66.61.6C.73.65
null = %x6e.75.6c.6c null = %x6E.75.6C.6C
true = %x74.72.75.65 true = %x74.72.75.65
object = %x7B [ member *( %x2C member ) ] %7D object = %x7B [ member *( %x2C member ) ] %x7D
member = string %x3A value member = string %x3A value
array = %x5B [ value *( %x2C value ) ] %5B array = %x5B [ value *( %x2C value ) ] %x5D
number = [ %x2D ] int number = [ %x2D ] int
int = %x30 / ( %x31-39 *digit ) int = %x30 / ( %x31-39 *digit )
digit = %x30-39 digit = %x30-39
@ -745,7 +745,7 @@ Specifically, the following mappings are used:
* `r` for room aliases. * `r` for room aliases.
* `u` for users. * `u` for users.
* `roomid` for room IDs (note the distinction from room aliases). * `roomid` for room IDs (note the distinction from room aliases).
* `e` for events, when after a room reference (`r` or `roomid`). * `e` for events, when after a room ID (`roomid`). Use of `e` after a room alias (`r`) is deprecated.
{{% boxes/note %}} {{% boxes/note %}}
During development of this URI format, types of `user`, `room`, and `event` During development of this URI format, types of `user`, `room`, and `event`
@ -755,6 +755,13 @@ wish to consider handling them as `u`, `r`, and `e` respectively.
`roomid` was otherwise unchanged. `roomid` was otherwise unchanged.
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
{{< changed-in v="1.11" >}}
Referencing event IDs within a room identified by room alias (`r`) rather than room ID
(`roomid`) is now deprecated. We are not aware of these ever having been used in
practice, and are nonsensical given room aliases are mutable.
{{% /boxes/note %}}
The `id without sigil` is simply the identifier for the entity without the defined The `id without sigil` is simply the identifier for the entity without the defined
sigil. For example, `!room:example.org` becomes `room:example.org` (`!` is the sigil sigil. For example, `!room:example.org` becomes `room:example.org` (`!` is the sigil
for room IDs). The sigils are described under the for room IDs). The sigils are described under the
@ -799,7 +806,6 @@ Examples of common URIs are:
<!-- Author's note: These examples should be consistent with the matrix.to counterparts. --> <!-- Author's note: These examples should be consistent with the matrix.to counterparts. -->
* Link to `#somewhere:example.org`: `matrix:r/somewhere:example.org` * Link to `#somewhere:example.org`: `matrix:r/somewhere:example.org`
* Link to `!somewhere:example.org`: `matrix:roomid/somewhere:example.org?via=elsewhere.ca` * Link to `!somewhere:example.org`: `matrix:roomid/somewhere:example.org?via=elsewhere.ca`
* Link to `$event` in `#somewhere:example.org`: `matrix:r/somewhere:example.org/e/event`
* Link to `$event` in `!somewhere:example.org`: `matrix:roomid/somewhere:example.org/e/event?via=elsewhere.ca` * Link to `$event` in `!somewhere:example.org`: `matrix:roomid/somewhere:example.org/e/event?via=elsewhere.ca`
* Link to chat with `@alice:example.org`: `matrix:u/alice:example.org?action=chat` * Link to chat with `@alice:example.org`: `matrix:u/alice:example.org?action=chat`
@ -809,9 +815,9 @@ A suggested client implementation algorithm is available in the
#### matrix.to navigation #### matrix.to navigation
{{% boxes/note %}} {{% boxes/note %}}
This namespacing existed prior to a `matrix:` scheme. This is **not** matrix.to is a Namespace URI which existed prior to a `matrix:` URI scheme.
meant to be interpreted as an available web service - see below for more This is **not** meant to be interpreted as an available web service - see
details. below for more details.
{{% /boxes/note %}} {{% /boxes/note %}}
A matrix.to URI has the following format, based upon the specification A matrix.to URI has the following format, based upon the specification
@ -843,10 +849,16 @@ Examples of matrix.to URIs are:
<!-- Author's note: These examples should be consistent with the matrix scheme counterparts. --> <!-- Author's note: These examples should be consistent with the matrix scheme counterparts. -->
* Link to `#somewhere:example.org`: `https://matrix.to/#/%23somewhere%3Aexample.org` * Link to `#somewhere:example.org`: `https://matrix.to/#/%23somewhere%3Aexample.org`
* Link to `!somewhere:example.org`: `https://matrix.to/#/!somewhere%3Aexample.org?via=elsewhere.ca` * Link to `!somewhere:example.org`: `https://matrix.to/#/!somewhere%3Aexample.org?via=elsewhere.ca`
* Link to `$event` in `#somewhere:example.org`: `https://matrix.to/#/%23somewhere:example.org/%24event%3Aexample.org`
* Link to `$event` in `!somewhere:example.org`: `https://matrix.to/#/!somewhere%3Aexample.org/%24event%3Aexample.org?via=elsewhere.ca` * Link to `$event` in `!somewhere:example.org`: `https://matrix.to/#/!somewhere%3Aexample.org/%24event%3Aexample.org?via=elsewhere.ca`
* Link to `@alice:example.org`: `https://matrix.to/#/%40alice%3Aexample.org` * Link to `@alice:example.org`: `https://matrix.to/#/%40alice%3Aexample.org`
{{% boxes/note %}}
{{< changed-in v="1.11" >}}
Referencing event IDs within a room identified by room alias rather than room ID
is now deprecated. We are not aware of these ever having been used in
practice, and are nonsensical given room aliases are mutable.
{{% /boxes/note %}}
{{% boxes/note %}} {{% boxes/note %}}
Historically, clients have not produced URIs which are fully encoded. Historically, clients have not produced URIs which are fully encoded.
Clients should try to interpret these cases to the best of their Clients should try to interpret these cases to the best of their
@ -921,6 +933,50 @@ unique servers based on the following criteria:
specify the servers it can. For example, a room with only 2 users in specify the servers it can. For example, a room with only 2 users in
it would result in maximum 2 `via` parameters. it would result in maximum 2 `via` parameters.
### Opaque Identifiers
The specification defines some identifiers to use the *Opaque Identifier
Grammar*. This is a common grammar intended for non-user-visible identifiers
which do not require parsing or interpretation (other than as a unique
identifier).
The grammar is defined as:
* Identifiers must be entirely composed of the characters `[0-9]`, `[A-Z]`,
`[a-z]`, `-`, `.`, `_`, and `~`.
* Unless otherwise specified, identifiers must be at least one character and at
most 255 characters in length.
{{% boxes/note %}}
The acceptable character set matches the unreserved character set in [RFC
3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).
{{% /boxes/note %}}
## Cryptographic key representation
Sometimes it is necessary to present a private cryptographic key in the user
interface.
When this happens, the key SHOULD be presented as a string formatted as
follows:
1. A byte array is created, consisting of two bytes `0x8B` and `0x01`,
followed by the raw key.
2. All the bytes in the array above, including the two header bytes,
are XORed together to form a parity byte. This parity byte is
appended to the byte array.
3. The byte array is encoded using base58, using the the alphabet
`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`.
4. A space is added after every 4th character.
When reading in a key, clients should disregard whitespace, and
perform the reverse of steps 1 through 4.
{{% boxes/note %}}
The base58 alphabet is the same as that used for [Bitcoin
addresses](https://en.bitcoin.it/wiki/Base58Check_encoding#Base58_symbol_chart).
{{% /boxes/note %}}
## 3PID Types ## 3PID Types
Third-party Identifiers (3PIDs) represent identifiers on other Third-party Identifiers (3PIDs) represent identifiers on other

@ -436,6 +436,12 @@ an application service-defined namespace will receive the same
`M_EXCLUSIVE` error code, but only if the application service has `M_EXCLUSIVE` error code, but only if the application service has
defined the namespace as `exclusive`. defined the namespace as `exclusive`.
If `/register` or `/login` is called with the `m.login.application_service`
login type, but without a valid `as_token`, the endpoints will return an error
with the `M_MISSING_TOKEN` or `M_UNKNOWN_TOKEN` error code and 401 as the HTTP
status code. This is the same behavior as invalid auth in the client-server API
(see [Using access tokens](/client-server-api/#using-access-tokens)).
#### Pinging #### Pinging
{{% added-in v="1.7" %}} {{% added-in v="1.7" %}}

@ -0,0 +1,102 @@
---
date: 2024-03-22T09:59:45-06:00
---
<!--
This is a header file for the generated changelog.
Variables:
v1.10 = Replaced by the version number (eg: v1.2)
March 22, 2024 = Replaced by the date (eg: April 01, 2021)
-->
## v1.10
<table class="release-info">
<tr><th>Git commit</th><td><a href="https://github.com/matrix-org/matrix-spec/tree/v1.10">https://github.com/matrix-org/matrix-spec/tree/v1.10</a></td>
<tr><th>Release date</th><td>March 22, 2024</td>
</table>
<!-- Intentionally blank line to ensure headers work in the concatenated changelog -->
### Client-Server API
**Backwards Compatible Changes**
- Allow `/versions` to optionally accept authentication, as per [MSC4026](https://github.com/matrix-org/matrix-spec-proposals/pull/4026). ([#1728](https://github.com/matrix-org/matrix-spec/issues/1728))
- Add local erasure requests, as per [MSC4025](https://github.com/matrix-org/matrix-spec-proposals/pull/4025). ([#1730](https://github.com/matrix-org/matrix-spec/issues/1730))
- Use the `body` field as optional media caption, as per [MSC2530](https://github.com/matrix-org/matrix-spec-proposals/pull/2530). ([#1731](https://github.com/matrix-org/matrix-spec/issues/1731))
- Add server support discovery endpoint, as per [MSC1929](https://github.com/matrix-org/matrix-spec-proposals/pull/1929). ([#1733](https://github.com/matrix-org/matrix-spec/issues/1733))
- Add support for multi-stream VoIP, as per [MSC3077](https://github.com/matrix-org/matrix-spec-proposals/pull/3077). ([#1735](https://github.com/matrix-org/matrix-spec/issues/1735))
- Specify that the `Retry-After` header may be used to rate-limit a client, as per [MSC4041](https://github.com/matrix-org/matrix-spec-proposals/pull/4041). ([#1737](https://github.com/matrix-org/matrix-spec/issues/1737))
- Add support for recursion on the `GET /relations` endpoints, as per [MSC3981](https://github.com/matrix-org/matrix-spec-proposals/pull/3981). ([#1746](https://github.com/matrix-org/matrix-spec/issues/1746))
**Spec Clarifications**
- The [strike](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike) element is deprecated in the HTML spec. Clients should prefer [s](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s) instead. ([#1629](https://github.com/matrix-org/matrix-spec/issues/1629))
- Clarify that read receipts should be batched by thread as well as by room. ([#1685](https://github.com/matrix-org/matrix-spec/issues/1685))
- Clarify that threads can be created based on replies. ([#1687](https://github.com/matrix-org/matrix-spec/issues/1687))
- Clarify in the reply fallbacks example that the prefix sequence should be repeated for each line. ([#1690](https://github.com/matrix-org/matrix-spec/issues/1690))
- Clarify the format of account data objects for secret storage. ([#1695](https://github.com/matrix-org/matrix-spec/issues/1695), [#1734](https://github.com/matrix-org/matrix-spec/issues/1734))
- Clarify that the key backup MAC is implemented incorrectly and does not pass the ciphertext through HMAC-SHA-256. ([#1712](https://github.com/matrix-org/matrix-spec/issues/1712))
- Clarify one-time key and fallback key types in examples. ([#1715](https://github.com/matrix-org/matrix-spec/issues/1715))
- Clarify that the HKDF calculation for SAS uses base64-encoded keys rather than the raw key bytes. ([#1719](https://github.com/matrix-org/matrix-spec/issues/1719))
- Clarify how to perform the ECDH exchange in step 12 of the SAS process. ([#1720](https://github.com/matrix-org/matrix-spec/issues/1720))
- Document the deprecation policy of HTML tags, as per [MSC4077](https://github.com/matrix-org/matrix-spec-proposals/pull/4077). ([#1732](https://github.com/matrix-org/matrix-spec/issues/1732))
- The [font](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font) element is deprecated in the HTML spec. Clients should prefer [span](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span) with the `data-mx-bg-color` and `data-mx-color` attributes instead. ([#1739](https://github.com/matrix-org/matrix-spec/issues/1739))
- Disambiguate uses of `PublicRoomsChunk` in the `GET /hierarchy` endpoint. ([#1740](https://github.com/matrix-org/matrix-spec/issues/1740))
- Clarify that `sdpMid` and `sdpMLineIndex` are not required in `m.call.candidates`. ([#1742](https://github.com/matrix-org/matrix-spec/issues/1742))
- Fix various typos throughout the specification. ([#1748](https://github.com/matrix-org/matrix-spec/issues/1748))
- Clearly indicate that each `Content-Type` may have distinct behaviour on non-JSON requests/responses. ([#1756](https://github.com/matrix-org/matrix-spec/issues/1756))
- Clarify that the `m.push_rules` account data type cannot be set using the `/account_data` API, as per [MSC4010](https://github.com/matrix-org/matrix-spec-proposals/pull/4010). ([#1763](https://github.com/matrix-org/matrix-spec/issues/1763))
### Server-Server API
**Spec Clarifications**
- Clarify Server-Server API request signing example by using the `POST` HTTP method, as `GET` requests don't have request bodies. ([#1721](https://github.com/matrix-org/matrix-spec/issues/1721))
- Disambiguate uses of `PublicRoomsChunk` in the `GET /hierarchy` endpoint. ([#1740](https://github.com/matrix-org/matrix-spec/issues/1740))
- Clarify that the `children_state`, `room_type` and `allowed_room_ids` properties in the items of the `children` array of the response of the `GET /hierarchy` endpoint are not required. ([#1741](https://github.com/matrix-org/matrix-spec/issues/1741))
### Application Service API
**Spec Clarifications**
- Clarify that the `/login` and `/register` endpoints should fail when using the `m.login.application_service` login type without a valid `as_token`. ([#1744](https://github.com/matrix-org/matrix-spec/issues/1744))
### Identity Service API
No significant changes.
### Push Gateway API
No significant changes.
### Room Versions
**Spec Clarifications**
- For room versions 7 through 11: Clarify that `invite->knock` is not a legal transition. ([#1717](https://github.com/matrix-org/matrix-spec/issues/1717))
### Appendices
No significant changes.
### Internal Changes/Tooling
**Spec Clarifications**
- Update the spec release process. ([#1680](https://github.com/matrix-org/matrix-spec/issues/1680))
- Minor clarifications to the contributing guide. ([#1697](https://github.com/matrix-org/matrix-spec/issues/1697))
- Update Docsy to v0.8.0. ([#1699](https://github.com/matrix-org/matrix-spec/issues/1699), [#1762](https://github.com/matrix-org/matrix-spec/issues/1762))
- Fix npm release script for `@matrix-org/spec`. ([#1713](https://github.com/matrix-org/matrix-spec/issues/1713))
- Add some clarifications around implementation requirements for MSCs. ([#1718](https://github.com/matrix-org/matrix-spec/issues/1718))
- Update HTML templates to include links to object schema definitions. ([#1724](https://github.com/matrix-org/matrix-spec/issues/1724))
- Factor out all the common parameters of the various `/relations` apis. ([#1745](https://github.com/matrix-org/matrix-spec/issues/1745))
- Add support for `$ref` URIs containing fragments in OpenAPI definitions and JSON schemas. ([#1751](https://github.com/matrix-org/matrix-spec/issues/1751), [#1754](https://github.com/matrix-org/matrix-spec/issues/1754))

@ -0,0 +1,93 @@
---
date: 2023-11-29T10:04:26-07:00
---
<!--
This is a header file for the generated changelog.
Variables:
v1.9 = Replaced by the version number (eg: v1.2)
November 29, 2023 = Replaced by the date (eg: April 01, 2021)
-->
## v1.9
<table class="release-info">
<tr><th>Git commit</th><td><a href="https://github.com/matrix-org/matrix-spec/tree/v1.9">https://github.com/matrix-org/matrix-spec/tree/v1.9</a></td>
<tr><th>Release date</th><td>November 29, 2023</td>
</table>
<!-- Intentionally blank line to ensure headers work in the concatenated changelog -->
### Client-Server API
**Backwards Compatible Changes**
- Add the `m.rule.suppress_edits` default push rule, as per [MSC3958](https://github.com/matrix-org/matrix-spec-proposals/pull/3958). ([#1617](https://github.com/matrix-org/matrix-spec/issues/1617))
**Spec Clarifications**
- Fix `m.call.negotiate` schema and example. ([#1546](https://github.com/matrix-org/matrix-spec/issues/1546))
- Clarify that the `via` property is required for `m.space.parent` and `m.space.child` as per [MSC1772](https://github.com/matrix-org/matrix-spec-proposals/pull/1772). Contributed by @PaarthShah. ([#1618](https://github.com/matrix-org/matrix-spec/issues/1618))
- Add a note to the `/publicRooms` API that the server name is case sensitive. ([#1638](https://github.com/matrix-org/matrix-spec/issues/1638))
- Clarify that an `m.room.name` event with an absent `name` field is not expected behavior. ([#1639](https://github.com/matrix-org/matrix-spec/issues/1639))
- Fix schemas used for account data and presence events in `GET /initialSync`. ([#1647](https://github.com/matrix-org/matrix-spec/issues/1647))
- Fix various typos throughout the specification. ([#1658](https://github.com/matrix-org/matrix-spec/issues/1658), [#1661](https://github.com/matrix-org/matrix-spec/issues/1661), [#1665](https://github.com/matrix-org/matrix-spec/issues/1665))
- Fix `.m.rule.suppress_notices` push rule not being valid JSON. ([#1671](https://github.com/matrix-org/matrix-spec/issues/1671))
- Add missing properties for `event_property_is` and `event_property_contains` push conditions to `PushConditions` object. ([#1673](https://github.com/matrix-org/matrix-spec/issues/1673))
- Indicate that fallback keys should have a `fallback` property set to `true`. ([#1676](https://github.com/matrix-org/matrix-spec/issues/1676))
- Clarify that thread roots are not considered within the thread. ([#1677](https://github.com/matrix-org/matrix-spec/issues/1677))
### Server-Server API
**Spec Clarifications**
- Fix schema of `m.receipt` EDU. ([#1636](https://github.com/matrix-org/matrix-spec/issues/1636))
- Fix various typos throughout the specification. ([#1661](https://github.com/matrix-org/matrix-spec/issues/1661))
- Clarify that federation requests for non-local users are invalid. ([#1672](https://github.com/matrix-org/matrix-spec/issues/1672))
### Application Service API
No significant changes.
### Identity Service API
No significant changes.
### Push Gateway API
No significant changes.
### Room Versions
No significant changes.
### Appendices
**Spec Clarifications**
- Clarify timestamp specification with respect to leap seconds. ([#1627](https://github.com/matrix-org/matrix-spec/issues/1627))
- Fix various typos throughout the specification. ([#1652](https://github.com/matrix-org/matrix-spec/issues/1652))
### Internal Changes/Tooling
**Backwards Compatible Changes**
- Add more CI checks for OpenAPI definitions and JSON Schemas. ([#1656](https://github.com/matrix-org/matrix-spec/issues/1656))
- Generate server-server OpenAPI definition. ([#1657](https://github.com/matrix-org/matrix-spec/issues/1657))
**Spec Clarifications**
- Replace all mentions of Swagger by OpenAPI. ([#1633](https://github.com/matrix-org/matrix-spec/issues/1633))
- Fix enum types in JSON schemas. ([#1634](https://github.com/matrix-org/matrix-spec/issues/1634))
- Fix schema of `m.mentions` object. ([#1635](https://github.com/matrix-org/matrix-spec/issues/1635))
- Fix rendering of `m.receipt` event in Client-Server API. ([#1637](https://github.com/matrix-org/matrix-spec/issues/1637))
- Remove required `fieldname` in appservice Protocol definition. ([#1646](https://github.com/matrix-org/matrix-spec/issues/1646))
- Fix github action workflow responsible for releasing of @matrix-org/spec package. ([#1648](https://github.com/matrix-org/matrix-spec/issues/1648))
- Upgrade GitHub actions. ([#1660](https://github.com/matrix-org/matrix-spec/issues/1660))

@ -106,7 +106,7 @@ No resource was found for this request.
`M_LIMIT_EXCEEDED` `M_LIMIT_EXCEEDED`
Too many requests have been sent in a short period of time. Wait a while Too many requests have been sent in a short period of time. Wait a while
then try again. then try again. See [Rate limiting](#rate-limiting).
`M_UNRECOGNIZED` `M_UNRECOGNIZED`
The server did not understand the request. This is expected to be returned with The server did not understand the request. This is expected to be returned with
@ -212,6 +212,28 @@ only read state (e.g.: `/sync`, get account data, etc).
The user is unable to reject an invite to join the server notices room. The user is unable to reject an invite to join the server notices room.
See the [Server Notices](#server-notices) module for more information. See the [Server Notices](#server-notices) module for more information.
#### Rate limiting
Homeservers SHOULD implement rate limiting to reduce the risk of being
overloaded. If a request is refused due to rate limiting, it should
return a standard error response of the form:
```json
{
"errcode": "M_LIMIT_EXCEEDED",
"error": "string",
"retry_after_ms": integer (optional, deprecated)
}
```
Homeservers SHOULD include a [`Retry-After`](https://www.rfc-editor.org/rfc/rfc9110#field.retry-after)
for any response with a 429 status code.
The `retry_after_ms` property MAY be included to tell the client how long
they have to wait in milliseconds before they can try again. This property is
deprecated, in favour of the `Retry-After` header.
{{< changed-in v="1.10" >}}: `retry_after_ms` property deprecated in favour of `Retry-After` header.
### Transaction identifiers ### Transaction identifiers
The client-server API typically uses `HTTP PUT` to submit requests with The client-server API typically uses `HTTP PUT` to submit requests with
@ -363,11 +385,12 @@ specify parameter values. The flow for this method is as follows:
{{% http-api spec="client-server" api="versions" %}} {{% http-api spec="client-server" api="versions" %}}
{{% http-api spec="client-server" api="support" %}}
## Client Authentication ## Client Authentication
Most API endpoints require the user to identify themselves by presenting Most API endpoints require the user to identify themselves by presenting
previously obtained credentials in the form of an `access_token` query previously obtained credentials in the form of an access token.
parameter or through an Authorization Header of `Bearer $access_token`.
An access token is typically obtained via the [Login](#login) or An access token is typically obtained via the [Login](#login) or
[Registration](#account-registration-and-management) processes. Access tokens [Registration](#account-registration-and-management) processes. Access tokens
can expire; a new access token can be generated by using a refresh token. can expire; a new access token can be generated by using a refresh token.
@ -381,16 +404,19 @@ investigate [macaroons](http://research.google.com/pubs/pub41892.html).
### Using access tokens ### Using access tokens
Access tokens may be provided in two ways, both of which the homeserver Access tokens may be provided via a request header, using the Authentication
MUST support: Bearer scheme: `Authorization: Bearer TheTokenHere`.
1. Via a query string parameter, `access_token=TheTokenHere`. Clients may alternatively provide the access token via a query string parameter:
2. Via a request header, `Authorization: Bearer TheTokenHere`. `access_token=TheTokenHere`. This method is deprecated to prevent the access
token being leaked in access/HTTP logs and SHOULD NOT be used by clients.
Clients are encouraged to use the `Authorization` header where possible Homeservers MUST support both methods.
to prevent the access token being leaked in access/HTTP logs. The query
string should only be used in cases where the `Authorization` header is {{% boxes/note %}}
inaccessible for the client. {{% changed-in v="1.11" %}}
Sending the access token as a query string parameter is now deprecated.
{{% /boxes/note %}}
When credentials are required but missing or invalid, the HTTP call will When credentials are required but missing or invalid, the HTTP call will
return with a status of 401 and the error code, `M_MISSING_TOKEN` or return with a status of 401 and the error code, `M_MISSING_TOKEN` or
@ -520,8 +546,10 @@ request parameter.
A client should first make a request with no `auth` parameter. A client should first make a request with no `auth` parameter.
The homeserver returns an HTTP 401 response, with a JSON body, as follows: The homeserver returns an HTTP 401 response, with a JSON body, as follows:
HTTP/1.1 401 Unauthorized ```
Content-Type: application/json HTTP/1.1 401 Unauthorized
Content-Type: application/json
```
```json ```json
{ {
@ -564,8 +592,10 @@ given. It also contains other keys dependent on the auth type being
attempted. For example, if the client is attempting to complete auth attempted. For example, if the client is attempting to complete auth
type `example.type.foo`, it might submit something like this: type `example.type.foo`, it might submit something like this:
POST /_matrix/client/v3/endpoint HTTP/1.1 ```
Content-Type: application/json POST /_matrix/client/v3/endpoint HTTP/1.1
Content-Type: application/json
```
```json ```json
{ {
@ -585,8 +615,10 @@ along with the same object as when no authentication was attempted, with
the addition of the `completed` key which is an array of auth types the the addition of the `completed` key which is an array of auth types the
client has completed successfully: client has completed successfully:
HTTP/1.1 401 Unauthorized ```
Content-Type: application/json HTTP/1.1 401 Unauthorized
Content-Type: application/json
```
```json ```json
{ {
@ -617,8 +649,10 @@ but the client may make a second attempt, it returns the same HTTP
status 401 response as above, with the addition of the standard status 401 response as above, with the addition of the standard
`errcode` and `error` fields describing the error. For example: `errcode` and `error` fields describing the error. For example:
HTTP/1.1 401 Unauthorized ```
Content-Type: application/json HTTP/1.1 401 Unauthorized
Content-Type: application/json
```
```json ```json
{ {
@ -645,8 +679,10 @@ status 401 response as above, with the addition of the standard
If the request fails for a reason other than authentication, the server If the request fails for a reason other than authentication, the server
returns an error message in the standard format. For example: returns an error message in the standard format. For example:
HTTP/1.1 400 Bad request ```
Content-Type: application/json HTTP/1.1 400 Bad request
Content-Type: application/json
```
```json ```json
{ {
@ -919,11 +955,12 @@ or completely closed registration (where the homeserver administrators create
and distribute accounts). and distribute accounts).
The token required for this authentication type is shared out of band from The token required for this authentication type is shared out of band from
Matrix and is an opaque string with maximum length of 64 characters in the Matrix and is an opaque string using the [Opaque Identifier
range `[A-Za-z0-9._~-]`. The server can keep any number of tokens for any Grammar](/appendices#opaque-identifiers), with maximum length of 64
length of time/validity. Such cases might be a token limited to 100 uses or characters. The server can keep any number of tokens for any length of
for the next 2 hours - after the tokens expire, they can no longer be used time/validity. Such cases might be a token limited to 100 uses or for the next
to create accounts. 2 hours - after the tokens expire, they can no longer be used to create
accounts.
To use this authentication type, clients should submit an auth dict with just To use this authentication type, clients should submit an auth dict with just
the type, token, and session: the type, token, and session:
@ -943,6 +980,129 @@ in the registration process that their token has expired.
{{% http-api spec="client-server" api="registration_tokens" %}} {{% http-api spec="client-server" api="registration_tokens" %}}
##### Terms of service at registration
{{% added-in v="1.11" %}}
| Type | Description |
|--------------------------|--------------------------------------------------------------------------|
| `m.login.terms` | Authentication requires the user to accept a set of policy documents. |
{{% boxes/note %}}
The `m.login.terms` authentication type is only valid on the
[`/register`](#post_matrixclientv3register) endpoint.
{{% /boxes/note %}}
This authentication type is used when the homeserver requires new users to
accept a given set of policy documents, such as a terms of service and a privacy
policy. There may be many different types of documents, all of which are
versioned and presented in (potentially) multiple languages.
When the server requires the user to accept some terms, it does so by returning
a 401 response to the `/register` request, where the response body includes
`m.login.terms` in the `flows` list, and the `m.login.terms` property in the
`params` object has the structure [shown below](#definition-mloginterms-params).
If a client encounters an invalid parameter, registration should stop with an
error presented to the user.
The client should present the user with a checkbox to accept each policy,
including a link to the provided URL. Once the user has done so, the client
submits an `auth` dict with just the `type` and `session`, as follows, to
indicate that all of the policies have been accepted:
```json
{
"type": "m.login.terms",
"session": "<session ID>"
}
```
The server is expected to track which document versions it presented to the
user during registration, if applicable.
**Example**
1. A client might submit a registration request as follows:
```
POST /_matrix/client/v3/register
```
```json
{
"username": "cheeky_monkey",
"password": "ilovebananas"
}
```
2. The server requires the user to accept some terms of service before
registration, so returns the following response:
```
HTTP/1.1 401 Unauthorized
Content-Type: application/json
```
```json
{
"flows": [
{ "stages": [ "m.login.terms" ] }
],
"params": {
"m.login.terms": {
"policies": {
"terms_of_service": {
"version": "1.2",
"en": {
"name": "Terms of Service",
"url": "https://example.org/somewhere/terms-1.2-en.html"
},
"fr": {
"name": "Conditions d'utilisation",
"url": "https://example.org/somewhere/terms-1.2-fr.html"
}
}
}
}
},
"session": "kasgjaelkgj"
}
```
3. The client presents the list of documents to the user, inviting them to
accept the polices.
4. The client repeats the registration request, confirming that the user has
accepted the documents:
```
POST /_matrix/client/v3/register
```
```json
{
"username": "cheeky_monkey",
"password": "ilovebananas",
"auth": {
"type": "m.login.terms",
"session": "kasgjaelkgj"
}
}
```
5. All authentication steps have now completed, so the request is successful:
```
HTTP/1.1 200 OK
Content-Type: application/json
```
```json
{
"access_token": "abc123",
"device_id": "GHTYAJCE",
"user_id": "@cheeky_monkey:matrix.org"
}
```
{{% definition path="api/client-server/definitions/m.login.terms_params" %}}
#### Fallback #### Fallback
Clients cannot be expected to be able to know how to process every Clients cannot be expected to be able to know how to process every
@ -1177,7 +1337,7 @@ is complete, the client will need to submit a `/login` request matching
`m.login.token`. `m.login.token`.
{{< added-in v="1.7" >}} Already-authenticated clients can additionally generate {{< added-in v="1.7" >}} Already-authenticated clients can additionally generate
a token for their user ID if supported by the homeserver using a token for their user ID if supported by the homeserver using
[`POST /login/get_token`](/client-server-api/#post_matrixclientv1loginget_token). [`POST /login/get_token`](/client-server-api/#post_matrixclientv1loginget_token).
{{% http-api spec="client-server" api="login" %}} {{% http-api spec="client-server" api="login" %}}
@ -2156,6 +2316,19 @@ following endpoint.
This endpoint is particularly useful if the client has lost context on the aggregation for This endpoint is particularly useful if the client has lost context on the aggregation for
a parent event and needs to rebuild/verify it. a parent event and needs to rebuild/verify it.
When using the `recurse` parameter, note that there no way for a client to
control how far the server recurses. If the client decides that the server's
recursion level is insufficient, it could, for example, perform the recursion
itself, or disable whatever feature requires more recursion.
Filters specified via `event_type` or `rel_type` will be applied to all events
returned, whether direct or indirect relations. Events that would match the filter,
but whose only relation to the original given event is through a non-matching
intermediate event, will not be included. This means that supplying a `rel_type`
parameter of `m.thread` is not appropriate for fetching all events in a thread since
relations to the threaded events would be filtered out. For this purpose, clients should
omit the `rel_type` parameter and perform any necessary filtering on the client side.
{{% boxes/note %}} {{% boxes/note %}}
Because replies do not use `rel_type`, they will not be accessible via this API. Because replies do not use `rel_type`, they will not be accessible via this API.
{{% /boxes/note %}} {{% /boxes/note %}}
@ -2521,25 +2694,6 @@ users, they should include the display name and avatar URL fields in
these events so that clients already have these details to hand, and do these events so that clients already have these details to hand, and do
not have to perform extra round trips to query it. not have to perform extra round trips to query it.
## Security
### Rate limiting
Homeservers SHOULD implement rate limiting to reduce the risk of being
overloaded. If a request is refused due to rate limiting, it should
return a standard error response of the form:
```json
{
"errcode": "M_LIMIT_EXCEEDED",
"error": "string",
"retry_after_ms": integer (optional)
}
```
The `retry_after_ms` key SHOULD be included to tell the client how long
they have to wait in milliseconds before they can try again.
## Modules ## Modules
Modules are parts of the Client-Server API which are not universal to Modules are parts of the Client-Server API which are not universal to

@ -26,6 +26,15 @@ These events can also be received in a `/events` response or in the
#### Server Behaviour #### Server Behaviour
Servers MUST reject clients from setting account data for event types Servers MUST reject setting account data for event types
that the server manages. Currently, this only includes that the server manages by using a 405 error response.
[m.fully\_read](#mfully_read). Currently, this only includes [`m.fully_read`](#mfully_read)
and [`m.push_rules`](#push-rules-events). This applies to
both global and room-specific account data.
{{% boxes/note %}}
{{% changed-in v="1.10" %}} `m.push_rules` was added to the rejection
list.
{{% /boxes/note %}}
Servers must allow clients to read the above event types as normal.

@ -77,6 +77,7 @@ algorithm is represented by an object with the following properties:
|------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------| |------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| key | string | **Required.** The unpadded Base64-encoded 32-byte Curve25519 public key. | | key | string | **Required.** The unpadded Base64-encoded 32-byte Curve25519 public key. |
| signatures | Signatures | **Required.** Signatures of the key object. The signature is calculated using the process described at [Signing JSON](/appendices/#signing-json). | | signatures | Signatures | **Required.** Signatures of the key object. The signature is calculated using the process described at [Signing JSON](/appendices/#signing-json). |
| fallback | boolean | Indicates whether this is a [fallback key](#one-time-and-fallback-keys). Defaults to `false`. |
Example: Example:
@ -150,7 +151,9 @@ JSON](/appendices/#signing-json).
One-time and fallback keys are also uploaded to the homeserver using the One-time and fallback keys are also uploaded to the homeserver using the
[`/keys/upload`](/client-server-api/#post_matrixclientv3keysupload) API. New [`/keys/upload`](/client-server-api/#post_matrixclientv3keysupload) API. New
one-time and fallback keys are uploaded as needed. one-time and fallback keys are uploaded as needed. Fallback keys for key
algorithms whose format is a signed JSON object should contain a property named
`fallback` with a value of `true`.
Devices must store the private part of each key they upload. They can Devices must store the private part of each key they upload. They can
discard the private part of a one-time key when they receive a message discard the private part of a one-time key when they receive a message
@ -657,10 +660,12 @@ The process between Alice and Bob verifying each other would be:
11. Alice's device receives Bob's message and verifies the commitment 11. Alice's device receives Bob's message and verifies the commitment
hash from earlier matches the hash of the key Bob's device just sent hash from earlier matches the hash of the key Bob's device just sent
and the content of Alice's `m.key.verification.start` message. and the content of Alice's `m.key.verification.start` message.
12. Both Alice and Bob's devices perform an Elliptic-curve 12. Both Alice's and Bob's devices perform an Elliptic-curve Diffie-Hellman using
Diffie-Hellman their private ephemeral key, and the other device's ephemeral public key
(*ECDH(K<sub>A</sub><sup>private</sup>*,*K<sub>B</sub><sup>public</sup>*)), (*ECDH(K<sub>A</sub><sup>private</sup>*,*K<sub>B</sub><sup>public</sup>*)
using the result as the shared secret. for Alice's device and
*ECDH(K<sub>B</sub><sup>private</sup>*,*K<sub>A</sub><sup>public</sup>*)
for Bob's device), using the result as the shared secret.
13. Both Alice and Bob's devices display a SAS to their users, which is 13. Both Alice and Bob's devices display a SAS to their users, which is
derived from the shared key using one of the methods in this derived from the shared key using one of the methods in this
section. If multiple SAS methods are available, clients should allow section. If multiple SAS methods are available, clients should allow
@ -669,7 +674,7 @@ The process between Alice and Bob verifying each other would be:
their devices if they match or not. their devices if they match or not.
15. Assuming they match, Alice and Bob's devices each calculate Message 15. Assuming they match, Alice and Bob's devices each calculate Message
Authentication Codes (MACs) for: Authentication Codes (MACs) for:
* Each of the keys that they wish the other user to verify (usually their * Each of the keys that they wish the other user to verify (usually their
device ed25519 key and their master cross-signing key). device ed25519 key and their master cross-signing key).
* The complete list of key IDs that they wish the other user to verify. * The complete list of key IDs that they wish the other user to verify.
@ -833,15 +838,15 @@ is the concatenation of:
- The Device ID of the device which sent the - The Device ID of the device which sent the
`m.key.verification.start` message, followed by `|`. `m.key.verification.start` message, followed by `|`.
- The public key from the `m.key.verification.key` message sent by - The public key from the `m.key.verification.key` message sent by
the device which sent the `m.key.verification.start` message, the device which sent the `m.key.verification.start` message, encoded as
followed by `|`. unpadded base64, followed by `|`.
- The Matrix ID of the user who sent the `m.key.verification.accept` - The Matrix ID of the user who sent the `m.key.verification.accept`
message, followed by `|`. message, followed by `|`.
- The Device ID of the device which sent the - The Device ID of the device which sent the
`m.key.verification.accept` message, followed by `|`. `m.key.verification.accept` message, followed by `|`.
- The public key from the `m.key.verification.key` message sent by - The public key from the `m.key.verification.key` message sent by
the device which sent the `m.key.verification.accept` message, the device which sent the `m.key.verification.accept` message, encoded as
followed by `|`. unpadded base64, followed by `|`.
- The `transaction_id` being used. - The `transaction_id` being used.
When the `key_agreement_protocol` is the deprecated method `curve25519`, When the `key_agreement_protocol` is the deprecated method `curve25519`,
@ -1192,11 +1197,12 @@ strings in the general form:
- the ID as a UTF-8 string - the ID as a UTF-8 string
- the first key, as 32 bytes. The key to use depends on the mode field: - the first key, as 32 bytes. The key to use depends on the mode field:
- if `0x00` or `0x01`, then the current user's own master cross-signing public key - if `0x00` or `0x01`, then the current user's own master cross-signing public key
- if `0x02`, then the current device's device key - if `0x02`, then the current device's Ed25519 signing key
- the second key, as 32 bytes. The key to use depends on the mode field: - the second key, as 32 bytes. The key to use depends on the mode field:
- if `0x00`, then what the device thinks the other user's master - if `0x00`, then what the device thinks the other user's master
cross-signing key is cross-signing key is
- if `0x01`, then what the device thinks the other device's device key is - if `0x01`, then what the device thinks the other device's Ed25519 signing
key is
- if `0x02`, then what the device thinks the user's master cross-signing key - if `0x02`, then what the device thinks the user's master cross-signing key
is is
- a random shared secret, as a byte string. It is suggested to use a secret - a random shared secret, as a byte string. It is suggested to use a secret
@ -1266,10 +1272,10 @@ tries to read a message that it does not have keys for, it may request
the key from the server and decrypt it. Backups are per-user, and users the key from the server and decrypt it. Backups are per-user, and users
may replace backups with new backups. may replace backups with new backups.
In contrast with [Key requests](#key-requests), Server-side key backups In contrast with [key requests](#key-requests), server-side key backups do not
do not require another device to be online from which to request keys. require another device to be online from which to request keys. However, as
However, as the session keys are stored on the server encrypted, it the session keys are stored on the server encrypted, the client requires a
requires users to enter a decryption key to decrypt the session keys. [decryption key](#decryption-key) to decrypt the session keys.
To create a backup, a client will call [POST To create a backup, a client will call [POST
/\_matrix/client/v3/room\_keys/version](#post_matrixclientv3room_keysversion) and define how the keys are to /\_matrix/client/v3/room\_keys/version](#post_matrixclientv3room_keysversion) and define how the keys are to
@ -1290,7 +1296,7 @@ Clients must only store keys in backups after they have ensured that the
- checking that it is signed by the user's [master cross-signing - checking that it is signed by the user's [master cross-signing
key](#cross-signing) or by a verified device belonging to the same user, or key](#cross-signing) or by a verified device belonging to the same user, or
- by deriving the public key from a private key that it obtained from a trusted - deriving the public key from a private key that it obtained from a trusted
source. Trusted sources for the private key include the user entering the source. Trusted sources for the private key include the user entering the
key, retrieving the key stored in [secret storage](#secret-storage), or key, retrieving the key stored in [secret storage](#secret-storage), or
obtaining the key via [secret sharing](#sharing) from a verified device obtaining the key via [secret sharing](#sharing) from a verified device
@ -1307,31 +1313,24 @@ replace it with the new key based on the key metadata as follows:
- and finally, if `is_verified` and `first_message_index` are equal, - and finally, if `is_verified` and `first_message_index` are equal,
then it will keep the key with a lower `forwarded_count`. then it will keep the key with a lower `forwarded_count`.
###### Recovery key ###### Decryption key
If the recovery key (the private half of the backup encryption key) is Normally, the decryption key (i.e. the secret part of the encryption key) is
presented to the user to save, it is presented as a string constructed stored on the server or shared with other devices using the [Secrets](#secrets)
as follows: module. When doing so, it is identified using the name `m.megolm_backup.v1`,
and the key is base64-encoded before being encrypted.
1. The 256-bit curve25519 private key is prepended by the bytes `0x8B` If the backup decryption key is given directly to the user, the key should be
and `0x01` presented as a string using the common [cryptographic key
2. All the bytes in the string above, including the two header bytes, representation](/appendices/#cryptographic-key-representation).
are XORed together to form a parity byte. This parity byte is
appended to the byte string.
3. The byte string is encoded using base58, using the same [mapping as
is used for Bitcoin
addresses](https://en.bitcoin.it/wiki/Base58Check_encoding#Base58_symbol_chart),
that is, using the alphabet
`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`.
4. A space should be added after every 4th character.
When reading in a recovery key, clients must disregard whitespace, and {{% boxes/note %}}
perform the reverse of steps 1 through 3. The backup decryption key was previously referred to as a "recovery
key". However, this conflicted with common practice in client user
The recovery key can also be stored on the server or shared with other devices interfaces, which often use the term "recovery key" to refer to the [secret
using the [Secrets](#secrets) module. When doing so, it is identified using the storage](#storage) key. The term "recovery key" is no longer used in this
name `m.megolm_backup.v1`, and the key is base64-encoded before being specification.
encrypted. {{% /boxes/note %}}
###### Backup algorithm: `m.megolm_backup.v1.curve25519-aes-sha2` ###### Backup algorithm: `m.megolm_backup.v1.curve25519-aes-sha2`
@ -1361,10 +1360,18 @@ The `session_data` field in the backups is constructed as follows:
PKCS\#7 padding. This encrypted data, encoded using unpadded base64, PKCS\#7 padding. This encrypted data, encoded using unpadded base64,
becomes the `ciphertext` property of the `session_data`. becomes the `ciphertext` property of the `session_data`.
5. Pass the raw encrypted data (prior to base64 encoding) through 5. Pass an empty string through HMAC-SHA-256 using the MAC key generated above.
HMAC-SHA-256 using the MAC key generated above. The first 8 bytes of The first 8 bytes of the resulting MAC are base64-encoded, and become the
the resulting MAC are base64-encoded, and become the `mac` property `mac` property of the `session_data`.
of the `session_data`.
{{% boxes/warning %}}
Step 5 was intended to pass the raw encrypted data, but due to a bug in libolm,
all implementations have since passed an empty string instead.
Future versions of the spec will fix this problem. See
[MSC4048](https://github.com/matrix-org/matrix-spec-proposals/pull/4048) for a
potential new key backup algorithm version that would fix this issue.
{{% /boxes/warning %}}
{{% definition path="api/client-server/definitions/key_backup_session_data" %}} {{% definition path="api/client-server/definitions/key_backup_session_data" %}}
@ -1765,9 +1772,9 @@ Example response:
], ],
}, },
"device_one_time_keys_count": { "device_one_time_keys_count": {
"curve25519": 10,
"signed_curve25519": 20 "signed_curve25519": 20
} },
"device_unused_fallback_key_types": ["signed_curve25519"]
} }
``` ```

@ -14,7 +14,7 @@ event with the corresponding emoji (👍). Another potential usage is to allow
bots to send an event indicating the success or failure of a command. bots to send an event indicating the success or failure of a command.
Along with the normal properties `event_id` and `rel_type`, an `m.relates_to` Along with the normal properties `event_id` and `rel_type`, an `m.relates_to`
property with `rel_type: m.annotion` should contain a `key` that indicates the property with `rel_type: m.annotation` should contain a `key` that indicates the
annotation being applied. For example, when reacting with emojis, the key annotation being applied. For example, when reacting with emojis, the key
contains the emoji being used. contains the emoji being used.

@ -27,18 +27,41 @@ instead.
Some message types support HTML in the event content that clients should Some message types support HTML in the event content that clients should
prefer to display if available. Currently `m.text`, `m.emote`, `m.notice`, prefer to display if available. Currently `m.text`, `m.emote`, `m.notice`,
and `m.key.verification.request` support an additional `format` parameter of `m.image`, `m.file`, `m.audio`, `m.video` and `m.key.verification.request`
`org.matrix.custom.html`. When this field is present, a `formatted_body` support an additional `format` parameter of `org.matrix.custom.html`. When this
with the HTML must be provided. The plain text version of the HTML field is present, a `formatted_body` with the HTML must be provided. The plain
should be provided in the `body`. text version of the HTML should be provided in the `body`.
{{% boxes/note %}}
{{% changed-in v="1.10" %}}
In previous versions of the specification, the `format` and `formatted` fields
were limited to `m.text`, `m.emote`, `m.notice`, and
`m.key.verification.request`. This list is expanded to include `m.image`,
`m.file`, `m.audio` and `m.video` for [media captions](#media-captions).
{{% /boxes/note %}}
Clients should limit the HTML they render to avoid Cross-Site Scripting, Clients should limit the HTML they render to avoid Cross-Site Scripting,
HTML injection, and similar attacks. The strongly suggested set of HTML HTML injection, and similar attacks. The strongly suggested set of HTML
tags to permit, denying the use and rendering of anything else, is: tags to permit, denying the use and rendering of anything else, is:
`font`, `del`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `blockquote`, `p`, `del`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `blockquote`, `p`, `a`, `ul`,
`a`, `ul`, `ol`, `sup`, `sub`, `li`, `b`, `i`, `u`, `strong`, `em`, `ol`, `sup`, `sub`, `li`, `b`, `i`, `u`, `strong`, `em`, `s`, `code`,
`strike`, `code`, `hr`, `br`, `div`, `table`, `thead`, `tbody`, `tr`, `hr`, `br`, `div`, `table`, `thead`, `tbody`, `tr`, `th`, `td`,
`th`, `td`, `caption`, `pre`, `span`, `img`, `details`, `summary`. `caption`, `pre`, `span`, `img`, `details`, `summary`.
{{% boxes/note %}}
{{% added-in v="1.10" %}}
HTML features MAY be deprecated and replaced by their modern equivalent without
requiring a [Spec Change Proposal](/proposals) when they are deprecated in the
[WHATWG HTML Living Standard](https://html.spec.whatwg.org/multipage/).
{{% /boxes/note %}}
{{% boxes/note %}}
{{% changed-in v="1.10" %}}
In previous versions of the specification, the `font` tag was suggested with the
`data-mx-bg-color`, `data-mx-color` and `color` attributes. This tag is now
deprecated in favor of the `span` tag with the `data-mx-bg-color` and
`data-mx-color` attributes in new messages.
{{% /boxes/note %}}
Not all attributes on those tags should be permitted as they may be Not all attributes on those tags should be permitted as they may be
avenues for other disruption attempts, such as adding `onclick` handlers avenues for other disruption attempts, such as adding `onclick` handlers
@ -50,12 +73,12 @@ the tag.
| Tag | Permitted Attributes | | Tag | Permitted Attributes |
|--------|--------------------------------------------------------------------------------------------------------------------------------------------| |--------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `font` | `data-mx-bg-color`, `data-mx-color`, `color` | | `span` | `data-mx-bg-color`, `data-mx-color`, `data-mx-spoiler` (see [spoiler messages](#spoiler-messages)), `data-mx-maths` (see [mathematical messages](#mathematical-messages)) |
| `span` | `data-mx-bg-color`, `data-mx-color`, `data-mx-spoiler` (see [spoiler messages](#spoiler-messages)) |
| `a` | `name`, `target`, `href` (provided the value is not relative and has a scheme matching one of: `https`, `http`, `ftp`, `mailto`, `magnet`) | | `a` | `name`, `target`, `href` (provided the value is not relative and has a scheme matching one of: `https`, `http`, `ftp`, `mailto`, `magnet`) |
| `img` | `width`, `height`, `alt`, `title`, `src` (provided it is a [Matrix Content (`mxc://`) URI](#matrix-content-mxc-uris)) | | `img` | `width`, `height`, `alt`, `title`, `src` (provided it is a [Matrix Content (`mxc://`) URI](#matrix-content-mxc-uris)) |
| `ol` | `start` | | `ol` | `start` |
| `code` | `class` (only classes which start with `language-` for syntax highlighting) | | `code` | `class` (only classes which start with `language-` for syntax highlighting) |
| `div` | `data-mx-maths` (see [mathematical messages](#mathematical-messages)) |
Additionally, web clients should ensure that *all* `a` tags get a Additionally, web clients should ensure that *all* `a` tags get a
`rel="noopener"` to prevent the target page from referencing the `rel="noopener"` to prevent the target page from referencing the
@ -320,6 +343,107 @@ to the media repository, then reference the `mxc://` URI in a markdown-style lin
Clients SHOULD render spoilers differently with some sort of disclosure. For example, the Clients SHOULD render spoilers differently with some sort of disclosure. For example, the
client could blur the actual text and ask the user to click on it for it to be revealed. client could blur the actual text and ask the user to click on it for it to be revealed.
##### Media captions
{{% added-in v="1.10" %}}
Media messages, comprised of `m.image`, `m.file`, `m.audio` and `m.video`, can
include a caption to convey additional information about the media.
To send captions, clients MUST use the `filename` and the `body`, and optionally
the `formatted_body` with the `org.matrix.custom.html` format, described above.
If the `filename` is present, and its value is different than `body`, then
`body` is considered to be a caption, otherwise `body` is a filename. `format`
and `formatted_body` are only used for captions.
{{% boxes/note %}}
In previous versions of the specification, `body` was usually used to set the
filename of the uploaded file, and `filename` was only present on `m.file` with
the same purpose.
{{% /boxes/note %}}
An example of a media message with a caption is:
```json
{
"msgtype": "m.image",
"url": "mxc://example.org/abc123",
"filename": "dog.jpg",
"body": "this is a ~~cat~~ picture :3",
"format": "org.matrix.custom.html",
"formatted_body": "this is a <s>cat</s> picture :3",
"info": {
"w": 479,
"h": 640,
"mimetype": "image/jpeg",
"size": 27253
},
"m.mentions": {}
}
```
Clients MUST render the caption alongside the media and SHOULD prefer its
formatted representation.
##### Mathematical messages
{{% added-in v="1.11" %}}
Users might want to send mathematical notations in their messages.
To send mathematical notations clients MUST use the `formatted_body` and
therefore the `org.matrix.custom.html` format, described above. This makes
mathematical notations valid on any `msgtype` which can support this format
appropriately.
Mathematical notations themselves use the `span` or `div` tags, depending
whether the notation should be presented inline or not. The mathematical
notation is written in [LaTeX](https://www.latex-project.org/) format using the
`data-mx-maths` attribute.
The contents of the tag should be a fallback representation for clients that
cannot render the LaTeX format. The fallback representation could be, for
example, an image, or an HTML approximation, or the raw LaTeX source. When using
an image as a fallback, the sending client should be aware of issues that may
arise from the receiving client using a different background colour. The `body`
should include a textual representation of the notation.
An example of a mathematical notation is:
```json
{
"msgtype": "m.text",
"format": "org.matrix.custom.html",
"body": "This is an equation: sin(x)=a/b.",
"formatted_body": "This is an equation:
<span data-mx-maths=\"\\sin(x)=\\frac{a}{b}\">
sin(<i>x</i>)=<sup><i>a</i></sup>/<sub><i>b</i></sub>
</span>"
}
```
The LaTeX format is poorly defined and has several extensions, so if a client
encounters syntax that it cannot render, it SHOULD present the fallback
representation instead. Clients SHOULD, however, aim to support, at minimum, the
basic [LaTeX2e](https://www.latex-project.org/) maths commands and the
[TeX](https://tug.org/) maths commands, with the possible exception of commands
that could be security risks.
{{% boxes/warning %}}
In general, LaTeX places a heavy burden on client authors to ensure that it is
processed safely. Certain commands, such as [those that can create macros](https://katex.org/docs/supported#macros),
are potentially dangerous. Clients should either decline to process those
commands, or should take care to ensure that they are handled in safe ways (such
as by limiting recursion). In general, LaTeX commands should be filtered by
allowing known-good commands rather than forbidding known-bad commands.
Therefore, clients should not render mathematics by calling a LaTeX compiler
without proper sandboxing, as those executables were not written to handle
untrusted input. Some LaTeX rendering libraries are better suited for that by
allowing only a subset of LaTeX and enforcing recursion limits.
{{% /boxes/warning %}}
#### Server behaviour #### Server behaviour
Homeservers SHOULD reject `m.room.message` events which don't have a Homeservers SHOULD reject `m.room.message` events which don't have a

@ -13,6 +13,20 @@ the event to reference the entity being mentioned.
{{% definition path="api/client-server/definitions/m.mentions" %}} {{% definition path="api/client-server/definitions/m.mentions" %}}
An event's content will then look like this:
```json
{
"body": "Hello Alice!",
"msgtype": "m.text",
"format": "org.matrix.custom.html",
"formatted_body": "Hello <a href='https://matrix.to/#/@alice:example.org'>Alice</a>!",
"m.mentions": {
"user_ids": ["@alice:example.org"]
}
}
```
Additionally, see the [`.m.rule.is_user_mention`](#_m_rule_is_user_mention) and Additionally, see the [`.m.rule.is_user_mention`](#_m_rule_is_user_mention) and
[`.m.rule.is_room_mention`](#_m_rule_is_room_mention) push rules. [`.m.rule.is_room_mention`](#_m_rule_is_room_mention) push rules.
Users should not add their own Matrix ID to the `m.mentions` property as outgoing Users should not add their own Matrix ID to the `m.mentions` property as outgoing

@ -13,7 +13,7 @@ deciding what content is undesirable for any particular entity and
should instead be empowering those entities to make their own decisions. should instead be empowering those entities to make their own decisions.
As such, a generic framework for communicating "moderation policy lists" As such, a generic framework for communicating "moderation policy lists"
or "moderation policy rooms" is described. Note that this module only or "moderation policy rooms" is described. Note that this module only
describes the data structures and not how they should be interpreting: describes the data structures and not how they should be interpreted:
the entity making the decisions on filtering is best positioned to the entity making the decisions on filtering is best positioned to
interpret the rules how it sees fit. interpret the rules how it sees fit.

@ -454,7 +454,7 @@ Definition:
{ {
"kind": "event_match", "kind": "event_match",
"key": "content.msgtype", "key": "content.msgtype",
"pattern": "m.notice", "pattern": "m.notice"
} }
], ],
"actions": [] "actions": []
@ -750,6 +750,30 @@ Definition:
} }
``` ```
**`.m.rule.suppress_edits`**
{{% added-in v="1.9" %}}
Suppresses notifications related to [event replacements](#event-replacements).
Definition:
```json
{
"rule_id": ".m.rule.suppress_edits",
"default": true,
"enabled": true,
"conditions": [
{
"kind": "event_property_is",
"key": "content.m\\.relates_to.rel_type",
"value": "m.replace"
}
],
"actions": []
}
```
##### Default Content Rules ##### Default Content Rules
<a id="_m_rule_contains_user_name"/> **`.m.rule.contains_user_name`** <a id="_m_rule_contains_user_name"/> **`.m.rule.contains_user_name`**
@ -1046,16 +1070,16 @@ ahead), however if the `m.read.private` receipt were to be updated to
event D then the user has read up to D (the `m.read` receipt is now event D then the user has read up to D (the `m.read` receipt is now
behind the `m.read.private` receipt). behind the `m.read.private` receipt).
{{< added-in v="1.4" >}} When handling threaded read receipts, the server {{< added-in v="1.4" >}} When handling threaded read receipts, the server is to
is to partition the notification count to each thread (with the main timeline partition the notification count to each thread (with the main timeline being
being its own thread). To determine if an event is part of a thread the its own thread). To determine if an event is part of a thread the server follows
server follows the [event relationship](#forming-relationships-between-events) the [event relationship](#forming-relationships-between-events) until it finds a
until it finds a thread root (as specified by the [threading module](#threading)), thread root via an `m.thread` relation (as specified by the [threading
however it is not recommended that the server traverse infinitely. Instead, module](#threading)), however it is not recommended that the server traverse
implementations are encouraged to do a maximum of 3 hops to find a thread infinitely. Instead, implementations are encouraged to do a maximum of 3 hops to
before deciding that the event does not belong to a thread. This is primarily find a thread before deciding that the event does not belong to a thread. This
to ensure that future events, like `m.reaction`, are correctly considered is primarily to ensure that future events, like `m.reaction`, are correctly
"part of" a given thread. considered "part of" a given thread.
#### Server behaviour #### Server behaviour

@ -137,16 +137,20 @@ either a thread root's event ID or `main` for the main timeline.
Threading introduces a concept of multiple conversations being held in the same Threading introduces a concept of multiple conversations being held in the same
room and thus deserve their own read receipts and notification counts. An event is room and thus deserve their own read receipts and notification counts. An event is
considered to be "in a thread" if it meets any of the following criteria: considered to be "in a thread" if:
* It has a `rel_type` of `m.thread`.
* It has child events with a `rel_type` of `m.thread` (in which case it'd be the
thread root).
* Following the event relationships, it has a parent event which qualifies for
one of the above. Implementations should not recurse infinitely, though: a
maximum of 3 hops is recommended to cover indirect relationships.
Events not in a thread but still in the room are considered to be part of the * It has a `rel_type` of `m.thread`, or
"main timeline", or a special thread with an ID of `main`. * Following the event relationships, it has a parent event which references
the thread root with a `rel_type` of `m.thread`. Implementations should
not recurse infinitely, though: a maximum of 3 hops is recommended to
cover indirect relationships.
Events not in a thread but still in the room are considered to be in the "main
timeline". When referring to the main timeline as a thread (e.g. in receipts
and notifications counts) a special thread ID of `main` is used.
Thread roots are considered to be in the main timeline, as are events that are
related to a thread root via non-thread relations.
The following is an example DAG for a room, with dotted lines showing event The following is an example DAG for a room, with dotted lines showing event
relationships and solid lines showing topological ordering. relationships and solid lines showing topological ordering.
@ -204,7 +208,7 @@ event when the user expands that thread.
#### Server behaviour #### Server behaviour
For efficiency, receipts SHOULD be batched into one event per room For efficiency, receipts SHOULD be batched into one event per room and thread
before delivering them to clients. before delivering them to clients.
Some receipts are sent across federation as EDUs with type `m.receipt`. The Some receipts are sent across federation as EDUs with type `m.receipt`. The

@ -60,7 +60,8 @@ specific fallback text is different for each `msgtype`, however the
general format for the `body` is: general format for the `body` is:
```text ```text
> <@alice:example.org> This is the original body > <@alice:example.org> This is the first line of the original body
> This is the second line
This is where the reply goes This is where the reply goes
``` ```

@ -66,6 +66,70 @@ default key.
|------------|-----------|------------------------------------------| |------------|-----------|------------------------------------------|
| key | string | **Required.** The ID of the default key. | | key | string | **Required.** The ID of the default key. |
###### `m.secret_storage.v1.aes-hmac-sha2`
For the purposes of allowing clients to check whether a user has correctly
entered the key, keys for use with the `m.secret_storage.v1.aes-hmac-sha2`
algorithm are stored with some additional data.
When storing a key, clients SHOULD:
1. Given the secret storage key, generate 64 bytes by performing an
HKDF with SHA-256 as the hash, a salt of 32 bytes of 0, and the empty
string as the info. The first 32 bytes are used as the AES key,
and the next 32 bytes are used as the MAC key.
2. Generate 16 random bytes, set bit 63 to 0 (in order to work around
differences in AES-CTR implementations), and use this as the AES
initialization vector (IV).
3. Encrypt a message consisting of 32 bytes of 0, using AES-CTR-256 using the
AES key and IV generated above.
4. Pass the raw encrypted data through HMAC-SHA-256 using the MAC key
generated above.
5. Encode the IV from step 2, and the MAC from step 4, using [unpadded
base64](/appendices/#unpadded-base64), and store the results in the `iv`
and `mac` properties respectively in the `m.secret_storage.key.[key ID]`
account-data. (The ciphertext from step 3 is discarded after passing
through the MAC calculation.)
This process can be repeated by a client checking if the key is correct: the
MAC should match if the key is correct. Note, however, that these properties
are **optional**. If they are not present, clients must assume that the key is
valid.
Note also, that although clients SHOULD use unpadded base64 as specified above,
some existing implementations use standard [RFC4648-compliant
base64](https://datatracker.ietf.org/doc/html/rfc4648#section-4) with padding,
so clients must accept either encoding.
The structure of a `m.secret_storage.key.[key ID]` account data object for use
with this algorithm is therefore as follows:
`AesHmacSha2KeyDescription`
| Parameter | Type | Description |
|-------------|--------|------------------------------------------------------------------------------------------------------|
| name | string | Optional. The name of the key. |
| algorithm | string | **Required.** The encryption algorithm to be used for this key: `m.secret_storage.v1.aes-hmac-sha2`. |
| passphrase | object | See [deriving keys from passphrases](#deriving-keys-from-passphrases) section for a description of this property. |
| iv | string | Optional. The 16-byte initialization vector for the validation check, encoded as base64. |
| mac | string | Optional. The MAC of the result of encrypting 32 bytes of 0, encoded as base64. |
For example, it could look like:
```json
{
"name": "m.default",
"algorithm": "m.secret_storage.v1.aes-hmac-sha2",
"iv": "random+data",
"mac": "mac+of+encrypted+zeros"
}
```
##### Secret storage ##### Secret storage
Encrypted data is stored in the user's account data using the event Encrypted data is stored in the user's account data using the event
@ -82,7 +146,7 @@ of the data.
| Parameter | Type | Description | | Parameter | Type | Description |
|-----------|------------------|-------------| |-----------|------------------|-------------|
| encrypted | {string: object} | **Required.** Map from key ID the encrypted data. The exact format for the encrypted data is dependent on the key algorithm. See the definition of `AesHmacSha2EncryptedData` in the [m.secret_storage.v1.aes-hmac-sha2](#msecret_storagev1aes-hmac-sha2) section. | | encrypted | {string: object} | **Required.** Map from key ID the encrypted data. The exact format for the encrypted data is dependent on the key algorithm. See the definition of `AesHmacSha2EncryptedData` in the [m.secret_storage.v1.aes-hmac-sha2](#msecret_storagev1aes-hmac-sha2-1) section. |
Example: Example:
@ -147,58 +211,41 @@ HMAC-SHA-256. The secret is encrypted as follows:
1. Given the secret storage key, generate 64 bytes by performing an 1. Given the secret storage key, generate 64 bytes by performing an
HKDF with SHA-256 as the hash, a salt of 32 bytes of 0, and with the HKDF with SHA-256 as the hash, a salt of 32 bytes of 0, and with the
secret name as the info. The first 32 bytes are used as the AES key, secret name as the info. The first 32 bytes are used as the AES key,
and the next 32 bytes are used as the MAC key and the next 32 bytes are used as the MAC key.
2. Generate 16 random bytes, set bit 63 to 0 (in order to work around 2. Generate 16 random bytes, set bit 63 to 0 (in order to work around
differences in AES-CTR implementations), and use this as the AES differences in AES-CTR implementations), and use this as the AES
initialization vector. This becomes the `iv` property, encoded using initialization vector (IV).
base64.
3. Encrypt the data using AES-CTR-256 using the AES key generated
above. This encrypted data, encoded using base64, becomes the
`ciphertext` property.
4. Pass the raw encrypted data (prior to base64 encoding) through
HMAC-SHA-256 using the MAC key generated above. The resulting MAC is
base64-encoded and becomes the `mac` property.
`AesHmacSha2EncryptedData` 3. Encrypt the data using AES-CTR-256 using the AES key and IV generated
above.
| Parameter | Type | Description 4. Pass the raw encrypted data through HMAC-SHA-256 using the MAC key
|------------|---------|------------------------------------------------------------------------| generated above.
| iv | string | **Required.** The 16-byte initialization vector, encoded as base64. |
| ciphertext | string | **Required.** The AES-CTR-encrypted data, encoded as base64. |
| mac | string | **Required.** The MAC, encoded as base64. |
For the purposes of allowing clients to check whether a user has 5. Encode the IV from step 2, the ciphertext from step 3, and MAC from step 4,
correctly entered the key, clients should: using [unpadded base64](/appendices/#unpadded-base64), and store them as
the `iv`, `ciphertext`, and `mac` properties respectively in the account
data object.
1. encrypt and MAC a message consisting of 32 bytes of 0 as described **Note**: some existing implementations encode these properties using
above, using the empty string as the info parameter to the HKDF in standard [RFC4648-compliant
step 1. base64](https://datatracker.ietf.org/doc/html/rfc4648#section-4) with
2. store the `iv` and `mac` in the `m.secret_storage.key.[key ID]` padding, so clients must accept either encoding.
account-data.
`AesHmacSha2KeyDescription` The structure of the `encrypted` property of an account data object encrypted
with this algorithm is therefore as follows:
| Parameter | Type | Description | `AesHmacSha2EncryptedData`
|-------------|--------|-----------------------------------------------------------------------------------------------------------------------------------|
| name | string | Optional. The name of the key. |
| algorithm | string | **Required.** The encryption algorithm to be used for this key. Currently, only `m.secret_storage.v1.aes-hmac-sha2` is supported. |
| passphrase | object | See [deriving keys from passphrases](#deriving-keys-from-passphrases) section for a description of this property. |
| iv | string | The 16-byte initialization vector, encoded as base64. |
| mac | string | The MAC of the result of encrypting 32 bytes of 0, encoded as base64. |
For example, the `m.secret_storage.key.key_id` for a key using this | Parameter | Type | Description
algorithm could look like: |------------|---------|------------------------------------------------------------------------|
| iv | string | **Required.** The 16-byte initialization vector, encoded as base64. |
| ciphertext | string | **Required.** The AES-CTR-encrypted data, encoded as base64. |
| mac | string | **Required.** The MAC, encoded as base64. |
```json
{
"name": "m.default",
"algorithm": "m.secret_storage.v1.aes-hmac-sha2",
"iv": "random+data",
"mac": "mac+of+encrypted+zeros"
}
```
and data encrypted using this algorithm could look like this: For example, data encrypted using this algorithm could look like this:
```json ```json
{ {
@ -212,27 +259,13 @@ and data encrypted using this algorithm could look like this:
} }
``` ```
###### Key representation ##### Key representation
When a user is given a raw key for `m.secret_storage.v1.aes-hmac-sha2`, When a user is given a raw key for `m.secret_storage.v1.aes-hmac-sha2`,
it will be presented as a string constructed as follows: the key should be presented as a string using the common [cryptographic key
representation](/appendices/#cryptographic-key-representation).
1. The key is prepended by the two bytes `0x8b` and `0x01`
2. All the bytes in the string above, including the two header bytes, ##### Deriving keys from passphrases
are XORed together to form a parity byte. This parity byte is
appended to the byte string.
3. The byte string is encoded using base58, using the same [mapping as
is used for Bitcoin
addresses](https://en.bitcoin.it/wiki/Base58Check_encoding#Base58_symbol_chart),
that is, using the alphabet
`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`.
4. The string is formatted into groups of four characters separated by
spaces.
When decoding a raw key, the process should be reversed, with the
exception that whitespace is insignificant in the user's input.
###### Deriving keys from passphrases
A user may wish to use a chosen passphrase rather than a randomly A user may wish to use a chosen passphrase rather than a randomly
generated key. In this case, information on how to generate the key from generated key. In this case, information on how to generate the key from

@ -10,7 +10,7 @@ This module allows a Matrix homeserver to delegate user authentication
to an external authentication server supporting one of these protocols. to an external authentication server supporting one of these protocols.
In this process, there are three systems involved: In this process, there are three systems involved:
- A Matrix client, using the APIs defined this specification, which - A Matrix client, using the APIs defined in this specification, which
is seeking to authenticate a user to a Matrix homeserver. is seeking to authenticate a user to a Matrix homeserver.
- A Matrix homeserver, implementing the APIs defined in this - A Matrix homeserver, implementing the APIs defined in this
specification, but which is delegating user authentication to the specification, but which is delegating user authentication to the

@ -12,11 +12,13 @@ as by providing some context to what is going on in the thread but keeping the f
history behind a disclosure. history behind a disclosure.
Threads are established using a `rel_type` of `m.thread` and reference the Threads are established using a `rel_type` of `m.thread` and reference the
*thread root* (the first event in a thread). It is not possible to create a *thread root* (the main timeline event to which the thread events refer). It is not possible to create a thread from an event which itself
thread from an event which itself is the child of an event relationship (i.e., is the child of an event relationship (i.e., one with an `m.relates_to`
one with an `m.relates_to` property). It is therefore also not possible to nest property with a `rel_type` property - see [Relationship types](#relationship-types)).
threads. All events in a thread reference the thread root instead of the It is therefore also not possible to nest threads.
most recent message, unlike rich reply chains.
Unlike rich reply chains, all events in a thread reference the thread root
instead of the most recent message.
As a worked example, the following represents a thread and how it would be formed: As a worked example, the following represents a thread and how it would be formed:

@ -96,13 +96,8 @@ Matrix clients can send DTMF as specified by WebRTC. The WebRTC standard as of A
in the RTP payload. in the RTP payload.
#### Grammar for VoIP IDs #### Grammar for VoIP IDs
`call_id`s and `party_id` are explicitly defined to be between 1 and 255 characters long, consisting
of the characters `[0-9a-zA-Z._~-]`.
(Note that this matches the grammar of 'opaque IDs' from `call_id`s and `party_id` must follow the [Opaque Identifier Grammar](/appendices#opaque-identifiers).
[MSC1597](https://github.com/matrix-org/matrix-spec-proposals/blob/rav/proposals/id_grammar/proposals/1597-id-grammar.md#opaque-ids),
and that of the `id` property of the
[`m.login.sso` flow schema](#definition-mloginsso-flow-schema).)
#### Behaviour on Room Leave #### Behaviour on Room Leave
If the client sees the user it is in a call with leave the room, the client should treat this If the client sees the user it is in a call with leave the room, the client should treat this
@ -171,18 +166,35 @@ In response to an incoming invite, a client may do one of several things:
##### Streams ##### Streams
Clients are expected to send one stream with one track of kind `audio` (creating a Clients may send more than one stream in a VoIP call. The streams should be
voice call). They can optionally send a second track in the same stream of kind differentiated by including metadata in the [`m.call.invite`](/client-server-api/#mcallinvite),
`video` (creating a video call). [`m.call.answer`](/client-server-api/#mcallanswer) and [`m.call.negotiate`](/client-server-api/#mcallnegotiate)
events, using the `sdp_stream_metadata` property. An [`m.call.sdp_stream_metadata_changed`](/client-server-api/#mcallsdp_stream_metadata_changed)
Clients implementing this specification use the first stream and will ignore event can be sent when the metadata changes but no negotiation is required.
any streamless tracks. Note that in the JavaScript WebRTC API, this means
`addTrack()` must be passed two parameters: a track and a stream, not just a Clients are recommended to not mute the audio of WebRTC tracks locally when an
track, and in a video call the stream must be the same for both audio and video incoming stream has the `audio_muted` field set to `true`. This is because when
track. the other user unmutes themselves, there may be a slight delay between their
client sending audio and the [`m.call.sdp_stream_metadata_changed`](/client-server-api/#mcallsdp_stream_metadata_changed)
A client may send other streams and tracks but the behaviour of the other party event arriving and any audio sent in between will not be heard. The other user
with respect to presenting such streams and tracks is undefined. will still stop transmitting audio once they mute on their side, so no audio is
sent without the user's knowledge.
The same suggestion does not apply to `video_muted`. Clients _should_ mute video
locally, so that the receiving side doesn't see a black video.
If `sdp_stream_metadata` is present and an incoming stream is not listed in it,
the stream should be ignored. If a stream has a `purpose` of an unknown type, it
should also be ignored.
For backwards compatibility, if `sdp_stream_metadata` is not present in the
initial [`m.call.invite`](/client-server-api/#mcallinvite) or [`m.call.answer`](/client-server-api/#mcallanswer)
event sent by the other party, the client should assume that this property is
not supported by the other party. It means that multiple streams cannot be
differentiated: the client should only use the first incoming stream and
shouldn't send more than one stream.
Clients implementing this specification should ignore any streamless tracks.
##### Invitees ##### Invitees
The `invitee` field should be added whenever the call is intended for one The `invitee` field should be added whenever the call is intended for one

@ -162,15 +162,20 @@ of access tokens to authenticate users. The access tokens provided by an
Identity Server cannot be used to authenticate Client-Server API Identity Server cannot be used to authenticate Client-Server API
requests. requests.
An access token is provided to an endpoint in one of two ways: Access tokens may be provided via a request header, using the
Authentication Bearer scheme: `Authorization: Bearer TheTokenHere`.
1. Via a query string parameter, `access_token=TheTokenHere`. Clients may alternatively provide the access token via a query string
2. Via a request header, `Authorization: Bearer TheTokenHere`. parameter: `access_token=TheTokenHere`. This method is deprecated to
prevent the access token being leaked in access/HTTP logs and SHOULD NOT
be used by clients.
Clients are encouraged to the use the `Authorization` header where Identity Servers MUST support both methods.
possible to prevent the access token being leaked in access/HTTP logs.
The query string should only be used in cases where the `Authorization` {{% boxes/note %}}
header is inaccessible for the client. {{% changed-in v="1.11" %}}
Sending the access token as a query string parameter is now deprecated.
{{% /boxes/note %}}
When credentials are required but missing or invalid, the HTTP call will When credentials are required but missing or invalid, the HTTP call will
return with a status of 401 and the error code `M_UNAUTHORIZED`. return with a status of 401 and the error code `M_UNAUTHORIZED`.

@ -380,9 +380,18 @@ As part of the proposal process the Spec Core Team will require evidence
of the MSC working in order for it to move into FCP. This can usually be of the MSC working in order for it to move into FCP. This can usually be
a branch/pull request to whichever implementation of choice that proves a branch/pull request to whichever implementation of choice that proves
the MSC works in practice, though in some cases the MSC itself will be the MSC works in practice, though in some cases the MSC itself will be
small enough to be considered proven. Where it's unclear if an MSC will small enough to be considered proven. Implementations do not need to be
require an implementation proof, ask in merged or released, but must be of sufficient quality to show that the
[\#matrix-spec:matrix.org](https://matrix.to/#/#matrix-spec:matrix.org). MSC works. Where it's unclear if an MSC will require an implementation
proof, ask in [\#matrix-spec:matrix.org](https://matrix.to/#/#matrix-spec:matrix.org).
Proposals may require both server-side and client-side implementations.
Proposals that have not yet been implemented will have the
`needs-implementation` label. After an implementation has been made, add a
comment in the GitHub issue indicating so. After an implementation has been
made, we will check it to verify that it implements the MSC. Proposals that
have implementations that have not yet been checked will have the
`implementation-needs-checking` label.
### Early release of an MSC/idea ### Early release of an MSC/idea

@ -1,12 +1,6 @@
Events must be signed by the server denoted by the `sender` property. Events must be signed by the server denoted by the `sender` property.
`m.room.redaction` events are not explicitly part of the auth rules.
They are still subject to the minimum power level rules, but should always
fall into "10. Otherwise, allow". Instead of being authorized at the time
of receipt, they are authorized at a later stage: see the
[Redactions](#redactions) section below for more information.
The types of state events that affect authorization are: The types of state events that affect authorization are:
- [`m.room.create`](/client-server-api#mroomcreate) - [`m.room.create`](/client-server-api#mroomcreate)
@ -21,6 +15,18 @@ For example, mentions of the `sender`'s power level can also refer to
the default power level for users in the room. the default power level for users in the room.
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
`m.room.redaction` events are subject to auth rules in the same way as any other event.
In practice, that means they will normally be allowed by the auth rules, unless the
`m.room.power_levels` event sets a power level requirement for `m.room.redaction`
events via the `events` or `events_default` properties. In particular, the _redact
level_ is **not** considered by the auth rules.
The ability to send a redaction event does not mean that the redaction itself should
be performed. Receiving servers must perform additional checks, as described in
the [Handling Redactions](#handling-redactions) section.
{{% /boxes/note %}}
The rules are as follows: The rules are as follows:
1. If type is `m.room.create`: 1. If type is `m.room.create`:
@ -117,7 +123,8 @@ The rules are as follows:
7. If `membership` is `knock`: 7. If `membership` is `knock`:
1. If the `join_rule` is anything other than `knock`, reject. 1. If the `join_rule` is anything other than `knock`, reject.
2. If `sender` does not match `state_key`, reject. 2. If `sender` does not match `state_key`, reject.
3. If the `sender`'s current membership is not `ban` or `join`, allow. 3. If the `sender`'s current membership is not `ban`, `invite`,
or `join`, allow.
4. Otherwise, reject. 4. Otherwise, reject.
8. Otherwise, the membership is unknown. Reject. 8. Otherwise, the membership is unknown. Reject.
5. If the `sender`'s current membership state is not `join`, reject. 5. If the `sender`'s current membership state is not `join`, reject.

@ -76,12 +76,6 @@ correctly structured are rejected under the authorization rules below.
Events must be signed by the server denoted by the `sender` property. Events must be signed by the server denoted by the `sender` property.
`m.room.redaction` events are not explicitly part of the auth rules.
They are still subject to the minimum power level rules, but should always
fall into "10. Otherwise, allow". Instead of being authorized at the time
of receipt, they are authorized at a later stage: see the
[Redactions](#redactions) section below for more information.
The types of state events that affect authorization are: The types of state events that affect authorization are:
- [`m.room.create`](/client-server-api#mroomcreate) - [`m.room.create`](/client-server-api#mroomcreate)
@ -96,6 +90,18 @@ For example, mentions of the `sender`'s power level can also refer to
the default power level for users in the room. the default power level for users in the room.
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
`m.room.redaction` events are subject to auth rules in the same way as any other event.
In practice, that means they will normally be allowed by the auth rules, unless the
`m.room.power_levels` event sets a power level requirement for `m.room.redaction`
events via the `events` or `events_default` properties. In particular, the _redact
level_ is **not** considered by the auth rules.
The ability to send a redaction event does not mean that the redaction itself should
be performed. Receiving servers must perform additional checks, as described in
the [Handling redactions](#handling-redactions) section.
{{% /boxes/note %}}
The rules are as follows: The rules are as follows:
1. If type is `m.room.create`: 1. If type is `m.room.create`:
@ -194,7 +200,8 @@ The rules are as follows:
If the `join_rule` is anything other than `knock` or If the `join_rule` is anything other than `knock` or
`knock_restricted`, reject. `knock_restricted`, reject.
2. If `sender` does not match `state_key`, reject. 2. If `sender` does not match `state_key`, reject.
3. If the `sender`'s current membership is not `ban` or `join`, allow. 3. If the `sender`'s current membership is not `ban`, `invite`,
or `join`, allow.
4. Otherwise, reject. 4. Otherwise, reject.
8. Otherwise, the membership is unknown. Reject. 8. Otherwise, the membership is unknown. Reject.
5. If the `sender`'s current membership state is not `join`, reject. 5. If the `sender`'s current membership state is not `join`, reject.
@ -214,7 +221,7 @@ The rules are as follows:
If either of the properties `events` or `notifications` in `content` If either of the properties `events` or `notifications` in `content`
are present and not an object with values that are integers, are present and not an object with values that are integers,
reject. reject.
3. If the `users` property in `content` is not an obiect with keys that 3. If the `users` property in `content` is not an object with keys that
are valid user IDs with values that are integers, reject. are valid user IDs with values that are integers, reject.
4. If there is no previous `m.room.power_levels` event in the room, 4. If there is no previous `m.room.power_levels` event in the room,
allow. allow.

@ -72,7 +72,7 @@ The `redacts` property of `m.room.redaction` events is moved from a top-level
event property to a property under the event `content`. event property to a property under the event `content`.
For backwards-compatibility with older clients, servers should add a `redacts` property For backwards-compatibility with older clients, servers should add a `redacts` property
to the top level of `m.room.redaction` events in when serving such events over the to the top level of `m.room.redaction` events when serving such events over the
Client-Server API. Client-Server API.
For improved compatibility with newer clients, servers should add a `redacts` property For improved compatibility with newer clients, servers should add a `redacts` property
@ -83,12 +83,6 @@ such events over the Client-Server API.
Events must be signed by the server denoted by the `sender` property. Events must be signed by the server denoted by the `sender` property.
`m.room.redaction` events are not explicitly part of the auth rules.
They are still subject to the minimum power level rules, but should always
fall into "10. Otherwise, allow". Instead of being authorized at the time
of receipt, they are authorized at a later stage: see the
[Redactions](#redactions) section below for more information.
The types of state events that affect authorization are: The types of state events that affect authorization are:
- [`m.room.create`](/client-server-api#mroomcreate) - [`m.room.create`](/client-server-api#mroomcreate)
@ -103,6 +97,18 @@ For example, mentions of the `sender`'s power level can also refer to
the default power level for users in the room. the default power level for users in the room.
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
`m.room.redaction` events are subject to auth rules in the same way as any other event.
In practice, that means they will normally be allowed by the auth rules, unless the
`m.room.power_levels` event sets a power level requirement for `m.room.redaction`
events via the `events` or `events_default` properties. In particular, the _redact
level_ is **not** considered by the auth rules.
The ability to send a redaction event does not mean that the redaction itself should
be performed. Receiving servers must perform additional checks, as described in
the [Handling redactions](#handling-redactions) section.
{{% /boxes/note %}}
The rules are as follows: The rules are as follows:
1. {{< changed-in this="true" >}} 1. {{< changed-in this="true" >}}
@ -200,7 +206,8 @@ The rules are as follows:
1. If the `join_rule` is anything other than `knock` or 1. If the `join_rule` is anything other than `knock` or
`knock_restricted`, reject. `knock_restricted`, reject.
2. If `sender` does not match `state_key`, reject. 2. If `sender` does not match `state_key`, reject.
3. If the `sender`'s current membership is not `ban` or `join`, allow. 3. If the `sender`'s current membership is not `ban`, `invite`,
or `join`, allow.
4. Otherwise, reject. 4. Otherwise, reject.
8. Otherwise, the membership is unknown. Reject. 8. Otherwise, the membership is unknown. Reject.
5. If the `sender`'s current membership state is not `join`, reject. 5. If the `sender`'s current membership state is not `join`, reject.
@ -218,7 +225,7 @@ The rules are as follows:
2. If either of the properties `events` or `notifications` in `content` 2. If either of the properties `events` or `notifications` in `content`
are present and not an object with values that are integers, are present and not an object with values that are integers,
reject. reject.
3. If the `users` property in `content` is not an obiect with keys that 3. If the `users` property in `content` is not an object with keys that
are valid user IDs with values that are integers, reject. are valid user IDs with values that are integers, reject.
4. If there is no previous `m.room.power_levels` event in the room, 4. If there is no previous `m.room.power_levels` event in the room,
allow. allow.

@ -89,12 +89,17 @@ The complete structure of a event in a v3 room is shown below.
### Authorization rules ### Authorization rules
{{< added-in this=true >}} `m.room.redaction` events are no longer {{% boxes/note %}}
explicitly part of the auth rules. They are still subject to the {{< added-in this=true >}} `m.room.redaction` events are subject to auth rules in
minimum power level rules, but should always fall into "11. Otherwise, the same way as any other event. In practice, that means they will normally be allowed
allow". Instead of being authorized at the time of receipt, they are by the auth rules, unless the `m.room.power_levels` event sets a power level requirement
authorized at a later stage: see the [Handling Redactions](#handling-redactions) for `m.room.redaction`events via the `events` or `events_default` properties. In
section below for more information. particular, the _redact level_ is **not** considered by the auth rules.
The ability to send a redaction event does not mean that the redaction itself should
be performed. Receiving servers must perform additional checks, as described in
the [Handling Redactions](#handling-redactions) section.
{{% /boxes/note %}}
<!-- set withVersioning=true so we get all the "new in this version" stuff --> <!-- set withVersioning=true so we get all the "new in this version" stuff -->
{{< rver-fragment name="v3-auth-rules" withVersioning=true >}} {{< rver-fragment name="v3-auth-rules" withVersioning=true >}}

@ -40,12 +40,6 @@ in [room version 5](/rooms/v5).
### Authorization rules ### Authorization rules
`m.room.redaction` events are not explicitly part of the auth rules.
They are still subject to the minimum power level rules, but should always
fall into "10. Otherwise, allow". Instead of being authorized at the time
of receipt, they are authorized at a later stage: see the
[Handling Redactions](#handling-redactions) section below for more information.
{{< added-in this=true >}} Rule 4, which related specifically to events {{< added-in this=true >}} Rule 4, which related specifically to events
of type `m.room.aliases`, is removed. `m.room.aliases` events must still pass of type `m.room.aliases`, is removed. `m.room.aliases` events must still pass
authorization checks relating to state events. authorization checks relating to state events.
@ -71,6 +65,18 @@ For example, mentions of the `sender`'s power level can also refer to
the default power level for users in the room. the default power level for users in the room.
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
`m.room.redaction` events are subject to auth rules in the same way as any other event.
In practice, that means they will normally be allowed by the auth rules, unless the
`m.room.power_levels` event sets a power level requirement for `m.room.redaction`
events via the `events` or `events_default` properties. In particular, the _redact
level_ is **not** considered by the auth rules.
The ability to send a redaction event does not mean that the redaction itself should
be performed. Receiving servers must perform additional checks, as described in
the [Handling Redactions](#handling-redactions) section.
{{% /boxes/note %}}
The rules are as follows: The rules are as follows:
1. If type is `m.room.create`: 1. If type is `m.room.create`:

@ -37,12 +37,6 @@ new point for `membership=knock` is added.
Events must be signed by the server denoted by the `sender` property. Events must be signed by the server denoted by the `sender` property.
`m.room.redaction` events are not explicitly part of the auth rules.
They are still subject to the minimum power level rules, but should always
fall into "10. Otherwise, allow". Instead of being authorized at the time
of receipt, they are authorized at a later stage: see the
[Redactions](#redactions) section below for more information.
The types of state events that affect authorization are: The types of state events that affect authorization are:
- [`m.room.create`](/client-server-api#mroomcreate) - [`m.room.create`](/client-server-api#mroomcreate)
@ -57,6 +51,18 @@ For example, mentions of the `sender`'s power level can also refer to
the default power level for users in the room. the default power level for users in the room.
{{% /boxes/note %}} {{% /boxes/note %}}
{{% boxes/note %}}
`m.room.redaction` events are subject to auth rules in the same way as any other event.
In practice, that means they will normally be allowed by the auth rules, unless the
`m.room.power_levels` event sets a power level requirement for `m.room.redaction`
events via the `events` or `events_default` properties. In particular, the _redact
level_ is **not** considered by the auth rules.
The ability to send a redaction event does not mean that the redaction itself should
be performed. Receiving servers must perform additional checks, as described in
the [Handling redactions](#handling-redactions) section.
{{% /boxes/note %}}
The rules are as follows: The rules are as follows:
1. If type is `m.room.create`: 1. If type is `m.room.create`:
@ -139,7 +145,8 @@ The rules are as follows:
If `membership` is `knock`: If `membership` is `knock`:
1. If the `join_rule` is anything other than `knock`, reject. 1. If the `join_rule` is anything other than `knock`, reject.
2. If `sender` does not match `state_key`, reject. 2. If `sender` does not match `state_key`, reject.
3. If the `sender`'s current membership is not `ban` or `join`, allow. 3. If the `sender`'s current membership is not `ban`, `invite`,
or `join`, allow.
4. Otherwise, reject. 4. Otherwise, reject.
7. Otherwise, the membership is unknown. Reject. 7. Otherwise, the membership is unknown. Reject.
5. If the `sender`'s current membership state is not `join`, reject. 5. If the `sender`'s current membership state is not `join`, reject.

@ -186,8 +186,8 @@ to send. The process overall is as follows:
header of `<hostname>`. The target server must present a valid certificate header of `<hostname>`. The target server must present a valid certificate
for `<hostname>`. for `<hostname>`.
6. If the `/.well-known` request returned an error response, and the 6. If the `/.well-known` request returned an error response, and
SRV record was not found, an IP address is resolved using CNAME, AAAA and A no SRV records were found, an IP address is resolved using CNAME, AAAA and A
records. Requests are made to the resolved IP address using port records. Requests are made to the resolved IP address using port
8448 and a `Host` header containing the `<hostname>`. The target 8448 and a `Host` header containing the `<hostname>`. The target
server must present a valid certificate for `<hostname>`. server must present a valid certificate for `<hostname>`.
@ -290,7 +290,7 @@ Step 1 sign JSON:
``` ```
{ {
"method": "GET", "method": "POST",
"uri": "/target", "uri": "/target",
"origin": "origin.hs.example.com", "origin": "origin.hs.example.com",
"destination": "destination.hs.example.com", "destination": "destination.hs.example.com",
@ -311,7 +311,7 @@ condition applies throughout the request signing process.
Step 2 add Authorization header: Step 2 add Authorization header:
GET /target HTTP/1.1 POST /target HTTP/1.1
Authorization: X-Matrix origin="origin.hs.example.com",destination="destination.hs.example.com",key="ed25519:key1",sig="ABCDEF..." Authorization: X-Matrix origin="origin.hs.example.com",destination="destination.hs.example.com",key="ed25519:key1",sig="ABCDEF..."
Content-Type: application/json Content-Type: application/json
@ -350,9 +350,10 @@ def authorization_headers(origin_name, origin_signing_key,
The format of the Authorization header is given in The format of the Authorization header is given in
[RFC 7235](https://datatracker.ietf.org/doc/html/rfc7235#section-2.1). In [RFC 7235](https://datatracker.ietf.org/doc/html/rfc7235#section-2.1). In
summary, the header begins with authorization scheme `X-Matrix`, followed by summary, the header begins with authorization scheme `X-Matrix`, followed by one
one or more spaces, followed by a comma-separated list of parameters written as or more spaces, followed by a comma-separated list of parameters written as
name=value pairs. The names are case insensitive and order does not matter. The name=value pairs. Zero or more spaces and tabs around each comma are allowed.
The names are case insensitive and order does not matter. The
values must be enclosed in quotes if they contain characters that are not values must be enclosed in quotes if they contain characters that are not
allowed in `token`s, as defined in allowed in `token`s, as defined in
[RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6); if a [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6); if a
@ -363,8 +364,9 @@ replaced by the character that follows the backslash.
For compatibility with older servers, the sender should For compatibility with older servers, the sender should
- only include one space after `X-Matrix`, - only include one space after `X-Matrix`,
- only use lower-case names, and - only use lower-case names,
- avoid using backslashes in parameter values. - avoid using backslashes in parameter values, and
- avoid including whitespace around the commas between name=value pairs.
For compatibility with older servers, the recipient should allow colons to be For compatibility with older servers, the recipient should allow colons to be
included in values without requiring the value to be enclosed in quotes. included in values without requiring the value to be enclosed in quotes.

@ -41,7 +41,6 @@ properties:
type: string type: string
example: "mxc://example.org/aBcDeFgH" example: "mxc://example.org/aBcDeFgH"
field_types: field_types:
title: Field Types
description: |- description: |-
The type definitions for the fields defined in the `user_fields` and The type definitions for the fields defined in the `user_fields` and
`location_fields`. Each entry in those arrays MUST have an entry here. The `location_fields`. Each entry in those arrays MUST have an entry here. The
@ -64,7 +63,6 @@ properties:
description: An placeholder serving as a valid example of the field value. description: An placeholder serving as a valid example of the field value.
type: string type: string
required: ['regexp', 'placeholder'] required: ['regexp', 'placeholder']
required: ['fieldname']
example: { example: {
"network": { "network": {
"regexp": "([a-z0-9]+\\.)*[a-z0-9]+", "regexp": "([a-z0-9]+\\.)*[a-z0-9]+",

@ -29,7 +29,9 @@ properties:
description: A secret token that the homeserver will use authenticate requests to the application service. description: A secret token that the homeserver will use authenticate requests to the application service.
sender_localpart: sender_localpart:
type: string type: string
description: The localpart of the user associated with the application service. description: |-
The localpart of the user associated with the application service. Events will be sent to the AS if this user is the target of the event, or
is a joined member of the room where the event occurred.
namespaces: namespaces:
type: object type: object
title: Namespaces title: Namespaces
@ -40,9 +42,10 @@ properties:
- $ref: namespace_list.yaml - $ref: namespace_list.yaml
- description: |- - description: |-
A list of namespaces defining the user IDs that the application A list of namespaces defining the user IDs that the application
service is interested in. Events will be sent to the AS if a service is interested in, in addition to its `sender_localpart`.
local user matching one of the namespaces is the target of the event, Events will be sent to the AS if a local user matching one of the
or is a joined member of the room where the event occurred. namespaces is the target of the event, or is a joined member of
the room where the event occurred.
rooms: rooms:
allOf: allOf:
- $ref: namespace_list.yaml - $ref: namespace_list.yaml

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save