aboutsummaryrefslogtreecommitdiff
path: root/clientapi
AgeCommit message (Collapse)Author
2020-12-18Fix /registerNeil Alexander
2020-12-18Do not check if a username is exclusive if the request is for an appservice ↵Will Hunt
in /register (#1652) * Do not check if a username is exclusive if the request is for an appservice in /register * remove useless comment * Move statements * fix broken test * Also fix the senderLocalpart problem * Check domain name is ours * Handle accessTokenErr * Return unauthorised instead of forbidden Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-12-18Don't send null in joined_rooms response (#1659)Neil Alexander
2020-12-17Add CS sendevent metricsNeil Alexander
Squashed commit of the following: commit c38c39107b6dda0c8e6320d61da2365c47eea4e9 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Thu Dec 17 10:13:09 2020 +0000 Update buckets commit 5a3bcc8bd4167150374827b0e42a0dea0366beff Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Thu Dec 17 09:41:43 2020 +0000 Update buckets commit 78dff8165ddf596e28af04faf56466752ebc17af Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Thu Dec 17 09:37:27 2020 +0000 Register sendEventDuration commit 612b0f3d84f1547ff30131f7b084baf609edab52 Author: Neil Alexander <neilalexander@users.noreply.github.com> Date: Thu Dec 17 09:35:59 2020 +0000 sendevent metrics
2020-12-03Peeking updates (#1607)Neil Alexander
* Add unpeek * Don't allow peeks into encrypted rooms * Fix send tests * Update consumers
2020-12-03Fix /joined_members API response (#1606)alexkursell
* Fix /joined_members API response * Fix golint issue
2020-12-02Top-level setup package (#1605)Neil Alexander
* Move config, setup, mscs into "setup" top-level folder * oops, forgot the EDU server * Add setup * goimports
2020-11-20Add last_seen_ip and last_seen_ts to /devices response (#1592)alexkursell
2020-11-18Allow = in user identifiers (#1590)bodqhrohro
While I was breaking through all the TDD bureaucracy to finally push this fix, it turned out that it already got fixed in #1578. Still I push the rest of the changes (basically, everything except of actually fixing the bug ;)). `=` is crucial for matrix-bifrost which turns XMPP @'s into =40. Signed-off-by: Bohdan Horbeshko <bodqhrohro@gmail.com>
2020-11-17Implemented whois endpoint (#1573)David Spenler
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-11-16Pass pointers to events — reloaded (#1583)Neil Alexander
* Pass events as pointers * Fix lint errors * Update gomatrixserverlib * Update gomatrixserverlib * Update to matrix-org/gomatrixserverlib#240
2020-11-12Fix username regex to allow = character (#1578)Neil Alexander
2020-11-09Implement read receipts (#1528)S7evinK
* fix conversion from int to string yields a string of one rune, not a string of digits * Add receipts table to syncapi * Use StreamingToken as the since value * Add required method to testEDUProducer * Make receipt json creation "easier" to read * Add receipts api to the eduserver * Add receipts endpoint * Add eduserver kafka consumer * Add missing kafka config * Add passing tests to whitelist Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Fix copy & paste error * Fix column count error * Make outbound federation receipts pass * Make "Inbound federation rejects receipts from wrong remote" pass * Don't use errors package * - Add TODO for batching requests - Rename variable * Return a better error message * - Use OutputReceiptEvent instead of InputReceiptEvent as result - Don't use the errors package for errors - Defer CloseAndLogIfError to close rows - Fix Copyright * Better creation/usage of JoinResponse * Query all joined rooms instead of just one * Update gomatrixserverlib * Add sqlite3 migration * Add postgres migration * Ensure required sequence exists before running migrations * Clarification on comment * - Fix a bug when creating client receipts - Use concrete types instead of interface{} * Remove dead code Use key for timestamp * Fix postgres query... * Remove single purpose struct * Use key/value directly * Only apply receipts on initial sync or if edu positions differ, otherwise we'll be sending the same receipts over and over again. * Actually update the id, so it is correctly send in syncs * Set receipt on request to /read_markers * Fix issue with receipts getting overwritten * Use fmt.Errorf instead of pkg/errors * Revert "Add postgres migration" This reverts commit 722fe5a04628882b787d096942459961db159b06. * Revert "Add sqlite3 migration" This reverts commit d113b03f6495a4b8f8bcf158a3d00b510b4240cc. * Fix selectRoomReceipts query * Make golangci-lint happy Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-11-05Implement forgetting about rooms (#1572)S7evinK
* Add basic storage methods * Add internal api handler * Add check for forgotten room * Add /rooms/{roomID}/forget endpoint * Add missing rsAPI method * Remove unused parameters * Add passing tests Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Add missing file * Add postgres migration * Add sqlite migration * Use Forgetter to forget room * Remove empty line * Update HTTP status codes It looks like the spec calls for these to be 400, rather than 403: https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-rooms-roomid-forget Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2020-10-19Send state after event, not currentDevon Johnson
Signed-off-by: Devon Johnson <djohnson1865@gmail.com>
2020-10-19KindOld (#1531)Neil Alexander
* Add KindOld * Don't process latest events/memberships for old events * Allow federationsender to ignore duplicate key entries when LatestEventIDs is duplicated by RS output events * Signal to downstream components if an event has become a forward extremity * Don't exclude from sync * Soft-fail checks on KindNew * Don't run the latest events updater at all for KindOld * Don't make federation sender change after all * Kind in federation sender join * Don't send isForwardExtremity * Fix syncapi * Update comments * Fix SendEventWithState * Update sytest-whitelist * Generate old output events * Sync API consumes old room events * Update comments
2020-10-16Take write lock for rate limit map (#1532)Neil Alexander
* Take write lock for rate limit map * Fix potential race condition
2020-10-15Start Kafka connections for each component that needs them (#1527)Neil Alexander
* Start Kafka connection for each component that needs one * Fix roomserver unit tests * Rename to naffkaInstance (@Kegsay review comment) * Fix import cycle
2020-10-14Send cumulative state when creating room (#1519)Neil Alexander
* Send state with new room events * lookupEvent sends outliers * Revert "lookupEvent sends outliers" This reverts commit 3e1655644105a542b806e28d6d2536fbd23ecc83.
2020-10-09Extend device_devices table (#1471)S7evinK
* Add last_used_ts and IP to database * Add migrations * Rename column Prepare statements * Add interface method and implement it Signed-off-by: Till Faelligen <tfaelligen@gmail.com> * Rename struct fields * Add user_agent to database * Add userAgent to registration calls * Add missing "IF NOT EXISTS" * use txn writer * Add UserAgent to Device Co-authored-by: Kegsay <kegan@matrix.org>
2020-10-09reject invalid UTF-8 (#1472)Pestdoktor
* reject invalid UTF-8 Signed-off-by: Jonas Fentker <jonas@fentker.eu> * update sytest-whitelist Signed-off-by: Jonas Fentker <jonas@fentker.eu> Co-authored-by: Kegsay <kegan@matrix.org>
2020-10-09Implement fully read markers (#1475)Loïck Bonniot
See #653 Signed-off-by: Loïck Bonniot <git@lesterpig.com> Co-authored-by: Kegsay <kegan@matrix.org>
2020-10-07Return 200 on join before time out (#1493)Neil Alexander
* Return 200 on join afer 15 seconds if nothing better has happened by that point * Return 202 instead, 20 second timeout
2020-10-02Implement account deactivation (#1455)Loïck Bonniot
* Implement account deactivation See #610 Signed-off-by: Loïck Bonniot <git@lesterpig.com> * Rename 'is_active' to 'is_deactivated' Signed-off-by: Loïck Bonniot <git@lesterpig.com> Co-authored-by: Kegsay <kegan@matrix.org>
2020-10-02Add 'completed' field in Interactive Auth API (#1469)Loïck Bonniot
This field must be present even after authentication failure, as tested by sytest. This is needed by #1455. Signed-off-by: Loïck Bonniot <git@lesterpig.com>
2020-09-29Finish implementing the capabilities endpoint (#1449)bn4t
Closes #1310 Signed-off-by: Benjamin Nater <me@bn4t.me>
2020-09-27unbreak CORS on /capabilities.Matthew Hodgson
fixes https://github.com/vector-im/element-web/issues/15297
2020-09-10Peeking via MSC2753 (#1370)Matthew Hodgson
Initial implementation of MSC2753, as tested by https://github.com/matrix-org/sytest/pull/944. Doesn't yet handle unpeeks, peeked EDUs, or history viz changing during a peek - these will follow. https://github.com/matrix-org/dendrite/pull/1370 has full details.
2020-09-07Remove current state server (#1405)Kegsay
* Remove current state server Closes #1365 #1272 #1357 * Remove current state server from scripts/docs
2020-09-07Remove QueryBulkStateContent from current state server (#1404)Kegsay
* Remove QueryBulkStateContent from current state server Expected fail due to db impl not existing * Implement query bulk state content * Fix up rejecting invites over federation * Fix bulk content marshalling
2020-09-04Remove QueryRoomsForUser from current state server (#1398)Kegsay
2020-09-04Password changes (#1397)Neil Alexander
* User API support for password changes * Password changes in client API * Update sytest-whitelist * Remove debug logging * Default logout_devices to true * Fix deleting devices by local part
2020-09-04Remove QueryCurrentState from current-state-server (#1395)Kegsay
2020-09-04Remove QueryKnownUsers from current state server (#1393)Kegsay
* Remove QueryKnownUsers from current state server * Fix HTTP mode
2020-09-03FIFO ordering of input events (#1386)Neil Alexander
* Initial FIFOing of roomserver inputs * Remove EventID response from api.InputRoomEventsResponse * Don't send back event ID unnecessarily * Fix ordering hopefully * Reduce copies, use buffered task channel to reduce contention on other rooms * Fix error handling
2020-09-03Rate limiting (#1385)Neil Alexander
* Initial rate limiting * Move rate limiting to client API * Update rate limits to hopefully be self-cleaning * Use X-Forwarded-For, add comments * Reduce rate limit threshold * Tweak interval * Configurable backoff * Review comments, set cleanup interval to 30 seconds * Allow generate-config to produce sane CI config * Fix Complement dockerfile
2020-09-02Add Queryer and Inputer and factor out more RSAPI stuff (#1382)Kegsay
* Add Queryer and use embedded structs * Add Inputer and factor out more RS API stuff This neatly splits up the RS API based on the functionality it provides, whilst providing a useful place for code sharing via the `helpers` package.
2020-09-02Fix #1381 (#1384)Neil Alexander
2020-09-01Public room client API changes (#1368)Rohit Mohan
Signed-off-by: Rohit Mohan <rohitmohan96@gmail.com>
2020-08-27Remove device DB from clientapi (#1352)Kegsay
* Remove device DB from clientapi * Remove device DB from startup configuration It's all an impl detail now in user API
2020-08-26Allow join to accept server_name in query parameters (#1346)Neil Alexander
2020-08-25[readability] use event.StateKeyEquals where relevant and minor for-loop ↵oliverpool
refactoring (#1339) * use event.StateKeyEquals where relevant Signed-off-by: Olivier Charvin <git@olivier.pfad.fr> * use userID
2020-08-25Enforce history visibility etc for /rooms/{roomID}/state (#1340)Neil Alexander
* Enforce history visibility etc for /rooms/{roomID}/state * Deduplicate OnIncomingStateRequest and OnIncomingStateTypeRequest * Revert "Deduplicate OnIncomingStateRequest and OnIncomingStateTypeRequest" This reverts commit 335035d66e629022232abc682d6631e3cf669e23.
2020-08-25Update /versions (#1338)Neil Alexander
2020-08-25Add spec compliant path for redaction (#1334)Kegsay
Possibly fixes #1194
2020-08-20#903: Client API: mutex on (user_id, room_id) (#1286)anandv96
* Client API: mutex on (user_id, room_id) * Client API: mutex on (user_id, room_id) Changed variable name used for the mutexes map Changed the place where the mutex is locked Changed unlock to a defered call instead of manually calling it
2020-08-17Make PerformJoin responsible for sending invite to RS input (#1277)Neil Alexander
* Make PerformJoin send input membership event * Invite input room events in separate goroutine * Don't limit roomserver input events using request context * Synchronous input room events * Nope, that didn't work * oops send state key to GetMembership * Don't generate stripped state in client API more times than necessary, generate output events on receiving end of federated invite * Commit membership updater changes * Tweaks
2020-08-17Synchronous invites (#1273)Neil Alexander
* Refactor invites to be synchronous * Fix synchronous invites * Fix client API return type for send invite error * Linter * Restore PerformError on rsAPI.PerformInvite * Update sytest-whitelist * Don't override PerformError with normal errors * Fix error passing * Un-whitelist a couple of tests * Update sytest-whitelist * Try to handle multiple invite rejections better * nolint * Update gomatrixserverlib * Fix /v1/invite test * Remove replace from go.mod
2020-08-13API setup refactoring (#1266)Neil Alexander
* Start HTTP endpoint refactoring * Update SetupAndServeHTTP * Fix builds * Don't set up external listener if no address configured * TLS HTTP setup * Break apart client/federation/key/media muxes * Tweaks * Fix P2P demos * Fix media API routing * Review comments @Kegsay * Update sample config * Fix gobind build * Fix External -> Public in federation API test
2020-08-10Prefix-defined Kafka topics (#1254)Neil Alexander
* Prefix-defined Kafka topics * Fix current state server test