Commit graph

697 commits

Author SHA1 Message Date
Travis Ralston
e10770ae8b
Merge pull request #1475 from turt2live/travis/s2s/event-auth
Document /event_auth and /query_auth
2018-08-07 08:30:22 -06:00
Travis Ralston
13a2b54bf9 query_auth consumes JSON 2018-08-03 13:57:43 -06:00
Travis Ralston
73958ecbff Document /event_auth and /query_auth
/event_auth is a fairly easy endpoint to determine the use case of. /query_auth is a little harder to investigate and has a fairly interesting purpose: it appears to be used for the sending server to admit defeat and shop around for the right auth chain, correcting it's own perspective as it goes.

/query_auth is based off the following research points in synapse:
* 43ecfe0b10/synapse/handlers/federation.py (L1947-L1990)
* 43ecfe0b10/synapse/handlers/federation.py (L2049-L2187)
* 43ecfe0b10/synapse/handlers/federation.py (L1716-L1761)
* 43ecfe0b10/synapse/federation/federation_server.py (L393-L446)
* https://github.com/matrix-org/synapse/blob/master/synapse/federation/transport/server.py#L482-L487
2018-08-03 09:27:19 -06:00
Travis Ralston
6b67d501e4
Merge branch 'master' into travis/s2s/query 2018-08-03 08:55:21 -06:00
Travis Ralston
1578da453b
Merge branch 'master' into travis/s2s/get-event 2018-08-03 08:01:43 -06:00
Travis Ralston
86d7f42173
Merge pull request #1455 from turt2live/travis/s2s/leaving-rooms
Document how leaving rooms/rejecting invites over federation works
2018-08-03 08:00:56 -06:00
Travis Ralston
d48f1e1713
Merge pull request #1461 from turt2live/travis/s2s/transactions
Improve documentation on how Transactions work
2018-08-03 07:38:45 -06:00
Travis Ralston
e766606f24 join -> leave 2018-08-02 18:54:12 -06:00
Travis Ralston
0b313dbdd9 Don't explain what a 400 Bad Request is 2018-08-02 18:47:17 -06:00
Travis Ralston
05bb7e1050 Spelling and word choice 2018-08-02 18:45:59 -06:00
Travis Ralston
53d4003d3a manual merge of master into travis/s2s/query 2018-08-02 16:48:32 -06:00
Travis Ralston
48972addbf
Merge pull request #1428 from turt2live/travis/s2s/joining-rooms
Improve the documentation for joining rooms
2018-08-02 16:44:31 -06:00
Travis Ralston
5596243add origin is required 2018-08-02 16:43:24 -06:00
Travis Ralston
8b7bc60367 list -> array 2018-08-02 16:42:03 -06:00
Travis Ralston
9d474bb819 Document event retrieval endpoints in more detail
This also adds a previously-undocumented endpoint: /state_ids

Backfill is technically not part of this section, however it is being left untouched to make the merge with #1469 easier (which moves it out of the file).

Reference material:
* Some calls to synapse on these endpoints with a relatively simple private room.
2018-08-02 12:44:54 -06:00
Travis Ralston
b96ee3e393
Merge pull request #1423 from turt2live/travis/s2s/keys
Improve the server key exchange portion of the s2s specification
2018-08-01 07:44:57 -06:00
Andrew Morgan
54a88eebf0
Merge pull request #1414 from matrix-org/anoa/third_party_cleanup
Clarification on third party fields
2018-08-01 01:38:01 -07:00
Travis Ralston
f5af4d2fb5
Merge pull request #1457 from matrix-org/dbkr/fix_room_tags
Fix room tags spec
2018-07-30 17:06:54 -06:00
Travis Ralston
7679b4f1d1 Improve documentation on how Transactions work
The response is based upon various sections of the Synapse code in how it generates a response.

There are no new fields added to the transaction. Originally, `previous_ids` and `pdu_failures` were to be documented however neither of these are used in the real world.
2018-07-30 16:58:13 -06:00
user
5f8967c074 Move TODO. field1, field2... -> fields... 2018-07-30 19:21:54 +01:00
user
a2e2ced03b Add reverse-lookup examples. 2018-07-30 11:12:05 +01:00
user
d785ac78a3 Remove explode and replace with TODO, require auth on CS 2018-07-30 11:12:05 +01:00
Andrew Morgan
53137a3c53 c/p bug, fix operationIds, move rst docs to md 2018-07-30 11:09:50 +01:00
Andrew Morgan
3e4962f211 Document standardized extensions to OpenAPI v2 2018-07-30 11:09:50 +01:00
Andrew Morgan
273acb277c Change fields to use new extended query array syntax 2018-07-30 11:09:50 +01:00
Andrew Morgan
0ff882fb3b Field definitions for protocol metadata 2018-07-30 11:09:50 +01:00
Kitsune Ral
346db48588 Revert giving get() a default
As per the PR review.

Signed-off-by: Alexey Rusakov <Alexey.Rusakov@pm.me>
2018-07-29 14:04:07 +09:00
Kitsune Ral
c6bfac41c5 Bypass jsonschema references resolver
jsonschema's resolver doesn't work with local files on Windows.
resolve_references only works with the local files (on Windows as well)
but that's exactly what's needed for the case (as long as we don't have
remote references, that is).

