-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token ops caching #9
Comments
see also: istio/istio#19289 |
We're going to roll out our own caching solution instead of piggybacking on the Mixer's. Rationale
Proposed solutionDevelop a component with an interface hiding whether the backing cache is in memory or distributed. For now, use an in-memory backing store with a map interface. Key for the ID token can be any constant string and TTL = token's After combing the Go ecosystem, Ristretto came up as one of the best options out there. Its robust design based on recent research on caching strategies caters for memory management, concurrency & lock contention, smart admission/eviction, TTL, etc. So that's the backing cache we're going to use. |
closed by #35. |
Caching is an important aspect of the Istio architecture:
From what I've gathered up to this point through debugging and code inspection is that the
ValidDuration
andValidUseCount
fields returned in adapter responses get used by the Mixer/Envoy to cache those responses.This affects both token validation and generation. In fact, if a positive validation response gets cached for a time period
C
, then we've got to be sureotherwise security flies out of the window.
If you don't set the
ValidDuration
andValidUseCount
fields explicitly in the adapter response, it looks like the Mixer fills them in for you with default values. I ran a test where the adapter just ignores the fields and then I could see the Mixer client outputting some values instead:So it looks like if we want security, we'll have to deal with caching explicitly to make sure the above invariant holds true at all times. Ditto for the response attribute we use to store the generated server token.
The text was updated successfully, but these errors were encountered: