28 #ifndef CPL_SWIFT_INCLUDED_H
29 #define CPL_SWIFT_INCLUDED_H
35 #include <curl/curl.h>
41 class VSISwiftHandleHelper final :
public IVSIS3LikeHandleHelper
44 std::string m_osStorageURL;
45 std::string m_osAuthToken;
46 std::string m_osBucket;
47 std::string m_osObjectKey;
49 static bool GetConfiguration(
const std::string &osPathForOption,
50 std::string &osStorageURL,
51 std::string &osAuthToken);
53 static bool GetCached(
const std::string &osPathForOption,
54 const char *pszURLKey,
const char *pszUserKey,
55 const char *pszPasswordKey, std::string &osStorageURL,
56 std::string &osAuthToken);
58 static std::string BuildURL(
const std::string &osStorageURL,
59 const std::string &osBucket,
60 const std::string &osObjectKey);
62 void RebuildURL()
override;
65 static bool CheckCredentialsV1(
const std::string &osPathForOption);
66 static bool AuthV1(
const std::string &osPathForOption,
67 std::string &osStorageURL, std::string &osAuthToken);
70 static bool CheckCredentialsV3(
const std::string &osPathForOption,
71 const std::string &osAuthType);
72 static bool AuthV3(
const std::string &osPathForOption,
73 const std::string &osAuthType, std::string &osStorageURL,
74 std::string &osAuthToken);
76 CreateAuthV3RequestObject(
const std::string &osPathForOption,
77 const std::string &osAuthType);
78 static bool GetAuthV3StorageURL(
const std::string &osPathForOption,
80 std::string &storageURL);
83 VSISwiftHandleHelper(
const std::string &osStorageURL,
84 const std::string &osAuthToken,
85 const std::string &osBucket,
86 const std::string &osObjectKey);
87 ~VSISwiftHandleHelper();
89 bool Authenticate(
const std::string &osPathForOption);
91 static VSISwiftHandleHelper *BuildFromURI(
const char *pszURI,
92 const char *pszFSPrefix);
95 GetCurlHeaders(
const std::string &osVerbosVerb,
96 const struct curl_slist *psExistingHeaders,
97 const void *pabyDataContent =
nullptr,
98 size_t nBytesContent = 0)
const override;
100 const std::string &GetURL()
const override
105 static void CleanMutex();
106 static void ClearCache();
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:57
Interface for downloading HTTP, FTP documents.
Interface for read and write JSON documents.
Definition: cpl_http.h:68