-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
refactor: move as discovery to normalize providers #11170
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Ignored Deployments
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11170 +/- ##
==========================================
+ Coverage 40.10% 40.14% +0.04%
==========================================
Files 178 178
Lines 28527 28589 +62
Branches 1240 1248 +8
==========================================
+ Hits 11440 11478 +38
- Misses 17087 17111 +24 ☔ View full report in Codecov by Sentry. |
4c666e2
to
27cbb18
Compare
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.
Nice, thanks! Left a comment, Wil try to re-review more thoroughly later.
if (c.issuer) { | ||
const issuer = new URL(c.issuer) | ||
try { | ||
const discoveryResponse = await o.discoveryRequest(issuer) |
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.
we can cache this in the module scope to potentially hit it less
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.
Not sure what do you mean by "module scope" but I implemented the caching mechanism with the cookies. My worry is that this could be considered bloat :/
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.
another solution is to make authorization become a lazy function for oidc providers. Technically, it's not much different with the original code, just move the discovery function call to providers, and parseProviders won't need to be async either. This is the first solution I've thought of.
Co-authored-by: Balázs Orbán <[email protected]>
☕️ Reasoning
Addressing some TODOs in
authorization-url
andproviders
:OAuthConfigInternal['authorization']
now returns aURL
andAuthorizationServer
if the provider type isoidc
.c.authorization
is empty for OAuth 2 providers🧢 Checklist
🎫 Affected issues
📌 Resources