-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
JWKS caching question #289
Comments
It's been awhile but you understanding seems correct, why not just move it? I guess my question is why do you need copies? My expectations is that it would be saved in an object and you could move it to the member variable and just reference that? Does that not fit you use case? |
Copying can very often be a required thing to do (especially in multithreaded code), so it definitely should be possible. Looking at the error it seems like it fails to copy the claims member in jwk_claims, which is of type EDIT: I added a copy to one of the test cases and it compiles fine in both clang/gcc, so I am not sure what msvc is up to here. |
I assume you solved this but there is some example code in #345 about how this could be done |
What's your question?
Is it expected that jwt::jwks can't be cached?
Additional Context
As far as I understand, relying parties are expected to cache retrieved key sets indefinitely (or until a
kid
is seen which is not present in the key set). I've been forced to cache the raw JSON and re-parse withjwt::parse_jwks
every time a request comes in because attempting to cache the parsedjwt::jwks
fails to compile with an error indicating that the underlyingjwt::jwk
is non-copyable.This:
auto jwks = jwt::parse_jwks(jwksJson); std::map<std::string, jwt::jwks<jwt::traits::kazuho_picojson>> xs; xs[issuerUrl] = jwks;
Results in this:
Is this a case of me missing something obvious? Or is this actually an issue?
The text was updated successfully, but these errors were encountered: