* Handle SAS verification by exposing an endpoint where the SAS can be sent to be verified
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Init cryptotest service with basic commands
* Add cryptotest service with challenge request / response / session invalidation commands
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Add cryptotest methods for testing key forwarding
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Add help messages for cryptotest cmds
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Add newer apt repository for updated libolm
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Move command functionalities for cryptotest to different functions
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Fixed cryptotest service and package name from echo
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Control which users can start a SAS verification with Neb through regexes in the config
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Have maximum number of ongoing verifications at any time
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Fix Trace to Tracef
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Add device ID to the configuration
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Basic e2ee support for some commands
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Move some of the client and crypto logic to a new BotClient type
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Use the state store to retrieve room joined users
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Start creating the database APIs for the crypto store
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Replace mautrix.Client usage with BotClient for all services to use the
e2ee-enabled client
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Use SQL backend for storing crypto material
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Perform a sync request with full state when starting
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Consider case where device ID is empty and log a warning
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Define project as a Go module and update dependency versions
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Update docs, configs and dockerfile to use latest Go version
Signed-off-by: Nikos Filippakis <me@nfil.dev>
* Add postgres database driver
Signed-off-by: Nikos Filippakis <me@nfil.dev>
Indirect this through a `NextBatchStore` type to get around circular dependencies
which are formed if you try to inline it in the `Sync()` while loop.
Fork out event handlers to separate functions in `Clients` to make gocyclo happy.
Add `UPDATE` query for `next_batch`.
Previously, we would notify `Services` based on matching the `room_id` of the
event with a list of `RoomIDs()` which the service returned.
Now we notify `Services` based on matching the `user_id` of the client listening
for events. This means that the service will receive more events because there
isn't a filter on a set of room IDs.
This is required in order to implement "auto-join on invite" semantics for
Services, as the room ID is not known at that point in time.