bndr / gojenkins

Jenkins API Client in Go. Looking for maintainers to move this project forward.
Apache License 2.0
863 stars 443 forks source link

Login Credentials are not checked in v1.0.1 #238

Closed TJM closed 3 years ago

TJM commented 3 years ago

IHAU who reversed some credentials accidentally (appuser_svc instead of svc_appuser), and our application using gojenkins just reported "no jobs found" rather than authentication failure or any failures. I am checking err on client.Init() and on the client.GetAllJobNames(). Neither one is returning an error. Is there a way to test the credentials to ensure they are correct?

~tommy

TJM commented 3 years ago

Hmm, specifically with v1.0.1 ... I just tried 1.1.0 (seems like more of a major upgrade since every interface changed to add context?? ... anyhow with 1.1.0, I do get an error indicating that the credentials are invalid.

figo commented 3 years ago

So you are fine with v1.1.0, which commit cause problem for you?

TJM commented 3 years ago

I am OK with using v1.1.0, as it is checking authentication response, at least during .Init(), I have not tried doing something "Unauthorized" yet :-/ ... If someone else comes along looking for this, they should know that they can upgrade to v1.1.0 to solve this problem.

When you asked which commit cause problem for you? ... Do you mean when I said it should be a major release instead of minor? whatever commit added context to everything is a major change, it changes the interface to every method call... someone cannot simply update (go get -u github.com/bndr/gojenkins), as they have to change every call to gojenkins in their code. I am not saying it was a bad change in any way, just that it should have probably been versioned as 2.0.0 :)

REF: https://semver.org/

TJM commented 3 years ago

Also, thanks for maintaining this! :)

figo commented 3 years ago

Understood, thanks for explaining and sharing the feedback :)