forked from TrueCloudLab/frostfs-sdk-go
[#131] pool: Sign session token before caching in newPool
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
d889ab3022
commit
998bae3f1c
1 changed files with 5 additions and 1 deletions
|
@ -290,8 +290,12 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
|
|||
} else if err == nil {
|
||||
healthy, atLeastOneHealthy = true, true
|
||||
st := sessionTokenForOwner(ownerID, cliRes)
|
||||
|
||||
// sign the session token and cache it on success
|
||||
if err = st.Sign(options.Key); err == nil {
|
||||
_ = cache.Put(formCacheKey(addr, options.Key), st)
|
||||
}
|
||||
}
|
||||
clientPacks[j] = &clientPack{client: c, healthy: healthy, address: addr}
|
||||
}
|
||||
source := rand.NewSource(time.Now().UnixNano())
|
||||
|
|
Loading…
Reference in a new issue