cloudfoundry / credhub-cli

CredHub CLI provides a command line interface to interact with CredHub servers
Apache License 2.0
39 stars 44 forks source link

Credhub Import Ignores Parse Errors #99

Open Salamandastron1 opened 4 years ago

Salamandastron1 commented 4 years ago

What version of the credhub server you are using? Server Version: 2.5.7

What version of the credhub cli you are using? CLI Version: 2.7.0

If you were attempting to accomplish a task, what was it you were attempting to do? I was attempting to import nested certificate variables. Cert, and Private key (PEM)

What did you expect to happen? I expected the credentials to be uploaded and if there is a value in yaml file that has incorrect indentation then I should be notified.

What was the actual behavior? The cli fails silently on parse errors and uploads all other credentials

Please confirm where necessary:

Steps to reproduce:

credhub import -f secret-bad-indent.yml 
secret-bad-indent.yml 
credentials:
  - name: /concourse/np/poe-ssl-pem
    type: certificate
    value:
      certificate: |
        -----BEGIN CERTIFICATE-----

        -----END CERTIFICATE-----
    private_key: |
      -----BEGIN RSA PRIVATE KEY-----

      -----END RSA PRIVATE KEY-----
credhub import -f secret-good.yml 
secret-good.yml 
credentials:
  - name: /concourse/np/poe-ssl-pem
    type: certificate
    value:
      certificate: |
        -----BEGIN CERTIFICATE-----

        -----END CERTIFICATE-----
      private_key: |
        -----BEGIN RSA PRIVATE KEY-----

        -----END RSA PRIVATE KEY-----

If you are a PCF customer with an Operation Manager (PCF Ops Manager) please direct your questions to support (https://support.pivotal.io/)

cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/173401404

The labels on this github issue will be updated when the story is started.