abedra / libvault

A C++ library for Hashicorp Vault
MIT License
34 stars 26 forks source link

Support Token AuthStrategy #107

Closed onetwopunch closed 1 year ago

onetwopunch commented 2 years ago

Maybe there's a way to do this and I'm missing it, but I can't seem to find a way to instantiate a Client without using an AuthStrategy. For context, we have an application that logs you into Vault and other applications once per day, setting the ~/.vault-token file that most other SDK's accept, so making users log in again would not be ideal.

If there is no way of doing this currently, perhaps we could add another constructor to Vault::Client that just accepted a raw token, instead of requiring an AuthStrategy, so we could read the file first and put it in?

abedra commented 2 years ago

There's the TokenStrategy available if you want to use a token directly. Is this what you're looking for?