JWT: Fallthrough to fetch keyset in case of cache error (#80081)

fallthrough to fetch keyset in case of cache error. Fixes #67582
This commit is contained in:
Jo
2024-01-08 16:02:31 +01:00
committed by GitHub
parent d2b023076b
commit c3d8c6e0ea

View File

@@ -194,7 +194,11 @@ func (ks *keySetHTTP) getJWKS(ctx context.Context) (keySetJWKS, error) {
if ks.cacheExpiration > 0 {
if val, err := ks.cache.Get(ctx, ks.cacheKey); err == nil {
err := json.Unmarshal(val, &jwks)
return jwks, err
if err != nil {
ks.log.Warn("Failed to unmarshal key set from cache", "err", err)
} else {
return jwks, err
}
}
}