12#ifndef CPL_SWIFT_INCLUDED_H
13#define CPL_SWIFT_INCLUDED_H
25class VSISwiftHandleHelper final :
public IVSIS3LikeHandleHelper
28 std::string m_osStorageURL;
29 std::string m_osAuthToken;
30 std::string m_osBucket;
31 std::string m_osObjectKey;
33 static bool GetConfiguration(
const std::string &osPathForOption,
34 std::string &osStorageURL,
35 std::string &osAuthToken);
37 static bool GetCached(
const std::string &osPathForOption,
38 const char *pszURLKey,
const char *pszUserKey,
39 const char *pszPasswordKey, std::string &osStorageURL,
40 std::string &osAuthToken);
42 static std::string BuildURL(
const std::string &osStorageURL,
43 const std::string &osBucket,
44 const std::string &osObjectKey);
46 void RebuildURL()
override;
49 static bool CheckCredentialsV1(
const std::string &osPathForOption);
50 static bool AuthV1(
const std::string &osPathForOption,
51 std::string &osStorageURL, std::string &osAuthToken);
54 static bool CheckCredentialsV3(
const std::string &osPathForOption,
55 const std::string &osAuthType);
56 static bool AuthV3(
const std::string &osPathForOption,
57 const std::string &osAuthType, std::string &osStorageURL,
58 std::string &osAuthToken);
60 CreateAuthV3RequestObject(
const std::string &osPathForOption,
61 const std::string &osAuthType);
62 static bool GetAuthV3StorageURL(
const std::string &osPathForOption,
64 std::string &storageURL);
67 VSISwiftHandleHelper(
const std::string &osStorageURL,
68 const std::string &osAuthToken,
69 const std::string &osBucket,
70 const std::string &osObjectKey);
71 ~VSISwiftHandleHelper();
73 bool Authenticate(
const std::string &osPathForOption);
75 static VSISwiftHandleHelper *BuildFromURI(
const char *pszURI,
76 const char *pszFSPrefix);
79 GetCurlHeaders(
const std::string &osVerbosVerb,
80 const struct curl_slist *psExistingHeaders,
81 const void *pabyDataContent =
nullptr,
82 size_t nBytesContent = 0)
const override;
84 const std::string &GetURL()
const override
89 static void CleanMutex();
90 static void ClearCache();
The CPLJSONArray class holds JSON object from CPLJSONDocument.
Definition: cpl_json.h:41
Interface for downloading HTTP, FTP documents.
Interface for read and write JSON documents.
Definition: cpl_http.h:52