kubernetes/staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator.go

var errAuthnCrash

const sharedLookupTimeout

type cacheRecord

type cacheWarning

type cachedTokenAuthenticator

type cache

// New returns a token authenticator that caches the results of the specified authenticator. A ttl of 0 bypasses the cache.
func New(authenticator authenticator.Token, cacheErrs bool, successTTL, failureTTL time.Duration) authenticator.Token {}

func newWithClock(authenticator authenticator.Token, cacheErrs bool, successTTL, failureTTL time.Duration, clock clock.Clock) authenticator.Token {}

// AuthenticateToken implements authenticator.Token
func (a *cachedTokenAuthenticator) AuthenticateToken(ctx context.Context, token string) (*authenticator.Response, bool, error) {}

func (a *cachedTokenAuthenticator) doAuthenticateToken(ctx context.Context, token string) *cacheRecord {}

// keyFunc generates a string key by hashing the inputs.
// This lowers the memory requirement of the cache and keeps tokens out of memory.
func keyFunc(hashPool *sync.Pool, auds []string, token string) string {}

// writeLengthPrefixedString writes s with a length prefix to prevent ambiguities, i.e. "xy" + "z" == "x" + "yz"
// the length of b is assumed to be 4 (b is mutated by this function to store the length of s)
func writeLengthPrefixedString(w io.Writer, b []byte, s string) {}

// writeLength encodes length into b and then writes it via the given writer
// the length of b is assumed to be 4
func writeLength(w io.Writer, b []byte, length int) {}

// toBytes performs unholy acts to avoid allocations
func toBytes(s string) []byte {}

// toString performs unholy acts to avoid allocations
func toString(b []byte) string {}

type recorder

// AddWarning adds a warning to recorder.
func (r *recorder) AddWarning(agent, text string) {}

func (r *recorder) extractWarnings() []*cacheWarning {}