frostfs-node/pkg/services/session/storage/types.go
Pavel Karpy 929c9851a6 [#1255] node/session: Create separate dir for in-memory storage
Move in-memory session storage to the separate directory of `storage`. It is
done for future support of different kind of session storages.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-03-29 09:35:10 +03:00

32 lines
676 B
Go

package storage
import (
"crypto/ecdsa"
)
// PrivateToken represents private session info.
type PrivateToken struct {
sessionKey *ecdsa.PrivateKey
exp uint64
}
// SetSessionKey sets a private session key.
func (t *PrivateToken) SetSessionKey(sessionKey *ecdsa.PrivateKey) {
t.sessionKey = sessionKey
}
// SetExpiredAt sets epoch number until token is valid.
func (t *PrivateToken) SetExpiredAt(exp uint64) {
t.exp = exp
}
// SessionKey returns the private session key.
func (t *PrivateToken) SessionKey() *ecdsa.PrivateKey {
return t.sessionKey
}
// ExpiredAt returns epoch number until token is valid.
func (t *PrivateToken) ExpiredAt() uint64 {
return t.exp
}