Skip to content
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

Permit construction of a GivenKeys map from JSON #74

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

sean-rn
Copy link
Contributor

@sean-rn sean-rn commented Nov 29, 2022

This simplifies the use case of supplementing keys loaded from a JWKS url with ones parsed from static JSON.

Pseudocode for how to use it:

staticKeys, err := keyfunc.NewGivenKeysFromJSON(staticJSON)
combinedKeys, err := keyfunc.Get(jwksURL, keyfunc.Options{GivenKeys: staticKeys})

@sean-rn
Copy link
Contributor Author

sean-rn commented Nov 29, 2022

Draft pending discussion on #73

This simplifies the use case of supplementing keys loaded from a JWKS url with ones parsed from static JSON
@sean-rn
Copy link
Contributor Author

sean-rn commented Nov 29, 2022

I don't love the function name keyfunc.NewGivenKeysFromJSON. Maybe just keyfunc.GivenKeysFromJSON is better.

@MicahParks
Copy link
Owner

I don't love the function name keyfunc.NewGivenKeysFromJSON. Maybe just keyfunc.GivenKeysFromJSON is better.

Let's leave it as keyfunc.NewGivenKeysFromJSON. GivenKeys isn't a specifically defined type by keyfunc, but I think it still makes sense as a name.

You can mark this PR as ready if you feel the changes are complete. I think these changes look great!

@sean-rn sean-rn marked this pull request as ready for review November 30, 2022 01:29
@MicahParks MicahParks merged commit 8c0f8a9 into MicahParks:master Nov 30, 2022
@sean-rn sean-rn deleted the given-keys-from-json branch November 30, 2022 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants