bes  Updated for version 3.20.13
AccessCredentials.h
1 //
2 // Created by ndp on 2/12/20.
3 //
4 
5 #ifndef HYRAX_GIT_ACCESSCREDENTIALS_H
6 #define HYRAX_GIT_ACCESSCREDENTIALS_H
7 
8 #include <map>
9 #include <string>
10 
12 public:
13  // These are the string keys used to express the normative key names
14  // for the credentials components.
15  static const char *ID_KEY;
16  static const char *KEY_KEY;
17  static const char *REGION_KEY;
18  static const char *URL_KEY;
19 
20 private:
21  std::map<std::string, std::string> kvp;
22  std::string d_config_name;
23  bool d_s3_tested;
24  bool d_is_s3;
25 public:
26  AccessCredentials() = default;
27 
28  explicit AccessCredentials(const std::string &config_name) :
29  d_config_name(config_name),
30  d_s3_tested(false),
31  d_is_s3(false) { }
32 
33  AccessCredentials(const AccessCredentials &ac) = default;
34 
35  virtual ~AccessCredentials() = default;
36 
37  virtual std::string get(const std::string &key);
38 
39  void add(const std::string &key, const std::string &value);
40 
41  virtual bool is_s3_cred();
42 
43  std::string to_json();
44 
45  std::string name() { return d_config_name; }
46 
47  void name(const std::string &name) { d_config_name = name; }
48 };
49 
50 #include <string>
51 #include <vector>
52 
53 #endif //HYRAX_GIT_ACCESSCREDENTIALS_H
void add(const std::string &key, const std::string &value)
Add the key and value pair.
virtual std::string get(const std::string &key)
virtual bool is_s3_cred()
Do the URL, ID, Key amd Region items make up an S3 Credential?