Adding the ability to not treat 4xx response codes as errors that sho… by bklawans · Pull Request #176 · BetterCloud/vault-java-driver · GitHub
Skip to content

Adding the ability to not treat 4xx response codes as errors that sho…#176

Merged
steve-perkins merged 2 commits into
BetterCloud:masterfrom
bklawans:master
Aug 19, 2019
Merged

Adding the ability to not treat 4xx response codes as errors that sho…#176
steve-perkins merged 2 commits into
BetterCloud:masterfrom
bklawans:master

Conversation

@bklawans

Copy link
Copy Markdown

Adds support for not treating 4xx status coded from vaults as errors for reads/writes, and allows them to be passed back without retries or being converted to VaultExceptions.

Use Case:
We have a spring app with a custom property resolver that can read properties from various sources, and want to add Vault as a new source. If a property does not exist in vault, it should read it from the next source. With the current version of vault-java-driver if the property is not in Vault it will retry the configured number of times, waiting between each retry, which significantly slows down the app startup. This PR allows us to turn that off and get an immediate "no such value" from Vault.

If you would prefer, I could modify this to still throw an exception but just turn off the retry logic.

…uld be retried and converted into exceptions
@steve-perkins

Copy link
Copy Markdown
Contributor

@bklawans

Copy link
Copy Markdown
Author

I absolutely agree - I was trying to avoid changing the default behavior, but since it sounds like we are on the same page I'll rev this PR to make it the default behavior. I'm traveling through Monday so it will take me a few days to turn around.

@steve-perkins

Copy link
Copy Markdown
Contributor

No problem at all. Thanks so much, and have a great weekend.

@bklawans

Copy link
Copy Markdown
Author

I've updated the PR to make this the default behavior, and added a new test to the VaultTests suite.

@steve-perkins

Copy link
Copy Markdown
Contributor

Awesome, thank you!

@steve-perkins steve-perkins merged commit 9419a3e into BetterCloud:master Aug 19, 2019
@jetersen

jetersen commented Aug 24, 2019

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants