Commit graph

1042 commits

Author SHA1 Message Date
Neil Alexander a6511677b5
Merge branch 'master' into neilalexander/config 2020-08-05 11:11:40 +01:00
Neil Alexander 15dc1f4d03
Use TransactionWriter in SQLite keyserver (#1239)
* Use TransactionWriter in SQLite keyserver

* Fix keyserver storage tests
2020-08-05 11:01:37 +01:00
Neil Alexander 22f028e141
SelectJoinedHostsForRooms should use QueryVariadic on SQLite (#1238)
* SelectJoinedHostsForRooms should use QueryVariadic on SQLite

* Fix strings.Replace

* Fix statement
2020-08-05 10:00:35 +01:00
Neil Alexander 6d3eb55b45
Set Listen address for all services in HTTP monolith mode 2020-08-04 16:43:05 +01:00
Neil Alexander c00bcb3826
Fix gobind build 2020-08-04 14:12:50 +01:00
Neil Alexander 9c2c19679d
Fix federation sender build 2020-08-04 14:08:13 +01:00
Neil Alexander 3ec01bdb63
Merge branch 'master' into neilalexander/config 2020-08-04 14:04:04 +01:00
Kegan Dougal 2197e54441 Update whitelist 2020-08-04 13:50:32 +01:00
Kegan Dougal 3c8e9d1d20 Bump to gmsl version which fixes outbound fed invites to synapse 2020-08-04 13:48:57 +01:00
Kegan Dougal 8ee4c0f71e Always set invite_room_state else synapse rejects invites 2020-08-04 12:14:18 +01:00
Kegan Dougal 4cf7c08146 Fix response format for federation /devices requests 2020-08-04 12:02:13 +01:00
Kegan Dougal 78ab33f91f Unbreak postgres 2020-08-04 11:41:48 +01:00
Kegsay 0c4e8f6d4f
Send device list updates to servers (outbound only) (#1237)
* Add QueryDeviceMessages to serve up device keys and stream IDs

* Consume key change events in fedsender

Don't yet send them to destinations as we haven't worked them out yet

* Send device list updates to all required servers

* Glue it all together
2020-08-04 11:32:14 +01:00
Neil Alexander 47a1ae2c33
Fix unit tests 2020-08-04 09:56:22 +01:00
Neil Alexander cc1d01cd28
Merge branch 'master' into neilalexander/config 2020-08-04 09:43:02 +01:00
Kegsay fb56bbf0b7
Generate stream IDs for locally uploaded device keys (#1236)
* Breaking: add stream_id to keyserver_device_keys table

* Add tests for stream ID generation

* Fix whitelist
2020-08-03 17:07:06 +01:00
Kegsay ffcb6d2ea1
Produce OTK counts in /sync response (#1235)
* Add QueryOneTimeKeys for /sync extensions

* Unbreak tests

* Produce OTK counts in /sync response

* Linting
2020-08-03 12:29:58 +01:00
Kegsay b5cb1d1534
Fix edge cases around device lists (#1234)
* Fix New users appear in /keys/changes

* Create blank device keys when logging in on a new device

* Add PerformDeviceUpdate and fix a few bugs

- Correct device deletion query on sqlite
- Return no keys on /keys/query rather than an empty key

* Unbreak sqlite properly

* Use a real DB for currentstateserver integration tests

* Race fix
2020-07-31 14:40:45 +01:00
Kegsay a7e67e65a8
Notify clients when devices are deleted (#1233)
* Recheck device lists when join/leave events come in

* Add PerformDeviceDeletion

* Notify clients when devices are deleted

* Unbreak things

* Remove debug logging
2020-07-30 18:00:56 +01:00
Neil Alexander b17bc36de0
Update config test 2020-07-30 16:18:59 +01:00
Neil Alexander fc274aa588
Merge branch 'master' into neilalexander/config 2020-07-30 16:15:10 +01:00
Neil Alexander 292a9ddd82
Fix Yggdrasil demo builds 2020-07-30 15:47:44 +01:00
Kegsay a2174d3294
Implement /keys/changes (#1232)
* Implement /keys/changes

And refactor QueryKeyChanges to accept a `to` offset.

* Unbreak tests

* Sort keys when serialising log tokens
2020-07-30 14:52:21 +01:00
Neil Alexander bfe4931af7
Fix sync API build 2020-07-30 14:02:36 +01:00
Neil Alexander 930ced1102
Merge branch 'master' into neilalexander/config 2020-07-30 13:58:28 +01:00
Neil Alexander ed6c8af282
Include database connection string in database options 2020-07-30 13:29:58 +01:00
Kegsay 9355fb5ac8
Hook up device list updates to the sync notifier (#1231)
* WIP hooking up key changes

* Fix import cycle, get tests passing and binary compiling

* Linting and update whitelist
2020-07-30 11:15:46 +01:00
Kegsay 0fdd4f14d1
Add support for logs in StreamingToken (#1229)
* Add support for logs in StreamingToken

Tokens now end up looking like `s11_22|dl-0-123|ab-0-12224`
where `dl` and `ab` are log names, `0` is the partition and
`123` and `12224` are the offsets.

* Also test reserialisation

* s/|/./g so tokens url escape nicely
2020-07-29 19:00:04 +01:00
Neil Alexander 393775ae68
Fix client API test 2020-07-29 15:48:46 +01:00
Neil Alexander dc416ebdb2
Maybe fix appservices 2020-07-29 15:33:23 +01:00
Neil Alexander 16984262bc
Fix current state server test (sort of) 2020-07-29 15:26:56 +01:00
Neil Alexander d6a6b27c5c
Further tweaks 2020-07-29 13:21:43 +01:00
Neil Alexander 65cae7a8f4
Fix more tests 2020-07-29 10:53:50 +01:00
Neil Alexander 11a7073c97
Fix roomserver test 2020-07-29 10:39:49 +01:00
Neil Alexander e1d00e47de
Update server key API tests 2020-07-29 09:55:57 +01:00
Neil Alexander a2082a6522
More shifting around 2020-07-29 09:48:03 +01:00
Kegsay 9a5fb489c5
Add QueryKeyChanges (#1228)
Hook some things up to call it as well.
2020-07-28 18:25:16 +01:00
Neil Alexander 85375ef96b
Don't forget current state and EDU servers 2020-07-28 17:43:53 +01:00
Neil Alexander d8eb0e1b4f
Initial pass at refactoring config (not finished) 2020-07-28 17:43:32 +01:00
Kegsay adf7b59294
Persist partition|offset|user_id in the keyserver (#1226)
* Persist partition|offset|user_id in the keyserver

Required for a query API which will be used by the syncapi which
will be called when a `/sync` request comes in which will return
a list of user IDs of people who have changed their device keys
between two tokens.

* Add tests and fix maxOffset bug

* s/offset/log_offset/g because 'offset' is a reserved word in postgres
2020-07-28 17:38:30 +01:00
Neil Alexander acc8e80a51
User directory (#1225)
* User directory

* Fix syncapi unit test

* Make user directory only show remote users you know about from your joined rooms

* Update sytest-whitelist

* Review comments
2020-07-28 10:53:17 +01:00
Kegsay c632867135
Modify /state/{eventType}/{stateKey} to return the event at the time the user left (#1222)
* Modify /state/{eventType}/{stateKey} to return the event at the time the user left

Or live, depending on their current state. Hopefully fixes some sytests!

* Linting

* Set HasBeenInRoom

* Fix cases for world-readable history visibility

* Fix bug in finding the requested state event

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-07-28 10:09:10 +01:00
Henrik Sölver 83f038e12b
Don't use more than 999 variables in SQLite querys. (#1224)
Closes #1223

Signed-off-by: Henrik Sölver <henrik.solver@gmail.com>

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-07-27 13:19:30 +01:00
Kegsay c8d476a3cc
Return HTTP errors when trying to kick invalid users (#1221)
Room integrity was never compromised as GMSL does auth checks,
but we would incorrectly 200 OK the request instead of 403ing.
2020-07-27 09:20:09 +01:00
Kegsay 61963a74ae
Add logic for determining when device lists have changed due to membership changes (#1220)
* Flesh out structure for handling device list updates for room membership changes

* First cut untested algorithm

* Add tests for determining changed/left device lists

* Linting

* Unbreak tests

* Sigh.. linting
2020-07-27 09:19:55 +01:00
Kegan Dougal abef9bc04f Put this in the right category 2020-07-24 17:11:16 +01:00
Kegan Dougal b63fa7b880 Update AWSY list 2020-07-24 16:17:33 +01:00
Kegsay af5b4d1f6b
Modify QuerySharedUsers to handle counts/include/exclude (#1219)
* Modify QuerySharedUsers to handle counts/include/exclude

We will need this functionality when working out whether to
send device list changes to users who have joined/left a room.

* Linting
2020-07-24 10:33:41 +01:00
Kegsay 98f2f09bb4
keyserver: produce key change events (#1218)
* Produce kafka events when keys are added

* Consume key changes in syncapi with TODO markers for handling them and catching up

* unbreak tests

* Linting
2020-07-23 16:41:36 +01:00
Kegsay 7b862384a7
currentstate: Add QuerySharedUsers (#1217)
This will be used to determine who to send device list updates to. It
can also be used to determine who to send presence info to.
2020-07-23 12:26:31 +01:00