Commit graph

1811 commits

Author SHA1 Message Date
Till Faelligen 61cdb714df Use typed values for Consent 2022-02-21 16:23:28 +01:00
Till Faelligen 185cb7a582 Remove BaseURL from Global
Update template
2022-02-21 16:22:25 +01:00
Till Faelligen e2b0ff675b Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/consent-tracking 2022-02-21 14:44:52 +01:00
Till Faelligen c0845ea1ad Update logging 2022-02-21 14:44:16 +01:00
Till Faelligen 6622fda08c Add sending server notices on startup 2022-02-21 14:27:59 +01:00
Till Faelligen 219a15c4c3 Load templates into one variable 2022-02-21 14:27:13 +01:00
Till Faelligen fb95331aa2 Add posibility to track sent policy versions 2022-02-21 14:26:00 +01:00
Neil Alexander a386fbed2c
Delete one-time keys when deleting a device (#2208) 2022-02-21 12:30:43 +00:00
Till Faelligen cb4526793d Add missing migrations 2022-02-21 12:15:56 +01:00
Till Faelligen 2e6987f8bd Add missing files 2022-02-21 12:12:07 +01:00
Till Faelligen 9c3a1cfd47 Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/consent-tracking 2022-02-21 12:08:03 +01:00
S7evinK 002429c9e2
Implement server notices (#2180)
* Add server_notices config

* Disallow rejecting "server notice" invites

* Update config

* Slightly refactor sendEvent and CreateRoom so it can be reused

* Implement unspecced server notices

* Validate the request

* Set the user api when starting

* Rename function/variables

* Update comments

* Update config

* Set the avatar on account creation

* Update test

* Only create the account when starting
Only add routes if sever notices are enabled

* Use reserver username
Check that we actually got roomData

* Add check for admin account
Enable server notices for CI
Return same values as Synapse

* Add custom error for rejecting server notice invite

* Move building an invite to it's own function, for reusability

* Don't create new rooms, use the existing one (follow Synapse behavior)

Co-authored-by: kegsay <kegan@matrix.org>
2022-02-18 16:05:03 +01:00
Neil Alexander dbded87525
Expose sync endpoints via /v3 (#2203) 2022-02-18 14:14:16 +00:00
Neil Alexander 9f4a39e8e0
Refactor user API storage (#2202)
* Refactor User API database

* Fix migration bugs
2022-02-18 13:51:59 +00:00
Neil Alexander 9bd5e414c9
Missing commit from #2186 2022-02-18 11:32:45 +00:00
Neil Alexander 153bfbbea5
Merge both user API databases into one (#2186)
* Merge user API databases into one

* Remove DeviceDatabase from config

* Fix tests

* Try that again

* Clean up keyserver device keys when the devices no longer exist in the user API

* Tweak ordering

* Fix UserExists flag, device check

* Allow including empty entries so we can clean them up

* Remove logging
2022-02-18 11:31:05 +00:00
kegsay 0a7dea4450
Update /whoami response to match Spec v1.2 (#2201)
Basically include `is_guest` and `device_id`. The latter is
needed for https://github.com/matrix-org/complement/pull/305
2022-02-18 11:28:02 +00:00
Neil Alexander 131bedc1a1
Remove event type and state key caches (#2200)
* Don't proactively cache event types and state keys when we don't know if the transaction has persisted yet

* Remove event type and state key caches altogether
2022-02-18 10:58:41 +00:00
Neil Alexander e1eb5807b6
Allow preventing guest registration (#2199)
* Allow disabling guest registration separately

* Update sample config

* Set `guests_disabled` to `true` in the sample config
2022-02-18 10:12:26 +00:00
kegsay 5dd203fde3
Listen for /v3 on CSAPI (#2197)
* Listen for /v3 on CSAPI

* Docs

* More docs

* Rename path variable to fix key backup tests

* Update routing.go

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-02-17 17:38:22 +00:00
Neil Alexander 0b123b29f5
Use process context for roomserver input (#2198) 2022-02-17 15:58:54 +00:00
Neil Alexander 140077265e
Make GetUserDevices logging entry more useful 2022-02-17 15:02:06 +00:00
Neil Alexander 7dfc7c3d70
Don't re-send sent events in add_state_events (#2195)
* Only add events to `add_state_events` that haven't already been sent to the roomserver output before

* Filter on event NIDs instead, hopefully bring joy to SQLite

* UnsentFilter, review comments
2022-02-17 13:53:48 +00:00
Neil Alexander 353168a9e9
Fix potential panic in NewStreamTokenFromString caused by off-by-one error (#2196)
Line 291 could panic when trying to set `positions[i]` if `i == len(positions)`.
2022-02-17 13:25:41 +00:00
S7evinK 89b7519089
Raise waitTime for network related issues (#2192) 2022-02-17 13:15:49 +00:00
Neil Alexander 934491eda5
Update NATS Server to v2.7.2 (#2193)
* Update NATS JetStream to v2.7.2

* Remove deprecated option
2022-02-17 13:15:35 +00:00
S7evinK f51e2a99e9
Remove outbound proxy, http.ProxyFromEnvironment is now used (#2191) 2022-02-17 13:54:29 +01:00
kegsay a4681bc7f7
Set 'complement' as the shared secret for CI (#2194) 2022-02-17 10:59:44 +00:00
S7evinK 5a39512f5f
Add account type (#2171)
* Add account_type for sqlite3

* Add account_type for postgres

* Remove CreateGuestAccount from interface

* Add new AccountTypes & update test

* Use newly added AccountType for account creation

* Add migrations

* Reuse type

* Add AccounnType to Device, so it can be verified on requests

* Rename migration, add missing update for appservices

* Rename sqlite3 migration

* Add missing AccountType to return value

* Update sqlite migration
Change allowance check on /admin/whois

* Fix migration, add IS NULL

* Move accountType to completeRegistration

* Fix migrations

* Add passing test
2022-02-16 18:55:38 +01:00
S7evinK e9b672a34e
Make "Device list doesn't change if remote server is down" pass (#2190) 2022-02-16 16:56:45 +00:00
Neil Alexander fa1e12b503
Don't panic on retiring an invite that we haven't seen yet (#2189) 2022-02-16 11:56:08 +00:00
Till Faelligen 74da1f0fb3 Remove "magic" Enabled function and use simple bool 2022-02-16 10:11:23 +01:00
Till Faelligen 26accb8c5d Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/consent-tracking 2022-02-16 08:39:54 +01:00
kegsay f92b048fec
Add host mount compatible Complement image (#2187) 2022-02-15 17:40:48 +00:00
Neil Alexander 4c8c53244e
Update prometheus 2022-02-15 16:27:22 +00:00
Till Faelligen 6482630f7b Fix insert statement 2022-02-15 14:28:51 +01:00
Till Faelligen 2fc1c46743 Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/consent-tracking 2022-02-15 14:16:37 +01:00
Till Faelligen 5a0ec6e443 Add policy version to create-account & mediaapi 2022-02-15 14:15:18 +01:00
Till Faelligen 535d388ec0 Add new login type "m.login.terms" 2022-02-15 14:14:39 +01:00
Till Faelligen cbdbbb0839 Make sure we use the correct login stages 2022-02-15 14:13:22 +01:00
Till Faelligen f8bebe5e5a Add policy_version to insertAccount statement 2022-02-15 14:10:50 +01:00
Neil Alexander e22e87c012
Update to matrix-org/gomatrixserverlib@20632dd 2022-02-15 11:14:43 +00:00
Till Faelligen d19518fca5 Add ConsentNotGiven error
Verify consent on desired endpoints
Store consent on POST requests
2022-02-15 11:07:24 +01:00
Till Faelligen 89340cfc52 Verify the user has given their consent, otherwise block access 2022-02-14 18:11:56 +01:00
Till Faelligen 11144de92f Implement consent tracking 2022-02-14 16:18:51 +01:00
Till Faelligen b2045c24cb Add missing yaml tag 2022-02-14 16:18:19 +01:00
Till Faelligen 097f1d4609 Add a way to update the policy_version for a user 2022-02-14 15:08:00 +01:00
Till Faelligen a505471c90 Add table migrations 2022-02-14 14:52:16 +01:00
Till Faelligen 3c5c3ea7fb Add methods to query the policy version 2022-02-14 14:03:30 +01:00
Till Faelligen 9583784e8a Add new coloumn to track accepted policy version 2022-02-14 14:02:13 +01:00