Update to NeoFS API v1.1.0

This commit is contained in:
Evgeniy Kulikov 2020-07-03 17:12:30 +03:00
parent d78a2c4488
commit 55a257f5ff
4 changed files with 11 additions and 11 deletions

View file

@ -15,7 +15,7 @@ func (n *neofsObject) containerList(ctx context.Context) ([]refs.CID, error) {
req.SetTTL(service.SingleForwardingTTL) req.SetTTL(service.SingleForwardingTTL)
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
err := service.SignDataWithSessionToken(n.key, req) err := service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -72,7 +72,7 @@ func (n *neofsObject) objectSearchContainer(ctx context.Context, cid refs.CID) (
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -156,7 +156,7 @@ func (n *neofsObject) objectFindID(ctx context.Context, cid refs.CID, name strin
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return id, err return id, err
} }
@ -232,7 +232,7 @@ func (n *neofsObject) objectHead(ctx context.Context, addr refs.Address) (*objec
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -274,7 +274,7 @@ func (n *neofsObject) objectGet(ctx context.Context, p getParams) (*object.Objec
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -388,7 +388,7 @@ func (n *neofsObject) objectPut(ctx context.Context, p putParams) (*object.Objec
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -409,7 +409,7 @@ func (n *neofsObject) objectPut(ctx context.Context, p putParams) (*object.Objec
req.SetTTL(service.SingleForwardingTTL) req.SetTTL(service.SingleForwardingTTL)
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -478,7 +478,7 @@ func (n *neofsObject) storageGroupPut(ctx context.Context, p sgParams) (*object.
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -514,7 +514,7 @@ func (n *neofsObject) objectDelete(ctx context.Context, p delParams) error {
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
req.SetToken(token) req.SetToken(token)
err = service.SignDataWithSessionToken(n.key, req) err = service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return err return err
} }

View file

@ -13,7 +13,7 @@ func (n *neofsObject) statusHealth(ctx context.Context) bool {
req.SetTTL(service.NonForwardingTTL) req.SetTTL(service.NonForwardingTTL)
req.SetVersion(APIVersion) req.SetVersion(APIVersion)
err := service.SignDataWithSessionToken(n.key, req) err := service.SignRequestData(n.key, req)
if err != nil { if err != nil {
return false return false
} }

View file

@ -122,7 +122,7 @@ func New(l *zap.Logger, v *viper.Viper, key *ecdsa.PrivateKey) (Pool, error) {
p.reqHealth = new(state.HealthRequest) p.reqHealth = new(state.HealthRequest)
p.reqHealth.SetTTL(service.NonForwardingTTL) 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`") return nil, errors.Wrap(err, "could not sign `HealthRequest`")
} }