This repository has been archived by the owner on May 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…artup should not be dependent on third-party server availability
…e if error occured during refresh
@ReneWerner87 could you please check is it I can continue covering with tests these pieces of code. But I am afraid that I will delay the code and I'm also forced into refactoring as I write the tests, so I wanted to put a comma somewhere. |
ping @ReneWerner87 :) |
Jo, sure.. Will check it on the weekend) currently to much other stuff) |
Thank you! :) |
ReneWerner87
approved these changes
Sep 13, 2021
@shytikov can you please correct the three comments of the automated test and the linter |
On it! @ReneWerner87 :) |
@ReneWerner87 Hopefully now everything shoudl be fine! |
This was referenced Sep 16, 2021
This was referenced Aug 28, 2022
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Looks like a lot of changes, but I've tried to structure it logically:
jwt.go
was split –Config
were moved toconfig.go
and the main middleware call was moved tomain.go
;jwks.go
file which contains code fromhttps://github.com/MicahParks/keyfunc
keyfunc
.I haven't modified logic from the initial
jwt.go
. All configurations which were added are optional, andjwks
will kick in only ifKeySetUrl
will be provided. That will replace the originalkeyfunc
with the one that is able to work withjwks
.I believe I could get away with smaller changes if I would reference
https://github.com/MicahParks/keyfunc
directly. But that would bring additional unused legacy dependencies to this middleware and to the rest of the projects which will be using it, so I decided to copy files instead.I have tested it on my JWKs server, and it works (on my machine :), including background updates of the keys.
I'm open to any suggestions that would make this PR better. Many thanks in advance!