From d370a2c6fd0dd91ca43227c91ceeb1c02ad0bccb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 Aug 2018 17:11:40 -0600 Subject: [PATCH 01/22] Prepare the identity service and server-server APIs for r0 * Create the changelog scaffolding * Set up the variables for versioning --- api/identity/associations.yaml | 2 +- api/identity/email_associations.yaml | 2 +- api/identity/invitation_signing.yaml | 2 +- api/identity/lookup.yaml | 2 +- api/identity/phone_associations.yaml | 2 +- api/identity/ping.yaml | 2 +- api/identity/pubkey.yaml | 2 +- api/identity/store_invite.yaml | 4 +-- api/server-server/backfill.yaml | 2 +- api/server-server/event_auth.yaml | 2 +- api/server-server/events.yaml | 2 +- api/server-server/invites.yaml | 2 +- api/server-server/joins.yaml | 2 +- api/server-server/keys_query.yaml | 2 +- api/server-server/keys_server.yaml | 2 +- api/server-server/leaving.yaml | 2 +- api/server-server/openid.yaml | 2 +- api/server-server/public_rooms.yaml | 2 +- api/server-server/query.yaml | 2 +- api/server-server/third_party_invite.yaml | 2 +- api/server-server/transactions.yaml | 2 +- api/server-server/version.yaml | 2 +- changelogs/identity_service.rst | 0 .../identity_service/newsfragments/.gitignore | 1 + changelogs/identity_service/pyproject.toml | 30 +++++++++++++++++ changelogs/server_server.rst | 0 .../server_server/newsfragments/.gitignore | 1 + changelogs/server_server/pyproject.toml | 30 +++++++++++++++++ scripts/gendoc.py | 15 ++++++--- .../templating/matrix_templates/sections.py | 8 +++++ scripts/templating/matrix_templates/units.py | 3 +- specification/identity_service_api.rst | 20 ++++++++++-- specification/server_server_api.rst | 32 +++++++++++++------ 33 files changed, 146 insertions(+), 40 deletions(-) create mode 100644 changelogs/identity_service.rst create mode 100644 changelogs/identity_service/newsfragments/.gitignore create mode 100644 changelogs/identity_service/pyproject.toml create mode 100644 changelogs/server_server.rst create mode 100644 changelogs/server_server/newsfragments/.gitignore create mode 100644 changelogs/server_server/pyproject.toml diff --git a/api/identity/associations.yaml b/api/identity/associations.yaml index 784bb5d63..59185c839 100644 --- a/api/identity/associations.yaml +++ b/api/identity/associations.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/identity/email_associations.yaml b/api/identity/email_associations.yaml index 8431c9e83..9649f6ef8 100644 --- a/api/identity/email_associations.yaml +++ b/api/identity/email_associations.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/identity/invitation_signing.yaml b/api/identity/invitation_signing.yaml index 982dbff78..bc06b89a3 100644 --- a/api/identity/invitation_signing.yaml +++ b/api/identity/invitation_signing.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/identity/lookup.yaml b/api/identity/lookup.yaml index bfd2153ec..1dc79d859 100644 --- a/api/identity/lookup.yaml +++ b/api/identity/lookup.yaml @@ -21,7 +21,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/identity/phone_associations.yaml b/api/identity/phone_associations.yaml index c2cc6cfe7..6d30ee3d9 100644 --- a/api/identity/phone_associations.yaml +++ b/api/identity/phone_associations.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/identity/ping.yaml b/api/identity/ping.yaml index 005160a35..b630c7332 100644 --- a/api/identity/ping.yaml +++ b/api/identity/ping.yaml @@ -23,7 +23,7 @@ basePath: /_matrix/identity produces: - application/json paths: - "/api/v1": + "/api/%IDENTITY_MAJOR_VERSION%": get: summary: Checks that an Identity server is available at this API endpopint. description: |- diff --git a/api/identity/pubkey.yaml b/api/identity/pubkey.yaml index 00796975d..3884b63af 100644 --- a/api/identity/pubkey.yaml +++ b/api/identity/pubkey.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/identity/store_invite.yaml b/api/identity/store_invite.yaml index 6b847b5b0..c4056acbb 100644 --- a/api/identity/store_invite.yaml +++ b/api/identity/store_invite.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/v1 +basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% produces: - application/json paths: @@ -46,7 +46,7 @@ paths: ``address`` parameter, notifying them of the invitation. Also, the generated ephemeral public key will be listed as valid on - requests to ``/_matrix/identity/api/v1/pubkey/ephemeral/isvalid``. + requests to ``/_matrix/identity/api/%IDENTITY_MAJOR_VERSION%/pubkey/ephemeral/isvalid``. operationId: storeInvite parameters: - in: body diff --git a/api/server-server/backfill.yaml b/api/server-server/backfill.yaml index 6b3cfaef0..5c88f554b 100644 --- a/api/server-server/backfill.yaml +++ b/api/server-server/backfill.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/event_auth.yaml b/api/server-server/event_auth.yaml index 8857131fa..0248fb1e7 100644 --- a/api/server-server/event_auth.yaml +++ b/api/server-server/event_auth.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/events.yaml b/api/server-server/events.yaml index cf3988a20..0b3183730 100644 --- a/api/server-server/events.yaml +++ b/api/server-server/events.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% produces: - application/json securityDefinitions: diff --git a/api/server-server/invites.yaml b/api/server-server/invites.yaml index 6d905e178..d55ccb5b5 100644 --- a/api/server-server/invites.yaml +++ b/api/server-server/invites.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/joins.yaml b/api/server-server/joins.yaml index 4902ea9e1..66a071e58 100644 --- a/api/server-server/joins.yaml +++ b/api/server-server/joins.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/keys_query.yaml b/api/server-server/keys_query.yaml index e616915bd..face2bd63 100644 --- a/api/server-server/keys_query.yaml +++ b/api/server-server/keys_query.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/key/v2 +basePath: /_matrix/key/%KEYS_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/keys_server.yaml b/api/server-server/keys_server.yaml index 8734f2edd..d09ba8e27 100644 --- a/api/server-server/keys_server.yaml +++ b/api/server-server/keys_server.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/key/v2 +basePath: /_matrix/key/%KEYS_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/server-server/leaving.yaml b/api/server-server/leaving.yaml index be08acba6..739f4962c 100644 --- a/api/server-server/leaving.yaml +++ b/api/server-server/leaving.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/openid.yaml b/api/server-server/openid.yaml index 0eac48c84..942a5d5e6 100644 --- a/api/server-server/openid.yaml +++ b/api/server-server/openid.yaml @@ -20,7 +20,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% produces: - application/json paths: diff --git a/api/server-server/public_rooms.yaml b/api/server-server/public_rooms.yaml index d162568f8..be9428a47 100644 --- a/api/server-server/public_rooms.yaml +++ b/api/server-server/public_rooms.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% produces: - application/json securityDefinitions: diff --git a/api/server-server/query.yaml b/api/server-server/query.yaml index dc14724c5..af70a9c36 100644 --- a/api/server-server/query.yaml +++ b/api/server-server/query.yaml @@ -20,7 +20,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% produces: - application/json securityDefinitions: diff --git a/api/server-server/third_party_invite.yaml b/api/server-server/third_party_invite.yaml index 5c12247cf..9e3bba2c2 100644 --- a/api/server-server/third_party_invite.yaml +++ b/api/server-server/third_party_invite.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/transactions.yaml b/api/server-server/transactions.yaml index 8d810ad59..bb6254e75 100644 --- a/api/server-server/transactions.yaml +++ b/api/server-server/transactions.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% consumes: - application/json produces: diff --git a/api/server-server/version.yaml b/api/server-server/version.yaml index 199755290..17110f19e 100644 --- a/api/server-server/version.yaml +++ b/api/server-server/version.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/v1 +basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% produces: - application/json paths: diff --git a/changelogs/identity_service.rst b/changelogs/identity_service.rst new file mode 100644 index 000000000..e69de29bb diff --git a/changelogs/identity_service/newsfragments/.gitignore b/changelogs/identity_service/newsfragments/.gitignore new file mode 100644 index 000000000..b722e9e13 --- /dev/null +++ b/changelogs/identity_service/newsfragments/.gitignore @@ -0,0 +1 @@ +!.gitignore \ No newline at end of file diff --git a/changelogs/identity_service/pyproject.toml b/changelogs/identity_service/pyproject.toml new file mode 100644 index 000000000..7a64eb0b9 --- /dev/null +++ b/changelogs/identity_service/pyproject.toml @@ -0,0 +1,30 @@ +[tool.towncrier] + filename = "../identity_service.rst" + directory = "newsfragments" + issue_format = "`#{issue} `_" + title_format = "{version}" + + [[tool.towncrier.type]] + directory = "breaking" + name = "Breaking Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "deprecation" + name = "Deprecations" + showcontent = true + + [[tool.towncrier.type]] + directory = "new" + name = "New Endpoints" + showcontent = true + + [[tool.towncrier.type]] + directory = "feature" + name = "Backwards Compatible Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "clarification" + name = "Spec Clarifications" + showcontent = true diff --git a/changelogs/server_server.rst b/changelogs/server_server.rst new file mode 100644 index 000000000..e69de29bb diff --git a/changelogs/server_server/newsfragments/.gitignore b/changelogs/server_server/newsfragments/.gitignore new file mode 100644 index 000000000..b722e9e13 --- /dev/null +++ b/changelogs/server_server/newsfragments/.gitignore @@ -0,0 +1 @@ +!.gitignore \ No newline at end of file diff --git a/changelogs/server_server/pyproject.toml b/changelogs/server_server/pyproject.toml new file mode 100644 index 000000000..984785273 --- /dev/null +++ b/changelogs/server_server/pyproject.toml @@ -0,0 +1,30 @@ +[tool.towncrier] + filename = "../server_server.rst" + directory = "newsfragments" + issue_format = "`#{issue} `_" + title_format = "{version}" + + [[tool.towncrier.type]] + directory = "breaking" + name = "Breaking Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "deprecation" + name = "Deprecations" + showcontent = true + + [[tool.towncrier.type]] + directory = "new" + name = "New Endpoints" + showcontent = true + + [[tool.towncrier.type]] + directory = "feature" + name = "Backwards Compatible Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "clarification" + name = "Spec Clarifications" + showcontent = true diff --git a/scripts/gendoc.py b/scripts/gendoc.py index 16c40af5d..e2f788ccc 100755 --- a/scripts/gendoc.py +++ b/scripts/gendoc.py @@ -518,6 +518,10 @@ if __name__ == '__main__': "--server_release", "-s", action="store", default="unstable", help="The server-server release tag to generate, e.g. r1.2" ) + parser.add_argument( + "--identity_release", "-i", action="store", default="unstable", + help="The identity service release tag to generate, e.g. r1.2" + ) parser.add_argument( "--list_targets", action="store_true", help="Do not update the specification. Instead print a list of targets.", @@ -536,12 +540,15 @@ if __name__ == '__main__': substitutions = { "%CLIENT_RELEASE_LABEL%": args.client_release, - # we hardcode a major version of r0. This ends up in the - # example API URLs. When we have released a new major version, - # we'll have to bump it. + # we hardcode the major versions. This ends up in the example + # API URLs. When we have released a new major version, we'll + # have to bump them. "%CLIENT_MAJOR_VERSION%": "r0", + "%SERVER_MAJOR_VERSION%": "v1", + "%IDENTITY_MAJOR_VERSION%": "v1", + "%KEYS_MAJOR_VERSION%": "v2", "%SERVER_RELEASE_LABEL%": args.server_release, - "%SERVER_MAJOR_VERSION%": extract_major(args.server_release), + "%IDENTITY_RELEASE_LABEL%": args.identity_release, } exit (main(args.target or ["all"], args.dest, args.nodelete, substitutions)) diff --git a/scripts/templating/matrix_templates/sections.py b/scripts/templating/matrix_templates/sections.py index 1a93c7237..7c982f809 100644 --- a/scripts/templating/matrix_templates/sections.py +++ b/scripts/templating/matrix_templates/sections.py @@ -32,6 +32,14 @@ class MatrixSections(Sections): changelogs = self.units.get("changelogs") return changelogs["client_server"] + def render_identity_service_changelog(self): + changelogs = self.units.get("changelogs") + return changelogs["identity_service"] + + def render_server_server_changelog(self): + changelogs = self.units.get("changelogs") + return changelogs["server_server"] + def _render_events(self, filterFn, sortFn): template = self.env.get_template("events.tmpl") examples = self.units.get("event_examples") diff --git a/scripts/templating/matrix_templates/units.py b/scripts/templating/matrix_templates/units.py index 90a87cd47..ed8943e0c 100644 --- a/scripts/templating/matrix_templates/units.py +++ b/scripts/templating/matrix_templates/units.py @@ -754,6 +754,7 @@ class MatrixUnits(Units): def load_apis(self, substitutions): cs_ver = substitutions.get("%CLIENT_RELEASE_LABEL%", "unstable") fed_ver = substitutions.get("%SERVER_RELEASE_LABEL%", "unstable") + is_ver = substitutions.get("%IDENTITY_RELEASE_LABEL%", "unstable") # we abuse the typetable to return this info to the templates return TypeTable(rows=[ @@ -770,7 +771,7 @@ class MatrixUnits(Units): "unstable", "Privileged server plugins", ), TypeTableRow( - "`Identity Service API `_", + "`Identity Service API `_", "unstable", "Mapping of third party IDs to Matrix IDs", ), TypeTableRow( diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index 3b037caf0..49d68834f 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -28,13 +28,27 @@ practice has only been applied specifically to email addresses. .. contents:: Table of Contents .. sectnum:: -Specification version ---------------------- +Changelog +--------- + +.. topic:: Version: %IDENTITY_RELEASE_LABEL% +{{identity_service_changelog}} This version of the specification is generated from `matrix-doc `_ as of Git commit `{{git_version}} `_. +For the full historical changelog, see +https://github.com/matrix-org/matrix-doc/blob/master/changelogs/identity_service.rst + + +Other versions of this specification +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following other versions are also available, in reverse chronological order: + +- `HEAD `_: Includes all changes since the latest versioned release. + General principles ------------------ @@ -138,7 +152,7 @@ associated with a Matrix user ID. At a later point, if the owner of that particular 3pid binds it with a Matrix user ID, the identity server will attempt to make an HTTP POST to the Matrix user's homeserver which looks roughly as below:: - POST https://bar.com:8448/_matrix/federation/v1/3pid/onbind + POST https://bar.com:8448/_matrix/federation/%SERVER_MAJOR_VERSION%/3pid/onbind Content-Type: application/json { diff --git a/specification/server_server_api.rst b/specification/server_server_api.rst index dbde8b104..ccebc313c 100644 --- a/specification/server_server_api.rst +++ b/specification/server_server_api.rst @@ -64,13 +64,27 @@ request. .. contents:: Table of Contents .. sectnum:: -Specification version ---------------------- +Changelog +--------- + +.. topic:: Version: %SERVER_RELEASE_LABEL% +{{server_server_changelog}} This version of the specification is generated from `matrix-doc `_ as of Git commit `{{git_version}} `_. +For the full historical changelog, see +https://github.com/matrix-org/matrix-doc/blob/master/changelogs/server_server.rst + + +Other versions of this specification +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following other versions are also available, in reverse chronological order: + +- `HEAD `_: Includes all changes since the latest versioned release. + Server Discovery ---------------- @@ -118,11 +132,11 @@ Retrieving Server Keys specification due to lack of significance. It may be reviewed `here `_. -Each homeserver publishes its public keys under ``/_matrix/key/v2/server/{keyId}``. -Homeservers query for keys by either getting ``/_matrix/key/v2/server/{keyId}`` +Each homeserver publishes its public keys under ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}``. +Homeservers query for keys by either getting ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}`` directly or by querying an intermediate notary server using a -``/_matrix/key/v2/query/{serverName}/{keyId}`` API. Intermediate notary servers -query the ``/_matrix/key/v2/server/{keyId}`` API on behalf of another server and +``/_matrix/key/%KEYS_MAJOR_VERSION%/query/{serverName}/{keyId}`` API. Intermediate notary servers +query the ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}`` API on behalf of another server and sign the response with their own key. A server may query multiple notary servers to ensure that they all report the same public keys. @@ -138,7 +152,7 @@ Publishing Keys +++++++++++++++ Homeservers publish the allowed TLS fingerprints and signing keys in a JSON -object at ``/_matrix/key/v2/server/{key_id}``. The response contains a list of +object at ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{key_id}``. The response contains a list of ``verify_keys`` that are valid for signing federation requests made by the homeserver and for signing events. It contains a list of ``old_verify_keys`` which are only valid for signing events. Finally the response contains a list of TLS @@ -152,7 +166,7 @@ Querying Keys Through Another Server Servers may query another server's keys through a notary server. The notary server may be another homeserver. The notary server will retrieve keys from -the queried servers through use of the ``/_matrix/key/v2/server/{keyId}`` +the queried servers through use of the ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}`` API. The notary server will additionally sign the response from the queried server before returning the results. @@ -1073,7 +1087,7 @@ that are too long. known hash functions like SHA-256 when none of the keys have been redacted]] .. |/query/directory| replace:: ``/query/directory`` -.. _/query/directory: #get-matrix-federation-v1-query-directory +.. _/query/directory: #get-matrix-federation-%SERVER_MAJOR_VERSION%-query-directory .. _`Invitation storage`: ../identity_service/unstable.html#invitation-storage .. _`Identity Service API`: ../identity_service/unstable.html From 0f28f8327021c43632678d4d54f5753c7cd021ec Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 Aug 2018 17:59:48 -0600 Subject: [PATCH 02/22] Fix client-server event schemas: remove `age`, dedupe fields This commit adds support for event schema examples to have references to help reduce the chance of fields being forgotten. This also helps reduce duplication of fields, allowing for a more consistent spec that uses the same values everywhere. This also removes both `unsigned` and `age` from the examples as per: * https://github.com/matrix-org/matrix-doc/issues/1524 * https://github.com/matrix-org/matrix-doc/issues/630 Finally, this replaces "localhost" in the examples with an example domain. This is really just a nitpick thing on my part where seeing a "real world" domain is preferred. Fixes https://github.com/matrix-org/matrix-doc/issues/1524 Fixes https://github.com/matrix-org/matrix-doc/issues/630 Step towards https://github.com/matrix-org/matrix-doc/issues/1530 --- event-schemas/examples/core/event.json | 6 ++++++ event-schemas/examples/core/room_edu.json | 4 ++++ event-schemas/examples/core/room_event.json | 7 +++++++ event-schemas/examples/core/state_event.json | 4 ++++ event-schemas/examples/m.call.answer | 10 +++------- event-schemas/examples/m.call.candidates | 10 +++------- event-schemas/examples/m.call.hangup | 10 +++------- event-schemas/examples/m.call.invite | 10 +++------- event-schemas/examples/m.direct | 7 ++++--- event-schemas/examples/m.ignored_user_list | 1 + event-schemas/examples/m.presence | 7 ++++--- event-schemas/examples/m.receipt | 18 +++++++++--------- event-schemas/examples/m.room.aliases | 14 +++++--------- event-schemas/examples/m.room.avatar | 14 +++++--------- event-schemas/examples/m.room.canonical_alias | 12 ++++-------- event-schemas/examples/m.room.create | 16 +++++++--------- event-schemas/examples/m.room.encrypted#megolm | 9 +++------ event-schemas/examples/m.room.encrypted#olm | 2 +- event-schemas/examples/m.room.encryption | 11 ++++------- event-schemas/examples/m.room.guest_access | 12 ++++-------- .../examples/m.room.history_visibility | 12 ++++-------- event-schemas/examples/m.room.join_rules | 12 ++++-------- event-schemas/examples/m.room.member | 14 +++++--------- .../examples/m.room.member#invite_room_state | 12 +++--------- .../examples/m.room.member#third_party_invite | 14 ++++---------- event-schemas/examples/m.room.message#m.audio | 12 ++++-------- event-schemas/examples/m.room.message#m.emote | 10 +++------- event-schemas/examples/m.room.message#m.file | 12 ++++-------- event-schemas/examples/m.room.message#m.image | 12 ++++-------- .../examples/m.room.message#m.location | 12 ++++-------- event-schemas/examples/m.room.message#m.notice | 10 +++------- event-schemas/examples/m.room.message#m.text | 10 +++------- event-schemas/examples/m.room.message#m.video | 14 +++++--------- event-schemas/examples/m.room.message.feedback | 10 +++------- event-schemas/examples/m.room.name | 12 ++++-------- event-schemas/examples/m.room.pinned_events | 14 +++++--------- event-schemas/examples/m.room.power_levels | 12 ++++-------- event-schemas/examples/m.room.redaction | 14 ++++---------- .../examples/m.room.third_party_invite | 12 ++++-------- event-schemas/examples/m.room.topic | 12 ++++-------- event-schemas/examples/m.room_key | 5 +++-- event-schemas/examples/m.sticker | 10 +++------- event-schemas/examples/m.tag | 1 + event-schemas/examples/m.typing | 10 +++++----- scripts/templating/matrix_templates/units.py | 2 +- 45 files changed, 175 insertions(+), 279 deletions(-) create mode 100644 event-schemas/examples/core/event.json create mode 100644 event-schemas/examples/core/room_edu.json create mode 100644 event-schemas/examples/core/room_event.json create mode 100644 event-schemas/examples/core/state_event.json diff --git a/event-schemas/examples/core/event.json b/event-schemas/examples/core/event.json new file mode 100644 index 000000000..8a469a5cb --- /dev/null +++ b/event-schemas/examples/core/event.json @@ -0,0 +1,6 @@ +{ + "content": { + "key": "value" + }, + "type": "org.example.custom.event" +} diff --git a/event-schemas/examples/core/room_edu.json b/event-schemas/examples/core/room_edu.json new file mode 100644 index 000000000..80575f5d7 --- /dev/null +++ b/event-schemas/examples/core/room_edu.json @@ -0,0 +1,4 @@ +{ + "$ref": "event.json", + "room_id": "!jEsUZKDJdhlrceRyVU:domain.com" +} diff --git a/event-schemas/examples/core/room_event.json b/event-schemas/examples/core/room_event.json new file mode 100644 index 000000000..fe9ff7ee6 --- /dev/null +++ b/event-schemas/examples/core/room_event.json @@ -0,0 +1,7 @@ +{ + "$ref": "event.json", + "event_id": "$143273582443PhrSn:domain.com", + "room_id": "!jEsUZKDJdhlrceRyVU:domain.com", + "sender": "@example:domain.com", + "origin_server_ts": 1432735824653 +} diff --git a/event-schemas/examples/core/state_event.json b/event-schemas/examples/core/state_event.json new file mode 100644 index 000000000..910747ee2 --- /dev/null +++ b/event-schemas/examples/core/state_event.json @@ -0,0 +1,4 @@ +{ + "$ref": "room_event.json", + "state_key": "ArbitraryString" +} diff --git a/event-schemas/examples/m.call.answer b/event-schemas/examples/m.call.answer index f7d144394..a4cfc1e16 100644 --- a/event-schemas/examples/m.call.answer +++ b/event-schemas/examples/m.call.answer @@ -1,5 +1,6 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.call.answer", "content": { "version" : 0, "call_id": "12345", @@ -8,10 +9,5 @@ "type" : "answer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.call.answer", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.call.candidates b/event-schemas/examples/m.call.candidates index 8e6849bb1..8f1f807ad 100644 --- a/event-schemas/examples/m.call.candidates +++ b/event-schemas/examples/m.call.candidates @@ -1,5 +1,6 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.call.candidates", "content": { "version" : 0, "call_id": "12345", @@ -10,10 +11,5 @@ "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0" } ] - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.call.candidates", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.call.hangup b/event-schemas/examples/m.call.hangup index 42e1f346c..295f16e48 100644 --- a/event-schemas/examples/m.call.hangup +++ b/event-schemas/examples/m.call.hangup @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.call.hangup", "content": { "version" : 0, "call_id": "12345" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.call.hangup", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.call.invite b/event-schemas/examples/m.call.invite index 974a5b4cd..fa482bd94 100644 --- a/event-schemas/examples/m.call.invite +++ b/event-schemas/examples/m.call.invite @@ -1,5 +1,6 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.call.invite", "content": { "version" : 0, "call_id": "12345", @@ -8,10 +9,5 @@ "type" : "offer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.call.invite", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.direct b/event-schemas/examples/m.direct index 92f13daa2..e453dd599 100644 --- a/event-schemas/examples/m.direct +++ b/event-schemas/examples/m.direct @@ -1,9 +1,10 @@ { + "$ref": "core/event.json", "type": "m.direct", "content": { "@bob:example.com": [ - "!abcdefgh:example.com", - "!hgfedcba:example.com" - ] + "!abcdefgh:example.com", + "!hgfedcba:example.com" + ] } } diff --git a/event-schemas/examples/m.ignored_user_list b/event-schemas/examples/m.ignored_user_list index f3a328f7f..9963d13aa 100644 --- a/event-schemas/examples/m.ignored_user_list +++ b/event-schemas/examples/m.ignored_user_list @@ -1,4 +1,5 @@ { + "$ref": "core/event.json", "type": "m.ignored_user_list", "content": { "ignored_users": { diff --git a/event-schemas/examples/m.presence b/event-schemas/examples/m.presence index 824ffcb71..36093cd92 100644 --- a/event-schemas/examples/m.presence +++ b/event-schemas/examples/m.presence @@ -1,10 +1,11 @@ { + "$ref": "core/event.json", + "sender": "@example:localhost", + "type": "m.presence", "content": { "avatar_url": "mxc://localhost:wefuiwegh8742w", "last_active_ago": 2478593, "presence": "online", "currently_active": false - }, - "sender": "@example:localhost", - "type": "m.presence" + } } diff --git a/event-schemas/examples/m.receipt b/event-schemas/examples/m.receipt index bd0b726c3..c52d8540f 100644 --- a/event-schemas/examples/m.receipt +++ b/event-schemas/examples/m.receipt @@ -1,13 +1,13 @@ { - "type": "m.receipt", - "room_id": "!KpjVgQyZpzBwvMBsnT:matrix.org", - "content": { - "$1435641916114394fHBLK:matrix.org": { - "m.read": { - "@rikj:jki.re": { - "ts": 1436451550453 - } - } + "$ref": "core/room_edu.json", + "type": "m.receipt", + "content": { + "$1435641916114394fHBLK:matrix.org": { + "m.read": { + "@rikj:jki.re": { + "ts": 1436451550453 } + } } + } } diff --git a/event-schemas/examples/m.room.aliases b/event-schemas/examples/m.room.aliases index ca87510e3..bb2fe21c5 100644 --- a/event-schemas/examples/m.room.aliases +++ b/event-schemas/examples/m.room.aliases @@ -1,12 +1,8 @@ { - "age": 242352, - "content": { - "aliases": ["#somewhere:localhost", "#another:localhost"] - }, - "state_key": "localhost", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", + "$ref": "core/state_event.json", + "state_key": "domain.com", "type": "m.room.aliases", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + "content": { + "aliases": ["#somewhere:domain.com", "#another:domain.com"] + } } diff --git a/event-schemas/examples/m.room.avatar b/event-schemas/examples/m.room.avatar index 2080d96ef..9b51e01fd 100644 --- a/event-schemas/examples/m.room.avatar +++ b/event-schemas/examples/m.room.avatar @@ -1,5 +1,7 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.avatar", + "state_key": "", "content": { "info": { "h": 398, @@ -7,12 +9,6 @@ "mimetype": "image/jpeg", "size": 31037 }, - "url": "mxc://localhost/JWEIFJgwEIhweiWJE" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.avatar", - "state_key": "", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + "url": "mxc://domain.com/JWEIFJgwEIhweiWJE" + } } diff --git a/event-schemas/examples/m.room.canonical_alias b/event-schemas/examples/m.room.canonical_alias index 59df586d9..06c3226c9 100644 --- a/event-schemas/examples/m.room.canonical_alias +++ b/event-schemas/examples/m.room.canonical_alias @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.canonical_alias", + "state_key": "", "content": { "alias": "#somewhere:localhost" - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.canonical_alias", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.create b/event-schemas/examples/m.room.create index 34dabb536..181274977 100644 --- a/event-schemas/examples/m.room.create +++ b/event-schemas/examples/m.room.create @@ -1,12 +1,10 @@ { - "age": 242352, - "content": { - "creator": "@example:localhost" - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", + "$ref": "core/state_event.json", "type": "m.room.create", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + "state_key": "", + "content": { + "creator": "@example:domain.com", + "room_version": "1", + "m.federate": true + } } diff --git a/event-schemas/examples/m.room.encrypted#megolm b/event-schemas/examples/m.room.encrypted#megolm index 1f9b75208..ac542e254 100644 --- a/event-schemas/examples/m.room.encrypted#megolm +++ b/event-schemas/examples/m.room.encrypted#megolm @@ -1,14 +1,11 @@ { + "$ref": "core/room_event.json", + "type": "m.room.encrypted", "content": { "algorithm": "m.megolm.v1.aes-sha2", "ciphertext": "AwgAEnACgAkLmt6qF84IK++J7UDH2Za1YVchHyprqTqsg...", "device_id": "RJYKSTBOIE", "sender_key": "IlRMeOPX2e0MurIyfWEucYBRVOEEUMrOHqn/8mLqMjA", "session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ" - }, - "event_id": "$WLGTSEFSEF:localhost", - "room_id": "!Cuyf34gef24t:localhost", - "origin_server_ts": 1476648761524, - "sender": "@example:localhost", - "type": "m.room.encrypted" + } } diff --git a/event-schemas/examples/m.room.encrypted#olm b/event-schemas/examples/m.room.encrypted#olm index abb23c31e..381651d95 100644 --- a/event-schemas/examples/m.room.encrypted#olm +++ b/event-schemas/examples/m.room.encrypted#olm @@ -1,6 +1,6 @@ { + "$ref": "core/room_event.json", "type": "m.room.encrypted", - "sender": "@example:localhost", "content": { "algorithm": "m.olm.v1.curve25519-aes-sha2", "sender_key": "Szl29ksW/L8yZGWAX+8dY1XyFi+i5wm+DRhTGkbMiwU", diff --git a/event-schemas/examples/m.room.encryption b/event-schemas/examples/m.room.encryption index 08f152396..6158b9379 100644 --- a/event-schemas/examples/m.room.encryption +++ b/event-schemas/examples/m.room.encryption @@ -1,13 +1,10 @@ { + "$ref": "core/state_event.json", + "type": "m.room.encryption", + "state_key": "", "content": { "algorithm": "m.megolm.v1.aes-sha2", "rotation_period_ms": 604800000, "rotation_period_msgs": 100 - }, - "event_id": "$WLGTSEFJJKJ:localhost", - "origin_server_ts": 1476648761524, - "sender": "@example:localhost", - "room_id": "!Cuyf34gef24t:localhost", - "state_key": "", - "type": "m.room.encryption" + } } diff --git a/event-schemas/examples/m.room.guest_access b/event-schemas/examples/m.room.guest_access index c636ff395..a6deff8c0 100644 --- a/event-schemas/examples/m.room.guest_access +++ b/event-schemas/examples/m.room.guest_access @@ -1,12 +1,8 @@ { - "age": 242353, + "$ref": "core/state_event.json", + "type": "m.room.guest_access", + "state_key": "", "content": { "guest_access": "can_join" - }, - "state_key": "", - "origin_server_ts": 1431961217938, - "event_id": "$WLGTSEFSEG:localhost", - "type": "m.room.guest_access", - "room_id": "!Cuyf34gef24u:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.history_visibility b/event-schemas/examples/m.room.history_visibility index 6fedc5dc6..27c4fec35 100644 --- a/event-schemas/examples/m.room.history_visibility +++ b/event-schemas/examples/m.room.history_visibility @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.history_visibility", + "state_key": "", "content": { "history_visibility": "shared" - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.history_visibility", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.join_rules b/event-schemas/examples/m.room.join_rules index 39e14fc5d..2873be781 100644 --- a/event-schemas/examples/m.room.join_rules +++ b/event-schemas/examples/m.room.join_rules @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.join_rules", + "state_key": "", "content": { "join_rule": "public" - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.join_rules", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.member b/event-schemas/examples/m.room.member index 2495145ba..ce31ab8fe 100644 --- a/event-schemas/examples/m.room.member +++ b/event-schemas/examples/m.room.member @@ -1,14 +1,10 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "state_key": "@alice:domain.com", + "type": "m.room.member", "content": { "membership": "join", - "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", + "avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto", "displayname": "Alice Margatroid" - }, - "state_key": "@alice:localhost", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.member", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.member#invite_room_state b/event-schemas/examples/m.room.member#invite_room_state index 1a93b395b..54d71ca7e 100644 --- a/event-schemas/examples/m.room.member#invite_room_state +++ b/event-schemas/examples/m.room.member#invite_room_state @@ -1,8 +1,8 @@ { - "age": 242352, + "$ref": "m.room.member", "content": { "membership": "invite", - "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", + "avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto", "displayname": "Alice Margatroid" }, "invite_room_state": [ @@ -20,11 +20,5 @@ "join_rule": "invite" } } - ], - "state_key": "@alice:localhost", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.member", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + ] } diff --git a/event-schemas/examples/m.room.member#third_party_invite b/event-schemas/examples/m.room.member#third_party_invite index 244e15562..92b5d2ef9 100644 --- a/event-schemas/examples/m.room.member#third_party_invite +++ b/event-schemas/examples/m.room.member#third_party_invite @@ -1,13 +1,13 @@ { - "age": 242352, + "$ref": "m.room.member", "content": { "membership": "invite", - "avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", + "avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto", "displayname": "Alice Margatroid", "third_party_invite": { "display_name": "alice", "signed": { - "mxid": "@alice:localhost", + "mxid": "@alice:domain.com", "signatures": { "magic.forest": { "ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg" @@ -16,11 +16,5 @@ "token": "abc123" } } - }, - "state_key": "@alice:localhost", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.member", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.audio b/event-schemas/examples/m.room.message#m.audio index 367eb9540..4ce5a2a8a 100644 --- a/event-schemas/examples/m.room.message#m.audio +++ b/event-schemas/examples/m.room.message#m.audio @@ -1,18 +1,14 @@ { - "age": 146, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "Bee Gees - Stayin' Alive", - "url": "mxc://localhost/ffed755USFFxlgbQYZGtryd", + "url": "mxc://domain.com/ffed755USFFxlgbQYZGtryd", "info": { "duration": 2140786, "size": 1563685, "mimetype": "audio/mpeg" }, "msgtype": "m.audio" - }, - "event_id": "$143273582443PhrSn:localhost", - "origin_server_ts": 1432735824653, - "room_id": "!jEsUZKDJdhlrceRyVU:localhost", - "type": "m.room.message", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.emote b/event-schemas/examples/m.room.message#m.emote index 79292ddf8..5fecb9a3f 100644 --- a/event-schemas/examples/m.room.message#m.emote +++ b/event-schemas/examples/m.room.message#m.emote @@ -1,14 +1,10 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "thinks this is an example emote", "msgtype": "m.emote", "format": "org.matrix.custom.html", "formatted_body": "thinks this is an example emote" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.message", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.file b/event-schemas/examples/m.room.message#m.file index e52c3a947..b518550aa 100644 --- a/event-schemas/examples/m.room.message#m.file +++ b/event-schemas/examples/m.room.message#m.file @@ -1,5 +1,6 @@ { - "age": 146, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "something-important.doc", "filename": "something-important.doc", @@ -8,11 +9,6 @@ "size": 46144 }, "msgtype": "m.file", - "url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe" - }, - "event_id": "$143273582443PhrSn:localhost", - "origin_server_ts": 1432735824653, - "room_id": "!jEsUZKDJdhlrceRyVU:localhost", - "type": "m.room.message", - "sender": "@example:localhost" + "url": "mxc://domain.com/FHyPlCeYUSFFxlgbQYZmoEoe" + } } diff --git a/event-schemas/examples/m.room.message#m.image b/event-schemas/examples/m.room.message#m.image index 91e72be26..60402effc 100644 --- a/event-schemas/examples/m.room.message#m.image +++ b/event-schemas/examples/m.room.message#m.image @@ -1,5 +1,6 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "filename.jpg", "info": { @@ -8,12 +9,7 @@ "mimetype": "image/jpeg", "size": 31037 }, - "url": "mxc://localhost/JWEIFJgwEIhweiWJE", + "url": "mxc://domain.com/JWEIFJgwEIhweiWJE", "msgtype": "m.image" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.message", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.location b/event-schemas/examples/m.room.message#m.location index 75363f6fd..1461a305d 100644 --- a/event-schemas/examples/m.room.message#m.location +++ b/event-schemas/examples/m.room.message#m.location @@ -1,10 +1,11 @@ { - "age": 146, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "Big Ben, London, UK", "geo_uri": "geo:51.5008,0.1247", "info": { - "thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe", + "thumbnail_url": "mxc://domain.com/FHyPlCeYUSFFxlgbQYZmoEoe", "thumbnail_info": { "mimetype": "image/jpeg", "size": 46144, @@ -13,10 +14,5 @@ } }, "msgtype": "m.location" - }, - "event_id": "$143273582443PhrSn:localhost", - "origin_server_ts": 1432735824653, - "room_id": "!jEsUZKDJdhlrceRyVU:localhost", - "type": "m.room.message", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.notice b/event-schemas/examples/m.room.message#m.notice index 978c67e6b..78e9dea67 100644 --- a/event-schemas/examples/m.room.message#m.notice +++ b/event-schemas/examples/m.room.message#m.notice @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "This is an example notice", "msgtype": "m.notice" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.message", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.text b/event-schemas/examples/m.room.message#m.text index 48a97db80..ba1fb7697 100644 --- a/event-schemas/examples/m.room.message#m.text +++ b/event-schemas/examples/m.room.message#m.text @@ -1,14 +1,10 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "This is an example text message", "msgtype": "m.text", "format": "org.matrix.custom.html", "formatted_body": "This is an example text message" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.message", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message#m.video b/event-schemas/examples/m.room.message#m.video index 576d80de4..304fbfbd1 100644 --- a/event-schemas/examples/m.room.message#m.video +++ b/event-schemas/examples/m.room.message#m.video @@ -1,10 +1,11 @@ { - "age": 146, + "$ref": "core/room_event.json", + "type": "m.room.message", "content": { "body": "Gangnam Style", - "url": "mxc://localhost/a526eYUSFFxlgbQYZmo442", + "url": "mxc://domain.com/a526eYUSFFxlgbQYZmo442", "info": { - "thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe", + "thumbnail_url": "mxc://domain.com/FHyPlCeYUSFFxlgbQYZmoEoe", "thumbnail_info": { "mimetype": "image/jpeg", "size": 46144, @@ -18,10 +19,5 @@ "mimetype": "video/mp4" }, "msgtype": "m.video" - }, - "event_id": "$143273582443PhrSn:localhost", - "origin_server_ts": 1432735824653, - "room_id": "!jEsUZKDJdhlrceRyVU:localhost", - "type": "m.room.message", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.message.feedback b/event-schemas/examples/m.room.message.feedback index 16fe0ee09..e146e8743 100644 --- a/event-schemas/examples/m.room.message.feedback +++ b/event-schemas/examples/m.room.message.feedback @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.room.message.feedback", "content": { "type": "delivered", "target_event_id": "$WEIGFHFW:localhost" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.message.feedback", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.name b/event-schemas/examples/m.room.name index 87db2008e..e77e2b53a 100644 --- a/event-schemas/examples/m.room.name +++ b/event-schemas/examples/m.room.name @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.name", + "state_key": "", "content": { "name": "The room name" - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.name", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.pinned_events b/event-schemas/examples/m.room.pinned_events index 6f41e97da..10d71a8d6 100644 --- a/event-schemas/examples/m.room.pinned_events +++ b/event-schemas/examples/m.room.pinned_events @@ -1,12 +1,8 @@ { - "age": 242352, - "content": { - "pinned": ["$someevent:localhost"] - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", + "$ref": "core/state_event.json", "type": "m.room.pinned_events", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + "state_key": "", + "content": { + "pinned": ["$someevent:domain.com"] + } } diff --git a/event-schemas/examples/m.room.power_levels b/event-schemas/examples/m.room.power_levels index 0c8f8bc53..37c27845e 100644 --- a/event-schemas/examples/m.room.power_levels +++ b/event-schemas/examples/m.room.power_levels @@ -1,5 +1,7 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.power_levels", + "state_key": "", "content": { "ban": 50, "events": { @@ -15,11 +17,5 @@ "@example:localhost": 100 }, "users_default": 0 - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.power_levels", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.redaction b/event-schemas/examples/m.room.redaction index e24a8cdbe..42bc84115 100644 --- a/event-schemas/examples/m.room.redaction +++ b/event-schemas/examples/m.room.redaction @@ -1,14 +1,8 @@ { - "unsigned": { - "age": 242352 - }, - "content": { - "reason": "Spamming" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", + "$ref": "core/room_event.json", "type": "m.room.redaction", - "room_id": "!Cuyf34gef24t:localhost", "redacts": "$fukweghifu23:localhost", - "sender": "@example:localhost" + "content": { + "reason": "Spamming" + } } diff --git a/event-schemas/examples/m.room.third_party_invite b/event-schemas/examples/m.room.third_party_invite index 3f9d48fef..03f35375e 100644 --- a/event-schemas/examples/m.room.third_party_invite +++ b/event-schemas/examples/m.room.third_party_invite @@ -1,5 +1,7 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.third_party_invite", + "state_key": "pc98", "content": { "display_name": "Alice Margatroid", "key_validity_url": "https://magic.forest/verifykey", @@ -8,11 +10,5 @@ "public_key": "def456", "key_validity_url": "https://magic.forest/verifykey" }] - }, - "state_key": "pc98", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.third_party_invite", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room.topic b/event-schemas/examples/m.room.topic index 65daa9872..69e5d4f1c 100644 --- a/event-schemas/examples/m.room.topic +++ b/event-schemas/examples/m.room.topic @@ -1,12 +1,8 @@ { - "age": 242352, + "$ref": "core/state_event.json", + "type": "m.room.topic", + "state_key": "", "content": { "topic": "A room topic" - }, - "state_key": "", - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.room.topic", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.room_key b/event-schemas/examples/m.room_key index 53f83e522..dba497b42 100644 --- a/event-schemas/examples/m.room_key +++ b/event-schemas/examples/m.room_key @@ -1,9 +1,10 @@ { + "$ref": "core/event.json", + "type": "m.room_key", "content": { "algorithm": "m.megolm.v1.aes-sha2", "room_id": "!Cuyf34gef24t:localhost", "session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ", "session_key": "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8LlfJL7qNBEY..." - }, - "type": "m.room_key" + } } diff --git a/event-schemas/examples/m.sticker b/event-schemas/examples/m.sticker index f00e5b238..971cdc905 100644 --- a/event-schemas/examples/m.sticker +++ b/event-schemas/examples/m.sticker @@ -1,5 +1,6 @@ { - "age": 242352, + "$ref": "core/room_event.json", + "type": "m.sticker", "content": { "body": "Landing", "info": { @@ -16,10 +17,5 @@ "size": 73602 }, "url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP" - }, - "origin_server_ts": 1431961217939, - "event_id": "$WLGTSEFSEF:localhost", - "type": "m.sticker", - "room_id": "!Cuyf34gef24t:localhost", - "sender": "@example:localhost" + } } diff --git a/event-schemas/examples/m.tag b/event-schemas/examples/m.tag index 53dbc921a..0d61d91b6 100644 --- a/event-schemas/examples/m.tag +++ b/event-schemas/examples/m.tag @@ -1,4 +1,5 @@ { + "$ref": "core/event.json", "type": "m.tag", "content": { "tags": { diff --git a/event-schemas/examples/m.typing b/event-schemas/examples/m.typing index 1d2c517b9..416b99688 100644 --- a/event-schemas/examples/m.typing +++ b/event-schemas/examples/m.typing @@ -1,7 +1,7 @@ { - "type": "m.typing", - "room_id": "!z0mnsuiwhifuhwwfw:matrix.org", - "content": { - "user_ids": ["@alice:matrix.org", "@bob:example.com"] - } + "$ref": "core/room_edu.json", + "type": "m.typing", + "content": { + "user_ids": ["@alice:matrix.org", "@bob:example.com"] + } } diff --git a/scripts/templating/matrix_templates/units.py b/scripts/templating/matrix_templates/units.py index 90a87cd47..9a6f35692 100644 --- a/scripts/templating/matrix_templates/units.py +++ b/scripts/templating/matrix_templates/units.py @@ -792,7 +792,7 @@ class MatrixUnits(Units): logger.info("Reading event example: %s" % filepath) try: with open(filepath, "r") as f: - example = json.load(f) + example = resolve_references(filepath, json.load(f)) examples[filename] = examples.get(filename, []) examples[filename].append(example) if filename != event_name: From 06d43aef173cf4f821c459d04e2d8885bbdfd714 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 24 Aug 2018 18:08:05 -0600 Subject: [PATCH 03/22] Changelog --- changelogs/client_server/newsfragments/1558.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/1558.clarification diff --git a/changelogs/client_server/newsfragments/1558.clarification b/changelogs/client_server/newsfragments/1558.clarification new file mode 100644 index 000000000..3482d89cc --- /dev/null +++ b/changelogs/client_server/newsfragments/1558.clarification @@ -0,0 +1 @@ +Update all event examples to be accurate representations of their associated events. From 295b1322e245bc3cdd020d19691f969f4389e132 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 25 Aug 2018 22:26:23 -0600 Subject: [PATCH 04/22] Add back the unsigned.age property to voip event examples --- event-schemas/examples/m.call.answer | 3 +++ event-schemas/examples/m.call.candidates | 3 +++ event-schemas/examples/m.call.hangup | 3 +++ event-schemas/examples/m.call.invite | 3 +++ 4 files changed, 12 insertions(+) diff --git a/event-schemas/examples/m.call.answer b/event-schemas/examples/m.call.answer index a4cfc1e16..e616ba344 100644 --- a/event-schemas/examples/m.call.answer +++ b/event-schemas/examples/m.call.answer @@ -9,5 +9,8 @@ "type" : "answer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } + }, + "unsigned": { + "age": 1234, } } diff --git a/event-schemas/examples/m.call.candidates b/event-schemas/examples/m.call.candidates index 8f1f807ad..4a4e66885 100644 --- a/event-schemas/examples/m.call.candidates +++ b/event-schemas/examples/m.call.candidates @@ -11,5 +11,8 @@ "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0" } ] + }, + "unsigned": { + "age": 1234, } } diff --git a/event-schemas/examples/m.call.hangup b/event-schemas/examples/m.call.hangup index 295f16e48..f88a7308d 100644 --- a/event-schemas/examples/m.call.hangup +++ b/event-schemas/examples/m.call.hangup @@ -4,5 +4,8 @@ "content": { "version" : 0, "call_id": "12345" + }, + "unsigned": { + "age": 1234, } } diff --git a/event-schemas/examples/m.call.invite b/event-schemas/examples/m.call.invite index fa482bd94..182a255f3 100644 --- a/event-schemas/examples/m.call.invite +++ b/event-schemas/examples/m.call.invite @@ -9,5 +9,8 @@ "type" : "offer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } + }, + "unsigned": { + "age": 1234, } } From e5a7dd1c45a2547efcbaced3aa1ccd06a85b3cdc Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 25 Aug 2018 23:00:26 -0600 Subject: [PATCH 05/22] Remove excess commas from JSON --- event-schemas/examples/m.call.answer | 2 +- event-schemas/examples/m.call.candidates | 2 +- event-schemas/examples/m.call.hangup | 2 +- event-schemas/examples/m.call.invite | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/event-schemas/examples/m.call.answer b/event-schemas/examples/m.call.answer index e616ba344..a7b9e883f 100644 --- a/event-schemas/examples/m.call.answer +++ b/event-schemas/examples/m.call.answer @@ -11,6 +11,6 @@ } }, "unsigned": { - "age": 1234, + "age": 1234 } } diff --git a/event-schemas/examples/m.call.candidates b/event-schemas/examples/m.call.candidates index 4a4e66885..1a3fdedf0 100644 --- a/event-schemas/examples/m.call.candidates +++ b/event-schemas/examples/m.call.candidates @@ -13,6 +13,6 @@ ] }, "unsigned": { - "age": 1234, + "age": 1234 } } diff --git a/event-schemas/examples/m.call.hangup b/event-schemas/examples/m.call.hangup index f88a7308d..cf2d68595 100644 --- a/event-schemas/examples/m.call.hangup +++ b/event-schemas/examples/m.call.hangup @@ -6,6 +6,6 @@ "call_id": "12345" }, "unsigned": { - "age": 1234, + "age": 1234 } } diff --git a/event-schemas/examples/m.call.invite b/event-schemas/examples/m.call.invite index 182a255f3..069d334e9 100644 --- a/event-schemas/examples/m.call.invite +++ b/event-schemas/examples/m.call.invite @@ -11,6 +11,6 @@ } }, "unsigned": { - "age": 1234, + "age": 1234 } } From 4b05194a913e210585febe3df1864d2b6e384eab Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 27 Aug 2018 19:18:14 -0600 Subject: [PATCH 06/22] Fix bad merge --- event-schemas/examples/m.room.member#invite_room_state | 7 ------- 1 file changed, 7 deletions(-) diff --git a/event-schemas/examples/m.room.member#invite_room_state b/event-schemas/examples/m.room.member#invite_room_state index 44f160c23..7055d0a09 100644 --- a/event-schemas/examples/m.room.member#invite_room_state +++ b/event-schemas/examples/m.room.member#invite_room_state @@ -21,13 +21,6 @@ "join_rule": "invite" } } - }, - { - "type": "m.room.join_rules", - "state_key": "", - "content": { - "join_rule": "invite" - } } ] } From 8e42f3ab3a3de8a7eba1d9f5354a140d45c3ec65 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 27 Aug 2018 19:26:08 -0600 Subject: [PATCH 07/22] Fix bad merge on brackets --- event-schemas/examples/m.room.member#invite_room_state | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/event-schemas/examples/m.room.member#invite_room_state b/event-schemas/examples/m.room.member#invite_room_state index 7055d0a09..cbd76100e 100644 --- a/event-schemas/examples/m.room.member#invite_room_state +++ b/event-schemas/examples/m.room.member#invite_room_state @@ -21,6 +21,6 @@ "join_rule": "invite" } } - } - ] + ] + } } From cff5b8b205d8b86bacc3ab75171f47f7b427a2dc Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 27 Aug 2018 19:30:46 -0600 Subject: [PATCH 08/22] More versioned links --- specification/server_server_api.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/server_server_api.rst b/specification/server_server_api.rst index ccebc313c..d04c04073 100644 --- a/specification/server_server_api.rst +++ b/specification/server_server_api.rst @@ -1089,9 +1089,9 @@ that are too long. .. |/query/directory| replace:: ``/query/directory`` .. _/query/directory: #get-matrix-federation-%SERVER_MAJOR_VERSION%-query-directory -.. _`Invitation storage`: ../identity_service/unstable.html#invitation-storage -.. _`Identity Service API`: ../identity_service/unstable.html -.. _`Client-Server API`: ../client_server/unstable.html +.. _`Invitation storage`: ../identity_service/%IDENTITY_RELEASE_LABEL%.html#invitation-storage +.. _`Identity Service API`: ../identity_service/%IDENTITY_RELEASE_LABEL%.html +.. _`Client-Server API`: ../client_server/%CLIENT_RELEASE_LABEL%.html .. _`Inviting to a room`: #inviting-to-a-room .. _`Canonical JSON`: ../appendices.html#canonical-json .. _`Unpadded Base64`: ../appendices.html#unpadded-base64 From 62b1b8b66097f3d8be2f9cc465335f28641d15fb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 09:32:14 -0600 Subject: [PATCH 09/22] Have unsigned.age appear on all room events This is useful for a lot of things, like bridges (appservices), VoIP handling, and clients which generally may wish to do something with the field. Might as well include it on every event, despite the recommendation of https://github.com/matrix-org/matrix-doc/issues/1524 --- event-schemas/examples/core/room_event.json | 5 ++++- event-schemas/examples/m.call.answer | 3 --- event-schemas/examples/m.call.candidates | 3 --- event-schemas/examples/m.call.hangup | 3 --- event-schemas/examples/m.call.invite | 3 --- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/event-schemas/examples/core/room_event.json b/event-schemas/examples/core/room_event.json index fe9ff7ee6..41837afb5 100644 --- a/event-schemas/examples/core/room_event.json +++ b/event-schemas/examples/core/room_event.json @@ -3,5 +3,8 @@ "event_id": "$143273582443PhrSn:domain.com", "room_id": "!jEsUZKDJdhlrceRyVU:domain.com", "sender": "@example:domain.com", - "origin_server_ts": 1432735824653 + "origin_server_ts": 1432735824653, + "unsigned": { + "age": 1234 + } } diff --git a/event-schemas/examples/m.call.answer b/event-schemas/examples/m.call.answer index a7b9e883f..a4cfc1e16 100644 --- a/event-schemas/examples/m.call.answer +++ b/event-schemas/examples/m.call.answer @@ -9,8 +9,5 @@ "type" : "answer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } - }, - "unsigned": { - "age": 1234 } } diff --git a/event-schemas/examples/m.call.candidates b/event-schemas/examples/m.call.candidates index 1a3fdedf0..8f1f807ad 100644 --- a/event-schemas/examples/m.call.candidates +++ b/event-schemas/examples/m.call.candidates @@ -11,8 +11,5 @@ "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0" } ] - }, - "unsigned": { - "age": 1234 } } diff --git a/event-schemas/examples/m.call.hangup b/event-schemas/examples/m.call.hangup index cf2d68595..295f16e48 100644 --- a/event-schemas/examples/m.call.hangup +++ b/event-schemas/examples/m.call.hangup @@ -4,8 +4,5 @@ "content": { "version" : 0, "call_id": "12345" - }, - "unsigned": { - "age": 1234 } } diff --git a/event-schemas/examples/m.call.invite b/event-schemas/examples/m.call.invite index 069d334e9..fa482bd94 100644 --- a/event-schemas/examples/m.call.invite +++ b/event-schemas/examples/m.call.invite @@ -9,8 +9,5 @@ "type" : "offer", "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" } - }, - "unsigned": { - "age": 1234 } } From c7a228bf7ba1551e0df04e583a0d86644ad1b352 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 19:32:52 -0600 Subject: [PATCH 10/22] Don't make the major version a variable We are likely to want to maintain v1 when we release a v2, so we'll avoid a variable for now. --- api/identity/associations.yaml | 2 +- api/identity/email_associations.yaml | 2 +- api/identity/invitation_signing.yaml | 2 +- api/identity/lookup.yaml | 2 +- api/identity/phone_associations.yaml | 2 +- api/identity/ping.yaml | 2 +- api/identity/pubkey.yaml | 2 +- api/identity/store_invite.yaml | 4 ++-- api/server-server/backfill.yaml | 2 +- api/server-server/event_auth.yaml | 2 +- api/server-server/events.yaml | 2 +- api/server-server/invites.yaml | 2 +- api/server-server/joins.yaml | 2 +- api/server-server/keys_query.yaml | 2 +- api/server-server/keys_server.yaml | 2 +- api/server-server/leaving.yaml | 2 +- api/server-server/openid.yaml | 2 +- api/server-server/public_rooms.yaml | 2 +- api/server-server/query.yaml | 2 +- api/server-server/third_party_invite.yaml | 2 +- api/server-server/transactions.yaml | 2 +- api/server-server/version.yaml | 2 +- scripts/gendoc.py | 3 --- specification/identity_service_api.rst | 2 +- specification/server_server_api.rst | 10 +++++----- 25 files changed, 29 insertions(+), 32 deletions(-) diff --git a/api/identity/associations.yaml b/api/identity/associations.yaml index e99ec8714..4225919b1 100644 --- a/api/identity/associations.yaml +++ b/api/identity/associations.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: diff --git a/api/identity/email_associations.yaml b/api/identity/email_associations.yaml index ef3e01eae..28f5e6809 100644 --- a/api/identity/email_associations.yaml +++ b/api/identity/email_associations.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: diff --git a/api/identity/invitation_signing.yaml b/api/identity/invitation_signing.yaml index 3a48485b5..7de62dd41 100644 --- a/api/identity/invitation_signing.yaml +++ b/api/identity/invitation_signing.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: diff --git a/api/identity/lookup.yaml b/api/identity/lookup.yaml index c17516449..f04436ef3 100644 --- a/api/identity/lookup.yaml +++ b/api/identity/lookup.yaml @@ -21,7 +21,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: diff --git a/api/identity/phone_associations.yaml b/api/identity/phone_associations.yaml index e7991ceef..f6b1bd45b 100644 --- a/api/identity/phone_associations.yaml +++ b/api/identity/phone_associations.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: diff --git a/api/identity/ping.yaml b/api/identity/ping.yaml index b630c7332..005160a35 100644 --- a/api/identity/ping.yaml +++ b/api/identity/ping.yaml @@ -23,7 +23,7 @@ basePath: /_matrix/identity produces: - application/json paths: - "/api/%IDENTITY_MAJOR_VERSION%": + "/api/v1": get: summary: Checks that an Identity server is available at this API endpopint. description: |- diff --git a/api/identity/pubkey.yaml b/api/identity/pubkey.yaml index 071564d84..9cb7c74e9 100644 --- a/api/identity/pubkey.yaml +++ b/api/identity/pubkey.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: diff --git a/api/identity/store_invite.yaml b/api/identity/store_invite.yaml index e631d60d7..1eca7198e 100644 --- a/api/identity/store_invite.yaml +++ b/api/identity/store_invite.yaml @@ -19,7 +19,7 @@ host: localhost:8090 schemes: - https - http -basePath: /_matrix/identity/api/%IDENTITY_MAJOR_VERSION% +basePath: /_matrix/identity/api/v1 produces: - application/json paths: @@ -46,7 +46,7 @@ paths: ``address`` parameter, notifying them of the invitation. Also, the generated ephemeral public key will be listed as valid on - requests to ``/_matrix/identity/api/%IDENTITY_MAJOR_VERSION%/pubkey/ephemeral/isvalid``. + requests to ``/_matrix/identity/api/v1/pubkey/ephemeral/isvalid``. operationId: storeInvite parameters: - in: body diff --git a/api/server-server/backfill.yaml b/api/server-server/backfill.yaml index 5c88f554b..6b3cfaef0 100644 --- a/api/server-server/backfill.yaml +++ b/api/server-server/backfill.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/event_auth.yaml b/api/server-server/event_auth.yaml index 0248fb1e7..8857131fa 100644 --- a/api/server-server/event_auth.yaml +++ b/api/server-server/event_auth.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/events.yaml b/api/server-server/events.yaml index 0b3183730..cf3988a20 100644 --- a/api/server-server/events.yaml +++ b/api/server-server/events.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 produces: - application/json securityDefinitions: diff --git a/api/server-server/invites.yaml b/api/server-server/invites.yaml index d55ccb5b5..6d905e178 100644 --- a/api/server-server/invites.yaml +++ b/api/server-server/invites.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/joins.yaml b/api/server-server/joins.yaml index 66a071e58..4902ea9e1 100644 --- a/api/server-server/joins.yaml +++ b/api/server-server/joins.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/keys_query.yaml b/api/server-server/keys_query.yaml index face2bd63..e616915bd 100644 --- a/api/server-server/keys_query.yaml +++ b/api/server-server/keys_query.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/key/%KEYS_MAJOR_VERSION% +basePath: /_matrix/key/v2 consumes: - application/json produces: diff --git a/api/server-server/keys_server.yaml b/api/server-server/keys_server.yaml index d09ba8e27..8734f2edd 100644 --- a/api/server-server/keys_server.yaml +++ b/api/server-server/keys_server.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/key/%KEYS_MAJOR_VERSION% +basePath: /_matrix/key/v2 produces: - application/json paths: diff --git a/api/server-server/leaving.yaml b/api/server-server/leaving.yaml index 739f4962c..be08acba6 100644 --- a/api/server-server/leaving.yaml +++ b/api/server-server/leaving.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/openid.yaml b/api/server-server/openid.yaml index 942a5d5e6..0eac48c84 100644 --- a/api/server-server/openid.yaml +++ b/api/server-server/openid.yaml @@ -20,7 +20,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 produces: - application/json paths: diff --git a/api/server-server/public_rooms.yaml b/api/server-server/public_rooms.yaml index 98736977b..b76910236 100644 --- a/api/server-server/public_rooms.yaml +++ b/api/server-server/public_rooms.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 produces: - application/json securityDefinitions: diff --git a/api/server-server/query.yaml b/api/server-server/query.yaml index af70a9c36..dc14724c5 100644 --- a/api/server-server/query.yaml +++ b/api/server-server/query.yaml @@ -20,7 +20,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 produces: - application/json securityDefinitions: diff --git a/api/server-server/third_party_invite.yaml b/api/server-server/third_party_invite.yaml index 9e3bba2c2..5c12247cf 100644 --- a/api/server-server/third_party_invite.yaml +++ b/api/server-server/third_party_invite.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/transactions.yaml b/api/server-server/transactions.yaml index edfecac13..ad10ec0b9 100644 --- a/api/server-server/transactions.yaml +++ b/api/server-server/transactions.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 consumes: - application/json produces: diff --git a/api/server-server/version.yaml b/api/server-server/version.yaml index 17110f19e..199755290 100644 --- a/api/server-server/version.yaml +++ b/api/server-server/version.yaml @@ -19,7 +19,7 @@ info: host: localhost:8448 schemes: - https -basePath: /_matrix/federation/%SERVER_MAJOR_VERSION% +basePath: /_matrix/federation/v1 produces: - application/json paths: diff --git a/scripts/gendoc.py b/scripts/gendoc.py index b7fe8155d..8f5b51542 100755 --- a/scripts/gendoc.py +++ b/scripts/gendoc.py @@ -548,9 +548,6 @@ if __name__ == '__main__': # API URLs. When we have released a new major version, we'll # have to bump them. "%CLIENT_MAJOR_VERSION%": "r0", - "%SERVER_MAJOR_VERSION%": "v1", - "%IDENTITY_MAJOR_VERSION%": "v1", - "%KEYS_MAJOR_VERSION%": "v2", "%SERVER_RELEASE_LABEL%": args.server_release, "%IDENTITY_RELEASE_LABEL%": args.identity_release, "%PUSH_GATEWAY_RELEASE_LABEL%": args.push_gateway_release, diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index 3aa50c815..3f2eb21d5 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -221,7 +221,7 @@ associated with a Matrix user ID. At a later point, if the owner of that particular 3pid binds it with a Matrix user ID, the identity server will attempt to make an HTTP POST to the Matrix user's homeserver which looks roughly as below:: - POST https://bar.com:8448/_matrix/federation/%SERVER_MAJOR_VERSION%/3pid/onbind + POST https://bar.com:8448/_matrix/federation/v1/3pid/onbind Content-Type: application/json { diff --git a/specification/server_server_api.rst b/specification/server_server_api.rst index f91b71797..81fe301b3 100644 --- a/specification/server_server_api.rst +++ b/specification/server_server_api.rst @@ -132,8 +132,8 @@ Retrieving Server Keys specification due to lack of significance. It may be reviewed `here `_. -Each homeserver publishes its public keys under ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}``. -Homeservers query for keys by either getting ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}`` +Each homeserver publishes its public keys under ``/_matrix/key/v2/server/{keyId}``. +Homeservers query for keys by either getting ``/_matrix/key/v2/server/{keyId}`` directly or by querying an intermediate notary server using a ``/_matrix/key/v2/query/{serverName}/{keyId}`` API. Intermediate notary servers query the ``/_matrix/key/v2/server/{keyId}`` API on behalf of another server and @@ -152,7 +152,7 @@ Publishing Keys +++++++++++++++ Homeservers publish the allowed TLS fingerprints and signing keys in a JSON -object at ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{key_id}``. The response contains a list of +object at ``/_matrix/key/v2/server/{key_id}``. The response contains a list of ``verify_keys`` that are valid for signing federation requests made by the homeserver and for signing events. It contains a list of ``old_verify_keys`` which are only valid for signing events. Finally the response contains a list of TLS @@ -166,7 +166,7 @@ Querying Keys Through Another Server Servers may query another server's keys through a notary server. The notary server may be another homeserver. The notary server will retrieve keys from -the queried servers through use of the ``/_matrix/key/%KEYS_MAJOR_VERSION%/server/{keyId}`` +the queried servers through use of the ``/_matrix/key/v2/server/{keyId}`` API. The notary server will additionally sign the response from the queried server before returning the results. @@ -1115,7 +1115,7 @@ that are too long. known hash functions like SHA-256 when none of the keys have been redacted]] .. |/query/directory| replace:: ``/query/directory`` -.. _/query/directory: #get-matrix-federation-%SERVER_MAJOR_VERSION%-query-directory +.. _/query/directory: #get-matrix-federation-v1-query-directory .. _`Invitation storage`: ../identity_service/%IDENTITY_RELEASE_LABEL%.html#invitation-storage .. _`Identity Service API`: ../identity_service/%IDENTITY_RELEASE_LABEL%.html From f030d19f3c137be7d70319763c16c0eaee78fd39 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 20:57:41 -0600 Subject: [PATCH 11/22] Clean up identity service swagger * Add `consumes` (swagger) * Remove `http` as a supported scheme (the spec specifically says clients MUST use https) * Clarify various descriptions * Full stops * Additional wording * s/older versions/previous drafts - we haven't had a release yet * Indentation on examples --- api/identity/associations.yaml | 20 +++++++++++++------- api/identity/email_associations.yaml | 11 ++++++----- api/identity/invitation_signing.yaml | 19 ++++++++++--------- api/identity/lookup.yaml | 19 +++++++++++++------ api/identity/phone_associations.yaml | 11 +++++++---- api/identity/ping.yaml | 13 +++++++------ api/identity/pubkey.yaml | 7 ++++--- api/identity/store_invite.yaml | 13 ++++++++----- 8 files changed, 68 insertions(+), 45 deletions(-) diff --git a/api/identity/associations.yaml b/api/identity/associations.yaml index 4225919b1..a400bf953 100644 --- a/api/identity/associations.yaml +++ b/api/identity/associations.yaml @@ -18,15 +18,17 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: "/3pid/getValidated3pid": get: summary: Check whether ownership of a 3pid was validated. - description: A client can check whether ownership of a 3pid was validated + description: |- + Determines if a given 3pid has been validated by a user. operationId: getValidated3pid parameters: - in: query @@ -61,7 +63,9 @@ paths: description: The address of the 3pid being looked up. validated_at: type: integer - description: Timestamp indicating the time that the 3pid was validated. + description: |- + Timestamp, in milliseconds, indicating the time that the 3pid + was validated. required: ['medium', 'address', 'validated_at'] 400: description: |- @@ -78,7 +82,7 @@ paths: schema: $ref: "../client-server/definitions/errors/error.yaml" 404: - description: The Session ID or client secret were not found + description: The Session ID or client secret were not found. examples: application/json: { "errcode": "M_NO_VALID_SESSION", @@ -95,7 +99,7 @@ paths: Future calls to ``/lookup`` for any of the session\'s 3pids will return this association. - Note: for backwards compatibility with older versions of this + Note: for backwards compatibility with previous drafts of this specification, the parameters may also be specified as ``application/x-form-www-urlencoded`` data. However, this usage is deprecated. @@ -132,7 +136,6 @@ paths: "not_before": 1428825849161, "not_after": 4582425849161, "ts": 1428825849161, - "signatures": { "matrix.org": { "ed25519:0": "ENiU2YORYUJgE6WBMitU0mppbQjidDLanAusj8XS2nVRHPu+0t42OKA/r6zV6i2MzUbNQ3c3MiLScJuSsOiVDQ" @@ -162,7 +165,10 @@ paths: description: The unix timestamp at which the association was verified. signatures: type: object - description: The signatures of the verifying identity services which show that the association should be trusted, if you trust the verifying identity services. + description: |- + The signatures of the verifying identity services which show that the + association should be trusted, if you trust the verifying identity + services. $ref: "../../schemas/server-signatures.yaml" required: - address diff --git a/api/identity/email_associations.yaml b/api/identity/email_associations.yaml index 28f5e6809..dc3cd78eb 100644 --- a/api/identity/email_associations.yaml +++ b/api/identity/email_associations.yaml @@ -18,8 +18,9 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: @@ -34,13 +35,13 @@ paths: that that user was able to read the email for that email address, and so we validate ownership of the email address. - Note that Home Servers offer APIs that proxy this API, adding + Note that homeservers offer APIs that proxy this API, adding additional behaviour on top, for example, ``/register/email/requestToken`` is designed specifically for use when registering an account and therefore will inform the user if the email address given is already registered on the server. - Note: for backwards compatibility with older versions of this + Note: for backwards compatibility with previous drafts of this specification, the parameters may also be specified as ``application/x-form-www-urlencoded`` data. However, this usage is deprecated. @@ -58,7 +59,7 @@ paths: properties: client_secret: type: string - description: A unique string used to identify the validation attempt + description: A unique string used to identify the validation attempt. email: type: string description: The email address to validate. @@ -119,7 +120,7 @@ paths: associate the email address with any Matrix user ID. Specifically, calls to ``/lookup`` will not show a binding. - Note: for backwards compatibility with older versions of this + Note: for backwards compatibility with previous drafts of this specification, the parameters may also be specified as ``application/x-form-www-urlencoded`` data. However, this usage is deprecated. diff --git a/api/identity/invitation_signing.yaml b/api/identity/invitation_signing.yaml index 7de62dd41..0b76a773d 100644 --- a/api/identity/invitation_signing.yaml +++ b/api/identity/invitation_signing.yaml @@ -18,8 +18,9 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: @@ -29,7 +30,7 @@ paths: description: |- Sign invitation details. - The identity server will look up ``token`` which was stored in a call + The identity service will look up ``token`` which was stored in a call to ``store-invite``, and fetch the sender of the invite. operationId: blindlySignStuff parameters: @@ -38,24 +39,24 @@ paths: schema: type: object example: { - "mxid": "@foo:bar.com", - "token": "sometoken", - "private_key": "base64encodedkey" - } + "mxid": "@foo:bar.com", + "token": "sometoken", + "private_key": "base64encodedkey" + } properties: mxid: type: string description: The Matrix user ID of the user accepting the invitation. token: type: string - description: Token from the call to ``store-invite`` + description: The token from the call to ``store-invite``. private_key: type: string description: The private key, encoded as `Unpadded base64`_. required: ["mxid", "token", "private_key"] responses: 200: - description: The signedjson of the mxid, sender, and token. + description: The signed JSON of the mxid, sender, and token. schema: type: object properties: @@ -85,7 +86,7 @@ paths: "token": "abc123" } 404: - description: Token was not found. + description: The token was not found. examples: application/json: { "errcode": "M_UNRECOGNIZED", diff --git a/api/identity/lookup.yaml b/api/identity/lookup.yaml index f04436ef3..1870a31f9 100644 --- a/api/identity/lookup.yaml +++ b/api/identity/lookup.yaml @@ -1,6 +1,7 @@ # Copyright 2016 OpenMarket Ltd # Copyright 2017 Kamax.io # Copyright 2017 New Vector Ltd +# Copyright 2018 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,8 +21,9 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: @@ -46,7 +48,7 @@ paths: responses: 200: description: - The association for that 3pid, or the empty object if no association is known. + The association for that 3pid, or an empty object if no association is known. examples: application/json: { "address": "louise@bobs.burgers", @@ -66,10 +68,10 @@ paths: properties: address: type: string - description: The 3pid address of the user being looked up. + description: The 3pid address of the user being looked up, matching the address requested. medium: type: string - description: The literal string "email". + description: A medium from the `3PID Types`_ Appendix, matching the medium requested. mxid: type: string description: The Matrix user ID associated with the 3pid. @@ -126,7 +128,9 @@ paths: #- type: 3PID Address - type: string - type: string - description: an array of arrays containing the `3PID Types`_ with the ``medium`` in first position and the ``address`` in second position. + description: |- + An array of arrays containing the `3PID Types`_ with the ``medium`` + in first position and the ``address`` in second position. required: - "threepids" responses: @@ -157,6 +161,9 @@ paths: - type: string - type: string - type: string - description: an array of array containing the `3PID Types`_ with the ``medium`` in first position, the ``address`` in second position and Matrix ID in third position. + description: |- + An array of array containing the `3PID Types`_ with the ``medium`` + in first position, the ``address`` in second position and Matrix user + ID in third position. required: - "threepids" diff --git a/api/identity/phone_associations.yaml b/api/identity/phone_associations.yaml index f6b1bd45b..836984d02 100644 --- a/api/identity/phone_associations.yaml +++ b/api/identity/phone_associations.yaml @@ -18,8 +18,9 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: @@ -34,13 +35,13 @@ paths: indicates that that user was able to read the SMS for that phone number, and so we validate ownership of the phone number. - Note that Home Servers offer APIs that proxy this API, adding + Note that homeservers offer APIs that proxy this API, adding additional behaviour on top, for example, ``/register/msisdn/requestToken`` is designed specifically for use when registering an account and therefore will inform the user if the phone number given is already registered on the server. - Note: for backwards compatibility with older versions of this + Note: for backwards compatibility with previous drafts of this specification, the parameters may also be specified as ``application/x-form-www-urlencoded`` data. However, this usage is deprecated. @@ -106,6 +107,8 @@ paths: - ``M_INVALID_ADDRESS``: The phone number provided was invalid. - ``M_SEND_ERROR``: The validation SMS could not be sent. + - ``M_DESTINATION_REJECTED``: The identity service cannot deliver an + SMS to the provided country or region. examples: application/json: { "errcode": "M_INVALID_ADDRESS", @@ -125,7 +128,7 @@ paths: associate the phone number address with any Matrix user ID. Specifically, calls to ``/lookup`` will not show a binding. - Note: for backwards compatibility with older versions of this + Note: for backwards compatibility with previous drafts of this specification, the parameters may also be specified as ``application/x-form-www-urlencoded`` data. However, this usage is deprecated. diff --git a/api/identity/ping.yaml b/api/identity/ping.yaml index 005160a35..2788d9d32 100644 --- a/api/identity/ping.yaml +++ b/api/identity/ping.yaml @@ -1,4 +1,5 @@ # Copyright 2018 Kamax Sàrl +# Copyright 2018 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +15,7 @@ swagger: "2.0" info: - title: "Matrix Client-Identity Versions API" + title: "Matrix Identity Service Ping API" version: "1.0.0" host: localhost:8090 schemes: @@ -25,19 +26,19 @@ produces: paths: "/api/v1": get: - summary: Checks that an Identity server is available at this API endpopint. + summary: Checks that an Identity Service is available at this API endpoint. description: |- - Checks that an Identity server is available at this API endpopint. + Checks that an Identity Service is available at this API endpoint. - To discover that an Identity server is available at a specific URL, + To discover that an Identity Service is available at a specific URL, this endpoint can be queried and will return an empty object. This is primarly used for auto-discovery and health check purposes - by entities acting as a client for the Identity server. + by entities acting as a client for the Identity Service. operationId: ping responses: 200: - description: An Identity server is ready to serve requests. + description: An Identity Service is ready to serve requests. examples: application/json: {} schema: diff --git a/api/identity/pubkey.yaml b/api/identity/pubkey.yaml index 9cb7c74e9..6b17e7c64 100644 --- a/api/identity/pubkey.yaml +++ b/api/identity/pubkey.yaml @@ -18,8 +18,9 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: @@ -113,8 +114,8 @@ paths: The validity of the public key. examples: application/json: { - "valid": true - } + "valid": true + } schema: type: object properties: diff --git a/api/identity/store_invite.yaml b/api/identity/store_invite.yaml index 1eca7198e..89d437a47 100644 --- a/api/identity/store_invite.yaml +++ b/api/identity/store_invite.yaml @@ -18,16 +18,17 @@ info: host: localhost:8090 schemes: - https - - http basePath: /_matrix/identity/api/v1 +consumes: + - application/json produces: - application/json paths: "/store-invite": post: - summary: Store pending invitations to a user\'s 3pid. + summary: Store pending invitations to a user's 3pid. description: |- - Store pending invitations to a user\'s 3pid. + Store pending invitations to a user's 3pid. In addition to the request parameters specified below, an arbitrary number of other parameters may also be specified. These may be used in @@ -47,6 +48,8 @@ paths: Also, the generated ephemeral public key will be listed as valid on requests to ``/_matrix/identity/api/v1/pubkey/ephemeral/isvalid``. + + Currently, invites may only be issued for 3pids of the ``email`` medium. operationId: storeInvite parameters: - in: body @@ -84,7 +87,7 @@ paths: description: The generated token. public_keys: type: array - description: A list of [server\'s long-term public key, generated ephemeral public key]. + description: A list of [server's long-term public key, generated ephemeral public key]. items: type: string display_name: @@ -111,7 +114,7 @@ paths: application/json: { "errcode": "M_THREEPID_IN_USE", "error": "Binding already known", - "mxid": mxid + "mxid": "@alice:example.com" } schema: $ref: "../client-server/definitions/errors/error.yaml" From bbba7dedd6db353787646c490d3480bc73140470 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 21:00:47 -0600 Subject: [PATCH 12/22] Clean up identity service RST * Title casing * s/identity server/identity service * Rough column limit enforcement * Add some links (used by future commits) --- specification/identity_service_api.rst | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index 7bbd8ae8c..e842f877c 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -1,6 +1,7 @@ .. Copyright 2016 OpenMarket Ltd .. Copyright 2017 Kamax.io .. Copyright 2017 New Vector Ltd +.. Copyright 2018 New Vector Ltd .. .. Licensed under the Apache License, Version 2.0 (the "License"); .. you may not use this file except in compliance with the License. @@ -56,7 +57,7 @@ is left as an exercise for the client. 3PID types are described in `3PID Types`_ Appendix. -API Standards +API standards ------------- The mandatory baseline for identity service communication in Matrix is exchanging @@ -146,25 +147,24 @@ Key management An identity service has some long-term public-private keypairs. These are named in a scheme ``algorithm:identifier``, e.g. ``ed25519:0``. When signing an -association, the Matrix standard JSON signing format is used, as specified in -the server-server API specification under the heading "Signing Events". +association, the standard `Signing JSON`_ algorithm applies. In the event of key compromise, the identity service may revoke any of its keys. An HTTP API is offered to get public keys, and check whether a particular key is valid. -The identity server may also keep track of some short-term public-private +The identity service may also keep track of some short-term public-private keypairs, which may have different usage and lifetime characteristics than the service's long-term keys. {{pubkey_is_http_api}} -Association Lookup +Association lookup ------------------ {{lookup_is_http_api}} -Establishing Associations +Establishing associations ------------------------- The flow for creating an association is session-based. @@ -198,7 +198,7 @@ General {{associations_is_http_api}} -Invitation Storage +Invitation storage ------------------ An identity service can store pending invitations to a user's 3pid, which will @@ -241,10 +241,14 @@ Where the signature is produced using a long-term private key. Ephemeral invitation signing ---------------------------- -To aid clients who may not be able to perform crypto themselves, the identity service offers some crypto functionality to help in accepting invitations. -This is less secure than the client doing it itself, but may be useful where this isn't possible. +To aid clients who may not be able to perform crypto themselves, the identity +service offers some crypto functionality to help in accepting invitations. +This is less secure than the client doing it itself, but may be useful where +this isn't possible. {{invitation_signing_is_http_api}} .. _`Unpadded Base64`: ../appendices.html#unpadded-base64 .. _`3PID Types`: ../appendices.html#pid-types +.. _`Signing JSON`: ../appendices.html#signing-json +.. _`/3pid/onbind`: ../server_server.html#put-matrix-federation-v1-3pid-onbind From 039cefdbeaedcc3ab51746555c55a9dbb2509613 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 21:01:14 -0600 Subject: [PATCH 13/22] Say that identity services should be nice to web browsers (CORS/OPTIONS) --- specification/identity_service_api.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index e842f877c..ea6077990 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -137,6 +137,22 @@ should allow a 3pid to be mapped to a Matrix user identity, but not in the other direction (i.e. one should not be able to get all 3pids associated with a Matrix user ID, or get all 3pids associated with a 3pid). +Web browser clients +------------------- + +It is realistic to expect that some clients will be written to be run within a web +browser or similar environment. In these cases, the identity service should respond to +pre-flight requests and supply Cross-Origin Resource Sharing (CORS) headers on all +requests. + +When a client approaches the server with a pre-flight (OPTIONS) request, the server +should respond with the CORS headers for that route. The recommended CORS headers +to be returned by servers on all requests are:: + + Access-Control-Allow-Origin: * + Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS + Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization + Status check ------------ From 0387da51e268ce79f0c27fa6e8cb7ea444ff6515 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 21:01:28 -0600 Subject: [PATCH 14/22] Clarify how sessions work when establishing associations --- specification/identity_service_api.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index ea6077990..ab7c9b0cb 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -199,6 +199,12 @@ session, within a 24 hour period since its most recent modification. Any attempts to perform these actions after the expiry will be rejected, and a new session should be created and used instead. +To start a session, the client makes a request to the appropriate ``/requestToken`` +endpoint. The user then receives a validation token which should be provided +to the client. The client then provides the token to the appropriate ``/submitToken`` +endpoint, completing the session. At this point, the client should ``/bind`` the +third party identifier or leave it for another entity to bind. + Email associations ~~~~~~~~~~~~~~~~~~ From dc602b74d2feae8fcc50463c790014bfdf96da9a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 29 Aug 2018 21:01:49 -0600 Subject: [PATCH 15/22] Reference the server-server specification for /onbind --- specification/identity_service_api.rst | 34 +++----------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index ab7c9b0cb..f6997ea17 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -227,36 +227,10 @@ An identity service can store pending invitations to a user's 3pid, which will be retrieved and can be either notified on or look up when the 3pid is associated with a Matrix user ID. -At a later point, if the owner of that particular 3pid binds it with a Matrix user ID, the identity server will attempt to make an HTTP POST to the Matrix user's homeserver which looks roughly as below:: - - POST https://bar.com:8448/_matrix/federation/v1/3pid/onbind - Content-Type: application/json - - { - "medium": "email", - "address": "foo@bar.baz", - "mxid": "@alice:example.tld", - "invites": [ - { - "medium": "email", - "address": "foo@bar.baz", - "mxid": "@alice:example.tld", - "room_id": "!something:example.tld", - "sender": "@bob:example.tld", - "signed": { - "mxid": "@alice:example.tld", - "signatures": { - "vector.im": { - "ed25519:0": "somesignature" - } - }, - "token": "sometoken" - } - } - ] - } - -Where the signature is produced using a long-term private key. +At a later point, if the owner of that particular 3pid binds it with a Matrix user +ID, the identity service will attempt to make an HTTP POST to the Matrix user's +homeserver via the `/3pid/onbind`_ endpoint. The request MUST be signed with a +long-term private key for the identity service. {{store_invite_is_http_api}} From 55c4307f1291cb6aab353da8cf2e403eb2bc9a6c Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 30 Aug 2018 14:37:24 +0100 Subject: [PATCH 16/22] Rewrite the section on signing events ... for clarity and de-duplication. And to say a bit about validating the signatures. --- api/server-server/definitions/pdu.yaml | 3 +- .../definitions/unsigned_pdu.yaml | 6 +- specification/server_server_api.rst | 185 ++++++++---------- 3 files changed, 85 insertions(+), 109 deletions(-) diff --git a/api/server-server/definitions/pdu.yaml b/api/server-server/definitions/pdu.yaml index bb14ede27..d86b85384 100644 --- a/api/server-server/definitions/pdu.yaml +++ b/api/server-server/definitions/pdu.yaml @@ -23,7 +23,8 @@ allOf: hashes: type: object title: Event Hash - description: Hashes of the PDU, following the algorithm specified in `Signing Events`_. + description: |- + Content hashes of the PDU, following the algorithm specified in `Signing Events`_. example: { "sha256": "thishashcoversallfieldsincasethisisredacted" } diff --git a/api/server-server/definitions/unsigned_pdu.yaml b/api/server-server/definitions/unsigned_pdu.yaml index 64991d227..446973ed0 100644 --- a/api/server-server/definitions/unsigned_pdu.yaml +++ b/api/server-server/definitions/unsigned_pdu.yaml @@ -55,8 +55,8 @@ properties: prev_events: type: array description: |- - Event IDs and hashes of the most recent events in the room that the homeserver was aware - of when it made this event. + Event IDs and reference hashes for the most recent events in the room + that the homeserver was aware of when it made this event. items: type: array maxItems: 2 @@ -86,7 +86,7 @@ properties: auth_events: type: array description: |- - An event reference list containing the authorization events that would + Event IDs and reference hashes for the authorization events that would allow this event to be in the room. items: type: array diff --git a/specification/server_server_api.rst b/specification/server_server_api.rst index 244a8b82e..e55b8113e 100644 --- a/specification/server_server_api.rst +++ b/specification/server_server_api.rst @@ -112,7 +112,7 @@ Server implementation {{version_ss_http_api}} -Retrieving Server Keys +Retrieving server keys ~~~~~~~~~~~~~~~~~~~~~~ .. NOTE:: @@ -965,142 +965,114 @@ Signing Events Signing events is complicated by the fact that servers can choose to redact non-essential parts of an event. -Before signing the event, the ``unsigned`` and ``signature`` members are -removed, it is encoded as `Canonical JSON`_, and then hashed using SHA-256. The -resulting hash is then stored in the event JSON in a ``hash`` object under a -``sha256`` key. +Adding hashes and signatures to outgoing events +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code:: python - - def hash_event(event_json_object): - - # Keys under "unsigned" can be modified by other servers. - # They are useful for conveying information like the age of an - # event that will change in transit. - # Since they can be modifed we need to exclude them from the hash. - unsigned = event_json_object.pop("unsigned", None) - - # Signatures will depend on the current value of the "hashes" key. - # We cannot add new hashes without invalidating existing signatures. - signatures = event_json_object.pop("signatures", None) +Before signing the event, the *content hash* of the event is calculated as +described below. The hash is encoded using `Unpadded Base64`_ and stored in the +event object, in a ``hashes`` object, under a ``sha256`` key. - # The "hashes" key might contain multiple algorithms if we decide to - # migrate away from SHA-2. We don't want to include an existing hash - # output in our hash so we exclude the "hashes" dict from the hash. - hashes = event_json_object.pop("hashes", {}) - - # Encode the JSON using a canonical encoding so that we get the same - # bytes on every server for the same JSON object. - event_json_bytes = encode_canonical_json(event_json_bytes) +The event object is then *redacted*, following the `redaction +algorithm`_. Finally it is signed as described in `Signing JSON`_, using the +server's signing key (see also `Retrieving server keys`_). - # Add the base64 encoded bytes of the hash to the "hashes" dict. - hashes["sha256"] = encode_base64(sha256(event_json_bytes).digest()) +The signature is then copied back to the original event object. - # Add the "hashes" dict back the event JSON under a "hashes" key. - event_json_object["hashes"] = hashes - if unsigned is not None: - event_json_object["unsigned"] = unsigned - return event_json_object +See `Persistent Data Unit schema`_ for an example of a signed event. -The event is then stripped of all non-essential keys both at the top level and -within the ``content`` object. Any top-level keys not in the following list -MUST be removed: -.. code:: +Validating hashes and signatures on received events +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When a server receives an event over federation from another server, the +receiving server should check the hashes and signatures on that event. - auth_events - depth - event_id - hashes - membership - origin - origin_server_ts - prev_events - prev_state - room_id - sender - signatures - state_key - type - -A new ``content`` object is constructed for the resulting event that contains -only the essential keys of the original ``content`` object. If the original -event lacked a ``content`` object at all, a new empty JSON object is created -for it. - -The keys that are considered essential for the ``content`` object depend on the -the ``type`` of the event. These are: +First the signature is checked. The event is redacted following the `redaction +algorithm`_, and the resultant object is checked for a signature from the +originating server, following the algorithm described in `Checking for a signature`_. +Note that this step should succeed whether we have been sent the full event or +a redacted copy. -.. code:: +If the signature is found to be valid, the expected content hash is calculated +as described below. The content hash in the ``hashes`` property of the received +event is base64-decoded, and the two are compared for equality. - type is "m.room.aliases": - aliases +If the hash check fails, then it is assumed that this is because we have only +been given a redacted version of the event. To enforce this, the receiving +server should use the redacted copy it calculated rather than the full copy it +received. - type is "m.room.create": - creator +Calculating the content hash for an event +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - type is "m.room.history_visibility": - history_visibility +The *content hash* of an event covers the complete event including the +*unredacted* contents. It is calculated as follows. - type is "m.room.join_rules": - join_rule +First, any existing ``unsigned``, ``signature``, and ``hashes`` members are +removed. The resulting object is then encoded as `Canonical JSON`_, and the +JSON is hashed using SHA-256. - type is "m.room.member": - membership - type is "m.room.power_levels": - ban - events - events_default - kick - redact - state_default - users - users_default - -The resulting stripped object with the new ``content`` object and the original -``hashes`` key is then signed using the JSON signing algorithm outlined below: +Example code +~~~~~~~~~~~~ .. code:: python - def sign_event(event_json_object, name, key): - - # Make sure the event has a "hashes" key. - if "hashes" not in event_json_object: - event_json_object = hash_event(event_json_object) + def hash_and_sign_event(event_object, signing_key, signing_name): + # First we need to hash the event object. + content_hash = compute_content_hash(event_object) + event_object["hashes"] = {"sha256": encode_unpadded_base64(content_hash)} # Strip all the keys that would be removed if the event was redacted. # The hashes are not stripped and cover all the keys in the event. # This means that we can tell if any of the non-essential keys are # modified or removed. - stripped_json_object = strip_non_essential_keys(event_json_object) + stripped_object = strip_non_essential_keys(event_object) # Sign the stripped JSON object. The signature only covers the # essential keys and the hashes. This means that we can check the # signature even if the event is redacted. - signed_json_object = sign_json(stripped_json_object) + signed_object = sign_json(stripped_object, signing_key, signing_name) # Copy the signatures from the stripped event to the original event. - event_json_object["signatures"] = signed_json_oject["signatures"] - return event_json_object + event_object["signatures"] = signed_object["signatures"] -Servers can then transmit the entire event or the event with the non-essential -keys removed. If the entire event is present, receiving servers can then check -the event by computing the SHA-256 of the event, excluding the ``hash`` object. -If the keys have been redacted, then the ``hash`` object is included when -calculating the SHA-256 hash instead. + def compute_content_hash(event_object): + # take a copy of the event before we remove any keys. + event_object = dict(event_object) -New hash functions can be introduced by adding additional keys to the ``hash`` -object. Since the ``hash`` object cannot be redacted a server shouldn't allow -too many hashes to be listed, otherwise a server might embed illict data within -the ``hash`` object. For similar reasons a server shouldn't allow hash values -that are too long. + # Keys under "unsigned" can be modified by other servers. + # They are useful for conveying information like the age of an + # event that will change in transit. + # Since they can be modifed we need to exclude them from the hash. + event_object.pop("unsigned", None) + + # Signatures will depend on the current value of the "hashes" key. + # We cannot add new hashes without invalidating existing signatures. + event_object.pop("signatures", None) + + # The "hashes" key might contain multiple algorithms if we decide to + # migrate away from SHA-2. We don't want to include an existing hash + # output in our hash so we exclude the "hashes" dict from the hash. + event_object.pop("hashes", None) + + # Encode the JSON using a canonical encoding so that we get the same + # bytes on every server for the same JSON object. + event_json_bytes = encode_canonical_json(event_object) + + return hashlib.sha256(event_json_bytes) .. TODO - [[TODO(markjh): We might want to specify a maximum number of keys for the - ``hash`` and we might want to specify the maximum output size of a hash]] - [[TODO(markjh) We might want to allow the server to omit the output of well - known hash functions like SHA-256 when none of the keys have been redacted]] + + [[TODO(markjh): Since the ``hash`` object cannot be redacted a server + shouldn't allow too many hashes to be listed, otherwise a server might embed + illict data within the ``hash`` object. + + We might want to specify a maximum number of keys for the + ``hash`` and we might want to specify the maximum output size of a hash]] + + [[TODO(markjh) We might want to allow the server to omit the output of well + known hash functions like SHA-256 when none of the keys have been redacted]] + .. |/query/directory| replace:: ``/query/directory`` .. _/query/directory: #get-matrix-federation-v1-query-directory @@ -1111,3 +1083,6 @@ that are too long. .. _`Inviting to a room`: #inviting-to-a-room .. _`Canonical JSON`: ../appendices.html#canonical-json .. _`Unpadded Base64`: ../appendices.html#unpadded-base64 +.. _`redaction algorithm`: ../client_server/unstable.html#redactions +.. _`Signing JSON`: ../appendices.html#signing-json +.. _`Checking for a signature`: ../appendices.html#checking-for-a-signature From 6aacec317867b64a6a00994ad8b222e0666c3e30 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 Aug 2018 11:40:08 -0600 Subject: [PATCH 17/22] Fix power level JSON example --- event-schemas/examples/m.room.power_levels | 1 + 1 file changed, 1 insertion(+) diff --git a/event-schemas/examples/m.room.power_levels b/event-schemas/examples/m.room.power_levels index b09746dfb..ad741e88e 100644 --- a/event-schemas/examples/m.room.power_levels +++ b/event-schemas/examples/m.room.power_levels @@ -20,4 +20,5 @@ "notifications": { "room": 20 } + } } From 31ea4279d1fb776a0734eb47a28368330f895ce4 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 Aug 2018 11:53:39 -0600 Subject: [PATCH 18/22] Resolve references in the check_examples script --- event-schemas/check_examples.py | 47 ++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/event-schemas/check_examples.py b/event-schemas/check_examples.py index f2456d97e..be541aa97 100755 --- a/event-schemas/check_examples.py +++ b/event-schemas/check_examples.py @@ -44,16 +44,51 @@ except ImportError as e: raise +def load_file(path): + print("Loading reference: %s" % path) + if not path.startswith("file://"): + raise Exception("Bad ref: %s" % (path,)) + path = path[len("file://"):] + with open(path, "r") as f: + if path.endswith(".json"): + return json.load(f) + else: + # We have to assume it's YAML because some of the YAML examples + # do not have file extensions. + return yaml.load(f) + + +def resolve_references(path, schema): + if isinstance(schema, dict): + # do $ref first + if '$ref' in schema: + value = schema['$ref'] + path = os.path.abspath(os.path.join(os.path.dirname(path), value)) + ref = load_file("file://" + path) + result = resolve_references(path, ref) + del schema['$ref'] + else: + result = {} + + for key, value in schema.items(): + result[key] = resolve_references(path, value) + return result + elif isinstance(schema, list): + return [resolve_references(path, value) for value in schema] + else: + return schema + + def check_example_file(examplepath, schemapath): with open(examplepath) as f: - example = yaml.load(f) + example = resolve_references(examplepath, json.load(f)) with open(schemapath) as f: schema = yaml.load(f) fileurl = "file://" + os.path.abspath(schemapath) schema["id"] = fileurl - resolver = jsonschema.RefResolver(schemapath, schema, handlers={"file": load_yaml}) + resolver = jsonschema.RefResolver(schemapath, schema, handlers={"file": load_file}) print ("Checking schema for: %r %r" % (examplepath, schemapath)) try: @@ -85,14 +120,6 @@ def check_example_dir(exampledir, schemadir): raise ValueError("Error validating examples") -def load_yaml(path): - if not path.startswith("file:///"): - raise Exception("Bad ref: %s" % (path,)) - path = path[len("file://"):] - with open(path, "r") as f: - return yaml.load(f) - - if __name__ == '__main__': try: check_example_dir("examples", "schema") From c8a8f13623e8022f1eaa17f5dc76995d3366cbbb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 Aug 2018 11:57:01 -0600 Subject: [PATCH 19/22] Don't check the underlying definitions Otherwise the script will try to find a schema for our templates, which don't exist. --- event-schemas/check_examples.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/event-schemas/check_examples.py b/event-schemas/check_examples.py index be541aa97..deb0433e5 100755 --- a/event-schemas/check_examples.py +++ b/event-schemas/check_examples.py @@ -106,6 +106,9 @@ def check_example_dir(exampledir, schemadir): if filename.startswith("."): # Skip over any vim .swp files. continue + if os.dirname(os.path.join(root, filename)) == "core": + # Skip checking the underlying definitions + continue examplepath = os.path.join(root, filename) schemapath = examplepath.replace(exampledir, schemadir) if schemapath.find("#") >= 0: From 464f4f5f2166608f573afb95a2299381f9ab477b Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 Aug 2018 12:05:56 -0600 Subject: [PATCH 20/22] Correctly check for the 'core' folder --- event-schemas/check_examples.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event-schemas/check_examples.py b/event-schemas/check_examples.py index deb0433e5..3e536ec3b 100755 --- a/event-schemas/check_examples.py +++ b/event-schemas/check_examples.py @@ -106,7 +106,8 @@ def check_example_dir(exampledir, schemadir): if filename.startswith("."): # Skip over any vim .swp files. continue - if os.dirname(os.path.join(root, filename)) == "core": + cwd = os.path.basename(os.path.dirname(os.path.join(root, filename))) + if cwd == "core": # Skip checking the underlying definitions continue examplepath = os.path.join(root, filename) From 32cde24bcfdc9bc63fef0658b1669e1828cb0a2c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 Aug 2018 12:26:24 -0600 Subject: [PATCH 21/22] Fix server-server link in IS spec --- specification/identity_service_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/identity_service_api.rst b/specification/identity_service_api.rst index f6997ea17..e233e4fc0 100644 --- a/specification/identity_service_api.rst +++ b/specification/identity_service_api.rst @@ -247,4 +247,4 @@ this isn't possible. .. _`Unpadded Base64`: ../appendices.html#unpadded-base64 .. _`3PID Types`: ../appendices.html#pid-types .. _`Signing JSON`: ../appendices.html#signing-json -.. _`/3pid/onbind`: ../server_server.html#put-matrix-federation-v1-3pid-onbind +.. _`/3pid/onbind`: ../server_server/unstable.html#put-matrix-federation-v1-3pid-onbind From 429f30274495bf4fee8c9e0d841db57466fcdfda Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 Aug 2018 13:32:53 -0600 Subject: [PATCH 22/22] Add an `age` to the invite room state example --- event-schemas/examples/m.room.member#invite_room_state | 1 + 1 file changed, 1 insertion(+) diff --git a/event-schemas/examples/m.room.member#invite_room_state b/event-schemas/examples/m.room.member#invite_room_state index cbd76100e..c99c66c0f 100644 --- a/event-schemas/examples/m.room.member#invite_room_state +++ b/event-schemas/examples/m.room.member#invite_room_state @@ -6,6 +6,7 @@ "displayname": "Alice Margatroid" }, "unsigned": { + "age": 1234, "invite_room_state": [ { "type": "m.room.name",