-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: Initialize connectors lazily (not on server start) #2789
base: master
Are you sure you want to change the base?
Conversation
e043b00
to
a4e14d1
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.
👍 ❤️
Signed-off-by: Daniel Lipovetsky <[email protected]>
a4e14d1
to
1890bf3
Compare
@nabokihms Could you please allow the CI workflows to run? Thanks! |
The PR is backward compatible, addresses a long-standing issue, comes with a unit test, and CI is passing (ne job fails because the PR needs some labels, which I don't have the permission to create) @nabokihms and/or @sagikazarmark, please let me know if there's anything else I can do to help it along, or if you disagree with the approach I took. Thank you! 🙏 |
Sorry, slacked a little because of KubeCon. I will take a look till the end of the week and give my feedback. |
@dlipovetsky Sorry for the long delay. This feature overlaps with what we in Palak also need, so I'd be happy to work with you on this feature. I had a chance to look through the code and even test the PR, and there are some questions I'd like to discuss upfront.
What do you think about the following proposal? This is more complicated, but I believe provides better UX for users.
|
Thanks for the review!
Good point. I do not use the dex UI directly, so I did not see (or consider) this.
Good point. A couple of questions: Does "attempt" mean a login attempt? When you say "Dex will try to make a request to the provider," are you referring to this code path: Line 639 in 1890bf3
Good point.
I agree, your proposal does provide better UX. Being unfamiliar with the dex code, I made the smallest possible change that allowed dex to start in the presence of a misconfigured connector 😅 Let me know if you'd like to me to work on this, or if you'd like to do it yourself. Also, let me know if you'd like the work to go in a new PR. |
@dlipovetsky I would be happy if you had time to work on this feature. It is ok to work on this improvement in the scope of this PR. Opening a new PR is not necessary. |
Overview
Initialize connectors lazily (not on server start).
What this PR does / why we need it
Dex initializes all connectors on server start. Connectors may fail to initialize, e.g. if they require a remote service that is unavailable, or if they are misconfigured. If any connector fails to initialize, dex exits. This PR adds an option to skip connector initialization during server start. Dex will initialize each connector when it needs it to serve a request.
This change is backward-compatible. The current behavior (exiting) remains the default; the new behavior is enabled by a field in the configuration file:
Closes #1723
Special notes for your reviewer
Does this PR introduce a user-facing change?