CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gateway_util.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_GATEWAY_UTIL_H_
6 #define CVMFS_GATEWAY_UTIL_H_
7 
8 #include <string>
9 
10 namespace gateway {
11 
12 struct GatewayKey {
13  public:
15  GatewayKey(const std::string &i, const std::string &s) : id_(i), secret_(s) {}
16 
17  bool IsValid() const { return !id_.empty(); }
18  std::string id() const { return id_; }
19  std::string secret() const { return secret_; }
20 
21  private:
22  std::string id_;
23  std::string secret_;
24 };
25 
26 int APIVersion();
27 
28 GatewayKey ReadGatewayKey(const std::string& key_file_name);
29 
30 bool ReadKeys(const std::string& key_file_name, std::string* key_id,
31  std::string* secret);
32 
33 bool ParseKey(const std::string& body, std::string* key_id,
34  std::string* secret);
35 
36 } // namespace gateway
37 
38 #endif // CVMFS_GATEWAY_UTIL_H_
int APIVersion()
Definition: gateway_util.cc:26
std::string id() const
Definition: gateway_util.h:18
bool ParseKey(const std::string &body, std::string *key_id, std::string *secret)
Definition: gateway_util.cc:59
std::string secret() const
Definition: gateway_util.h:19
GatewayKey(const std::string &i, const std::string &s)
Definition: gateway_util.h:15
bool IsValid() const
Definition: gateway_util.h:17
bool ReadKeys(const std::string &key_file_name, std::string *key_id, std::string *secret)
Definition: gateway_util.cc:37
std::string secret_
Definition: gateway_util.h:23
GatewayKey ReadGatewayKey(const std::string &key_file_name)
Definition: gateway_util.cc:28