forked from TrueCloudLab/frostfs-api-go
session: change KeyStore documentation
parent
22265a9f03
commit
701bbafcf1
|
@ -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}}
|
||||
|
|
|
@ -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 (
|
||||
|
|
Loading…
Reference in New Issue