20 #ifndef __LOGINMANAGER_P_H__ 21 #define __LOGINMANAGER_P_H__ 45 static constexpr
const char*
mscoreHost =
"https://musescore.com";
56 static constexpr
const char*
apiHost =
"https://api.musescore.com/";
57 static constexpr
const char*
apiRoot =
"/v2";
62 static constexpr
const char*
loginPage =
"https://musescore.com/user/auth/webview";
63 static constexpr
const char*
loginSuccessPage =
"https://musescore.com/user/auth/webview/success";
65 static QUrl
getUpdateScoreInfoUrl(
const QString& scoreId,
const QString& accessToken,
bool newScore,
const QString& customPath);
94 QHttpMultiPart* _multipart =
nullptr;
96 QNetworkReply* _reply =
nullptr;
102 QNetworkRequest buildRequest()
const;
117 void executeRequest(QNetworkAccessManager* mgr);
118 QNetworkReply*
reply() {
return _reply; }
119 const QNetworkReply*
reply()
const {
return _reply; }
129 class ApiWebEngineRequestInterceptor :
public QWebEngineUrlRequestInterceptor
133 ApiWebEngineRequestInterceptor(QObject* parent) : QWebEngineUrlRequestInterceptor(parent) {}
134 void interceptRequest(QWebEngineUrlRequestInfo& info)
override;
ApiRequest & setPath(const QString &path)
Definition: loginmanager_p.h:111
const QNetworkReply * reply() const
Definition: loginmanager_p.h:119
static const ApiInfo & instance()
Definition: loginmanager_p.h:49
static const QUrl loginUrl
Definition: loginmanager_p.h:67
static ApiInfo * _instance
Definition: loginmanager_p.h:33
Definition: loginmanager_p.h:31
const QByteArray apiKey
Definition: loginmanager_p.h:71
ApiRequest & addPostParameter(const QString &key, const QString &val)
Definition: loginmanager_p.h:113
int retryCount() const
Definition: loginmanager_p.h:121
Definition: loginmanager_p.h:84
static QString getOsInfo()
Definition: loginmanager.cpp:101
static constexpr const char * userAgentTemplate
Definition: loginmanager_p.h:60
ApiInfo & operator=(const ApiInfo &)=delete
Definition: loginmanager_p.h:86
ApiRequest(QObject *parent=nullptr)
Definition: loginmanager_p.h:108
static void createInstance()
Definition: loginmanager.cpp:67
static QString apiInfoLocation()
Definition: loginmanager.cpp:35
static constexpr const char * apiKeyHeader
Definition: loginmanager_p.h:59
QUrlQuery _bodyQuery
Definition: loginmanager_p.h:93
Definition: loginmanager_p.h:79
Definition: loginmanager_p.h:85
ApiInfo(QByteArray clientId, QByteArray apiKey)
Definition: loginmanager.cpp:114
static const QUrl loginSuccessUrl
Definition: loginmanager_p.h:68
static QByteArray genClientId()
Definition: loginmanager.cpp:44
ApiRequest & setMethod(Method m)
Definition: loginmanager_p.h:110
Definition: loginmanager_p.h:145
Definition: loginmanager_p.h:146
QUrlQuery _urlQuery
Definition: loginmanager_p.h:92
static constexpr const char * loginSuccessPage
Definition: loginmanager_p.h:63
static constexpr const char * defaultUpdateScoreInfoPath
Definition: loginmanager_p.h:46
QUrl _url
Definition: loginmanager_p.h:91
HttpStatus
Definition: loginmanager_p.h:142
Definition: aeolus.cpp:26
static constexpr const char * loginPage
Definition: loginmanager_p.h:62
Definition: loginmanager_p.h:144
ApiRequest & addGetParameter(const QString &key, const QString &val)
Definition: loginmanager_p.h:112
static constexpr const char * apiRoot
Definition: loginmanager_p.h:57
static QUrl getUpdateScoreInfoUrl(const QString &scoreId, const QString &accessToken, bool newScore, const QString &customPath)
Definition: loginmanager.cpp:130
static constexpr const char * apiHost
Definition: loginmanager_p.h:56
ApiRequest & setMultiPartData(QHttpMultiPart *m)
Definition: loginmanager_p.h:114
static constexpr const char * clientIdHeader
Definition: loginmanager_p.h:58
const QByteArray clientId
Definition: loginmanager_p.h:70
static constexpr const char * mscoreHost
Definition: loginmanager_p.h:45
QNetworkReply * reply()
Definition: loginmanager_p.h:118
const QByteArray userAgent
Definition: loginmanager_p.h:72
Method
Definition: loginmanager_p.h:83