mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
The key id travels in the header of a token that has not been checked yet, so it is chosen by whoever sent the request. Only found keys were kept, so an id the issuer does not publish missed the cache every time and fetched the document again — one request in, one request out, from a caller who has not authenticated. The document is what is held now. An id that is not in it is answered from the copy already read, and the issuer is asked again only when that copy expires. Concurrent lookups that do need the document share one fetch. Every caller learns of a rotation at the same moment, so without that a rotation is a burst. A caller that brings no cache is given one for the call, rather than a value whose maps are nil. Co-authored-by: Hanzo Dev <[email protected]>