forked from TrueCloudLab/frostfs-node
[#233] services/object: Implement new Get algorithm
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
26f03c6301
commit
f24daa10ff
31 changed files with 2163 additions and 355 deletions
|
@ -5,7 +5,6 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/token"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// KeyStorage represents private key storage of the local node.
|
||||
|
@ -30,11 +29,9 @@ func NewKeyStorage(localKey *ecdsa.PrivateKey, tokenStore *storage.TokenStore) *
|
|||
func (s *KeyStorage) GetKey(token *token.SessionToken) (*ecdsa.PrivateKey, error) {
|
||||
if token != nil {
|
||||
pToken := s.tokenStore.Get(token.OwnerID(), token.ID())
|
||||
if pToken == nil {
|
||||
return nil, errors.Wrapf(storage.ErrNotFound, "(%T) could not get session key", s)
|
||||
if pToken != nil {
|
||||
return pToken.SessionKey(), nil
|
||||
}
|
||||
|
||||
return pToken.SessionKey(), nil
|
||||
}
|
||||
|
||||
return s.key, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue