-
Notifications
You must be signed in to change notification settings - Fork 154
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
feat: glob support for RedirectURIs #297
Conversation
Codecov Report
@@ Coverage Diff @@
## main #297 +/- ##
==========================================
- Coverage 39.75% 39.63% -0.13%
==========================================
Files 74 74
Lines 5941 5965 +24
==========================================
+ Hits 2362 2364 +2
- Misses 3329 3350 +21
- Partials 250 251 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
pkg/op/session.go
Outdated
@@ -98,5 +100,16 @@ func ValidateEndSessionPostLogoutRedirectURI(postLogoutRedirectURI string, clien | |||
return nil | |||
} | |||
} | |||
if globClient, ok := client.(HasRedirectGlobs); ok { | |||
for _, uriGlob := range globClient.PostLogoutRedirectURIGlobs() { | |||
matcher, err := glob.Compile(uriGlob) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you aware of https://github.com/gobwas/glob#performance?
I understand that this is the only moment where you can actually compile the globs, as they come from storage and there is no way to store the compiled objects. However, I do would like to see some benchmarks to have an idea about performance impact using this library / approach. It might be just fine, but this sentence triggers me:
This means, that compilation could take time, but strings matching is done faster,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muhlemmer I could add a LRU cache of compiled globs. Or perhaps, I should add that to the glob library so that all users benefit? Adding a cache is pretty easy but adds a dependency and a utility function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nice LRU cache that is already indirectly part of the oidc package, github.com/hashicorp/golang-lru, has a nice generics-enhanced interface. Are we ready to use generics in the next
branch?
Thanks for working on this! I quickly went over what you've done so far and left a comment. When this PR moves out of draft I will do a more detailed review. Unless you have a direct need to have this in current stable |
Hmm. Do you like my idea for Are there releases of the Answer: Yes: "v2.0.0-dynamic-issuer.8" I can switch to |
|
I'm okay with merging this into |
🎉 This PR is included in version 1.13.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
To maintain backwards compatibility, an optional op.Client interface is added:
In the
next
branch, instead of adding an additional interface,RedirectURIs
will be changed to return two arrays.Resolves #293