Signed-off-by: Alexey Rusakov <Alexey.Rusakov@pm.me>
2018-07-29 12:40:19 +09:00
Kitsune Ral
d17ec7f184 Check that path starts with file://, not file:///
Because file:/// is not a thing on Windows.
2018-07-29 12:40:18 +09:00
Kitsune Ral
2c9f00d37a Follow PEP 8 2018-07-29 12:40:17 +09:00
Kitsune Ral
31687608dc Factor out common code 2018-07-29 12:40:16 +09:00
Travis Ralston
73b0a03b9b Remove more padding 2018-07-27 08:39:15 -06:00
David Baker
5ddf5374db Missing comma 2018-07-27 12:24:29 +01:00
David Baker
e4fd088fcc Fix room tags spec 2018-07-27 12:05:30 +01:00
Travis Ralston
cafd1a9ab3 Use more modern timestamps 2018-07-26 16:46:33 -06:00
Travis Ralston
e27f4a69a0 Key versions must be [0-9a-zA-Z_] 2018-07-26 16:46:13 -06:00
Travis Ralston
bdccfca726 Timestamps should be in milliseconds 2018-07-26 16:43:43 -06:00
Travis Ralston
cad1db2a14 Unpadded means unpadded 2018-07-26 16:43:16 -06:00
Travis Ralston
9dbb627d7b Undo accidental changes to the operation ID 2018-07-26 16:42:40 -06:00
Travis Ralston
2f71703427 Deprecate key ID querying 2018-07-26 16:42:21 -06:00
Travis Ralston
9fdd8a6f96 Document how leaving rooms/rejecting invites over federation works
Fixes https://github.com/matrix-org/matrix-doc/issues/1401

This is very similar to the joining rooms handshake, and much of it is a near copy/paste of the make_join and send_join API. The major difference is the send_leave API doesn't return anything.

References:
* Handling of make_leave: d69decd5c7/synapse/handlers/federation.py (L1285-L1310)
* send_leave route: d69decd5c7/synapse/federation/transport/client.py (L267)
* make_leave route: d69decd5c7/synapse/federation/transport/server.py (L396)
* send_leave returning nothing: d69decd5c7/synapse/handlers/federation.py (L1346)
2018-07-26 14:59:43 -06:00
Travis Ralston
c2f1c6e78d Improve the joining rooms handshake documentation
There isn't a whole lot to this section that needed work. The section overall lost the table schema in favour of having the endpoints close by.

The directory query is improved in https://github.com/matrix-org/matrix-doc/pull/1443
2018-07-26 08:43:08 -06:00
Travis Ralston
8e97b0ca81 Improve the server key exchange portion of the s2s specification
Most of the text has been shuffled into the swagger definitions to bring it closer to where it matters.

This also attempts to clarify what is out in the wild. Most importantly, the first version of the key exchange is outright removed from the specification. Other research points/questions are:

* What is a "Key ID"?
  * 1241156c82/synapse/rest/key/v2/local_key_resource.py (L81-L83)
  * 1241156c82/synapse/rest/key/v2/local_key_resource.py (L88-L91)
* Returning a cached response if the server throws a 400, 500, or otherwise not-offline status code
  * 1241156c82/synapse/rest/key/v2/remote_key_resource.py (L227-L229)
* `minimum_valid_until_ts` default
  * This branch of the ladder: 1241156c82/synapse/rest/key/v2/remote_key_resource.py (L192)
* Returning empty arrays when querying offline/no servers
  * Queried by hand against matrix.org as a notary server with a fake domain name to query
* Returning all keys even when querying for specific keys
  * Queried by hand using matrix.org as a notary server against a server publishing multiple keys.

The examples and descriptions were also improved as part of this commit.
2018-07-26 08:41:00 -06:00
Travis Ralston
d914c402e2 Improve the profile query to have more sane responses
This is a mix of Synapse and Dendrite behaviour, mostly Dendrite. Synapse returns `null` for field values that aren't set, however Dendrite just doesn't return them and instead opts for an empty object.

Further, synapse is lacking in error codes in this area. Dendrite does some additional validation on this API which introduces more errors for bad requests, instead of defaulting to empty objects/200 OK responses.

Likewise, Dendrite returns a 404 when the user is not found while Synapse returns 200 OK/empty object.
2018-07-26 08:40:39 -06:00
Travis Ralston
0ddf578b61 Combine all queries into their own section
This removes the Directory and Profile sections, instead opting to document them as Queries. 

The behaviour of profile queries is based on Synapse's behaviour. A few issues have been opened to improve the behaviour:
* https://github.com/matrix-org/matrix-doc/issues/1434
* https://github.com/matrix-org/matrix-doc/issues/1435
* https://github.com/matrix-org/matrix-doc/issues/1436
* https://github.com/matrix-org/matrix-doc/issues/1437

This fixes https://github.com/matrix-org/matrix-doc/issues/1404
2018-07-26 08:40:39 -06:00
Travis Ralston
b0744aa1e9
Merge pull request #1413 from turt2live/travis/s2s/join-swagger
Convert joins/invites to swagger
2018-07-26 08:39:26 -06:00
Travis Ralston
af0629a520 Full stop 2018-07-26 08:36:12 -06:00
Travis Ralston
9f399a08fe Full stops
I'm never going to remember these
2018-07-24 14:41:42 -06:00
Travis Ralston
0d1b82a601 Add the event_id to unsigned PDUs
This went missing in the swagger conversion. The example already has an event_id.
2018-07-24 14:40:32 -06:00
Travis Ralston
eaf175056f Full stops 2018-07-24 10:58:15 -06:00