-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Default constructor for jwks object #346
Default constructor for jwks object #346
Conversation
whoever created the CI job to not only indicate exactly where the lining error is, but also generate a patch file and sample commands to apply it deserves a gold star. |
⭐ appreciate it 🙏 |
It would be amazing to have a test to help ensure this behavior is maintained :) Similar to But just check the list empty (you might need to usenthe itors to count) |
…efault-construct-jwks
@prince-chrismc I shouldn't have made the PR w/o a test. It's in. |
I appreciate the design to always uphold the invariants of every type.
For
jwt::jwks
, which is an object holding a collection of jwks, constructing an empty collection of jwks is valid and maintains the invariants of the type.The motivation for this is encapsulating
jwt::jwks
in a caching class, where JWKs are often cached with periodic refreshing. There aren't any keys until fetched from issuer. I found myself doingjwt::jwks{"{\"keys\":[]}"}
since there wasn't a default constructor, which feels silly.