BetterCloud / vault-java-driver

Zero-dependency Java client for HashiCorp's Vault
https://bettercloud.github.io/vault-java-driver/
335 stars 224 forks source link

Vault Auth error is not propagated to the consumer #181

Open imsatyam opened 5 years ago

imsatyam commented 5 years ago

Auth.java class does not propagate the error message returned by vault to the consumer.

Concerned Code

if (restResponse.getStatus() != 200) {
        throw new VaultException("Vault responded with HTTP status code: " + restResponse.getStatus(), restResponse.getStatus());
}

Example: I am using loginByAwsIam method to read secrets from vault. Vault returns 400 error with valid error message. However, as a consumer, I never get to see the error message. All I could see was Vault responded with HTTP status code: 400.

Is it intentional?

If not, I can raise a PR to fix this.