Files
upstream-centrifugo/internal/jwks/cache.go
upstream-mirror b352a9a30d
Some checks failed
test / Lint (push) Failing after 3s
test / Test with Go 1.26.8 (push) Failing after 2s
snapshot of https://github.com/centrifugal/centrifugo.git (master, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:17:21 +05:00

21 lines
584 B
Go

package jwks
import (
"errors"
)
var (
// ErrCacheNotFound returned when cache value not found.
ErrCacheNotFound = errors.New("cache: value not found")
)
// Cache works with cache layer. The cacheKey is opaque to the cache and chosen by
// the caller — Manager uses a composite of the resolved JWKS endpoint URL and the
// JWT header kid so that keys cached from one trust domain (templated URL) cannot
// satisfy lookups for another. See Manager.FetchKey.
type Cache interface {
Add(cacheKey string, key *JWK) error
Get(cacheKey string) (*JWK, error)
Len() (int, error)
}