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

@ -14,6 +14,7 @@ import (
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/fclient"
"github.com/matrix-org/gomatrixserverlib/spec"
)
var requestFrom = flag.String("from", "", "the server name that the request should originate from")
@ -49,7 +50,7 @@ func main() {
panic("unexpected key block")
}
serverName := gomatrixserverlib.ServerName(*requestFrom)
serverName := spec.ServerName(*requestFrom)
client := fclient.NewFederationClient(
[]*fclient.SigningIdentity{
{
@ -83,10 +84,10 @@ func main() {
}
}
req := gomatrixserverlib.NewFederationRequest(
req := fclient.NewFederationRequest(
method,
serverName,
gomatrixserverlib.ServerName(u.Host),
spec.ServerName(u.Host),
u.RequestURI(),
)
@ -97,7 +98,7 @@ func main() {
}
if err = req.Sign(
gomatrixserverlib.ServerName(*requestFrom),
spec.ServerName(*requestFrom),
gomatrixserverlib.KeyID(keyBlock.Headers["Key-ID"]),
privateKey,
); err != nil {