Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23988

@CLIMethods do not support authentication via SecurityRealm's CLIAuthenticator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cli, core
    • Labels:
      None
    • Environment:
      1.573
    • Similar Issues:

      Description

      When using the CLI with --username foo --password bar arguments (provided by AbstractPasswordBasedSecurityRealm), only CLICommand based commands (like help, who-am-i, and list-jobs) seem to work. @CLIMethod based commands (e.g. quiet-down) fail a permission check for anonymous.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
            test/src/test/java/hudson/cli/CLIRegistererTest.java
            http://jenkins-ci.org/commit/jenkins/867884f6328a4a16899c49859230442b5316aee1
            Log:
            [FIXED JENKINS-23988] Consider CLIAuthenticator for CLIMethods

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/cli/declarative/CLIRegisterer.java test/src/test/java/hudson/cli/CLIRegistererTest.java http://jenkins-ci.org/commit/jenkins/867884f6328a4a16899c49859230442b5316aee1 Log: [FIXED JENKINS-23988] Consider CLIAuthenticator for CLIMethods
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
            test/src/test/java/hudson/cli/CLIRegistererTest.java
            http://jenkins-ci.org/commit/jenkins/c869cfdc0e9ee0d6f77a9335b1055220e57bc7d5
            Log:
            Merge pull request #1340 from daniel-beck/JENKINS-23988

            [FIXED JENKINS-23988] Consider CLIAuthenticator for CLIMethods

            Compare: https://github.com/jenkinsci/jenkins/compare/1cf735417efc...c869cfdc0e9e

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/cli/declarative/CLIRegisterer.java test/src/test/java/hudson/cli/CLIRegistererTest.java http://jenkins-ci.org/commit/jenkins/c869cfdc0e9ee0d6f77a9335b1055220e57bc7d5 Log: Merge pull request #1340 from daniel-beck/ JENKINS-23988 [FIXED JENKINS-23988] Consider CLIAuthenticator for CLIMethods Compare: https://github.com/jenkinsci/jenkins/compare/1cf735417efc...c869cfdc0e9e
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3617
            [FIXED JENKINS-23988] Consider CLIAuthenticator for CLIMethods (Revision 867884f6328a4a16899c49859230442b5316aee1)

            Result = SUCCESS
            daniel-beck : 867884f6328a4a16899c49859230442b5316aee1
            Files :

            • test/src/test/java/hudson/cli/CLIRegistererTest.java
            • core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3617 [FIXED JENKINS-23988] Consider CLIAuthenticator for CLIMethods (Revision 867884f6328a4a16899c49859230442b5316aee1) Result = SUCCESS daniel-beck : 867884f6328a4a16899c49859230442b5316aee1 Files : test/src/test/java/hudson/cli/CLIRegistererTest.java core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
            Hide
            snup67 snup snup added a comment -

            I'm using Jenkins version 1.576 and face the problem with using username/password on CLICommand.

            I tried to upgrade Jenkins to 1.577 but still facing the problem.
            I upgraded to Jenkins to 1.584 and the problem exist.
            All WAR file downloaded from http://mirrors.jenkins-ci.org/war/

            Since Jenkins is under Apache-Tomcat (on Unix Redhat OS) I renamed the old jenkins folder under ../webapps but it didn't help.
            of cource that I update also the jenkins-cli.jar that I use, related to the Jenkins version upgraded.

            Any advice what to do?
            Thanks

            Show
            snup67 snup snup added a comment - I'm using Jenkins version 1.576 and face the problem with using username/password on CLICommand. I tried to upgrade Jenkins to 1.577 but still facing the problem. I upgraded to Jenkins to 1.584 and the problem exist. All WAR file downloaded from http://mirrors.jenkins-ci.org/war/ Since Jenkins is under Apache-Tomcat (on Unix Redhat OS) I renamed the old jenkins folder under ../webapps but it didn't help. of cource that I update also the jenkins-cli.jar that I use, related to the Jenkins version upgraded. Any advice what to do? Thanks
            Hide
            danielbeck Daniel Beck added a comment -

            snup snup: I just tried on 1.583, and it worked like a charm. While it showed a warning about failure to use SSH keys, the command

            java -jar jenkins-cli.jar -s http://jenkins quiet-down --username danielbeck --password foo

            was correctly executed.

            Therefore whatever issue you experience in unrelated to this bug, and requests for assistance should be directed to the jenkinsci-users mailing list, or #jenkins on Freenode.

            Show
            danielbeck Daniel Beck added a comment - snup snup : I just tried on 1.583, and it worked like a charm. While it showed a warning about failure to use SSH keys, the command java -jar jenkins-cli.jar -s http: //jenkins quiet-down --username danielbeck --password foo was correctly executed. Therefore whatever issue you experience in unrelated to this bug, and requests for assistance should be directed to the jenkinsci-users mailing list, or #jenkins on Freenode.
            Hide
            snup67 snup snup added a comment -

            You are right on running the the quite-down command (or help command), but when running a job it simply not working

            java -jar jenkins-cli.jar -s http://jenkins build [JOB NAME] --username danielbeck --password foo

            I tried it on two versions 1.577 and 1.583

            Show
            snup67 snup snup added a comment - You are right on running the the quite-down command (or help command), but when running a job it simply not working java -jar jenkins-cli.jar -s http://jenkins build [JOB NAME] --username danielbeck --password foo I tried it on two versions 1.577 and 1.583

              People

              • Assignee:
                danielbeck Daniel Beck
                Reporter:
                danielbeck Daniel Beck
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: