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

Configurable ID for Credentials

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      It should be easier to refer to a particular Credentials from a script.

      Currently you can use GenericSCMStep with a hardcoded ID (or see JENKINS-26085). But this looks ugly in the script. It would be nicer for not just Workflow but other non-UI-driven plugins as well (Templates, Job DSL, YAML Project, &c.) if you could define a meaningful ID when creating a StandardCredentials. Perhaps this could be in an Advanced block when configuring the credentials. Without such a UI, you have to resort to editing $JENKINS_HOME/credentials.xml and reloading configuration from disk.

      Note that the actual lookup of the live StandardCredentials by its ID happens in some context, where the Item and DomainRestrictions are considered. So if the referent is not appropriate in the current context, the plugin code using the ID (for example, git-plugin) is responsible for rejecting the attempt, minimally just by saying that no Credentials with that ID could be found. In other words, security & sanity checks can be done in UI forms but they must be done again at runtime anyway; this is true even for freestyle projects since you can just upload a new config.xml with an arbitrary <credentialsId>...</credentialsId>.

      The Credentials plugin does of course need to take care to ensure that IDs are unique within a given CredentialsProvider when loading definitions from disk or adding definitions.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-26085 [ JENKINS-26085 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26299 [ JENKINS-26299 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-26051 [ JENKINS-26051 ]
            jglick Jesse Glick made changes -
            Assignee stephenconnolly [ stephenconnolly ] Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 21 (Web Link)" [ 12015 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "ssh-credentials-plugin PR 12 (Web Link)" [ 12016 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "plain-credentials-plugin PR 2 (Web Link)" [ 12017 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            morgwai Morgwai Kotarbinski made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Assignee Jesse Glick [ jglick ] stephenconnolly [ stephenconnolly ]
            jglick Jesse Glick made changes -
            Assignee stephenconnolly [ stephenconnolly ] Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            pablaasmo Per Arnold Blaasmo made changes -
            Link This issue is related to JENKINS-27500 [ JENKINS-27500 ]
            stephenconnolly Stephen Connolly made changes -
            Link This issue is duplicated by JENKINS-27500 [ JENKINS-27500 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 160089 ] JNJira + In-Review [ 196312 ]
            abayer Andrew Bayer made changes -
            Labels workflow pipeline workflow
            abayer Andrew Bayer made changes -
            Labels pipeline workflow pipeline
            anudeeplalam Anudeep Lalam made changes -
            Attachment CredentailID.png [ 35019 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: