From cd8c91cd4535942974d0f0da3178a497e93e90c2 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 12 Jan 2023 19:22:31 +0000 Subject: [PATCH 01/12] Use stable identifiers for faster joins --- internal/federation/handle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/federation/handle.go b/internal/federation/handle.go index 9121b5e1..e0b3500c 100644 --- a/internal/federation/handle.go +++ b/internal/federation/handle.go @@ -136,7 +136,7 @@ func SendJoinRequestsHandler(s *Server, w http.ResponseWriter, req *http.Request // if we expect a partial-state join, the request should have a "partial_state" flag queryParams := req.URL.Query() - partialState := queryParams.Get("org.matrix.msc3706.partial_state") + partialState := queryParams.Get("omit_members") if expectPartialState && partialState != "true" { log.Printf("Not a partial-state request: got %v, want %s", partialState, "true") From 1557661174519259e1be71d72442539f3b6d0d89 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 12 Jan 2023 19:27:22 +0000 Subject: [PATCH 02/12] Pull in corresponding GMSL changes ``` $ go get -u github.com/matrix-org/gomatrixserverlib@dmr/msc-3706-stable-identifiers go: downloading github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b go: downloading golang.org/x/crypto v0.5.0 go: downloading github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 go: downloading github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 go: downloading github.com/tidwall/gjson v1.14.4 go: downloading golang.org/x/sys v0.4.0 go: downloading github.com/tidwall/pretty v1.2.1 go: downloading golang.org/x/text v0.6.0 go: downloading golang.org/x/net v0.5.0 go: downloading golang.org/x/tools v0.1.12 go: downloading github.com/miekg/dns v1.1.50 go: downloading gopkg.in/h2non/gock.v1 v1.1.2 go: downloading github.com/stretchr/testify v1.8.0 go: upgraded github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 => v0.0.0-20220926102614-ceba4d9f7530 go: upgraded github.com/matrix-org/gomatrixserverlib v0.0.0-20220830164018-c71e518537a2 => v0.0.0-20230112185427-4f65e88d2a5b go: upgraded github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 => v0.0.0-20221111132719-399730281e66 go: upgraded github.com/tidwall/gjson v1.14.3 => v1.14.4 go: upgraded github.com/tidwall/pretty v1.2.0 => v1.2.1 go: upgraded golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 => v0.5.0 go: upgraded golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 => v0.5.0 go: upgraded golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 => v0.4.0 go: upgraded golang.org/x/tools v0.1.9 => v0.1.12 go: upgraded gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b => v3.0.1 ``` --- go.mod | 17 ++++++++--------- go.sum | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 084f572b..e5edd8b1 100644 --- a/go.mod +++ b/go.mod @@ -11,25 +11,24 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/gorilla/mux v1.8.0 - github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 - github.com/matrix-org/gomatrixserverlib v0.0.0-20220830164018-c71e518537a2 - github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 + github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect + github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 + github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b + github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect github.com/sirupsen/logrus v1.9.0 - github.com/tidwall/gjson v1.14.3 + github.com/tidwall/gjson v1.14.4 + github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect + golang.org/x/crypto v0.5.0 // indirect golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 // indirect golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect - golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - golang.org/x/tools v0.1.9 + golang.org/x/tools v0.1.12 gonum.org/v1/plot v0.11.0 - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect gotest.tools/v3 v3.0.3 // indirect maunium.net/go/mautrix v0.11.0 ) diff --git a/go.sum b/go.sum index c17dbf32..084b87fc 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,7 @@ github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyR github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -32,6 +33,7 @@ github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/ github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/frankban/quicktest v1.0.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/go-fonts/dejavu v0.1.0 h1:JSajPXURYqpr+Cu8U9bt8K+XcACIHWqWrvWCKyeFmVQ= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/latin-modern v0.2.0 h1:5/Tv1Ek/QCr20C6ZOz15vw3g7GELYL98KWr8Hgo+3vk= @@ -58,6 +60,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -71,19 +74,30 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5dLDCud4r0r55eP4j9FuUNpl60Gmntcop4= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= +github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 h1:kHKxCOLcHH8r4Fzarl4+Y3K5hjothkVW5z7T1dUM11U= +github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= github.com/matrix-org/gomatrixserverlib v0.0.0-20220830164018-c71e518537a2 h1:esbNn9hg//tAStA6TogatAJAursw23A+yfVRQsdiv70= github.com/matrix-org/gomatrixserverlib v0.0.0-20220830164018-c71e518537a2/go.mod h1:jX38yp3SSLJNftBg3PXU1ayd0PCLIiDHQ4xAc9DIixk= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b h1:KF04qwpznTsjdnAkxdXB52T9o/aYdUKywfqrtDNlZ4E= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 h1:eCEHXWDv9Rm335MSuB49mFUK44bwZPFSDde3ORE3syk= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= +github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 h1:6z4KxomXSIGWqhHcfzExgkH3Z3UkIXry4ibJS4Aqz2Y= +github.com/matrix-org/util v0.0.0-20221111132719-399730281e66/go.mod h1:iBI1foelCqA09JJgPV0FYz4qA5dUXYOxMi57FxKBdd4= github.com/mattn/go-sqlite3 v1.14.13/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg= github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= +github.com/miekg/dns v1.1.50/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 h1:yH0SvLzcbZxcJXho2yh7CqdENGMQe73Cw3woZBpPli0= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= @@ -101,6 +115,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -110,27 +125,36 @@ github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= +github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.12/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -138,9 +162,13 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220513210258-46612604a0f9/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -169,22 +197,33 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220513224357-95641704303c/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220919232410-f2f64ebce3c1/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220907140024-f12130a52804/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -199,17 +238,27 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -217,6 +266,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -230,8 +281,11 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -248,9 +302,14 @@ gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= gonum.org/v1/plot v0.11.0 h1:z2ZkgNqW34d0oYUzd80RRlc0L9kWtenqK4kflZG1lGc= gonum.org/v1/plot v0.11.0/go.mod h1:fH9YnKnDKax0u5EzHVXvhN5HJwtMFWIOLNuhgUahbCQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/h2non/gock.v1 v1.0.14 h1:fTeu9fcUvSnLNacYvYI54h+1/XEteDyHvrVCZEEEYNM= gopkg.in/h2non/gock.v1 v1.0.14/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= +gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -259,6 +318,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= From 5de6bcb891cb9a53da673260e45a50fac78633c9 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 12:19:03 +0000 Subject: [PATCH 03/12] Adapt to GMSL secondary server names change See https://github.com/matrix-org/gomatrixserverlib/pull/344 AFAICS passing nil means that the server isn't going to accept any vhosting shenanigans. --- internal/federation/handle.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/federation/handle.go b/internal/federation/handle.go index e0b3500c..b94db3ce 100644 --- a/internal/federation/handle.go +++ b/internal/federation/handle.go @@ -18,7 +18,7 @@ import ( func MakeJoinRequestsHandler(s *Server, w http.ResponseWriter, req *http.Request) { // Check federation signature fedReq, errResp := gomatrixserverlib.VerifyHTTPRequest( - req, time.Now(), gomatrixserverlib.ServerName(s.serverName), s.keyRing, + req, time.Now(), gomatrixserverlib.ServerName(s.serverName), nil, s.keyRing, ) if fedReq == nil { w.WriteHeader(errResp.Code) @@ -125,7 +125,7 @@ func MakeRespMakeKnock(s *Server, room *ServerRoom, userID string) (resp gomatri // the current server is returned to the joining server. func SendJoinRequestsHandler(s *Server, w http.ResponseWriter, req *http.Request, expectPartialState bool, omitServersInRoom bool) { fedReq, errResp := gomatrixserverlib.VerifyHTTPRequest( - req, time.Now(), gomatrixserverlib.ServerName(s.serverName), s.keyRing, + req, time.Now(), gomatrixserverlib.ServerName(s.serverName), nil, s.keyRing, ) if fedReq == nil { w.WriteHeader(errResp.Code) @@ -238,7 +238,7 @@ func HandleInviteRequests(inviteCallback func(*gomatrixserverlib.Event)) func(*S // https://matrix.org/docs/spec/server_server/r0.1.4#put-matrix-federation-v2-invite-roomid-eventid s.mux.Handle("/_matrix/federation/v2/invite/{roomID}/{eventID}", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { fedReq, errResp := gomatrixserverlib.VerifyHTTPRequest( - req, time.Now(), gomatrixserverlib.ServerName(s.serverName), s.keyRing, + req, time.Now(), gomatrixserverlib.ServerName(s.serverName), nil, s.keyRing, ) if fedReq == nil { w.WriteHeader(errResp.Code) @@ -491,7 +491,7 @@ func HandleTransactionRequests(pduCallback func(*gomatrixserverlib.Event), eduCa // Check federation signature fedReq, errResp := gomatrixserverlib.VerifyHTTPRequest( - req, time.Now(), gomatrixserverlib.ServerName(srv.serverName), srv.keyRing, + req, time.Now(), gomatrixserverlib.ServerName(srv.serverName), nil, srv.keyRing, ) if fedReq == nil { log.Printf( From 9b3b082ed2e61bb4f1fb668b67448509e0f832e5 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 12:36:38 +0000 Subject: [PATCH 04/12] GMSL signing identity changes https://github.com/matrix-org/gomatrixserverlib/commit/900369eadf392f7cfeff66a2c56c0705df9496e1 --- internal/federation/server.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/internal/federation/server.go b/internal/federation/server.go index cd5432ab..ed7974d1 100644 --- a/internal/federation/server.go +++ b/internal/federation/server.go @@ -186,8 +186,13 @@ func (s *Server) FederationClient(deployment *docker.Deployment) *gomatrixserver if !s.listening { s.t.Fatalf("FederationClient() called before Listen() - this is not supported because Listen() chooses a high-numbered port and thus changes the server name and thus changes the way federation requests are signed. Ensure you Listen() first!") } + identity := gomatrixserverlib.SigningIdentity{ + ServerName: gomatrixserverlib.ServerName(s.ServerName()), + KeyID: s.KeyID, + PrivateKey: s.Priv, + } f := gomatrixserverlib.NewFederationClient( - gomatrixserverlib.ServerName(s.serverName), s.KeyID, s.Priv, + []*gomatrixserverlib.SigningIdentity{&identity}, gomatrixserverlib.WithTransport(&docker.RoundTripper{Deployment: deployment}), ) return f @@ -336,17 +341,18 @@ func (s *Server) MustCreateEvent(t *testing.T, room *ServerRoom, ev b.Event) *go // It returns the resultant room. func (s *Server) MustJoinRoom(t *testing.T, deployment *docker.Deployment, remoteServer gomatrixserverlib.ServerName, roomID string, userID string) *ServerRoom { t.Helper() + origin := gomatrixserverlib.ServerName(s.serverName) fedClient := s.FederationClient(deployment) - makeJoinResp, err := fedClient.MakeJoin(context.Background(), remoteServer, roomID, userID, SupportedRoomVersions()) + makeJoinResp, err := fedClient.MakeJoin(context.Background(), origin, remoteServer, roomID, userID, SupportedRoomVersions()) if err != nil { t.Fatalf("MustJoinRoom: make_join failed: %v", err) } roomVer := makeJoinResp.RoomVersion - joinEvent, err := makeJoinResp.JoinEvent.Build(time.Now(), gomatrixserverlib.ServerName(s.serverName), s.KeyID, s.Priv, roomVer) + joinEvent, err := makeJoinResp.JoinEvent.Build(time.Now(), origin, s.KeyID, s.Priv, roomVer) if err != nil { t.Fatalf("MustJoinRoom: failed to sign event: %v", err) } - sendJoinResp, err := fedClient.SendJoin(context.Background(), gomatrixserverlib.ServerName(remoteServer), joinEvent) + sendJoinResp, err := fedClient.SendJoin(context.Background(), origin, remoteServer, joinEvent) if err != nil { t.Fatalf("MustJoinRoom: send_join failed: %v", err) } @@ -366,17 +372,18 @@ func (s *Server) MustJoinRoom(t *testing.T, deployment *docker.Deployment, remot // Leaves a room. If this is rejecting an invite then a make_leave request is made first, before send_leave. func (s *Server) MustLeaveRoom(t *testing.T, deployment *docker.Deployment, remoteServer gomatrixserverlib.ServerName, roomID string, userID string) { t.Helper() + origin := gomatrixserverlib.ServerName(s.serverName) fedClient := s.FederationClient(deployment) var leaveEvent *gomatrixserverlib.Event room := s.rooms[roomID] if room == nil { // e.g rejecting an invite - makeLeaveResp, err := fedClient.MakeLeave(context.Background(), remoteServer, roomID, userID) + makeLeaveResp, err := fedClient.MakeLeave(context.Background(), origin, remoteServer, roomID, userID) if err != nil { t.Fatalf("MustLeaveRoom: (rejecting invite) make_leave failed: %v", err) } roomVer := makeLeaveResp.RoomVersion - leaveEvent, err = makeLeaveResp.LeaveEvent.Build(time.Now(), gomatrixserverlib.ServerName(s.serverName), s.KeyID, s.Priv, roomVer) + leaveEvent, err = makeLeaveResp.LeaveEvent.Build(time.Now(), origin, s.KeyID, s.Priv, roomVer) if err != nil { t.Fatalf("MustLeaveRoom: (rejecting invite) failed to sign event: %v", err) } @@ -391,7 +398,7 @@ func (s *Server) MustLeaveRoom(t *testing.T, deployment *docker.Deployment, remo }, }) } - err := fedClient.SendLeave(context.Background(), gomatrixserverlib.ServerName(remoteServer), leaveEvent) + err := fedClient.SendLeave(context.Background(), origin, remoteServer, leaveEvent) if err != nil { t.Fatalf("MustLeaveRoom: send_leave failed: %v", err) } @@ -407,7 +414,7 @@ func (s *Server) ValidFederationRequest(t *testing.T, handler func(fr *gomatrixs return func(w http.ResponseWriter, req *http.Request) { // Check federation signature fedReq, errResp := gomatrixserverlib.VerifyHTTPRequest( - req, time.Now(), gomatrixserverlib.ServerName(s.serverName), s.keyRing, + req, time.Now(), gomatrixserverlib.ServerName(s.serverName), nil, s.keyRing, ) if fedReq == nil { t.Errorf( From a31b5105bcd2bbe339b196c14f4ffc8ac1ad9170 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 13:17:35 +0000 Subject: [PATCH 05/12] More `origin` arguments there's probably a neater way to not write `gomatrixserverlib.ServerName` but idk what the best thing to do is here. --- tests/direct_messaging_test.go | 2 +- tests/federation_event_auth_test.go | 2 +- tests/federation_query_profile_test.go | 3 +++ ...federation_room_get_missing_events_test.go | 5 ++++- tests/federation_room_join_test.go | 20 ++++++++++--------- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/direct_messaging_test.go b/tests/direct_messaging_test.go index 0a980c11..6b310a03 100644 --- a/tests/direct_messaging_test.go +++ b/tests/direct_messaging_test.go @@ -138,7 +138,7 @@ func TestIsDirectFlagFederation(t *testing.T) { t.Fatalf("failed to make invite request: %s", err) } _, since := alice.MustSync(t, client.SyncReq{}) - _, err = srv.FederationClient(deployment).SendInviteV2(context.Background(), "hs1", inviteReq) + _, err = srv.FederationClient(deployment).SendInviteV2(context.Background(), gomatrixserverlib.ServerName(srv.ServerName()), "hs1", inviteReq) if err != nil { t.Fatalf("failed to send invite v2: %s", err) } diff --git a/tests/federation_event_auth_test.go b/tests/federation_event_auth_test.go index 4d3b85e5..cbad14ea 100644 --- a/tests/federation_event_auth_test.go +++ b/tests/federation_event_auth_test.go @@ -77,7 +77,7 @@ func TestEventAuth(t *testing.T) { getEventAuth := func(t *testing.T, eventID string, wantAuthEventIDs []string) { t.Helper() t.Logf("/event_auth for %s - want %v", eventID, wantAuthEventIDs) - eventAuthResp, err := srv.FederationClient(deployment).GetEventAuth(context.Background(), "hs1", room.Version, roomID, eventID) + eventAuthResp, err := srv.FederationClient(deployment).GetEventAuth(context.Background(), gomatrixserverlib.ServerName(srv.ServerName()), "hs1", room.Version, roomID, eventID) must.NotError(t, "failed to /event_auth", err) if len(eventAuthResp.AuthEvents) == 0 { t.Fatalf("/event_auth returned 0 auth events") diff --git a/tests/federation_query_profile_test.go b/tests/federation_query_profile_test.go index 3874c328..d586fda1 100644 --- a/tests/federation_query_profile_test.go +++ b/tests/federation_query_profile_test.go @@ -77,6 +77,7 @@ func TestInboundFederationProfile(t *testing.T) { srv := federation.NewServer(t, deployment, federation.HandleKeyRequests(), ) + origin := gomatrixserverlib.ServerName(srv.ServerName()) cancel := srv.Listen() defer cancel() @@ -84,6 +85,7 @@ func TestInboundFederationProfile(t *testing.T) { t.Run("Non-numeric ports in server names are rejected", func(t *testing.T) { fedReq := gomatrixserverlib.NewFederationRequest( "GET", + origin, "hs1", "/_matrix/federation/v1/query/profile"+ "?user_id=@user1:localhost:http"+ @@ -114,6 +116,7 @@ func TestInboundFederationProfile(t *testing.T) { fedReq := gomatrixserverlib.NewFederationRequest( "GET", + origin, "hs1", "/_matrix/federation/v1/query/profile"+ "?user_id=@alice:hs1"+ diff --git a/tests/federation_room_get_missing_events_test.go b/tests/federation_room_get_missing_events_test.go index 87f0bae3..3d3cddd7 100644 --- a/tests/federation_room_get_missing_events_test.go +++ b/tests/federation_room_get_missing_events_test.go @@ -367,7 +367,10 @@ func TestInboundCanReturnMissingEvents(t *testing.T) { room := srv.MustJoinRoom(t, deployment, "hs1", roomID, charlie) alice.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(charlie, roomID)) - req := gomatrixserverlib.NewFederationRequest("POST", "hs1", + req := gomatrixserverlib.NewFederationRequest( + "POST", + gomatrixserverlib.ServerName(srv.ServerName()), + "hs1", fmt.Sprintf("/_matrix/federation/v1/get_missing_events/%s", roomID), ) diff --git a/tests/federation_room_join_test.go b/tests/federation_room_join_test.go index d4e4bbbb..9867323e 100644 --- a/tests/federation_room_join_test.go +++ b/tests/federation_room_join_test.go @@ -266,6 +266,7 @@ func TestBannedUserCannotSendJoin(t *testing.T) { federation.HandleKeyRequests(), federation.HandleTransactionRequests(nil, nil), ) + origin := gomatrixserverlib.ServerName(srv.ServerName()) cancel := srv.Listen() defer cancel() @@ -289,7 +290,7 @@ func TestBannedUserCannotSendJoin(t *testing.T) { }) // charlie sends a make_join for a different user - makeJoinResp, err := fedClient.MakeJoin(context.Background(), "hs1", roomID, srv.UserID("charlie2"), federation.SupportedRoomVersions()) + makeJoinResp, err := fedClient.MakeJoin(context.Background(), origin, "hs1", roomID, srv.UserID("charlie2"), federation.SupportedRoomVersions()) must.NotError(t, "MakeJoin", err) // ... and does a switcheroo to turn it into a join for himself @@ -299,7 +300,7 @@ func TestBannedUserCannotSendJoin(t *testing.T) { must.NotError(t, "JoinEvent.Build", err) // SendJoin should return a 403. - _, err = fedClient.SendJoin(context.Background(), "hs1", joinEvent) + _, err = fedClient.SendJoin(context.Background(), origin, "hs1", joinEvent) if err == nil { t.Errorf("SendJoin returned 200, want 403") } else if httpError, ok := err.(gomatrix.HTTPError); ok { @@ -380,7 +381,7 @@ func testValidationForSendMembershipEndpoint(t *testing.T, baseApiPath, expected url.PathEscape(event.EventID()), ) t.Logf("PUT %s", path) - req := gomatrixserverlib.NewFederationRequest("PUT", "hs1", path) + req := gomatrixserverlib.NewFederationRequest("PUT", gomatrixserverlib.ServerName(srv.ServerName()), "hs1", path) if err := req.SetContent(event); err != nil { t.Errorf("req.SetContent: %v", err) return @@ -467,6 +468,7 @@ func TestSendJoinPartialStateResponse(t *testing.T) { // accept incoming presence transactions, etc federation.HandleTransactionRequests(nil, nil), ) + origin := gomatrixserverlib.ServerName(srv.ServerName()) cancel := srv.Listen() defer cancel() @@ -481,20 +483,20 @@ func TestSendJoinPartialStateResponse(t *testing.T) { // now we send a make_join... charlie := srv.UserID("charlie") fedClient := srv.FederationClient(deployment) - makeJoinResp, err := fedClient.MakeJoin(context.Background(), "hs1", roomID, charlie, federation.SupportedRoomVersions()) + makeJoinResp, err := fedClient.MakeJoin(context.Background(), origin, "hs1", roomID, charlie, federation.SupportedRoomVersions()) if err != nil { t.Fatalf("make_join failed: %v", err) } // ... construct a signed join event ... roomVer := makeJoinResp.RoomVersion - joinEvent, err := makeJoinResp.JoinEvent.Build(time.Now(), gomatrixserverlib.ServerName(srv.ServerName()), srv.KeyID, srv.Priv, roomVer) + joinEvent, err := makeJoinResp.JoinEvent.Build(time.Now(), origin, srv.KeyID, srv.Priv, roomVer) if err != nil { t.Fatalf("failed to sign join event: %v", err) } // and send_join it, with the magic param - sendJoinResp, err := fedClient.SendJoinPartialState(context.Background(), "hs1", joinEvent) + sendJoinResp, err := fedClient.SendJoinPartialState(context.Background(), origin, "hs1", joinEvent) if err != nil { t.Fatalf("send_join failed: %v", err) } @@ -519,8 +521,8 @@ func TestSendJoinPartialStateResponse(t *testing.T) { }) // check the returned auth events match those expected. - // Now that we include heroes in the partial join response, - // all of the events are included under "state" and so we don't expect any + // Now that we include heroes in the partial join response, + // all of the events are included under "state" and so we don't expect any // extra auth_events. // TODO: add in a second e.g. power_levels event so that we add stuff to the // auth chain. @@ -528,7 +530,7 @@ func TestSendJoinPartialStateResponse(t *testing.T) { for _, ev := range sendJoinResp.AuthEvents { returnedAuthEventKeys = append(returnedAuthEventKeys, typeAndStateKeyForEvent(gjson.ParseBytes(ev))) } - must.CheckOffAll(t, returnedAuthEventKeys, []interface{}{ }) + must.CheckOffAll(t, returnedAuthEventKeys, []interface{}{}) // check the server list. Only one, so we can use HaveInOrder even though the list is unordered must.HaveInOrder(t, sendJoinResp.ServersInRoom, []string{"hs1"}) From fe5887f0907b88a9c562a67009200b8b7af26545 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 13:40:18 +0000 Subject: [PATCH 06/12] And some more that I missed due to build tags --- tests/federation_room_join_partial_state_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/federation_room_join_partial_state_test.go b/tests/federation_room_join_partial_state_test.go index 83021ef0..4d12b940 100644 --- a/tests/federation_room_join_partial_state_test.go +++ b/tests/federation_room_join_partial_state_test.go @@ -1560,7 +1560,7 @@ func TestPartialStateJoin(t *testing.T) { fedClient2 := testServer2.FederationClient(deployment) // charlie sends a make_join - _, err := fedClient2.MakeJoin(context.Background(), "hs1", roomID, testServer2.UserID("charlie"), federation.SupportedRoomVersions()) + _, err := fedClient2.MakeJoin(context.Background(), gomatrixserverlib.ServerName(testServer2.ServerName()), "hs1", roomID, testServer2.UserID("charlie"), federation.SupportedRoomVersions()) if err == nil { t.Errorf("MakeJoin returned 200, want 404") @@ -1627,7 +1627,7 @@ func TestPartialStateJoin(t *testing.T) { // SendJoin should return a 404 because the homeserver under test has not // finished its partial join. - _, err = fedClient2.SendJoin(context.Background(), "hs1", joinEvent) + _, err = fedClient2.SendJoin(context.Background(), gomatrixserverlib.ServerName(testServer2.ServerName()), "hs1", joinEvent) if err == nil { t.Errorf("SendJoin returned 200, want 404") } else if httpError, ok := err.(gomatrix.HTTPError); ok { @@ -1733,7 +1733,7 @@ func TestPartialStateJoin(t *testing.T) { fedClient2 := testServer2.FederationClient(deployment) // charlie sends a make_knock - _, err := fedClient2.MakeKnock(context.Background(), "hs1", roomID, testServer2.UserID("charlie"), federation.SupportedRoomVersions()) + _, err := fedClient2.MakeKnock(context.Background(), gomatrixserverlib.ServerName(testServer2.ServerName()), "hs1", roomID, testServer2.UserID("charlie"), federation.SupportedRoomVersions()) if err == nil { t.Errorf("MakeKnock returned 200, want 404") @@ -1800,7 +1800,7 @@ func TestPartialStateJoin(t *testing.T) { // SendKnock should return a 404 because the homeserver under test has not // finished its partial join. - _, err = fedClient2.SendKnock(context.Background(), "hs1", knockEvent) + _, err = fedClient2.SendKnock(context.Background(), gomatrixserverlib.ServerName(testServer2.ServerName()), "hs1", knockEvent) if err == nil { t.Errorf("SendKnock returned 200, want 404") } else if httpError, ok := err.(gomatrix.HTTPError); ok { @@ -3323,7 +3323,7 @@ func testReceiveEventDuringPartialStateJoin( // is resolved. For now, we use this to check whether Synapse has calculated the partial state // flag for the last event correctly. - stateReq := gomatrixserverlib.NewFederationRequest("GET", "hs1", + stateReq := gomatrixserverlib.NewFederationRequest("GET", gomatrixserverlib.ServerName(psjResult.Server.ServerName()), "hs1", fmt.Sprintf("/_matrix/federation/v1/state_ids/%s?event_id=%s", url.PathEscape(psjResult.ServerRoom.RoomID), url.QueryEscape(event.EventID()), @@ -3367,7 +3367,7 @@ func testReceiveEventDuringPartialStateJoin( ) // check the server's idea of the state at the event. We do this by making a `state_ids` request over federation - stateReq = gomatrixserverlib.NewFederationRequest("GET", "hs1", + stateReq = gomatrixserverlib.NewFederationRequest("GET", gomatrixserverlib.ServerName(psjResult.Server.ServerName()), "hs1", fmt.Sprintf("/_matrix/federation/v1/state_ids/%s?event_id=%s", url.PathEscape(psjResult.ServerRoom.RoomID), url.QueryEscape(event.EventID()), From 09b8f2695a7bce2062ceabad1f1186e57f7681d4 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 14:06:08 +0000 Subject: [PATCH 07/12] Need to call ServerName() after Listen() --- tests/federation_query_profile_test.go | 2 +- tests/federation_room_join_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/federation_query_profile_test.go b/tests/federation_query_profile_test.go index d586fda1..91a1d102 100644 --- a/tests/federation_query_profile_test.go +++ b/tests/federation_query_profile_test.go @@ -77,9 +77,9 @@ func TestInboundFederationProfile(t *testing.T) { srv := federation.NewServer(t, deployment, federation.HandleKeyRequests(), ) - origin := gomatrixserverlib.ServerName(srv.ServerName()) cancel := srv.Listen() defer cancel() + origin := gomatrixserverlib.ServerName(srv.ServerName()) // sytest: Non-numeric ports in server names are rejected t.Run("Non-numeric ports in server names are rejected", func(t *testing.T) { diff --git a/tests/federation_room_join_test.go b/tests/federation_room_join_test.go index 9867323e..7e02291b 100644 --- a/tests/federation_room_join_test.go +++ b/tests/federation_room_join_test.go @@ -266,8 +266,8 @@ func TestBannedUserCannotSendJoin(t *testing.T) { federation.HandleKeyRequests(), federation.HandleTransactionRequests(nil, nil), ) - origin := gomatrixserverlib.ServerName(srv.ServerName()) cancel := srv.Listen() + origin := gomatrixserverlib.ServerName(srv.ServerName()) defer cancel() fedClient := srv.FederationClient(deployment) @@ -468,9 +468,9 @@ func TestSendJoinPartialStateResponse(t *testing.T) { // accept incoming presence transactions, etc federation.HandleTransactionRequests(nil, nil), ) - origin := gomatrixserverlib.ServerName(srv.ServerName()) cancel := srv.Listen() defer cancel() + origin := gomatrixserverlib.ServerName(srv.ServerName()) // annoyingly we can't get to the room that alice and bob already share (see https://github.com/matrix-org/complement/issues/254) // so we have to create a new one. From de84cc01a7586ad8226a8a72ade43c2ceda62bd6 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 14:45:55 +0000 Subject: [PATCH 08/12] Update to GMSL PR changes --- go.mod | 2 +- go.sum | 2 ++ tests/federation_room_join_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index e5edd8b1..91d79423 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 - github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b + github.com/matrix-org/gomatrixserverlib v0.0.0-20230113143423-41fb88cc9ce1 github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 084b87fc..1089f03c 100644 --- a/go.sum +++ b/go.sum @@ -88,6 +88,8 @@ github.com/matrix-org/gomatrixserverlib v0.0.0-20220830164018-c71e518537a2 h1:es github.com/matrix-org/gomatrixserverlib v0.0.0-20220830164018-c71e518537a2/go.mod h1:jX38yp3SSLJNftBg3PXU1ayd0PCLIiDHQ4xAc9DIixk= github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b h1:KF04qwpznTsjdnAkxdXB52T9o/aYdUKywfqrtDNlZ4E= github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230113143423-41fb88cc9ce1 h1:BmOvd/I6QE/AsZSFLBQ1G+bSe+QXE3B7SN6fdgnfixI= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230113143423-41fb88cc9ce1/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 h1:eCEHXWDv9Rm335MSuB49mFUK44bwZPFSDde3ORE3syk= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= diff --git a/tests/federation_room_join_test.go b/tests/federation_room_join_test.go index 7e02291b..77c8fc75 100644 --- a/tests/federation_room_join_test.go +++ b/tests/federation_room_join_test.go @@ -501,8 +501,8 @@ func TestSendJoinPartialStateResponse(t *testing.T) { t.Fatalf("send_join failed: %v", err) } - if !sendJoinResp.PartialState { t.Skip("Server does not support partial_state") + if !sendJoinResp.MembersOmitted { } // check the returned state events match those expected From 30d8d05d71157df0209caa85baf0aa13890a0f7d Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 14:53:32 +0000 Subject: [PATCH 09/12] And another one I missed --- internal/federation/handle.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/federation/handle.go b/internal/federation/handle.go index b94db3ce..dd8cc12b 100644 --- a/internal/federation/handle.go +++ b/internal/federation/handle.go @@ -187,11 +187,11 @@ func SendJoinRequestsHandler(s *Server, w http.ResponseWriter, req *http.Request // return state and auth chain b, err := json.Marshal(gomatrixserverlib.RespSendJoin{ - Origin: gomatrixserverlib.ServerName(s.serverName), - AuthEvents: gomatrixserverlib.NewEventJSONsFromEvents(authEvents), - StateEvents: gomatrixserverlib.NewEventJSONsFromEvents(stateEvents), - PartialState: expectPartialState, - ServersInRoom: serversInRoom, + Origin: gomatrixserverlib.ServerName(s.serverName), + AuthEvents: gomatrixserverlib.NewEventJSONsFromEvents(authEvents), + StateEvents: gomatrixserverlib.NewEventJSONsFromEvents(stateEvents), + MembersOmitted: expectPartialState, + ServersInRoom: serversInRoom, }) if err != nil { w.WriteHeader(500) From 7972c6d53dab90e3c57b99582cc5a218e3ebac78 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 15:24:35 +0000 Subject: [PATCH 10/12] And another one I missed missed this one because struct fields are optional(?) --- tests/federation_room_get_missing_events_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/federation_room_get_missing_events_test.go b/tests/federation_room_get_missing_events_test.go index 3d3cddd7..1aeeb791 100644 --- a/tests/federation_room_get_missing_events_test.go +++ b/tests/federation_room_get_missing_events_test.go @@ -261,6 +261,7 @@ func TestOutboundFederationIgnoresMissingEventWithBadJSONForRoomVersion6(t *test fedClient := srv.FederationClient(deployment) resp, err := fedClient.SendTransaction(context.Background(), gomatrixserverlib.Transaction{ TransactionID: "wut", + Origin: gomatrixserverlib.ServerName(srv.ServerName()), Destination: gomatrixserverlib.ServerName("hs1"), PDUs: []json.RawMessage{ sentEvent.JSON(), @@ -306,6 +307,7 @@ func TestOutboundFederationIgnoresMissingEventWithBadJSONForRoomVersion6(t *test resp, err = fedClient.SendTransaction(context.Background(), gomatrixserverlib.Transaction{ TransactionID: "t2", + Origin: gomatrixserverlib.ServerName(srv.ServerName()), Destination: gomatrixserverlib.ServerName("hs1"), PDUs: []json.RawMessage{ message3.JSON(), From b625f849bf0bf8d10ff6eecc226e2efb48f0f632 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 18:24:41 +0000 Subject: [PATCH 11/12] Use main branch of GMSL --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 91d79423..39b747fc 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/matrix-org/gomatrix v0.0.0-20220926102614-ceba4d9f7530 - github.com/matrix-org/gomatrixserverlib v0.0.0-20230113143423-41fb88cc9ce1 + github.com/matrix-org/gomatrixserverlib v0.0.0-20230113181222-67e060196d05 github.com/matrix-org/util v0.0.0-20221111132719-399730281e66 github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect github.com/morikuni/aec v1.0.0 // indirect diff --git a/go.sum b/go.sum index 1089f03c..5ad7e5aa 100644 --- a/go.sum +++ b/go.sum @@ -90,6 +90,8 @@ github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b h1:KF github.com/matrix-org/gomatrixserverlib v0.0.0-20230112185427-4f65e88d2a5b/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= github.com/matrix-org/gomatrixserverlib v0.0.0-20230113143423-41fb88cc9ce1 h1:BmOvd/I6QE/AsZSFLBQ1G+bSe+QXE3B7SN6fdgnfixI= github.com/matrix-org/gomatrixserverlib v0.0.0-20230113143423-41fb88cc9ce1/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230113181222-67e060196d05 h1:b0bSn6mQXKC0rktS5CZS/4imu643NYccnpSCv/w6xWc= +github.com/matrix-org/gomatrixserverlib v0.0.0-20230113181222-67e060196d05/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 h1:eCEHXWDv9Rm335MSuB49mFUK44bwZPFSDde3ORE3syk= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= From 323490a59ae39e050c255b41e824bcbcc96cad19 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 13 Jan 2023 18:36:19 +0000 Subject: [PATCH 12/12] Fix bad git hygiene --- tests/federation_room_join_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/federation_room_join_test.go b/tests/federation_room_join_test.go index 77c8fc75..cd178f7b 100644 --- a/tests/federation_room_join_test.go +++ b/tests/federation_room_join_test.go @@ -501,8 +501,8 @@ func TestSendJoinPartialStateResponse(t *testing.T) { t.Fatalf("send_join failed: %v", err) } - t.Skip("Server does not support partial_state") if !sendJoinResp.MembersOmitted { + t.Skip("Server does not support partial_state") } // check the returned state events match those expected