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

The file field on FileCredentialsImpl of class FileItem is not describable

    XMLWordPrintable

Details

    • 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

          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

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

          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.
          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 stephenconnolly. AFAIK used only by FileCredentialsImpl and CertificateCredentialsImpl.

          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 stephenconnolly . AFAIK used only by FileCredentialsImpl and CertificateCredentialsImpl .

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

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

          People

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

            Dates

              Created:
              Updated:
              Resolved: