aboutsummaryrefslogtreecommitdiff
path: root/clientapi
AgeCommit message (Collapse)Author
2021-07-09Implement /_synapse/admin/v1/register (#1911)kegsay
* Implement /_synapse/admin/v1/register This is implemented identically to Synapse, so scripts which work with Synapse should work with Dendrite. ``` Test 27 POST /_synapse/admin/v1/register with shared secret... OK Test 28 POST /_synapse/admin/v1/register admin with shared secret... OK Test 29 POST /_synapse/admin/v1/register with shared secret downcases capitals... OK Test 30 POST /_synapse/admin/v1/register with shared secret disallows symbols... OK ``` Sytest however has `implementation_specific => "synapse"` which stops these tests from running. * Add missing muxes to gobind * Linting
2021-06-14Use NotFound instead of Forbidden for missing account data (#1872)Adam Greig
Signed-off-by: Adam Greig <adam@adamgreig.com>
2021-04-15Fix registration error when disabledNeil Alexander
2021-04-09Remove legacy register endpoint (#1822)Kegsay
* Remove legacy register endpoint We only support `/r0` CS API paths, not `/v1`. * Finish removing
2021-04-07Implement OpenID module (#599) (#1812)Bruce MacDonald
* Implement OpenID module (#599) - Unrelated: change Riot references to Element in client API routing Signed-off-by: Bruce MacDonald <contact@bruce-macdonald.com> * OpenID module tweaks (#599) - specify expiry is ms rather than vague ts - add OpenID token lifetime to configuration - use Go naming conventions for the path params - store plaintext token rather than hash - remove openid table sqllite mutex * Add default OpenID token lifetime (#599) * Update dendrite-config.yaml Co-authored-by: Kegsay <kegsay@gmail.com> Co-authored-by: Kegsay <kegan@matrix.org>
2021-03-08Return a more useful error on /register spec compliance violation (#1792)Neil Alexander
2021-03-05Tweak AS registration check and AS component HTTP clients (#1785)Neil Alexander
* Tweak AS registration check * Check appservice usernames using correct function * Update sytest-whitelist * Use gomatrixserverlib.Client since that allows us to disable TLS validation using the config * Add appservice-specific client and ability to control TLS validation for appservices only * Set timeout on appservice client * Review comments * Remove dead code * Enforce LoginTypeApplicationService after all * Check correct auth type field
2021-03-03Fix appsevice alias queries part 2 (#1684)Will Hunt
* Check membership of room * Use QueryStateAfterEventsResponse * Fix complexity * Add field ShouldHitAppservice to GetRoomIDForAlias * Hit appservice when trying to join a non-existent alias * remove unused * Changes that I made a long time ago * Rename to appserviceJoinedAtEvent * Check membership in GetMemberships * Update QueryMembershipsForRoom * Tweaks in client API * Update appserviceJoinedAtEvent * Comments * Try QueryMembershipForUser instead * Undo some changes to client API that shouldn't be needed * More /event tweaks * Refactor /event bit * Go back to QueryMembershipsForRoom because appservices are hard * Fix bugs in onMessage * Add comments * More logical naming, clean up a bit Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-03-03Send events to appservice based on room membership (#1680)Will Hunt
* Check membership of room * Use QueryStateAfterEventsResponse * Fix complexity * Changes that I made a long time ago * Rename to appserviceJoinedAtEvent * Check membership in GetMemberships * Update QueryMembershipsForRoom * Tweaks in client API * Update appserviceJoinedAtEvent * Comments * Try QueryMembershipForUser instead * Undo some changes to client API that shouldn't be needed * More /event tweaks * Refactor /event bit * Go back to QueryMembershipsForRoom because appservices are hard * Fix bugs in onMessage * Add comments Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2021-03-03Increase gocyclo complexity to 25 (and remove all but 2 golint directives ↵Neil Alexander
related to it) (#1783)
2021-03-02Return the current OTK count on an empty upload request (#1774)Neil Alexander
* Always return OTK counts * Fix parameter ordering * Send IDs over to keyserver internal API * Review comments * Fix syntax error * Fix panic, hopefully * Require user ID to be set * Fix user API call
2021-02-12Implement /createRoom power_level_content_override (#1761)Michael Telatynski
* Implement /createRoom power_level_content_override * delint * Skip having to re-marshal PowerLevelContentOverride by making use of `json.RawMessage`
2021-01-22Gate peeking behind msc flags (#1731)Kegsay
2021-01-18Mention unstable features in /_matrix/client/versions (#1710)sumitks866
* Mention unstable features in /_matrix/client/versions * list enabled mscs * Don't update go.mod/go.sum * goimports Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
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