tabeyti / jenkins-jack

Jack into your Jenkins to execute Pipeline scripts, provide Pipeline step autocompletions, pull Shared Library step documenation, run console groovy scripts across multiple nodes, and more! Honestly, not that much more.
Other
97 stars 32 forks source link

Do not authenticate when the user is undefined #26

Closed b1zzu closed 3 years ago

b1zzu commented 4 years ago

What

I starting a local jenkins that doesn't require any authentication, therefore I removed the username and password from the configuration

    "jenkins-jack.jenkins.connections": [

        {
            "name": "default",
            "uri": "http://localhost:8080",
            "active": true
        }
    ],

but I was receiving this error:

Jenkins Jack: Could not connect to the remote Jenkins

with some additional investigation I found out that it was trying to connect to Jenkins using this url:

http://undefined:undefined@localhost:8080

I found two solutions to this problem:

  1. Check if username or password are undefined and if they are don't set the username and password
  2. Set the username and password in the configuration explicit to null

In this PR I've gone for the first option, but if you guys think the second options is better, then I propose to document it out

Update:

I tried again with the second options but it seems it doesn't work, maybe I'm doing something wrong this time, or I was doing something wrong before