BetterCloud / vault-java-driver

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

Possibility to use a different token than the one defined in the config #106

Open Erenthil opened 6 years ago

steve-perkins commented 6 years ago

Can you talk a bit about the use case(s) here? The fundamental design of the driver thus far has been that tokens are tied to VaultConfig objects, and passed to Vault objects one time at construction. If you need to use multiple tokens, then you simply have multiple Vault objects.

If someone is routinely using a variety of different tokens in the same area of code, then I could perhaps understand their preferences differing on that design. But I have to believe that this is an edge case rather than the typical norm, and breaking the existing pattern for it seems to be a bit muddled and confusing.

fbourasse commented 6 years ago

Sorry for the delay of response. For me, the token should not be included in the object VaultConfig as multiple users can use the same address/timeout/ssl config but will use different token.

A solution would be to implement a SessionManager that can be extended as it's the case for the Spring Vault project.

Here is my use case :