VaultClient - abedra/libvault GitHub Wiki
The VaultClient
object is the main object for this library. After it is constructed, it is provided to the various backends to complete requests. The constructor accepts the following options:
Name | Type | Description |
---|---|---|
config | VaultConfig& | Configuration |
authentication strategy | AuthenticationStrategy& | Method for Vault authentication |
http error callback | HttpErrorCallback | Callback for CURL errors |
The caller must provide the config and authentication strategy. The http error callback is optional. The following example demonstrates how to properly construct the object:
HttpErrorCallback httpErrorCallback = [&](std::string err) {
std::cout << err << std::endl;
};
auto config = VaultConfig::make().getConfig();
auto authStrategy = AppRole("role_id_guid", "secret_id_guid");
auto vaultClient = VaultClient(config, authStrategy, httpErrorCallback);