28 #ifndef CPL_GOOGLE_CLOUD_INCLUDED_H
29 #define CPL_GOOGLE_CLOUD_INCLUDED_H
39 #include <curl/curl.h>
44 class VSIGSHandleHelper final :
public IVSIS3LikeHandleHelper
49 std::string m_osEndpoint;
50 std::string m_osBucketObjectKey;
51 std::string m_osSecretAccessKey;
52 std::string m_osAccessKeyId;
53 bool m_bUseAuthenticationHeader;
55 std::string m_osUserProject{};
57 static bool GetConfiguration(
const std::string &osPathForOption,
59 std::string &osSecretAccessKey,
60 std::string &osAccessKeyId,
61 bool &bUseAuthenticationHeader,
64 static bool GetConfigurationFromConfigFile(
65 std::string &osSecretAccessKey, std::string &osAccessKeyId,
66 std::string &osOAuth2RefreshToken, std::string &osOAuth2ClientId,
67 std::string &osOAuth2ClientSecret, std::string &osCredentials);
69 void RebuildURL()
override;
72 VSIGSHandleHelper(
const std::string &osEndpoint,
73 const std::string &osBucketObjectKey,
74 const std::string &osSecretAccessKey,
75 const std::string &osAccessKeyId,
bool bUseHeaderFile,
77 const std::string &osUserProject);
80 static VSIGSHandleHelper *
81 BuildFromURI(
const char *pszURI,
const char *pszFSPrefix,
82 const char *pszURIForPathSpecificOption =
nullptr,
85 bool UsesHMACKey()
const;
88 GetCurlHeaders(
const std::string &osVerbosVerb,
89 const struct curl_slist *psExistingHeaders,
90 const void *pabyDataContent =
nullptr,
91 size_t nBytesContent = 0)
const override;
93 const std::string &GetURL()
const override
98 std::string GetCopySourceHeader()
const override
100 return "x-goog-copy-source";
103 const char *GetMetadataDirectiveREPLACE()
const override
105 return "x-goog-metadata-directive: REPLACE";
110 static void CleanMutex();
111 static void ClearCache();
Manager of Google OAuth2 authentication.
Definition: cpl_http.h:236
Interface for downloading HTTP, FTP documents.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1042
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1183
Various convenience functions for working with strings and string lists.