diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-01-22 16:09:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-22 16:09:05 +0000 |
commit | 6757b67a321c684769ad022351541c7c6417c693 (patch) | |
tree | 261accd97b834dfb42b9bbade97a4e3c2067e3d2 /cmd | |
parent | 93942f8ab62ffdb55888d5d35adef6fe73e3ea59 (diff) |
NewClient and NewFederationClient updates (#1730)
* Use matrix-org/gomatrixserverlib#252
* Add missing WithSkipVerify to test
* Functions instead
* Update gomatrixserverlib to matrix-org/gomatrixserverlib#252
* Fix disabling TLS validation
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dendrite-demo-libp2p/main.go | 9 | ||||
-rw-r--r-- | cmd/dendrite-demo-yggdrasil/yggconn/client.go | 9 | ||||
-rw-r--r-- | cmd/dendritejs/main.go | 8 | ||||
-rw-r--r-- | cmd/furl/main.go | 1 |
4 files changed, 17 insertions, 10 deletions
diff --git a/cmd/dendrite-demo-libp2p/main.go b/cmd/dendrite-demo-libp2p/main.go index 3acec2fd..31e7739a 100644 --- a/cmd/dendrite-demo-libp2p/main.go +++ b/cmd/dendrite-demo-libp2p/main.go @@ -76,9 +76,10 @@ func createFederationClient( "matrix", p2phttp.NewTransport(base.LibP2P, p2phttp.ProtocolOption("/matrix")), ) - return gomatrixserverlib.NewFederationClientWithTransport( + return gomatrixserverlib.NewFederationClient( base.Base.Cfg.Global.ServerName, base.Base.Cfg.Global.KeyID, - base.Base.Cfg.Global.PrivateKey, true, tr, + base.Base.Cfg.Global.PrivateKey, + gomatrixserverlib.WithTransport(tr), ) } @@ -90,7 +91,9 @@ func createClient( "matrix", p2phttp.NewTransport(base.LibP2P, p2phttp.ProtocolOption("/matrix")), ) - return gomatrixserverlib.NewClientWithTransport(tr) + return gomatrixserverlib.NewClient( + gomatrixserverlib.WithTransport(tr), + ) } func main() { diff --git a/cmd/dendrite-demo-yggdrasil/yggconn/client.go b/cmd/dendrite-demo-yggdrasil/yggconn/client.go index ea51f4b1..157a9bf2 100644 --- a/cmd/dendrite-demo-yggdrasil/yggconn/client.go +++ b/cmd/dendrite-demo-yggdrasil/yggconn/client.go @@ -33,7 +33,9 @@ func (n *Node) CreateClient( }, }, ) - return gomatrixserverlib.NewClientWithTransport(tr) + return gomatrixserverlib.NewClient( + gomatrixserverlib.WithTransport(tr), + ) } func (n *Node) CreateFederationClient( @@ -53,8 +55,9 @@ func (n *Node) CreateFederationClient( }, }, ) - return gomatrixserverlib.NewFederationClientWithTransport( + return gomatrixserverlib.NewFederationClient( base.Cfg.Global.ServerName, base.Cfg.Global.KeyID, - base.Cfg.Global.PrivateKey, true, tr, + base.Cfg.Global.PrivateKey, + gomatrixserverlib.WithTransport(tr), ) } diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go index 1ffb1667..b77d141d 100644 --- a/cmd/dendritejs/main.go +++ b/cmd/dendritejs/main.go @@ -139,16 +139,18 @@ func createFederationClient(cfg *config.Dendrite, node *go_http_js_libp2p.P2pLoc tr := go_http_js_libp2p.NewP2pTransport(node) fed := gomatrixserverlib.NewFederationClient( - cfg.Global.ServerName, cfg.Global.KeyID, cfg.Global.PrivateKey, true, + cfg.Global.ServerName, cfg.Global.KeyID, cfg.Global.PrivateKey, + gomatrixserverlib.WithTransport(tr), ) - fed.Client = *gomatrixserverlib.NewClientWithTransport(tr) return fed } func createClient(node *go_http_js_libp2p.P2pLocalNode) *gomatrixserverlib.Client { tr := go_http_js_libp2p.NewP2pTransport(node) - return gomatrixserverlib.NewClientWithTransport(tr) + return gomatrixserverlib.NewClient( + gomatrixserverlib.WithTransport(tr), + ) } func createP2PNode(privKey ed25519.PrivateKey) (serverName string, node *go_http_js_libp2p.P2pLocalNode) { diff --git a/cmd/furl/main.go b/cmd/furl/main.go index 3955ef0c..bec04f0a 100644 --- a/cmd/furl/main.go +++ b/cmd/furl/main.go @@ -54,7 +54,6 @@ func main() { gomatrixserverlib.ServerName(*requestFrom), gomatrixserverlib.KeyID(keyBlock.Headers["Key-ID"]), privateKey, - false, ) u, err := url.Parse(flag.Arg(0)) |