28 #ifndef CPL_SWIFT_INCLUDED_H
29 #define CPL_SWIFT_INCLUDED_H
35 #include <curl/curl.h>
41 class VSISwiftHandleHelper final:
public IVSIS3LikeHandleHelper
49 static bool GetConfiguration(
const std::string& osPathForOption,
53 static bool GetCached(
const std::string& osPathForOption,
54 const char* pszURLKey,
55 const char* pszUserKey,
56 const char* pszPasswordKey,
64 void RebuildURL()
override;
67 static bool CheckCredentialsV1(
const std::string& osPathForOption);
68 static bool AuthV1(
const std::string& osPathForOption,
73 static bool CheckCredentialsV3(
const std::string& osPathForOption,
75 static bool AuthV3(
const std::string& osPathForOption,
79 static CPLJSONObject CreateAuthV3RequestObject(
const std::string& osPathForOption,
81 static bool GetAuthV3StorageURL(
const std::string& osPathForOption,
86 VSISwiftHandleHelper(
const CPLString& osStorageURL,
90 ~VSISwiftHandleHelper();
92 bool Authenticate(
const std::string& osPathForOption);
94 static VSISwiftHandleHelper* BuildFromURI(
const char* pszURI,
95 const char* pszFSPrefix);
97 struct curl_slist* GetCurlHeaders(
const CPLString& osVerbosVerb,
98 const struct curl_slist* psExistingHeaders,
99 const void *pabyDataContent =
nullptr,
100 size_t nBytesContent = 0)
const override;
102 const CPLString& GetURL()
const override {
return m_osURL; }
104 static void CleanMutex();
105 static void ClearCache();