diff --git a/cmd/lotus/rpc.go b/cmd/lotus/rpc.go index 096b9b750..a0be6ecbe 100644 --- a/cmd/lotus/rpc.go +++ b/cmd/lotus/rpc.go @@ -4,12 +4,19 @@ import ( "net/http" "github.com/filecoin-project/go-lotus/api" + "github.com/filecoin-project/go-lotus/lib/auth" "github.com/filecoin-project/go-lotus/lib/jsonrpc" ) func serveRPC(a api.FullNode, addr string) error { rpcServer := jsonrpc.NewServer() rpcServer.Register("Filecoin", api.PermissionedFullAPI(a)) - http.Handle("/rpc/v0", rpcServer) + + ah := &auth.Handler{ + Verify: a.AuthVerify, + Next: rpcServer.ServeHTTP, + } + + http.Handle("/rpc/v0", ah) return http.ListenAndServe(addr, http.DefaultServeMux) }