-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Release v1.0.0 #23
Comments
Oh, and I also plan on adding |
This is effectively token validation implemented inside of keyfunc. I think unless golang-jwt provides an interface to try multiple keys this is the only option. Here is the issue from the original repo dgrijalva/jwt-go#416 |
Is there a need to support multiple Options actually? Line 20 in b671333
If not, I think jwksUrl could also be put into the options and the whole interface simplified to jwks, err := keyfunc.NewJWKs(keyfunc.Options{
url: "https://example.com",
RefreshInterval: 1 * time.Hour,
RefreshRateLimit: 5 * time.Minute,
RefreshTimeout: 10 * time.Second,
RefreshUnknownKID: true,
}) |
There isn't. It was meant as a backwards compatible way of introducing options. It's also a pattern I've seen before with options. I'm now considering making it a non-variadic argument, which would simplify pointers like from #18 and #24. |
If the key set construction performance is a concern, it should be possible to keep track of the response data hash Lines 184 to 188 in b671333
and construct new keyset only when hash changes. UPD: or just keep actual data bytes and simply compare to response body bytes |
Simplifying the whole interface to one function with one large |
I'm starting work on |
The PR is ready and can be viewed here: #25
I plan on leaving the PR up until at least the 6th of December for anyone who wishes to provide feedback or additional input. |
Closing due to the |
The purpose of this issue is to release
v1.0.0
.Initially, I was waiting on this PR before doing a
v1.0.0
release: golang-jwt/jwt#105 but it seems that the PR is stale and it, along with golang-jwt/jwt#73, will go unresolved for an undetermined amount of time.The alternative plan, of creating the
github.com/MicahParks/compatibility-keyfunc
package and removing fork support from this package will likely be the long term solution. (See thev0.9.0
release.)If you have an idea about how to improve the package before the package's externally facing API is stabilized with
v1.0.0
, please comment on this issue. I've included my thoughts for changes below.If you would like to participate, please feel free to leave a comment constructive to the conversation that includes what you are in favor of and/or proposed changes you are not in favor of.
I would like for this project to be feature-complete upon the
v1.0.0
release, with the exception of adding support for additional cryptographic algorithms as they become standardized and widely adopted. This isn't a hard requirement, but I have every intention to avoid a/v2
for this project.My thoughts on changes for
v1.0.0
:Breaking:
JWKs
toJWKS
orJWKSet
.JWKs
as a short hand forJWK Set
.JWKs
as a short and forJSON Web Keys
, so I'm thinking usingJWKs
as a shorthand forJWK Set
is incorrect.keyfunc.JWKs
data structure through a struct literal, so the only breaking portion should be non-shorthand declarations ofkeyfunc.JWKs
. There would also be documentation changes.New features:
map[string]interface{}
or maybe something similar tomap[string]*jsonKey
.Keyfunc
method.kid
keys in theKeyfunc
method.kid
JSON attribute in a JWK is optional: https://datatracker.ietf.org/doc/html/rfc7517#section-4.5kid
JSON attribute in their JWK Sets.Keyfunc
method, if there is no matchingkid
, every key could be cycled through until there is no error.Options
fields to explicitly enable/disable the behavior.Improvements:
precomputed
field.Keyfunc
method is called, meaning the errors in parsing don't need to be reported asynchronously. It also may have a slight performance gain due to unused keys.The text was updated successfully, but these errors were encountered: