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

The file field on FileCredentialsImpl of class FileItem is not describable

    Details

    • Similar Issues:
    • Released As:
      2.3.3

      Description

      Seems like the plain-credential plugin is not compatible with JCasC.

      At least JCasC export cannot describe FileItem class.

      plain-credential is using a non describable interface of FileItem fromĀ org.apache.commons.fileupload.FileItem not sure how to convert this type to a describable type.

        Attachments

          Activity

          Hide
          casz Joseph Petersen (old) added a comment -

          Jesse Glick do you have any suggestion how I could contribute to plain-credentials-plugin to make it even more JCasC compatible?

          Show
          casz Joseph Petersen (old) added a comment - Jesse Glick do you have any suggestion how I could contribute to plain-credentials-plugin to make it even more JCasC compatible?
          Hide
          jglick Jesse Glick added a comment -

          FileCredentialsImpl is weird. Definitely not a generally supported usage of @DataBoundConstructor. You cannot and should not attempt to export a FileItem; it is just there to handle browser file uploads. From the perspective of JCasC, ignore the file parameter and use only fileName + secretBytes (the things you actually have getters for anyway).

          You may need to be adding SecretBytes support to JCasC for the first time. Created by Stephen Connolly. AFAIK used only by FileCredentialsImpl and CertificateCredentialsImpl.

          Show
          jglick Jesse Glick added a comment - FileCredentialsImpl is weird. Definitely not a generally supported usage of @DataBoundConstructor . You cannot and should not attempt to export a FileItem ; it is just there to handle browser file uploads. From the perspective of JCasC, ignore the file parameter and use only fileName + secretBytes (the things you actually have getters for anyway). You may need to be adding SecretBytes support to JCasC for the first time. Created by Stephen Connolly . AFAIK used only by FileCredentialsImpl and CertificateCredentialsImpl .
          Hide
          jglick Jesse Glick added a comment -

          To be clear, I do not believe any patch to plain-credentials is possible, at least without a rewrite of file uploads in Stapler. configuration-as-code is just going to have to deal with what is there.

          Show
          jglick Jesse Glick added a comment - To be clear, I do not believe any patch to plain-credentials is possible, at least without a rewrite of file uploads in Stapler. configuration-as-code is just going to have to deal with what is there.
          Hide
          timja Tim Jacomb added a comment -

          This is fixed by adjusting the converter in the credentials-plugin
          https://github.com/jenkinsci/credentials-plugin/pull/135

          released in 2.3.3

          Show
          timja Tim Jacomb added a comment - This is fixed by adjusting the converter in the credentials-plugin https://github.com/jenkinsci/credentials-plugin/pull/135 released in 2.3.3

            People

            • Assignee:
              timja Tim Jacomb
              Reporter:
              casz Joseph Petersen (old)
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: