diff --git a/config/config.go b/config/config.go index a6089c5..f58b3c5 100644 --- a/config/config.go +++ b/config/config.go @@ -6,7 +6,7 @@ import ( "github.com/go-playground/validator/v10" "github.com/pkg/errors" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) // Config diff --git a/go.mod b/go.mod index 7f40f8f..476813d 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/yhirose/go-peg v0.0.0-20210804202551-de25d6753cf1 golang.org/x/crypto v0.0.0-20211202192323-5770296d904e golang.org/x/text v0.3.7 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.0 gorm.io/driver/mysql v1.2.1 gorm.io/driver/postgres v1.2.3 gorm.io/driver/sqlite v1.2.6 @@ -64,6 +64,5 @@ require ( github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect google.golang.org/protobuf v1.26.0-rc.1 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect mellium.im/sasl v0.2.1 // indirect ) diff --git a/go.sum b/go.sum index 73cef0e..fdba0f3 100644 --- a/go.sum +++ b/go.sum @@ -431,12 +431,12 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.2.1 h1:h+3f1l9Ng2C072Y2tIiLgPpWN78r1KXL7bHJ0nTjlhU= gorm.io/driver/mysql v1.2.1/go.mod h1:qsiz+XcAyMrS6QY+X3M9R6b/lKM1imKmcuK9kac5LTo= gorm.io/driver/postgres v1.2.3 h1:f4t0TmNMy9gh3TU2PX+EppoA6YsgFnyq8Ojtddb42To= diff --git a/tzkt/api/api.go b/tzkt/api/api.go index b2094a3..1bf09c7 100644 --- a/tzkt/api/api.go +++ b/tzkt/api/api.go @@ -151,14 +151,11 @@ func (tzkt *API) auth(request *http.Request) error { if tzkt.privateKey == "" || tzkt.user == "" { return errors.Errorf("you have to set auth data") } - - nonce := time.Now().UnixMilli() key, err := crypto.NewKeyFromBase58(tzkt.privateKey) if err != nil { return err } - - nonceString := fmt.Sprintf("%d", nonce) + nonceString := fmt.Sprintf("%d", time.Now().UTC().UnixMilli()) sign, err := key.Sign([]byte(nonceString)) if err != nil {