Skip to content

Commit

Permalink
Everything now lives under the Vault namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
abedra committed Jan 20, 2020
1 parent bc280b4 commit c1b119e
Show file tree
Hide file tree
Showing 25 changed files with 646 additions and 614 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include_directories("${CMAKE_SOURCE_DIR}/lib")

add_library(vault SHARED
include/VaultClient.h
src/VaultHttpConsumer.cpp
src/HttpConsumer.cpp
src/VaultClient.cpp
src/HttpClient.cpp
src/KeyValue.cpp
Expand All @@ -31,9 +31,9 @@ add_library(vault SHARED
src/WrappedSecretAppRoleStrategy.cpp
src/Base64.cpp
src/LdapStrategy.cpp
src/VaultConfigBuilder.cpp
src/ConfigBuilder.cpp
src/AppRole.cpp
src/Sys.cpp)
src/Sys.cpp )

set_target_properties(vault PROPERTIES
VERSION ${PROJECT_VERSION}
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@ The following example shows both a secret put and get. The most common scenario

int main(void)
{
HttpErrorCallback httpErrorCallback = [&](std::string err) {
Vault::HttpErrorCallback httpErrorCallback = [&](std::string err) {
std::cout << err << std::endl;
};

auto config = VaultConfigBuilder().build();
AppRoleStrategy authStrategy{Vault::RoleId{"<role_id>"}, Vault::SecretId{"<secret_id>"}};
VaultClient vaultClient{config, authStrategy, httpErrorCallback};
Vault::Config config = Vault::ConfigBuilder().build();
Vault::AppRoleStrategy authStrategy{
Vault::RoleId{"<role_id>"},
Vault::SecretId{"<secret_id>"}
};
Vault::Client vaultClient{config, authStrategy, httpErrorCallback};

KeyValue kv{vaultClient, KeyValue::Version::v1};
Vault::KeyValue kv{vaultClient, Vault::KeyValue::Version::v1};
Vault::Path mount{"/test"};
KeyValue kv2{vaultClient, mount};
Vault::KeyValue kv2{vaultClient, mount};

Parameters parameters(
Vault::Parameters parameters(
{
{"foo","world"},
{"baz","quux"},
Expand Down
17 changes: 10 additions & 7 deletions example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@

int main(void)
{
HttpErrorCallback httpErrorCallback = [&](std::string err) {
Vault::HttpErrorCallback httpErrorCallback = [&](std::string err) {
std::cout << err << std::endl;
};

auto config = VaultConfigBuilder().build();
AppRoleStrategy authStrategy{Vault::RoleId{"<role_id>"}, Vault::SecretId{"<secret_id>"}};
VaultClient vaultClient{config, authStrategy, httpErrorCallback};
Vault::Config config = Vault::ConfigBuilder().build();
Vault::AppRoleStrategy authStrategy{
Vault::RoleId{"<role_id>"},
Vault::SecretId{"<secret_id>"}
};
Vault::Client vaultClient{config, authStrategy, httpErrorCallback};

KeyValue kv{vaultClient, KeyValue::Version::v1};
Vault::KeyValue kv{vaultClient, Vault::KeyValue::Version::v1};
Vault::Path mount{"/test"};
KeyValue kv2{vaultClient, mount};
Vault::KeyValue kv2{vaultClient, mount};

Parameters parameters(
Vault::Parameters parameters(
{
{"foo","world"},
{"baz","quux"},
Expand Down
Loading

0 comments on commit c1b119e

Please sign in to comment.