Line |
Branch |
Exec |
Source |
1 |
|
|
/** |
2 |
|
|
* This file is part of the CernVM File System. |
3 |
|
|
*/ |
4 |
|
|
|
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: |
14 |
|
✗ |
GatewayKey() {} |
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_ |
39 |
|
|
|