Description of change
This PR makes the maximum size of the JWT-SVID cache in spire-agent configurable. This avoid the cache becoming too large and using too much memory. When the cache becomes too big, the least recently used JWT-SVID is evicted.
There's more improvements that can be made here. We could also periodically try to evict expired tokens, since tokens can have different TTLs. Opening this for now to see if that's a desired behaviour.
Pull Request check list
Affected functionality spire-agent JWT-SVID cache
Description of change This PR makes the maximum size of the JWT-SVID cache in spire-agent configurable. This avoid the cache becoming too large and using too much memory. When the cache becomes too big, the least recently used JWT-SVID is evicted.
There's more improvements that can be made here. We could also periodically try to evict expired tokens, since tokens can have different TTLs. Opening this for now to see if that's a desired behaviour.
Which issue this PR fixes fixes #4891