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,
63 const CPLHTTPResult *psResult,
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()
override;
73 bool Authenticate(
const std::string &osPathForOption);
75 static VSISwiftHandleHelper *BuildFromURI(
const char *pszURI,
76 const char *pszFSPrefix);
78 struct curl_slist *GetCurlHeaders(
const std::string &osVerbosVerb,
79 struct curl_slist *psHeaders,
80 const void *pabyDataContent =
nullptr,
81 size_t nBytesContent = 0)
const override;
83 const std::string &GetURL()
const override
88 static void CleanMutex();
89 static void ClearCache();
Interface for downloading HTTP, FTP documents.
Interface for read and write JSON documents.