public
Description: An HTTP proxy for signing OAuth requests
Clone URL: git://github.com/mojodna/oauth-proxy.git
cleanup, commentary, and changed command-line args to use -'s, not _'s
mojodna (author)
Fri Apr 25 21:11:33 -0700 2008
commit  fb796c52818d0239f860287808378bc9b923461a
tree    6eb0858e5a0ba61752c497d8592aa8bfd59ff7fd
parent  973051dad7e0d11ebd03751e354a150621621261
0
...
2
3
4
5
 
6
7
8
...
10
11
12
13
 
...
2
3
4
 
5
6
7
8
...
10
11
12
 
13
0
@@ -2,7 +2,7 @@ This is an OAuth proxy. It allows vanilla requests to be funneled through it an
0
 appropriately using OAuth. For now, it only uses a single, pre-set access token.
0
 
0
 To create an OAuth proxy server:
0
-mktap oauth_proxy --consumer_key <consumer key> --consumer_secret <consumer secret> [--token <token>] [--token_secret <token secret>] [-p <proxy port>] [--ssl]
0
+mktap oauth_proxy --consumer-key <consumer key> --consumer-secret <consumer secret> [--token <token>] [--token-secret <token secret>] [-p <proxy port>] [--ssl]
0
 
0
 Start the generated tap (in the foreground):
0
 twistd -nf oauth_proxy.tap
0
@@ -10,4 +10,4 @@ twistd -nf oauth_proxy.tap
0
 (For mktap to find oauth_proxy, you may need to make sure that "." is in your PYTHONPATH)
0
 
0
 Or, just run it with twistd:
0
-twistd -n oauth_proxy --consumer_key <consumer key> --consumer_secret <consumer secret> [--token <token>] [--token_secret <token secret>] [-p <proxy port>] [--ssl]
0
+twistd -n oauth_proxy --consumer-key <consumer key> --consumer-secret <consumer secret> [--token <token>] [--token-secret <token secret>] [-p <proxy port>] [--ssl]
...
55
56
57
58
59
 
 
60
61
62
 
 
63
64
 
65
66
67
...
71
72
73
 
 
74
75
76
...
55
56
57
 
 
58
59
60
 
 
61
62
63
 
64
65
66
67
...
71
72
73
74
75
76
77
78
0
@@ -55,13 +55,13 @@ class OAuthCredentials:
0
 
0
 
0
 class Options(usage.Options):
0
- synopsis = "Usage: mktap oauth_proxy --consumer_key <consumer key> --consumer_secret <consumer secret> [--token <token>] [--token_secret <token secret>] [-p <proxy port>] [--ssl] "
0
- longdesc = "Makes an OAuth HTTP proxy server.."
0
+ synopsis = "Usage: oauth_proxy --consumer-key <consumer key> --consumer-secret <consumer secret> [--token <token>] [--token-secret <token secret>] [-p <proxy port>] [--ssl]"
0
+ longdesc = "An OAuth HTTP proxy server.."
0
   optParameters = [
0
- ['consumer_key', None, None, "OAuth Consumer Key"],
0
- ['consumer_secret', None, None, "OAuth Consumer Secret"],
0
+ ['consumer-key', None, None, "OAuth Consumer Key"],
0
+ ['consumer-secret', None, None, "OAuth Consumer Secret"],
0
     ['token', None, None, "OAuth Access/Request Token"],
0
- ['token_secret', None, None, "OAuth Access/Request Token Secret"],
0
+ ['token-secret', None, None, "OAuth Access/Request Token Secret"],
0
     ['port', 'p', 8001, "Proxy port", int],
0
   ]
0
 
0
@@ -71,6 +71,8 @@ class Options(usage.Options):
0
 class OAuthProxyClient(proxy.ProxyClient):
0
   def connectionMade(self):
0
     # if retrieval of OAuth credentials is to be asynchronous, it needs to be done here (if it's even possible)
0
+ # otherwise, this class has no point
0
+ # however, it's possible that reading headers can't happen in OAuthProxyClientFactory
0
     proxy.ProxyClient.connectionMade(self)
0
 
0
 
...
11
12
13
14
15
16
 
 
 
17
18
 
19
20
21
...
11
12
13
 
 
 
14
15
16
17
 
18
19
20
21
0
@@ -11,11 +11,11 @@ def makeService(config):
0
 
0
   useSSL = config["ssl"]
0
 
0
- consumerKey = config["consumer_key"]
0
- consumerSecret = config["consumer_secret"]
0
- if config.has_key("token") and config.has_key("token_secret"):
0
+ consumerKey = config["consumer-key"]
0
+ consumerSecret = config["consumer-secret"]
0
+ if config.has_key("token") and config.has_key("token-secret"):
0
     token = config["token"]
0
- tokenSecret = config["token_secret"]
0
+ tokenSecret = config["token-secret"]
0
   else:
0
     token = tokenSecret = None
0
 

Comments

    No one has commented yet.