hashicorp-vault-plugin
hashicorp-vault-plugin copied to clipboard
Vault access denied should be an exception
Vault secrets being null or empty is an exception.
Access denied results in empty secrets and and therefore the principle of least surprise dictates that the failed secret fetching should fail the build - otherwise user ends up with a build with empty secrets.
Relevant tickets:
- https://github.com/jenkinsci/hashicorp-vault-plugin/issues/162
- https://github.com/jenkinsci/hashicorp-vault-plugin/issues/156
- [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your master branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
I hope you find my trivial change to your liking.
Sorry, I don't know java so I'm a bit short on competence to write tests but I note that I managed to introduce no syntax errors :-)
The CI / Build on Jenkins 2.164.3, JDK 11 and ubuntu-latest
build failure I'm similarly incompetent to solve, but it appears to be related to maven not my change.
Hi @ash1425! I would like to pick up on this PR. We also thought that throwing an exception on Access Denied would be nice. Should I create a new Ticket for that? Do you think we could re-use the "Fail if path is not found" flag or create a separate one for Access Denied? CC @jetersen (maybe you can help us with how to proceed here, as you are the top contributor/reviewing a lot😃)
Better PR #257 . But this issue should be solved!