forked from TrueCloudLab/frostfs-node
[#1400] owner: Upgrade SDK package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f8ac4632f8
commit
bb25ecbd15
60 changed files with 379 additions and 327 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl"
|
||||
netmapSDK "github.com/nspcc-dev/neofs-sdk-go/netmap"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/owner"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/user"
|
||||
)
|
||||
|
||||
type netValueReader func(interface{}) (interface{}, error)
|
||||
|
@ -248,14 +248,14 @@ func newCachedContainerLister(c *cntClient.Client) *ttlContainerLister {
|
|||
|
||||
lruCnrListerCache := newNetworkTTLCache(containerListerCacheSize, containerListerCacheTTL, func(key interface{}) (interface{}, error) {
|
||||
var (
|
||||
id *owner.ID
|
||||
id *user.ID
|
||||
strID = key.(string)
|
||||
)
|
||||
|
||||
if strID != "" {
|
||||
id = owner.NewID()
|
||||
id = new(user.ID)
|
||||
|
||||
err := id.Parse(strID)
|
||||
err := id.DecodeString(strID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ func newCachedContainerLister(c *cntClient.Client) *ttlContainerLister {
|
|||
// List returns list of container IDs from the cache. If list is missing in the
|
||||
// cache or expired, then it returns container IDs from side chain and updates
|
||||
// the cache.
|
||||
func (s *ttlContainerLister) List(id *owner.ID) ([]*cid.ID, error) {
|
||||
func (s *ttlContainerLister) List(id *user.ID) ([]*cid.ID, error) {
|
||||
var str string
|
||||
|
||||
if id != nil {
|
||||
|
@ -286,7 +286,7 @@ func (s *ttlContainerLister) List(id *owner.ID) ([]*cid.ID, error) {
|
|||
}
|
||||
|
||||
// InvalidateContainerList removes cached list of container IDs.
|
||||
func (s *ttlContainerLister) InvalidateContainerList(id *owner.ID) {
|
||||
func (s *ttlContainerLister) InvalidateContainerList(id *user.ID) {
|
||||
(*ttlNetCache)(s).remove(id.String())
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/util/state"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/netmap"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/owner"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/user"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/version"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
"go.etcd.io/bbolt"
|
||||
|
@ -77,7 +77,7 @@ type cfg struct {
|
|||
|
||||
key *keys.PrivateKey
|
||||
|
||||
ownerIDFromKey *owner.ID // owner ID calculated from key
|
||||
ownerIDFromKey user.ID // user ID calculated from key
|
||||
|
||||
apiVersion version.Version
|
||||
|
||||
|
@ -234,8 +234,6 @@ func initCfg(path string) *cfg {
|
|||
|
||||
key := nodeconfig.Key(appCfg)
|
||||
|
||||
ownerIDFromKey := owner.NewIDFromPublicKey(&key.PrivateKey.PublicKey)
|
||||
|
||||
var logPrm logger.Prm
|
||||
|
||||
err := logPrm.SetLevelString(
|
||||
|
@ -316,10 +314,10 @@ func initCfg(path string) *cfg {
|
|||
Key: &key.PrivateKey,
|
||||
}),
|
||||
persistate: persistate,
|
||||
|
||||
ownerIDFromKey: ownerIDFromKey,
|
||||
}
|
||||
|
||||
user.IDFromKey(&c.ownerIDFromKey, key.PrivateKey.PublicKey)
|
||||
|
||||
if metricsconfig.Address(c.appCfg) != "" {
|
||||
c.metricsCollector = metrics.NewStorageMetrics()
|
||||
netState.metrics = c.metricsCollector
|
||||
|
|
|
@ -32,7 +32,7 @@ import (
|
|||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/netmap"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/owner"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/user"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
|
@ -557,7 +557,7 @@ type morphContainerReader struct {
|
|||
get containerCore.Source
|
||||
|
||||
lister interface {
|
||||
List(*owner.ID) ([]*cid.ID, error)
|
||||
List(*user.ID) ([]*cid.ID, error)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,7 @@ func (x *morphContainerReader) GetEACL(id *cid.ID) (*eaclSDK.Table, error) {
|
|||
return x.eacl.GetEACL(id)
|
||||
}
|
||||
|
||||
func (x *morphContainerReader) List(id *owner.ID) ([]*cid.ID, error) {
|
||||
func (x *morphContainerReader) List(id *user.ID) ([]*cid.ID, error) {
|
||||
return x.lister.List(id)
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import (
|
|||
eaclSDK "github.com/nspcc-dev/neofs-sdk-go/eacl"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/owner"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/user"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
|
@ -124,8 +124,8 @@ func (i *delNetInfo) TombstoneLifetime() (uint64, error) {
|
|||
// returns node owner ID calculated from configured private key.
|
||||
//
|
||||
// Implements method needed for Object.Delete service.
|
||||
func (i *delNetInfo) LocalNodeID() *owner.ID {
|
||||
return i.cfg.ownerIDFromKey
|
||||
func (i *delNetInfo) LocalNodeID() *user.ID {
|
||||
return &i.cfg.ownerIDFromKey
|
||||
}
|
||||
|
||||
type innerRingFetcherWithNotary struct {
|
||||
|
|
|
@ -15,12 +15,12 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage/persistent"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage/temporary"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/owner"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/user"
|
||||
)
|
||||
|
||||
type sessionStorage interface {
|
||||
Create(ctx context.Context, body *session.CreateRequestBody) (*session.CreateResponseBody, error)
|
||||
Get(ownerID *owner.ID, tokenID []byte) *storage.PrivateToken
|
||||
Get(ownerID *user.ID, tokenID []byte) *storage.PrivateToken
|
||||
RemoveOld(epoch uint64)
|
||||
|
||||
Close() error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue