aboutsummaryrefslogtreecommitdiff
path: root/clientapi
AgeCommit message (Collapse)Author
2022-11-02Implement `/thirdparty` endpoints (#2831)Till
Implements the following endpoints ``` GET /_matrix/client/v3/thirdparty/protocols GET /_matrix/client/v3/thirdparty/protocols/{protocol} GET /_matrix/client/v3/thirdparty/location GET /_matrix/client/v3/thirdparty/location/{protocol} GET /_matrix/client/v3/thirdparty/user GET /_matrix/client/v3/thirdparty/user/{protocol} ```
2022-10-31Add `/_dendrite/admin/downloadState/{serverName}/{roomID}` admin endpointNeil Alexander
2022-10-28Add hcaptcha support besides Google ReCaptcha (#2834)X. Ding
### Pull Request Checklist This PR add support for hcaptcha.com as an alternative to Google ReCaptcha. It also makes possible for user to customize ReCaptcha URL when needed. (Such as use recaptcha.net instead of www.google.com) This feature needs manual test cuz it involves 3rd party _captcha_. Signed-off-by: `Simon Ding <dxl@plotbridge.com>` Co-authored-by: dxl <dxl@plotbridge.com>
2022-10-27Add AS specific public room list endpoints (#2836)Till
Adds `PUT /_matrix/client/v3/directory/list/appservice/{networkId}/{roomId}` and `DELTE /_matrix/client/v3/directory/list/appservice/{networkId}/{roomId}` support, as well as the ability to filter `/publicRooms` on networkID and including all networks.
2022-10-26Initial support for multiple server names (#2829)Neil Alexander
This PR is the first step towards virtual hosting by laying the groundwork for multiple server names being configured.
2022-10-25Filter `/members`, return members at given point (#2827)Till
Makes the tests ``` Can get rooms/{roomId}/members at a given point Can filter rooms/{roomId}/members ``` pass, by moving `/members` and `/joined_members` to the SyncAPI.
2022-10-24Fix slow querying of cross-signing signaturesNeil Alexander
2022-10-21Set `display_name` and/or `avatar_url` for server notices (#2820)Till
This should fix #2815 by making sure we actually set the `display_name` and/or `avatar_url` and create the needed membership event. To avoid creating a new membership event when starting Dendrite, `SetAvatarURL` and `SetDisplayName` now return a `Changed` value, which also makes the regular endpoints idempotent.
2022-10-17Scope transactions to endpoints (#2799)Till
To avoid returning results from e.g. `/redact` on `/sendToDevice` requests. Takes the raw URL path and uses `filepath.Dir` to remove the `txnID` (file) from it. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-10-17Set `org.matrix.msc2285.stable` in `/versions`Neil Alexander
2022-10-11Private read receipts (#2789)Neil Alexander
Implement behaviours for `m.read.private` receipts.
2022-10-10Move /event to the SyncAPI (#2782)Till
This allows us to apply history visibility without having to recalculate it in the roomserver. Unblocks https://github.com/matrix-org/complement/pull/495, fix missing part of https://github.com/matrix-org/dendrite/issues/617
2022-10-10Tweak `GetAccountByPassword` moreNeil Alexander
2022-10-06Always return `one_time_key_counts` on `/keys/upload` (#2769)Till
The OTK count is [required](https://spec.matrix.org/v1.4/client-server-api/#post_matrixclientv3keysupload) in responses to `/keys/upload`, so return those.
2022-09-30Add `/_dendrite/admin/refreshDevices/{userID}` (#2746)Till
Allows to immediately query `/devices/{userID}` over federation to (hopefully) resolve E2EE issues.
2022-09-27Fulltext implementation using Bleve (#2675)Till
Based on #2480 This actually indexes events based on their event type. They are removed from the index if we receive a `m.room.redaction` event on the `OutputRoomEvent` stream. An admin endpoint is added to reindex all existing events. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-09-13Send-to-device consumer/producer tweaks (#2713)Till
Some tweaks for the send-to-device consumers/producers: - use `json.RawMessage` without marshalling it first - try further devices (if available) if we failed to `PublishMsg` in the producers - some logging changes (to better debug E2EE issues)
2022-09-01Configuration tweaks (#2567)Neil Alexander
This makes the following changes: * The various `Defaults` functions are now responsible for setting sane defaults if `generate` is specified, rather than hiding them in `generate-config` * Some configuration options have been marked as `omitempty` so that they don't appear in generated configs unnecessarily (monolith-specific vs. polylith-specific options) * A new option `-polylith` has been added to `generate-config` to create a config that makes sense for polylith deployments (i.e. including the internal/external API listeners and per-component database sections) * A new option `-normalise` has been added to `generate-config` to take an existing file and add any missing options and/or defaults
2022-08-26Restrict username length properly (#2676)Neil Alexander
This fixes #2674 by fixing the username check to comply with the [spec appendices](https://spec.matrix.org/v1.3/appendices/#user-identifiers): > The length of a user ID, including the @ sigil and the domain, MUST NOT exceed 255 characters.
2022-08-16Use `is_direct` flag from `/createRoom`, update stripped state (#2644)Neil Alexander
* Use `is_direct` flag from `/createRoom`, update stripped state * Add comment
2022-08-12Show/hide users in user directory (#2637)Till
* CS API changes * Query remote profiles * Add passing tests * Don't create a new FullyQualifiedProfile * Handle sql.ErrNoRows Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-08-12Use `/admin/v1/register` in `create-account` (#2484)Till
* Get all account data on CompleteSync * Revert "Get all account data on CompleteSync" This reverts commit 44a3e566d8fb940b0b757aea9b8408fa19ea9f54. * Use /_synapse/admin/v1/register to create account * Linting * Linter again :) * Update docs * Use HTTP API to reset password, add option to User API `PerformPasswordUpdate` to invalidate sessions * Fix routing name * Tell me more about what went wrong * Deprecate the `-reset-password` flag, document the new API Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-08-12Protect user_interactive reads and writes with locks (#2635)Tak Wai Wong
* Protect user_interactive reads and writes with locks * Ignore golangci-lint false positive * fix lint Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-08-11Generic-based internal HTTP API (#2626)Neil Alexander
* Generic-based internal HTTP API (tested out on a few endpoints in the federation API) * Add `PerformInvite` * More tweaks * Fix metric name * Fix LookupStateIDs * Lots of changes to clients * Some serverside stuff * Some error handling * Use paths as metric names * Revert "Use paths as metric names" This reverts commit a9323a6a343f5ce6461a2e5bd570fe06465f1b15. * Namespace metric names * Remove duplicate entry * Remove another duplicate entry * Tweak error handling * Some more tweaks * Update error behaviour * Some more error tweaking * Fix API path for `PerformDeleteKeys` * Fix another path * Tweak federation client proxying * Fix another path * Don't return typed nils * Some more tweaks, not that it makes any difference * Tweak federation client proxying * Maybe fix the key backup test
2022-08-05Do not use `ioutil` as it is deprecated (#2625)Neil Alexander
2022-08-05Fix linter issues (#2624)Till
* Try that again * All hail the mighty linter? * And once again * goimport all the things
2022-07-25Make the User API responsible for sending account data output events (#2592)Neil Alexander
* Make the User API responsible for sending account data output events * Clean up producer * Review comments
2022-07-25Add .well-known/matrix/client to clientapi (#2551)Jonathan Bartlett
Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-07-05Hopefully fix read receipts timestamps (#2557)Neil Alexander
This should avoid coercions between signed and unsigned ints which might fix problems like `sql: converting argument $5 type: uint64 values with high bit set are not supported`.
2022-06-29Add `evacuateUser` endpoint, use it when deactivating accounts (#2545)Neil Alexander
* Add `evacuateUser` endpoint, use it when deactivating accounts * Populate the API * Clean up user devices when deactivating * Include invites, delete pushers
2022-06-13Handle state before, send history visibility in output (#2532)Neil Alexander
* Check state before event * Tweaks * Refactor a bit, include in output events * Don't waste time if soft failed either * Tweak control flow, comments, use GMSL history visibility type
2022-06-09Allow "registration is idempotent, with username specified" to pass (#2488)Till
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-06-07Rate limiting changes (#2519)Neil Alexander
* Rate limiting changes This makes the following changes: * For logged in users, the rate limiting now applies to the device session rather than the remote IP address; * For non-logged in users, the rate limiting continues to apply to remote address as it does today; * It is now possible to add user IDs to the `exempt_user_ids` option under `rate_limiting` to exclude bots from rate limiting; * Admin and appservice users are now exempt from rate limiting by default. * Fix build with media API
2022-06-03Make setting state idempotent (#2512)Till
* Make Setting state twice is idempotent pass * Add passing tests * PR comment & comments
2022-06-01Update versionsNeil Alexander
2022-05-25Restricted join support on `/make_join`, `/send_join` (#2478)Neil Alexander
* Add `QueryRestrictedJoinAllowed` * Add `Resident` flag to `QueryRestrictedJoinAllowedResponse` * Check restricted joins on federation API * Return `Restricted` to determine if the room was restricted or not * Populate `AuthorisedVia` properly * Sign the event on `/send_join`, return it in the `/send_join` response in the `"event"` key * Kick back joins with invalid authorising user IDs, use event from `"event"` key if returned in `RespSendJoin` * Use invite helper in `QueryRestrictedJoinAllowed` * Only use users with the power to invite, change error bubbling a bit * Placate the almighty linter One day I will nuke `gocyclo` from orbit and everything in the world will be much better for it. * Review comments
2022-05-24Fix `join_authorised_via_users_server` key name in `SendEvent`Neil Alexander
2022-05-24Give PL100 to invited users in `trusted_private_chat` preset (#2485)Neil Alexander
2022-05-24Strip `join_authorised_by_users_server` when updating membership events ↵Neil Alexander
using `/rooms/{roomID}/state` (#2482)
2022-05-20Fix `/deactivate` (#2474)Till
* Fix /deactivate * Update test to correctly check the expected response
2022-05-11Add RoomExists flag to QueryMembershipForUser (#2450)kegsay
Fixes https://github.com/matrix-org/complement/pull/369
2022-05-10Back out matrix-org/dendrite#2421 by restoring `http.Client`sNeil Alexander
This creates problems with non-HTTPS endpoints and should fix #2444.
2022-05-09One NATS instance per `BaseDendrite` (#2438)Neil Alexander
* One NATS instance per `BaseDendrite` * Fix roomserver
2022-05-06Clean up interface definitions (#2427)kegsay
* tidy up interfaces * remove unused GetCreatorIDForAlias * Add RoomserverUserAPI interface * Define more interfaces * Use AppServiceInternalAPI for consistent naming * clean up federationapi constructor a bit * Fix monolith in -http mode
2022-05-05Define component interfaces based on consumers (2/2) (#2425)kegsay
* convert remaining interfaces * Tidy up the userapi interfaces
2022-05-05Define component interfaces based on consumers (1/2) (#2423)kegsay
* Specify interfaces used by appservice, do half of clientapi * convert more deps of clientapi to finer-grained interfaces * Convert mediaapi and rest of clientapi * Somehow this got missed
2022-05-05Use `gomatrixserverlib.Client` instead of `http.Client` (#2421)Neil Alexander
* Update to matrix-org/gomatrixserverlib#303 * Use `gomatrixserverlib.Client` for phone-home stats * Use `gomatrixserverlib.Client` for push notifications * Use `gomatrixserverlib.Client` for appservices * Use `gomatrixserverlib.Client` for three-PID invites
2022-05-05Fix user already joined when using server notices (#2364)Till
2022-05-05syncapi: define specific interfaces for internal HTTP communications (#2416)kegsay
* syncapi: use finer-grained interfaces when making the syncapi * Use specific interfaces for syncapi-roomserver interactions * Define query access token api for shared http auth code
2022-05-03Tidy up `AddPublicRoutes` (#2412)Neil Alexander
* Simplify federation API `AddPublicRoutes` * Simplify client API `AddPublicRoutes` * Simplify media API `AddPublicRoutes` * Simplify sync API `AddPublicRoutes` * Simplify `AddAllPublicRoutes`