diff --git a/session/service.go b/session/service.go index ecbd6f5f..6e293d36 100644 --- a/session/service.go +++ b/session/service.go @@ -1,20 +1,5 @@ package session -import ( - "context" - "crypto/ecdsa" - - "github.com/nspcc-dev/neofs-api-go/refs" -) - -type ( - // KeyStore is an interface that describes storage, - // that allows to fetch public keys by OwnerID. - KeyStore interface { - Get(ctx context.Context, id refs.OwnerID) ([]*ecdsa.PublicKey, error) - } -) - // NewInitRequest returns new initialization CreateRequest from passed Token. func NewInitRequest(t *Token) *CreateRequest { return &CreateRequest{Message: &CreateRequest_Init{Init: t}} diff --git a/session/types.go b/session/types.go index bacc770f..435616ab 100644 --- a/session/types.go +++ b/session/types.go @@ -1,6 +1,9 @@ package session import ( + "context" + "crypto/ecdsa" + "github.com/nspcc-dev/neofs-api-go/internal" "github.com/nspcc-dev/neofs-api-go/refs" "github.com/nspcc-dev/neofs-api-go/service" @@ -51,6 +54,14 @@ type PrivateTokenStore interface { Store(TokenID, PrivateToken) error } +// KeyStore is an interface of the storage of public keys addressable by OwnerID, +type KeyStore interface { + // Get must return the storage record corresponding to the passed key. + // + // Resulting error must be ErrKeyNotFound if there is no corresponding record. + Get(context.Context, OwnerID) ([]*ecdsa.PublicKey, error) +} + const ErrPrivateTokenNotFound = internal.Error("private token not found") const (