Skip to content

feat: jwt JWKS Redis cache adapter #216

@FumingPower3925

Description

@FumingPower3925

Summary

Add an optional Redis-backed JWKS key cache for the JWT middleware.

Context

The JWT middleware eagerly fetches JWKS keys at init and refreshes periodically. In multi-instance deployments, each instance independently fetches from the JWKS endpoint. A shared Redis cache reduces external calls and improves startup time for new instances.

Scope

  • Implement RedisKeyCache that stores fetched JWKS responses in Redis with TTL
  • On JWKS refresh: check Redis first, fetch from endpoint only on miss
  • On JWKS fetch: write to Redis with configurable TTL
  • Key: configurable (default: jwks:<endpoint_hash>)
  • Use celeris's native Redis driver
  • Optional — JWT middleware works without it (falls back to direct fetch)

Metadata

Metadata

Labels

middlewareMiddleware implementation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions