File indexing completed on 2025-01-18 09:55:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef DAVIX_GCLOUD_UTILS_HPP
0023 #define DAVIX_GCLOUD_UTILS_HPP
0024
0025 #include <params/davixrequestparams.hpp>
0026
0027 namespace Davix {
0028 namespace gcloud {
0029
0030 class CredentialsInternal;
0031 class CredentialProvider;
0032
0033
0034
0035
0036
0037
0038 class DAVIX_EXPORT Credentials {
0039 public:
0040 Credentials();
0041
0042 void setPrivateKey(const std::string &key);
0043 std::string getPrivateKey() const;
0044
0045 void setClientEmail(const std::string &key);
0046 std::string getClientEmail() const;
0047
0048 bool isEmpty() const;
0049
0050
0051 Credentials(const Credentials&);
0052 Credentials(Credentials&&);
0053 Credentials& operator=(const Credentials&);
0054 Credentials& operator=(Credentials&&);
0055 virtual ~Credentials();
0056
0057 private:
0058 CredentialsInternal *internal;
0059 };
0060
0061
0062
0063
0064
0065
0066 class DAVIX_EXPORT CredentialProvider {
0067 public:
0068 CredentialProvider();
0069 Credentials fromJSONString(const std::string &str);
0070 Credentials fromFile(const std::string &path);
0071 };
0072
0073 std::string getStringToSign(const std::string &verb, const Uri &url, const HeaderVec &headers, const time_t signDuration);
0074 Uri signURI(const Credentials& creds, const std::string &verb, const Uri &url, const HeaderVec &headers, const time_t signDuration);
0075 Uri signURIFixedTimeout(const Credentials& creds, const std::string &verb, const Uri &url, const HeaderVec &headers, const time_t signDuration);
0076
0077 Uri getListingURI(const Uri & original_url, const RequestParams & params);
0078
0079 std::string extract_bucket(const Uri & uri);
0080 std::string extract_path(const Uri & uri);
0081
0082 }
0083 }
0084
0085
0086
0087 #endif