refactor: update GMSL (#3058)

Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364

Read this commit by commit to avoid going insane.
This commit is contained in:
kegsay 2023-04-19 15:50:33 +01:00 committed by GitHub
parent 9fa39263c0
commit 72285b2659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
306 changed files with 2117 additions and 1934 deletions

View file

@ -19,8 +19,8 @@ import (
"reflect"
"testing"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/fclient"
"github.com/matrix-org/gomatrixserverlib/spec"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
)
@ -275,7 +275,7 @@ func Test_SigningIdentityFor(t *testing.T) {
tests := []struct {
name string
virtualHosts []*VirtualHost
serverName gomatrixserverlib.ServerName
serverName spec.ServerName
want *fclient.SigningIdentity
wantErr bool
}{
@ -285,17 +285,17 @@ func Test_SigningIdentityFor(t *testing.T) {
},
{
name: "no identity found",
serverName: gomatrixserverlib.ServerName("doesnotexist"),
serverName: spec.ServerName("doesnotexist"),
wantErr: true,
},
{
name: "found identity",
serverName: gomatrixserverlib.ServerName("main"),
serverName: spec.ServerName("main"),
want: &fclient.SigningIdentity{ServerName: "main"},
},
{
name: "identity found on virtual hosts",
serverName: gomatrixserverlib.ServerName("vh2"),
serverName: spec.ServerName("vh2"),
virtualHosts: []*VirtualHost{
{SigningIdentity: fclient.SigningIdentity{ServerName: "vh1"}},
{SigningIdentity: fclient.SigningIdentity{ServerName: "vh2"}},