-
Notifications
You must be signed in to change notification settings - Fork 7
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: support OIDC login #127
Conversation
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.
LGTM! Added a small comment.
@@ -269,7 +281,7 @@ class Client { | |||
promise will not be resolved or rejected if a callback is provided. | |||
*/ | |||
async login( | |||
credentials: Credentials, | |||
credentials?: Credentials, |
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.
Was wondering if putting the optional param in login
and connectAndLogin
at the end of the params list might be a better practice? This way, when not available, we would just not pass the param at the end instead of passing it as undefined
in the middle.
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.
In both cases clientVersion
is also optional, but with a default value (in TS you can't mark a param as optional and provide a default value as the variable will always be initialised). Incidentally, having an optional param before a non-optional gives a TS error.
Also, if we were to swap the order it would mean we would always have to provide the client version when we wanted to pass credentials, which would mean we wouldn't get the benefit of having a default value.
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.
Makes sense. I didn't spot that clientVersion
is provided a default value.
Changes
Support OIDC login.
QA
Follow the instructions in this PR: canonical/juju-dashboard#1776.
Details
https://warthogs.atlassian.net/browse/WD-11709