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

            Hide
            jglick Jesse Glick added a comment -

            Morgwai Kotarbinski JIRA tracks work in progress. Once the fix is merged to master it is Fixed.

            Show
            jglick Jesse Glick added a comment - Morgwai Kotarbinski JIRA tracks work in progress. Once the fix is merged to master it is Fixed .
            Hide
            morgwai Morgwai Kotarbinski added a comment -

            So where should I file an issue related to releasing a merged code in general? after all that's what end users see: it doesn't really matter how perfect is the code in master until it's released...

            Thanks!

            Show
            morgwai Morgwai Kotarbinski added a comment - So where should I file an issue related to releasing a merged code in general? after all that's what end users see: it doesn't really matter how perfect is the code in master until it's released... Thanks!
            Hide
            jglick Jesse Glick added a comment -

            There is no place to file such things, other than pestering the plugin maintainer, in this case Stephen Connolly.

            Show
            jglick Jesse Glick added a comment - There is no place to file such things, other than pestering the plugin maintainer, in this case Stephen Connolly .
            Hide
            anudeeplalam Anudeep Lalam added a comment -

            Jesse Glick - I am using Jenkins ver. 2.9. I want to customise my Jenkins Credential ID. When I try to configure, the edit option is not present for ID. Please see below.

            Where can I edit the ID ??

            Show
            anudeeplalam Anudeep Lalam added a comment - Jesse Glick - I am using Jenkins ver. 2.9. I want to customise my Jenkins Credential ID. When I try to configure, the edit option is not present for ID . Please see below. Where can I edit the ID ??
            Hide
            jglick Jesse Glick added a comment -

            Anudeep Lalam the ID can only be customized on new credentials. Once created it is immutable.

            Show
            jglick Jesse Glick added a comment - Anudeep Lalam the ID can only be customized on new credentials. Once created it is immutable.

              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: