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

credential ID accepts a too narrow set of characters

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • credentials-plugin
    • None

      It seems that there is hardcoded format enforcement for credentials ID which is very limiting for no clear technical reasons. See https://github.com/jenkinsci/credentials-plugin/blob/master/src/main/java/com/cloudbees/plugins/credentials/impl/BaseStandardCredentials.java#L206

      The current regex is [a-zA-Z0-9_.-]+ which prevents people from using logical names like "user@host".

      The current pattern allows only for simple characters which can normally exist in the username, making impossible to use some kind of safe separator when adding IDs.

      This requests for enlarging set of allowable characters and also to document the restriction pattern in the UI, so people would know what they can use.

      Please note that I would not mind raising a PR myself for addressing this but first I need some feedback regarding which are the real limitations regarding the ID. Sadly the source code does not indicate any reasons why this regex was added in the first place. 

          [JENKINS-45254] credential ID accepts a too narrow set of characters

          Sorin Sbarnea created issue -
          Sorin Sbarnea made changes -
          Description Original: It seems that there is hardcoded format enforcement for credentials ID which is very limiting for no clear technical reasons. See [https://github.com/jenkinsci/credentials-plugin/blob/master/src/main/java/com/cloudbees/plugins/credentials/impl/BaseStandardCredentials.java#L206]

          The current regex is {{[a-zA-Z0-9_.-]+}} which prevents people from using logical names like "user@host".

          The current pattern allows only for simple characters which can normally exist in the username, making impossible to use some kind of safe separator when adding IDs.

          This requests for enlarging set of allowable characters and also to document the restriction pattern in the UI, so people would know what they can use.

           
          New: It seems that there is hardcoded format enforcement for credentials ID which is very limiting for no clear technical reasons. See [https://github.com/jenkinsci/credentials-plugin/blob/master/src/main/java/com/cloudbees/plugins/credentials/impl/BaseStandardCredentials.java#L206]

          The current regex is {{[a-zA-Z0-9_.-]+}} which prevents people from using logical names like "user@host".

          The current pattern allows only for simple characters which can normally exist in the username, making impossible to use some kind of safe separator when adding IDs.

          This requests for enlarging set of allowable characters and also to document the restriction pattern in the UI, so people would know what they can use.

          Please note that I would not mind raising a PR myself for addressing this but first I need some feedback regarding which are the real limitations regarding the ID. Sadly the source code does not indicate any reasons why this regex was added in the first place. 
          Jesse Glick made changes -
          Component/s Original: credentials-binding-plugin [ 18129 ]
          Stephen Connolly made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ]

            Unassigned Unassigned
            ssbarnea Sorin Sbarnea
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: