vmware-archive / column

A stable API for Ansible
https://vmware.github.io/column/
GNU General Public License v3.0
38 stars 9 forks source link

Avoid 500 error on bad decrypt #170

Closed ericwb closed 6 years ago

ericwb commented 6 years ago

Currently when decrypting a value using the credential API that is not a valid encrypted string, it throws an error 500 due to an AnsibleError exception.

Column should gracefully handle bad data such as an invalid value.

This change catches the exception and then gives a 400 response to the user instead of a 500. The error message also states that the value was invalid.

Fixes Issue #168

Signed-off-by: Eric Brown browne@vmware.com

vmwclabot commented 6 years ago

@ericwb, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.