Skip to content

Commit

Permalink
Merge pull request #317 from filecoin-project/feat/tanlang/Update-the…
Browse files Browse the repository at this point in the history
…-authClient-with-token

feat: update the authClient with token
  • Loading branch information
simlecode authored Feb 27, 2023
2 parents a32bc4a + d25548a commit e6ee58d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type MySqlConfig struct {

type JWTConfig struct {
AuthURL string `toml:"authURL"`
Token string `toml:"token"`
}

const (
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ require (
github.com/filecoin-project/go-address v1.0.0
github.com/filecoin-project/go-bitfield v0.2.4
github.com/filecoin-project/go-jsonrpc v0.1.5
github.com/filecoin-project/go-state-types v0.9.8
github.com/filecoin-project/go-state-types v0.9.9
github.com/filecoin-project/specs-actors/v5 v5.0.6
github.com/filecoin-project/venus v1.9.0-rc1.0.20230105034113-333817b172f5
github.com/filecoin-project/venus-auth v1.9.0
github.com/filecoin-project/venus v1.9.0-rc1.0.20230110072447-c4bf086f7bc9
github.com/filecoin-project/venus-auth v1.9.1-0.20230208033930-699a27d22669
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/hunjixin/automapper v0.0.0-20191127090318-9b979ce72ce2
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ github.com/filecoin-project/go-state-types v0.1.3/go.mod h1:ezYnPf0bNkTsDibL/psS
github.com/filecoin-project/go-state-types v0.1.4/go.mod h1:xCA/WfKlC2zcn3fUmDv4IrzznwS98X5XW/irUP3Lhxg=
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.9.8 h1:xkdITiR7h691z1tWOhNCJxHI+cq+Mq7ATkpHQ7f1gu8=
github.com/filecoin-project/go-state-types v0.9.8/go.mod h1:+HCZifUV+e8TlQkgll22Ucuiq8OrVJkK+4Kh4u75iiw=
github.com/filecoin-project/go-state-types v0.9.9 h1:gd7Mo6f9jHHpLahttBE88YeQA77i4GK6W5kFdQDnuME=
github.com/filecoin-project/go-state-types v0.9.9/go.mod h1:+HCZifUV+e8TlQkgll22Ucuiq8OrVJkK+4Kh4u75iiw=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statemachine v1.0.1/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=
github.com/filecoin-project/go-statemachine v1.0.2-0.20220322104818-27f8fbb86dfd/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=
Expand Down Expand Up @@ -418,11 +418,11 @@ github.com/filecoin-project/specs-storage v0.4.1/go.mod h1:Z2eK6uMwAOSLjek6+sy0j
github.com/filecoin-project/storetheindex v0.3.5/go.mod h1:0r3d0kSpK63O6AvLr1CjAINLi+nWD49clzcnKV+GLpI=
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
github.com/filecoin-project/venus v1.2.4/go.mod h1:hJULXHGAnWuq5S5KRtPkwbT8DqgM9II7NwyNU7t59D0=
github.com/filecoin-project/venus v1.9.0-rc1.0.20230105034113-333817b172f5 h1:ZqG1/Hxa1I1TYUqL4zsegy3HTfcRK/ljJqE8Otduwp0=
github.com/filecoin-project/venus v1.9.0-rc1.0.20230105034113-333817b172f5/go.mod h1:BJn0TSnkDTX8R3duiCpgPKDYU5ybrPCgJlkxZi/wmTs=
github.com/filecoin-project/venus v1.9.0-rc1.0.20230110072447-c4bf086f7bc9 h1:eD/keGZz2no8fl5Be8rQflcsu0N7+CxQRwuH227EJIg=
github.com/filecoin-project/venus v1.9.0-rc1.0.20230110072447-c4bf086f7bc9/go.mod h1:Jfs63LOjq+VTaNMxjFvc8rNbAYEuGTqU9cL+Z2dTeOY=
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/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=
github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=
Expand Down
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func runAction(cctx *cli.Context) error {
log.Infof("defalut timeout: %v, sign message timeout: %v, estimate message timeout: %v", cfg.MessageService.DefaultTimeout,
cfg.MessageService.SignMessageTimeout, cfg.MessageService.EstimateMessageTimeout)

remoteAuthCli, err := jwtclient.NewAuthClient(cfg.JWT.AuthURL)
remoteAuthCli, err := jwtclient.NewAuthClient(cfg.JWT.AuthURL, cfg.JWT.Token)
if err != nil {
return err
}
Expand Down Expand Up @@ -340,8 +340,10 @@ func updateFlag(cfg *config.Config, ctx *cli.Context) error {
}

if ctx.IsSet("auth-token") {
cfg.Node.Token = ctx.String("auth-token")
cfg.Gateway.Token = ctx.String("auth-token")
token := ctx.String("auth-token")
cfg.Node.Token = token
cfg.Gateway.Token = token
cfg.JWT.Token = token
}

if ctx.IsSet("node-token") {
Expand Down

0 comments on commit e6ee58d

Please sign in to comment.