forked from TrueCloudLab/frostfs-node
[#1229] util: Fix session token expiration check
* Make session token expired at `current_epoch + 1` but not at `current_epoch` when it's still valid. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
0c2b6f3dac
commit
d90aab5454
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ func (s *KeyStorage) GetKey(info *SessionInfo) (*ecdsa.PrivateKey, error) {
|
||||||
|
|
||||||
pToken := s.tokenStore.Get(info.Owner, binID)
|
pToken := s.tokenStore.Get(info.Owner, binID)
|
||||||
if pToken != nil {
|
if pToken != nil {
|
||||||
if pToken.ExpiredAt() <= s.networkState.CurrentEpoch() {
|
if pToken.ExpiredAt() < s.networkState.CurrentEpoch() {
|
||||||
return nil, new(apistatus.SessionTokenExpired)
|
return nil, new(apistatus.SessionTokenExpired)
|
||||||
}
|
}
|
||||||
return pToken.SessionKey(), nil
|
return pToken.SessionKey(), nil
|
||||||
|
|
Loading…
Reference in a new issue