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

feat: support OIDC login #127

Merged
merged 2 commits into from
Jun 13, 2024
Merged

feat: support OIDC login #127

merged 2 commits into from
Jun 13, 2024

Conversation

huwshimi
Copy link
Member

@huwshimi huwshimi commented Jun 7, 2024

Changes

Support OIDC login.

QA

Follow the instructions in this PR: canonical/juju-dashboard#1776.

Details

https://warthogs.atlassian.net/browse/WD-11709

Copy link
Contributor

@vladimir-cucu vladimir-cucu left a 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,
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@huwshimi huwshimi merged commit d163d54 into juju:master Jun 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants