From 1863f18e3e4dce0fb9ec81c5b1e776fc88ead03b Mon Sep 17 00:00:00 2001 From: tanlang Date: Wed, 8 Feb 2023 06:17:45 +0000 Subject: [PATCH] feat: update the authClient with token --- cmd/venus-market/run.go | 6 +++++- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/venus-market/run.go b/cmd/venus-market/run.go index 211b57c5..07c6724c 100644 --- a/cmd/venus-market/run.go +++ b/cmd/venus-market/run.go @@ -100,6 +100,7 @@ func flagData(cctx *cli.Context, cfg *config.MarketConfig) error { if cctx.IsSet(ChainServiceTokenFlag.Name) { cfg.Signer.Token = cctx.String(ChainServiceTokenFlag.Name) + cfg.AuthNode.Token = cctx.String(ChainServiceTokenFlag.Name) } default: return fmt.Errorf("unsupport signer type %s", signerType) @@ -174,7 +175,10 @@ func runDaemon(cctx *cli.Context) error { // 'NewAuthClient' never returns an error, no needs to check var authClient *jwtclient.AuthClient if len(cfg.AuthNode.Url) != 0 { - authClient, _ = jwtclient.NewAuthClient(cfg.AuthNode.Url) + if len(cfg.AuthNode.Token) == 0 { + return fmt.Errorf("the auth node token must be configured if auth node url is configured") + } + authClient, _ = jwtclient.NewAuthClient(cfg.AuthNode.Url, cfg.AuthNode.Token) } resAPI := &impl.MarketNodeImpl{} diff --git a/go.mod b/go.mod index b461108b..bc7734e0 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/filecoin-project/specs-actors/v2 v2.3.6 github.com/filecoin-project/specs-actors/v7 v7.0.1 github.com/filecoin-project/venus v1.9.0-rc1.0.20230203064217-14f0513a243e - github.com/filecoin-project/venus-auth v1.9.0 + github.com/filecoin-project/venus-auth v1.9.1-0.20230208033930-699a27d22669 github.com/filecoin-project/venus-messager v1.9.0-rc1 github.com/golang/mock v1.6.0 github.com/google/uuid v1.3.0 diff --git a/go.sum b/go.sum index 80c659be..3e7b0fb1 100644 --- a/go.sum +++ b/go.sum @@ -460,8 +460,8 @@ github.com/filecoin-project/venus v1.2.4/go.mod h1:hJULXHGAnWuq5S5KRtPkwbT8DqgM9 github.com/filecoin-project/venus v1.9.0-rc1.0.20230203064217-14f0513a243e h1:l2EhKlBboVUij2CTf0iHtQvrCmOn52qTbtJAvjDjxss= github.com/filecoin-project/venus v1.9.0-rc1.0.20230203064217-14f0513a243e/go.mod h1:TIRaBucKJIIe0QxuSWsRkO6fpRdKWdYY990KjQ/Fa38= github.com/filecoin-project/venus-auth v1.3.2/go.mod h1:m5Jog2GYxztwP7w3m/iJdv/V1/bTcAVU9rm/CbhxRQU= -github.com/filecoin-project/venus-auth v1.9.0 h1:GH0o/jPdF55/U/uLoMzrqR9+DOsMf5oWM/X4UPuyWPA= -github.com/filecoin-project/venus-auth v1.9.0/go.mod h1:Ckj8F/iuSgXnCb9LvH0IiPR7swJZQAhabDOxVycLGWs= +github.com/filecoin-project/venus-auth v1.9.1-0.20230208033930-699a27d22669 h1:zIdLFAS6yrnceP0JLr10sNoDytXqYIZm9O/JatPk1CM= +github.com/filecoin-project/venus-auth v1.9.1-0.20230208033930-699a27d22669/go.mod h1:KWO++PuwXfcc4nA9LFFy1E3d39M/APL/1aU6vQNfUW0= github.com/filecoin-project/venus-messager v1.9.0-rc1 h1:NpjCXY1IMfUhoNvvocNxIirC+Q8iZsQYB8XXHe7s5mY= github.com/filecoin-project/venus-messager v1.9.0-rc1/go.mod h1:1v7uhBYR1IsIeCud4a+scDVNgVtjCxS/DVIxnXQiuMo= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=