Skip to content

Commit

Permalink
move tiered application profile to v2 of the KV Vault backend API
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Jun 23, 2018
1 parent e17ec26 commit 58b4530
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions aossl/profile/include/tiered_app_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class TieredApplicationProfile: public SafeApplicationProfile{
throw std::invalid_argument(GetParseError_En(d.GetParseError()));
}
if (d.IsObject()) {
const rapidjson::Value& token_val = d["data"][key.c_str()];
const rapidjson::Value& token_val = d["data"]["data"][key.c_str()];
data.assign(token_val.GetString());
}
KeyValueStore::set_opt(key, data);
Expand Down Expand Up @@ -183,7 +183,7 @@ class TieredApplicationProfile: public SafeApplicationProfile{
std::string vault_atype_key = "vault.authtype";
std::string vault_un_key = "vault.un";
std::string vault_pw_key = "vault.pw";
std::string secrets_path("/v1/secret/");
std::string secrets_path("/v1/secret/data/");
int auth_type = BASIC_AUTH_TYPE;
StringBuffer vault_addr_buf;
StringBuffer vault_cert_buf;
Expand Down Expand Up @@ -278,7 +278,7 @@ class TieredApplicationProfile: public SafeApplicationProfile{
if (env_vault_addr && env_vault_cert && env_vault_authtype && env_vault_authun && env_vault_authpw) {
std::string vaddr(env_vault_addr);
std::string cert(env_vault_cert);
std::string secrets_path("/v1/secret/");
std::string secrets_path("/v1/secret/data/");
std::string un(env_vault_authun);
std::string pw(env_vault_authpw);
std::string authtype_string(env_vault_authtype);
Expand All @@ -290,7 +290,7 @@ class TieredApplicationProfile: public SafeApplicationProfile{
} else if (env_vault_addr && env_vault_authtype && env_vault_authun && env_vault_authpw) {
std::string vaddr(env_vault_addr);
std::string cert(env_vault_cert);
std::string secrets_path("/v1/secret/");
std::string secrets_path("/v1/secret/data/");
std::string un(env_vault_authun);
std::string pw(env_vault_authpw);
std::string authtype_string(env_vault_authtype);
Expand Down
4 changes: 2 additions & 2 deletions aossl/vault/vault_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ THE SOFTWARE.
int main() {
// Build the Vault admin
std::string vault_address = "http://127.0.0.1:8200";
std::string secrets_url = "/v1/secret/";
std::string secrets_url = "/v1/secret/data/";
std::string secret_key = "testKey";
std::string un = "test";
std::string pw = "test";
Expand All @@ -56,7 +56,7 @@ int main() {
assert(false);
}
if (d.IsObject()) {
const rapidjson::Value& token_val = d["data"]["testKey"];
const rapidjson::Value& token_val = d["data"]["data"]["testKey"];
data.assign(token_val.GetString());
std::cout << data << std::endl;
assert(data == std::string("testValue"));
Expand Down

0 comments on commit 58b4530

Please sign in to comment.