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

credentials('some-id') should support Secret Zip type of credentials

      Instead of uploading a secret file, one can upload a zip file which is treated differently on usage.

      In essence, creation of the credential is just "Secret File" but when using the credential in withCredentials one either uses "Secret File" or "Secret ZIP File" in the snippet generator.

      A Declarative Pipeline does not expand the ZIP file correctly when it access the credential via:

      pipeline {
        environment {
          THING = credentials('my-zip-file-id')
        }
      }
      

      As best as I can tell, the file is being referenced, but it's not being unzipped into a temporary directory the way the following snippet might:

              withCredentials([zip(credentialsId: 'docker-config',
                                        variable: 'DOCKER_CONFIG')]) {
               }
      

          [JENKINS-50021] credentials('some-id') should support Secret Zip type of credentials

          Andrew Bayer added a comment -

          Well, this is actually hard to do. ZipFileBinding and FileBinding actually both use FileCredentials as their type - there is, so far as I can tell, no separate credentials type for zip files. And the way CredentialsBindingHandler works in Declarative is that it keys off of the credential type. So...looks like the answer is gonna be no, this can't be done with the current architecture.

          Andrew Bayer added a comment - Well, this is actually hard to do. ZipFileBinding and FileBinding actually both use FileCredentials as their type - there is, so far as I can tell, no separate credentials type for zip files. And the way CredentialsBindingHandler works in Declarative is that it keys off of the credential type. So...looks like the answer is gonna be no, this can't be done with the current architecture.

          Cosima added a comment -

          I receive an error message while attempting to use the AWS Command Line Interface (AWS CLI) to access my Amazon Simple Storage Service (Amazon S3) bucket. How can this be fixed?

          octordle

          Cosima added a comment - I receive an error message while attempting to use the AWS Command Line Interface (AWS CLI) to access my Amazon Simple Storage Service (Amazon S3) bucket. How can this be fixed? octordle

            Unassigned Unassigned
            rtyler R. Tyler Croy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: