29#include "AccessCredentials.h"
34using std::stringstream;
39const char *AccessCredentials::ID_KEY =
"id";
40const char *AccessCredentials::KEY_KEY =
"key";
41const char *AccessCredentials::REGION_KEY =
"region";
42const char *AccessCredentials::URL_KEY =
"url";
54 if (it != d_kvp.end())
66 d_kvp.insert(pair<string, string>(key, value));
75 d_is_s3 = !(
get(URL_KEY).empty() ||
get(ID_KEY).empty() ||
get(KEY_KEY).empty() ||
get(REGION_KEY).empty());
81string AccessCredentials::to_json()
const {
83 ss <<
"{" << endl << R
"( "AccessCredentials": { )" << endl;
84 ss << R"( "name": ")" << d_config_name << R"(",)" << endl;
86 for (
const auto &item: d_kvp) {
87 string key = item.first;
88 string value = item.second;
95 ss << R
"( ")" << item.first << R"(": ")" << item.second << R"(")";
97 ss << endl << " }" << endl <<
"}" << endl;
virtual bool is_s3_cred()
Do the URL, ID, Key amd Region items make up an S3 Credential?
virtual std::string get(const std::string &key)
virtual void add(const std::string &key, const std::string &value)
Add the key and value pair.
utility class for the HTTP catalog module