28#ifndef CPL_SWIFT_INCLUDED_H
29#define CPL_SWIFT_INCLUDED_H
41class VSISwiftHandleHelper final:
public IVSIS3LikeHandleHelper
44 CPLString m_osStorageURL;
45 CPLString m_osAuthToken;
47 CPLString m_osObjectKey;
49 static bool GetConfiguration(CPLString& osStorageURL,
50 CPLString& osAuthToken);
52 static bool GetCached(
const char* pszURLKey,
53 const char* pszUserKey,
54 const char* pszPasswordKey,
55 CPLString& osStorageURL,
56 CPLString& osAuthToken);
58 static CPLString BuildURL(
const CPLString& osStorageURL,
59 const CPLString& osBucket,
60 const CPLString& osObjectKey);
62 void RebuildURL()
override;
65 static bool CheckCredentialsV1();
66 static bool AuthV1(CPLString& osStorageURL,
67 CPLString& osAuthToken);
70 static bool CheckCredentialsV3(
const CPLString& osAuthType);
71 static bool AuthV3(
const CPLString& osAuthType,
72 CPLString& osStorageURL,
73 CPLString& osAuthToken);
74 static CPLJSONObject CreateAuthV3RequestObject(
const CPLString& osAuthType);
75 static bool GetAuthV3StorageURL(
const CPLHTTPResult *psResult,
76 CPLString& storageURL);
79 VSISwiftHandleHelper(
const CPLString& osStorageURL,
80 const CPLString& osAuthToken,
81 const CPLString& osBucket,
82 const CPLString& osObjectKey);
83 ~VSISwiftHandleHelper();
87 static VSISwiftHandleHelper* BuildFromURI(
const char* pszURI,
88 const char* pszFSPrefix);
90 struct curl_slist* GetCurlHeaders(
const CPLString& osVerbosVerb,
91 const struct curl_slist* psExistingHeaders,
92 const void *pabyDataContent =
nullptr,
93 size_t nBytesContent = 0)
const override;
95 const CPLString& GetURL()
const override {
return m_osURL; }
97 static void CleanMutex();
98 static void ClearCache();
Interface for downloading HTTP, FTP documents.
Interface for read and write JSON documents.