From 55a257f5ff328310b739dfb3d3529ff7bea71bd1 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Fri, 3 Jul 2020 17:12:30 +0300 Subject: [PATCH] Update to NeoFS API v1.1.0 --- neofs/layer/neofs-container.go | 2 +- neofs/layer/neofs-object.go | 16 ++++++++-------- neofs/layer/neofs-status.go | 2 +- neofs/pool/pool.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/neofs/layer/neofs-container.go b/neofs/layer/neofs-container.go index baeb137..bb37d10 100644 --- a/neofs/layer/neofs-container.go +++ b/neofs/layer/neofs-container.go @@ -15,7 +15,7 @@ func (n *neofsObject) containerList(ctx context.Context) ([]refs.CID, error) { req.SetTTL(service.SingleForwardingTTL) req.SetVersion(APIVersion) - err := service.SignDataWithSessionToken(n.key, req) + err := service.SignRequestData(n.key, req) if err != nil { return nil, err } diff --git a/neofs/layer/neofs-object.go b/neofs/layer/neofs-object.go index 6ac2f84..66b801a 100644 --- a/neofs/layer/neofs-object.go +++ b/neofs/layer/neofs-object.go @@ -72,7 +72,7 @@ func (n *neofsObject) objectSearchContainer(ctx context.Context, cid refs.CID) ( req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return nil, err } @@ -156,7 +156,7 @@ func (n *neofsObject) objectFindID(ctx context.Context, cid refs.CID, name strin req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return id, err } @@ -232,7 +232,7 @@ func (n *neofsObject) objectHead(ctx context.Context, addr refs.Address) (*objec req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return nil, err } @@ -274,7 +274,7 @@ func (n *neofsObject) objectGet(ctx context.Context, p getParams) (*object.Objec req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return nil, err } @@ -388,7 +388,7 @@ func (n *neofsObject) objectPut(ctx context.Context, p putParams) (*object.Objec req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return nil, err } @@ -409,7 +409,7 @@ func (n *neofsObject) objectPut(ctx context.Context, p putParams) (*object.Objec req.SetTTL(service.SingleForwardingTTL) req.SetVersion(APIVersion) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return nil, err } @@ -478,7 +478,7 @@ func (n *neofsObject) storageGroupPut(ctx context.Context, p sgParams) (*object. req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return nil, err } @@ -514,7 +514,7 @@ func (n *neofsObject) objectDelete(ctx context.Context, p delParams) error { req.SetVersion(APIVersion) req.SetToken(token) - err = service.SignDataWithSessionToken(n.key, req) + err = service.SignRequestData(n.key, req) if err != nil { return err } diff --git a/neofs/layer/neofs-status.go b/neofs/layer/neofs-status.go index 05cbc4b..6925527 100644 --- a/neofs/layer/neofs-status.go +++ b/neofs/layer/neofs-status.go @@ -13,7 +13,7 @@ func (n *neofsObject) statusHealth(ctx context.Context) bool { req.SetTTL(service.NonForwardingTTL) req.SetVersion(APIVersion) - err := service.SignDataWithSessionToken(n.key, req) + err := service.SignRequestData(n.key, req) if err != nil { return false } diff --git a/neofs/pool/pool.go b/neofs/pool/pool.go index bb84f12..c129986 100644 --- a/neofs/pool/pool.go +++ b/neofs/pool/pool.go @@ -122,7 +122,7 @@ func New(l *zap.Logger, v *viper.Viper, key *ecdsa.PrivateKey) (Pool, error) { p.reqHealth = new(state.HealthRequest) p.reqHealth.SetTTL(service.NonForwardingTTL) - if err := service.SignDataWithSessionToken(key, p.reqHealth); err != nil { + if err := service.SignRequestData(key, p.reqHealth); err != nil { return nil, errors.Wrap(err, "could not sign `HealthRequest`") }