forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Jwt support tasks take 2 #2
Open
jregistr
wants to merge
14
commits into
ryantxu:jwt
Choose a base branch
from
jregistr:jwt-support-tasks-take-2
base: jwt
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
Linking the related PR here for posterity: #2 |
7 tasks
Before it was not parsing JSON config due that the check for the JSON prefix was inverted. Also it would parse the config a key:value pairs due to missing else block, which would leave the expected claims map in a unexpected state.
By JWT spec audience may be an array therefore the previous claim validation logic could not work for it. Now audience is validated considering that it may be an array and the expected audience is checked to be contained in it or by equality if it's a single string.
As indicated in the contribution guidelines, the project should not keep using convey as test library. Tests were refactored to use the standard `testing` library and `testify` to perform assertions.
Including a unit test to validate that the JWT auth works correctly with Cloudflare Access JWTs.
Moving the JWT test files into a separated directory as done in other packages of Grafana project.
Jwt support for cloudflare access
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hey @ryantxu , here's the second round of PR for your JWT authentication PR.
With this PR, I'm aiming to target the remaining tasks for this PR.
Feel free to let me know what you deem is missing and I can send a follow-up PR or add to this one.
Special notes for your reviewer:
I updated the
jwt_test_data.google.json
file. I did this so I could get a new JWT value from App engine for testing.I then updated and added a new test case to
jwt_test.go
.For enabling testing the refreshing token on TTL, I updated the jwt file to use an interface Http Client and to use a type TimeNow for getting the current time. I then mocked these and added a new test case
to ``jwt_test.go`.
I then went through the docs and while considering the implementation, I made some updates.
And lastly, I noticed when I ran
make build-go
, it failed and suggested I rungo mod vendor
. I ran this and committed the results. Please let me know if this is not needed and I can remove that commit.I hope you are well.
Cheers!