Support cache and conditional requests to fetch public keys from GET /meta/public_keys/copilot_api
#9
Labels
breaking change
feature
New feature or request
pull request welcome
Issue is actionable and anyone can claim it
released
Follow up to #8.
The
GET /meta/public_keys/copilot_api
route returns anEtag
header, which it supports conditional requests.In order to implement caching of the public keys, we need to return the
etag
hash as "cache ID" and the keys in thefetchVerificationKeys()
method, and return the cache ID and the keys as part ofverifyRequestByKeyId()
This will introduce a breaking change
Once received, the result can be used as an optional cache argument, which will result in sending a conditional request
In this example, the 2nd request will get a 304 and return the keys that were passed as
options.cache.keys
The change to
verifyRequestByKeyId()
would be similarThis is an optimization and can be done later. Pull request welcome!
The text was updated successfully, but these errors were encountered: