migrate to new api v1.0.0

This commit is contained in:
Evgeniy Kulikov 2020-06-03 06:30:58 +03:00
parent a9f4ee535a
commit 799d391508
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
2 changed files with 3 additions and 3 deletions

4
app.go
View file

@ -108,14 +108,14 @@ func newApp(opt ...Option) App {
a.reqHealth = new(state.HealthRequest) a.reqHealth = new(state.HealthRequest)
a.reqHealth.SetTTL(service.NonForwardingTTL) a.reqHealth.SetTTL(service.NonForwardingTTL)
if err := service.SignRequestHeader(a.key, a.reqHealth); err != nil { if err := service.SignDataWithSessionToken(a.key, a.reqHealth); err != nil {
a.log.Fatal("could not sign `HealthRequest`", zap.Error(err)) a.log.Fatal("could not sign `HealthRequest`", zap.Error(err))
} }
a.reqNetmap = new(state.NetmapRequest) a.reqNetmap = new(state.NetmapRequest)
a.reqNetmap.SetTTL(service.SingleForwardingTTL) a.reqNetmap.SetTTL(service.SingleForwardingTTL)
if err := service.SignRequestHeader(a.key, a.reqNetmap); err != nil { if err := service.SignDataWithSessionToken(a.key, a.reqNetmap); err != nil {
a.log.Fatal("could not sign `NetmapRequest`", zap.Error(err)) a.log.Fatal("could not sign `NetmapRequest`", zap.Error(err))
} }

View file

@ -76,7 +76,7 @@ func (a *app) receiveFile(c *fasthttp.RequestCtx) {
req := &object.GetRequest{Address: refs.Address{ObjectID: oid, CID: cid}} req := &object.GetRequest{Address: refs.Address{ObjectID: oid, CID: cid}}
req.SetTTL(service.SingleForwardingTTL) req.SetTTL(service.SingleForwardingTTL)
if err = service.SignRequestHeader(a.key, req); err != nil { if err = service.SignDataWithSessionToken(a.key, req); err != nil {
log.Error("could not sign request", zap.Error(err)) log.Error("could not sign request", zap.Error(err))
c.Error("could not sign request", fasthttp.StatusBadRequest) c.Error("could not sign request", fasthttp.StatusBadRequest)
return return