summaryrefslogtreecommitdiffabout
path: root/include/opkele
Unidiff
Diffstat (limited to 'include/opkele') (more/less context) (show whitespace changes)
-rw-r--r--include/opkele/oauth/consumer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/opkele/oauth/consumer.h b/include/opkele/oauth/consumer.h
index 1e2784c..9196297 100644
--- a/include/opkele/oauth/consumer.h
+++ b/include/opkele/oauth/consumer.h
@@ -1,18 +1,19 @@
1#ifndef __OPKELE_OAUTH_CONSUMER_H 1#ifndef __OPKELE_OAUTH_CONSUMER_H
2#define __OPKELE_OAUTH_CONSUMER_H 2#define __OPKELE_OAUTH_CONSUMER_H
3 3
4#include <string> 4#include <string>
5#include <opkele/types.h> 5#include <opkele/types.h>
6#include <opkele/oauth.h> 6#include <opkele/oauth.h>
7#include <opkele/curl.h>
7 8
8namespace opkele { 9namespace opkele {
9 namespace oauth { 10 namespace oauth {
10 using std::string; 11 using std::string;
11 12
12 enum oauth_method_t { 13 enum oauth_method_t {
13 oauth_auth_header, oauth_post_body, oauth_url_query 14 oauth_auth_header, oauth_post_body, oauth_url_query
14 }; 15 };
15 16
16 struct service_endpoint_t { 17 struct service_endpoint_t {
17 string url; 18 string url;
18 string signature_method; 19 string signature_method;
@@ -32,26 +33,30 @@ namespace opkele {
32 virtual const service_endpoint_t& get_access_token_endpoint() const = 0; 33 virtual const service_endpoint_t& get_access_token_endpoint() const = 0;
33 34
34 virtual service_endpoint_t& get_url_endpoint(service_endpoint_t& sep, 35 virtual service_endpoint_t& get_url_endpoint(service_endpoint_t& sep,
35 const string& url) const = 0; 36 const string& url) const = 0;
36 }; 37 };
37 38
38 struct http_request_t { 39 struct http_request_t {
39 string authorize_header; 40 string authorize_header;
40 string method; 41 string method;
41 string url; 42 string url;
42 string body; 43 string body;
43 44
45 util::curl_slist_t _curl_headers_list;
46
44 http_request_t(const string& m,const string& u) 47 http_request_t(const string& m,const string& u)
45 : method(m), url(u) { } 48 : method(m), url(u) { }
49
50 void setup_curl(CURL *curl);
46 }; 51 };
47 52
48 class basic_consumer { 53 class basic_consumer {
49 public: 54 public:
50 token_t consumer_token; 55 token_t consumer_token;
51 56
52 basic_consumer(const token_t& ct) 57 basic_consumer(const token_t& ct)
53 : consumer_token(ct) { } 58 : consumer_token(ct) { }
54 virtual ~basic_consumer() { } 59 virtual ~basic_consumer() { }
55 60
56 virtual const basic_provider_endpoints& get_endpoints() const = 0; 61 virtual const basic_provider_endpoints& get_endpoints() const = 0;
57 virtual const string allocate_nonce(time_t ts) = 0; 62 virtual const string allocate_nonce(time_t ts) = 0;