AuthProxy: Fixes bug where long username could not be cached (#22926)

This commit is contained in:
Jon McKenzie
2020-03-20 16:50:27 -04:00
committed by GitHub
parent 5df00abfcf
commit 6c9d833602
3 changed files with 15 additions and 9 deletions

View File

@ -2,7 +2,6 @@ package middleware
import (
"context"
"encoding/base32"
"errors"
"fmt"
"net/http"
@ -364,7 +363,7 @@ func TestMiddlewareContext(t *testing.T) {
return nil
})
key := fmt.Sprintf(authproxy.CachePrefix, base32.StdEncoding.EncodeToString([]byte(name+"-"+group)))
key := fmt.Sprintf(authproxy.CachePrefix, authproxy.HashCacheKey(name+"-"+group))
err := sc.remoteCacheService.Set(key, int64(33), 0)
So(err, ShouldBeNil)
sc.fakeReq("GET", "/")