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

@CLIMethods do not support authentication via SecurityRealm's CLIAuthenticator

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • cli, core
    • None
    • 1.573

    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

            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

            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

            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

            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
            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
            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
            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

            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
            danielbeck Daniel Beck added a comment -

            snup67: 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.

            danielbeck Daniel Beck added a comment - snup67 : 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.
            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

            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

              danielbeck Daniel Beck
              danielbeck Daniel Beck
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: