Commit graph

2525 commits

Author SHA1 Message Date
Tak Wai Wong ed8b5d09eb refresh fork with upstream 2022-10-28 15:49:31 -07:00
Tak Wai Wong c4afa77636
Fix dendrite config to use env for chain_id and enable_authz (#49)
* Fix config to support env variables
2022-10-25 20:56:36 -07:00
Tak Wai Wong 8d2033418e
Merge branch 'matrix-org:main' into main 2022-10-25 17:26:39 -07:00
Tak Wai Wong f87fd94b1b
fix spelling in README 2022-10-25 09:29:31 -07:00
Till c62ac3d6ad
Fix Current state appears in timeline in private history with many messages after (#2830)
The problem was that we weren't getting enough recent events, as most of
them were removed by the history visibility filter. Now we're getting
all events between the given input range and re-slice the returned
values after applying history visibility.
2022-10-25 15:15:24 +02:00
Till Faelligen 8b7bf5e7d7
Return forbidden if not a member anymore (fix #2802) 2022-10-25 15:00:52 +02:00
Neil Alexander db6a214b04
Prettify unit test output 2022-10-25 12:28:34 +01:00
Till 313cb3fd19
Filter /members, return members at given point (#2827)
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-25 12:39:10 +02:00
Tak Wai Wong 15091daa37
revert Caddyfile 2022-10-24 21:53:45 -07:00
Tak Wai Wong dead9ec2c4
Remove CaddyFile 2022-10-24 21:52:57 -07:00
Tak Wai Wong 330ed77d47
revert unwanted changes 2022-10-24 21:52:07 -07:00
Kerem dd1bf9541a
removed comment 2022-10-24 21:35:37 -07:00
Kerem 3cd70dbf45
added canonical dendrite.yaml 2022-10-24 21:35:37 -07:00
Tak Wai Wong db9758464d
Dendrite should only support 1 chain id (#47)
* Support 1 blockchain only

* auth check based on single chain

* use config to set the blockchain provider URL

* fix config to read from env variable

* handle 31337 in addition to 1337
2022-10-24 21:35:36 -07:00
John Terzis 36039c2efc
HNT-105 invite authz 2022-10-24 21:35:36 -07:00
Tak Wai Wong 94061b7b8d
Return an "Unauthorized" error message + refresh zion contract types (#44)
* Add unauthorized message

* update regenerated types for zion contracts
2022-10-24 21:35:36 -07:00
Tak Wai Wong 18db428c23
Figure out space vs channel from roomid (#43)
* pass in roomserver API so that we have access to the db

* interface to get db info for spaceid and channelid

* determine space or channel by querying the room db

* Add authorization check to the JOIN endpoint

* fix lint errors
2022-10-24 21:35:36 -07:00
Tak Wai Wong c5a753d6e2
Updated generated GO types for Zion Space Manager contracts (#41)
* Refresh generated types

* Added Permission enum
2022-10-24 21:35:36 -07:00
John Terzis c2d57b8679
merge latest changes from dendrite main (#42)
* merge latest changes from dendrite main

* fix go formatting

Co-authored-by: John Terzis <john@hntlabs.com>
Co-authored-by: Tak Wai Wong <64229756+tak-hntlabs@users.noreply.github.com>
2022-10-24 21:35:32 -07:00
Tak Wai Wong c2e15cfed9
Support environment variables for selected config fields (#40)
* deployment time config using env variables

* check if ethereum is enabled before replacing the config value with env variable
2022-10-24 21:24:36 -07:00
Tak Wai Wong 04a78694d1
Authorization framework for gating dendrite endpoints (#39)
* import new versions of the zion contracts

* bootstrap zion authz

* define interface for space manager contract

* instantiate spacemanager interface

* load goerli and localhost

* embed json

* remove zion interface. Use contracts directly

* split user identifiter into address and chain id

* isAllowed in routing.go

* remove permission.go

Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-10-24 21:24:35 -07:00
Tak Wai Wong c9ec018121
Authorization - config, interface, and default implementation (#33)
* add config yaml for enable_auth

* zion_space_manager_localhost.go

* Placeholders for authorization

* rename func and type

* re-run go mod tidy

Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-10-24 21:24:35 -07:00
Brian Meek b8342738ac
Setup foundry to build abi.json files (#509)
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:23:17 -07:00
Brian Meek 1a2a0db1a3
Update to the latest go-ethereum
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:22:24 -07:00
Brian Meek 68d9300ec0
After discovering the full path using the go nm tool, properly set the ReleaseVersion in the clientapi router
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:20:49 -07:00
Brian Meek 93ea0f5864
Add commit ReleaseVersion to routing to return to clients in version request
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:18:59 -07:00
Brian Meek 4fe6a9e9da
Add commit hash to routing version API, TODO placeholder
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:18:59 -07:00
Brian Meek 8351e35287
Add commit hash to routing version API
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:18:58 -07:00
Tak Wai Wong 4d77bed1f0
Refresh dendrite subtree - pull changes for appservice bug (#457)
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-10-24 21:18:05 -07:00
Brian Meek db91fce6f0
Add commit hash to version API
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 21:16:32 -07:00
texuf 1f2f42494c
Fix broken notification incremental sync
I was not seeing unread notifications in sync, even if they were written to the db

Notifications are in their own stream, but the code was trying to tack them onto the join room stream. If the offsets “happened” to line up, you might get a count here or there, but they would be totally wrong (jump from 1 to 0 to 2, etc)

To fix, put them in their own top level object, handle them on the client.

Signed-off-by: Austin Ellis <austin@hntlabs.com>
2022-10-24 21:15:42 -07:00
Tak Wai Wong fbfde86914
Pull dendrite fork into the harmony repo (#423)
Austin's notification fix

Signed-off-by: Brian Meek <brian@hntlabs.com>
Signed-off-by: Austin Ellis <austin@hntlabs.com>
Co-authored-by: Brian Meek <brian@hntlabs.com>
Co-authored-by: texuf <texuf.eth@gmail.com>
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-10-24 20:05:09 -07:00
Brian Meek cda7734660
Fix test checking which clients connected
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:49 -07:00
Brian Meek befd9e6322
Fix test checking which clients connected
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:49 -07:00
Brian Meek cb184a7b3f
Update ReadAll to use non-deprecated version
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:49 -07:00
Brian Meek d641fed90b
Update golint and go versions
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:48 -07:00
Brian Meek 7e0e9bca34
Fix mispelling in comment
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:48 -07:00
Brian Meek 1bb8273d28
Add a delay before finishing the loadAndRunTests and destroying the dendrite docker container
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:48 -07:00
Brian Meek 1f0fce6235
Log events as string that are found when the dendrite-upgrade-tests fail to aid debugging
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:48 -07:00
Brian Meek 9e24a8d9cc
Log events that are found when the dendrite-upgrade-tests fail to aid debugging
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:48 -07:00
Brian Meek be116212c3
Update dependencies to see if it helps make tests more reliable, easier to debug
Signed-off-by: Brian Meek <brian@hntlabs.com>
2022-10-24 19:56:48 -07:00
Tak Wai Wong d1a5bf4e36
revert unintended rebase changes. 2022-10-24 19:56:22 -07:00
Tak Wai Wong 8392489a97
merge latest changes from dendrite main (#15)
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
2022-10-24 19:53:35 -07:00
Tak Wai Wong 8f77585eb5
Implement EIP-4361 sign in with Ethereum (#5)
* Blacklist some sytest tests that are failing in our environment

* Commenting out test that isn't reliably passing or failing, probably a race

* refresh latest dendrite main

* refresh latest dendrite main

* dendrite implementation of eip-4361

* simplify nonce generation

Co-authored-by: Brian Meek <brian@hntlabs.com>
Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
2022-10-24 19:53:01 -07:00
Tak Wai Wong 8c4b0c3d6f
Takwaiw/dendrite publickey (#2)
* Implementation of MSC 3782 Add publickey login as a new auth type.

Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
2022-10-24 19:53:01 -07:00
Brian Meek 348006647c
Test_UserStatistics Fix expected results to match observed results 2022-10-24 19:53:01 -07:00
Tak Wai Wong a2d0ea1be0
Implement EIP-4361 sign in with Ethereum (#5)
* Blacklist some sytest tests that are failing in our environment

* Commenting out test that isn't reliably passing or failing, probably a race

* refresh latest dendrite main

* refresh latest dendrite main

* dendrite implementation of eip-4361

* simplify nonce generation

Co-authored-by: Brian Meek <brian@hntlabs.com>
Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
2022-10-24 19:49:14 -07:00
Tak Wai Wong 3145a9dc52
Takwaiw/dendrite publickey (#2)
* Implementation of MSC 3782 Add publickey login as a new auth type.

Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
2022-10-24 19:44:47 -07:00
Brian Meek 56194c4e32
Test_UserStatistics Fix expected results to match observed results 2022-10-24 19:40:59 -07:00
Tak Wai Wong a6b3e46128
Pull latest dendrite fork into harmony (#252)
Latest dendrite main has changes for knockable rooms, and the fix for login crash. Pulled into dendrite fork. Rebased dendrite fork from dendrite main.

Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Co-authored-by: kegsay <kegan@matrix.org>
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
Co-authored-by: texuf <texuf.eth@gmail.com>
Co-authored-by: Brian Meek <brian@hntlabs.com>
Co-authored-by: Tak Wai Wong <takwaiw@gmail.com>
2022-10-24 19:40:52 -07:00