diff options
Diffstat (limited to 'src/web_service/web_backend.h')
| -rw-r--r-- | src/web_service/web_backend.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/web_service/web_backend.h b/src/web_service/web_backend.h index 04121f17e..81f58583c 100644 --- a/src/web_service/web_backend.h +++ b/src/web_service/web_backend.h | |||
| @@ -7,12 +7,10 @@ | |||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <string> | 8 | #include <string> |
| 9 | 9 | ||
| 10 | namespace Common { | ||
| 11 | struct WebResult; | ||
| 12 | } | ||
| 13 | |||
| 14 | namespace WebService { | 10 | namespace WebService { |
| 15 | 11 | ||
| 12 | struct WebResult; | ||
| 13 | |||
| 16 | class Client { | 14 | class Client { |
| 17 | public: | 15 | public: |
| 18 | Client(std::string host, std::string username, std::string token); | 16 | Client(std::string host, std::string username, std::string token); |
| @@ -25,8 +23,7 @@ public: | |||
| 25 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. | 23 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. |
| 26 | * @return the result of the request. | 24 | * @return the result of the request. |
| 27 | */ | 25 | */ |
| 28 | Common::WebResult PostJson(const std::string& path, const std::string& data, | 26 | WebResult PostJson(const std::string& path, const std::string& data, bool allow_anonymous); |
| 29 | bool allow_anonymous); | ||
| 30 | 27 | ||
| 31 | /** | 28 | /** |
| 32 | * Gets JSON from the specified path. | 29 | * Gets JSON from the specified path. |
| @@ -34,7 +31,7 @@ public: | |||
| 34 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. | 31 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. |
| 35 | * @return the result of the request. | 32 | * @return the result of the request. |
| 36 | */ | 33 | */ |
| 37 | Common::WebResult GetJson(const std::string& path, bool allow_anonymous); | 34 | WebResult GetJson(const std::string& path, bool allow_anonymous); |
| 38 | 35 | ||
| 39 | /** | 36 | /** |
| 40 | * Deletes JSON to the specified path. | 37 | * Deletes JSON to the specified path. |
| @@ -43,8 +40,7 @@ public: | |||
| 43 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. | 40 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. |
| 44 | * @return the result of the request. | 41 | * @return the result of the request. |
| 45 | */ | 42 | */ |
| 46 | Common::WebResult DeleteJson(const std::string& path, const std::string& data, | 43 | WebResult DeleteJson(const std::string& path, const std::string& data, bool allow_anonymous); |
| 47 | bool allow_anonymous); | ||
| 48 | 44 | ||
| 49 | /** | 45 | /** |
| 50 | * Gets a plain string from the specified path. | 46 | * Gets a plain string from the specified path. |
| @@ -52,7 +48,7 @@ public: | |||
| 52 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. | 48 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. |
| 53 | * @return the result of the request. | 49 | * @return the result of the request. |
| 54 | */ | 50 | */ |
| 55 | Common::WebResult GetPlain(const std::string& path, bool allow_anonymous); | 51 | WebResult GetPlain(const std::string& path, bool allow_anonymous); |
| 56 | 52 | ||
| 57 | /** | 53 | /** |
| 58 | * Gets an PNG image from the specified path. | 54 | * Gets an PNG image from the specified path. |
| @@ -60,14 +56,14 @@ public: | |||
| 60 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. | 56 | * @param allow_anonymous If true, allow anonymous unauthenticated requests. |
| 61 | * @return the result of the request. | 57 | * @return the result of the request. |
| 62 | */ | 58 | */ |
| 63 | Common::WebResult GetImage(const std::string& path, bool allow_anonymous); | 59 | WebResult GetImage(const std::string& path, bool allow_anonymous); |
| 64 | 60 | ||
| 65 | /** | 61 | /** |
| 66 | * Requests an external JWT for the specific audience provided. | 62 | * Requests an external JWT for the specific audience provided. |
| 67 | * @param audience the audience of the JWT requested. | 63 | * @param audience the audience of the JWT requested. |
| 68 | * @return the result of the request. | 64 | * @return the result of the request. |
| 69 | */ | 65 | */ |
| 70 | Common::WebResult GetExternalJWT(const std::string& audience); | 66 | WebResult GetExternalJWT(const std::string& audience); |
| 71 | 67 | ||
| 72 | private: | 68 | private: |
| 73 | struct Impl; | 69 | struct Impl; |