1
0
mirror of https://github.com/rancher/steve.git synced 2025-08-01 06:46:03 +00:00

Don't cache the user's schema cache key

This commit is contained in:
Darren Shepherd 2021-08-10 14:02:22 -07:00
parent a2354a9ed9
commit b219ba5d7c

View File

@ -64,10 +64,6 @@ func (l *AccessStore) AccessFor(user user.Info) *AccessSet {
}
func (l *AccessStore) CacheKey(user user.Info) string {
cacheKey, ok := l.cache.Get(user.GetName())
if ok {
return cacheKey.(string)
}
d := sha256.New()
l.users.addRolesToHash(d, user.GetName())
@ -81,7 +77,5 @@ func (l *AccessStore) CacheKey(user user.Info) string {
l.groups.addRolesToHash(d, group)
}
cacheKey = hex.EncodeToString(d.Sum(nil))
l.cache.Add(user.GetName(), cacheKey, 2*time.Second)
return cacheKey.(string)
return hex.EncodeToString(d.Sum(nil))
}