From 799d3915086b07d489b6616256921b8bb5330635 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 3 Jun 2020 06:30:58 +0300 Subject: [PATCH] migrate to new api v1.0.0 --- app.go | 4 ++-- receive.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.go b/app.go index e5ae490..dc56ddc 100644 --- a/app.go +++ b/app.go @@ -108,14 +108,14 @@ func newApp(opt ...Option) App { a.reqHealth = new(state.HealthRequest) 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.reqNetmap = new(state.NetmapRequest) 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)) } diff --git a/receive.go b/receive.go index 7f09ff4..2771bd7 100644 --- a/receive.go +++ b/receive.go @@ -76,7 +76,7 @@ func (a *app) receiveFile(c *fasthttp.RequestCtx) { req := &object.GetRequest{Address: refs.Address{ObjectID: oid, CID: cid}} 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)) c.Error("could not sign request", fasthttp.StatusBadRequest) return