Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update the authClient with token #284

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmd/venus-market/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down