Skip to content

fix: Fix login command when using native-tls#61

Merged
eikek merged 3 commits intomainfrom
fix-login-cmd
Mar 11, 2026
Merged

fix: Fix login command when using native-tls#61
eikek merged 3 commits intomainfrom
fix-login-cmd

Conversation

@eikek
Copy link
Member

@eikek eikek commented Mar 10, 2026

The login command was failing due to a failed request to fetch the openid-configuration. The error message was

thread 'main' (595104) panicked at src/httpclient/auth.rs:116:10: called `Result::unwrap()` on an `Err` value: Request(Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("renkulab.io")), port: None, path: "/auth/realms/Renku/.well-known/openid-configuration", query: None, fragment: None }, source: hyper::Error(Connect, "invalid URL, scheme is not http") }))

The error message is not very clear (it is an http/https url). Adding the oauth2 as an explicit dependency fixes this issue. This dependency was already defined transitively by the openidconnect crate.

Additionally, a small refactoring to not only pass the error message but the complete source error into the snafu wrapper structure.

supersedes #49

@eikek eikek requested a review from olevski March 10, 2026 16:51
@eikek eikek mentioned this pull request Mar 10, 2026
eikek added 3 commits March 10, 2026 21:24
For some reason that fixes the request to the openid discovery
endpoint.
Instead of just the message, propagate the complete error structure
@eikek eikek requested a review from Panaetius March 11, 2026 08:25
cmd.args(["--renku-url", "https://ci-renku-3668.dev.renku.ch"]); //use mock url?
let prg = cargo::cargo_bin!("rnk");
let mut cmd = Command::new(prg);
cmd.args(["--renku-url", "https://dev.renku.ch"]); //use mock url?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I've had good results using https://github.com/microsoft/injectorppforrust to just mock api requests so my tests don't depend on an external API being up, maybe that could be useful in the renku cli as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, yes maybe that is convenient. Could be looked into in a later PR.

Copy link
Member

@Panaetius Panaetius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thank you!

@eikek eikek merged commit 222c781 into main Mar 11, 2026
5 checks passed
@eikek eikek deleted the fix-login-cmd branch March 11, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants