Mantid
Loading...
Searching...
No Matches
GitHubApiHelper.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10
11namespace Mantid {
12namespace Kernel {
13
14namespace {
15 const static std::string DEFAULT_GITHUB_TOKEN("unsetunsetunsetunsetunsetunsetunsetunset");
16}
17
22class MANTID_KERNEL_DLL GitHubApiHelper : public InternetHelper {
23public:
26 virtual ~GitHubApiHelper() = default;
27
28 void reset() override;
29 bool isAuthenticated();
37 std::string getRateLimitDescription();
38
39protected:
40 virtual void processResponseHeaders(const Poco::Net::HTTPResponse &res) override;
41 virtual InternetHelper::HTTPStatus sendRequestAndProcess(Poco::Net::HTTPClientSession &session,
42 Poco::URI &uri, std::ostream &responseStream) override;
43private:
44 InternetHelper::HTTPStatus processAnonymousRequest(Poco::URI &uri, std::ostream &responseStream);
45 void addAuthenticationToken();
49 std::string m_api_token;
50};
51
52} // namespace Kernel
53} // namespace Mantid
GitHubApiHelper : A helper class for supporting access to the github api through HTTP and HTTPS,...
virtual ~GitHubApiHelper()=default
std::string m_api_token
API token for github access.
InternetHelper : A helper class for supporting access to resources through HTTP and HTTPS.
ProxyInfo : Container for carrying around network proxy information.
Definition: ProxyInfo.h:17
Helper class which provides the Collimation Length for SANS instruments.