Debian Codegraph @

deprecated/kqoauth/kqoauthrequest_p.h

raw symbols SCIP
1 /**
2 * KQOAuth - An OAuth authentication library for Qt.
3 *
4 * Author: Johan Paul ([email protected])
5 * http://www.johanpaul.com
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * KQOAuth is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with KQOAuth. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef KQOAUTHREQUEST_P_H
21 #define KQOAUTHREQUEST_P_H
22 #include "kqoauthglobals.h"
23 #include "kqoauthrequest.h"
24
25 #include <QString>
26 #include <QUrl>
27 #include <QMap>
28 #include <QPair>
29 #include <QMultiMap>
30 #include <QTimer>
31
32 class KQOAUTH_EXPORT KQOAuthRequestPrivate {
33
34 public:
35 KQOAuthRequestPrivate();
36 ~KQOAuthRequestPrivate();
37
38 // Helper methods to get the values for the OAuth request parameters.
39 QString oauthTimestamp() const;
40 QString oauthNonce() const;
41 QString oauthSignature();
42
43 // Utility methods for making the request happen.
44 void prepareRequest();
45 void signRequest();
46 bool validateRequest() const;
47 QByteArray requestBaseString();
48 QByteArray encodedParamaterList(const QList< QPair<QString, QString> > &requestParameters);
49 void insertAdditionalParams();
50 void insertPostBody();
51
52 QUrl oauthRequestEndpoint;
53 KQOAuthRequest::RequestHttpMethod oauthHttpMethod;
54 QString oauthHttpMethodString;
55 QString oauthConsumerKey;
56 QString oauthConsumerSecretKey;
57 QString oauthToken;
58 QString oauthTokenSecret;
59 QString oauthSignatureMethod;
60 KQOAuthRequest::RequestSignatureMethod requestSignatureMethod;
61 QUrl oauthCallbackUrl;
62 QString oauthVersion;
63 QString oauthVerifier;
64
65 // These will be generated by the helper methods
66 QString oauthTimestamp_;
67 QString oauthNonce_;
68
69 // User specified additional parameters needed for the request.
70 QList< QPair<QString, QString> > additionalParameters;
71
72 // The raw POST body content as given to the HTTP request.
73 QByteArray postBodyContent;
74
75 // Protocol parameters.
76 // These parameters are used in the "Authorized" header of the HTTP request.
77 QList< QPair<QString, QString> > requestParameters;
78
79 KQOAuthRequest::RequestType requestType;
80
81 //The Content-Type HTTP header
82 QString contentType;
83
84 //Raw data to post if type is not url-encoded
85 QByteArray postRawData;
86
87 // Timeout for this request in milliseconds.
88 int timeout;
89 QTimer timer;
90
91 bool debugOutput;
92
93 };
94 #endif // KQOAUTHREQUEST_P_H