GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/gateway_util.h
Date: 2026-08-30 02:40:36
Exec Total Coverage
Lines: 0 6 0.0%
Branches: 0 2 0.0%

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)
16 : id_(i), secret_(s) { }
17
18 bool IsValid() const { return !id_.empty(); }
19 std::string id() const { return id_; }
20 std::string secret() const { return secret_; }
21
22 private:
23 std::string id_;
24 std::string secret_;
25 };
26
27 int APIVersion();
28
29 // API version required for --allow-nonexistent-path. The receiver creates
30 // missing lease ancestors during the catalog merge.
31 const int kApiVersionNonexistentPath = 4;
32
33 std::string SessionTokenApiVersionPath(const std::string &token_path);
34 std::string MakeSessionTokenApiVersionRecord(int api_version,
35 const std::string &token);
36 bool ParseSessionTokenApiVersionRecord(const std::string &record,
37 const std::string &token,
38 int *api_version);
39
40 GatewayKey ReadGatewayKey(const std::string &key_file_name);
41
42 bool ReadKeys(const std::string &key_file_name, std::string *key_id,
43 std::string *secret);
44
45 bool ParseKey(const std::string &body, std::string *key_id,
46 std::string *secret);
47
48 } // namespace gateway
49
50 #endif // CVMFS_GATEWAY_UTIL_H_
51