12#ifndef CPL_GOOGLE_CLOUD_INCLUDED_H
13#define CPL_GOOGLE_CLOUD_INCLUDED_H
28class VSIGSHandleHelper final :
public IVSIS3LikeHandleHelper
33 std::string m_osEndpoint;
34 std::string m_osBucketObjectKey;
35 std::string m_osSecretAccessKey;
36 std::string m_osAccessKeyId;
37 bool m_bUseAuthenticationHeader;
39 std::string m_osUserProject{};
41 static bool GetConfiguration(
const std::string &osPathForOption,
43 std::string &osSecretAccessKey,
44 std::string &osAccessKeyId,
45 bool &bUseAuthenticationHeader,
48 static bool GetConfigurationFromConfigFile(
49 std::string &osSecretAccessKey, std::string &osAccessKeyId,
50 std::string &osOAuth2RefreshToken, std::string &osOAuth2ClientId,
51 std::string &osOAuth2ClientSecret, std::string &osCredentials);
53 void RebuildURL()
override;
56 VSIGSHandleHelper(
const std::string &osEndpoint,
57 const std::string &osBucketObjectKey,
58 const std::string &osSecretAccessKey,
59 const std::string &osAccessKeyId,
bool bUseHeaderFile,
61 const std::string &osUserProject);
64 static VSIGSHandleHelper *
65 BuildFromURI(
const char *pszURI,
const char *pszFSPrefix,
66 const char *pszURIForPathSpecificOption =
nullptr,
69 bool UsesHMACKey()
const;
72 GetCurlHeaders(
const std::string &osVerbosVerb,
73 const struct curl_slist *psExistingHeaders,
74 const void *pabyDataContent =
nullptr,
75 size_t nBytesContent = 0)
const override;
77 const std::string &GetURL()
const override
82 std::string GetCopySourceHeader()
const override
84 return "x-goog-copy-source";
87 const char *GetMetadataDirectiveREPLACE()
const override
89 return "x-goog-metadata-directive: REPLACE";
94 static void ClearCache();
Manager of Google OAuth2 authentication.
Definition: cpl_http.h:220
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:1030
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1179
Various convenience functions for working with strings and string lists.