Merge lp:~dobey/ubuntu/karmic/python-oauth/svn1124 into lp:ubuntu/karmic/python-oauth

Proposed by dobey
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dobey/ubuntu/karmic/python-oauth/svn1124
Merge into: lp:ubuntu/karmic/python-oauth
Diff against target: 101 lines
3 files modified
debian/changelog (+17/-0)
oauth/oauth.py (+22/-7)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~dobey/ubuntu/karmic/python-oauth/svn1124
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+12365@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Westby (james-w) wrote :

Looks good, thanks.

Please use "merge-upstream" for new upstream versions in future.
It makes everyone's lives easier, and will allow LP to build the
package from the branch one day. I'm currently writing up tutorial
documentation on it, you can find usage documentation in
/usr/share/doc/bzr-builddeb/user_manual/

Thanks,

James

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-09-10 17:45:33 +0000
3+++ debian/changelog 2009-09-24 18:25:19 +0000
4@@ -1,3 +1,20 @@
5+python-oauth (1.0a~svn1124-0ubuntu2) karmic; urgency=low
6+
7+ * oauth/oauth.py: Fix typo and argument handling creating invalid
8+ OAuthRequests with from_consumer_and_token staticmethod().
9+ (LP: #435994, http://code.google.com/p/oauth/issues/detail?id=117)
10+ * oauth/oauth.py: Fix HMAC-SHA1 verification to follow OAuth Core 1.0 spec
11+ (LP: #435992, http://code.google.com/p/oauth/issues/detail?id=125)
12+
13+ -- Rodney Dawes <rodney.dawes@canonical.com> Thu, 24 Sep 2009 14:15:33 -0400
14+
15+python-oauth (1.0a~svn1124-0ubuntu1) karmic; urgency=low
16+
17+ * New upsream snapshot, includes partial fix for issue 117, and fixes
18+ an error being raised when no verifier is sent to the server
19+
20+ -- Rodney Dawes <rodney.dawes@canonical.com> Thu, 24 Sep 2009 14:09:33 -0400
21+
22 python-oauth (1.0~svn1092-0ubuntu2) karmic; urgency=low
23
24 * oauth/oauth.py: Fix invalid OAuthRequests being constructed by
25
26=== modified file 'oauth/oauth.py'
27--- oauth/oauth.py 2009-09-10 17:45:33 +0000
28+++ oauth/oauth.py 2009-09-24 18:25:19 +0000
29@@ -320,10 +320,13 @@
30 parameters['oauth_callback'] = token.callback
31 # 1.0a support for verifier.
32 if token.verifier:
33+ parameters['oauth_verifier'] = token.verifier
34+ else:
35+ if callback:
36+ # 1.0a support for callback in the request token request.
37+ parameters['oauth_callback'] = callback
38+ if verifier:
39 parameters['oauth_verifier'] = verifier
40- elif callback:
41- # 1.0a support for callback in the request token request.
42- parameters['oauth_callback'] = callback
43
44 return OAuthRequest(http_method, http_url, parameters)
45 from_consumer_and_token = staticmethod(from_consumer_and_token)
46@@ -413,7 +416,10 @@
47 """
48 version = self._get_version(oauth_request)
49 consumer = self._get_consumer(oauth_request)
50- verifier = self._get_verifier(oauth_request)
51+ try:
52+ verifier = self._get_verifier(oauth_request)
53+ except OAuthError:
54+ verifier = None
55 # Get the request token.
56 token = self._get_token(oauth_request, 'request')
57 self._check_signature(oauth_request, consumer, token)
58@@ -617,8 +623,8 @@
59 raw = '&'.join(sig)
60 return key, raw
61
62- def build_signature(self, oauth_request, consumer, token):
63- """Builds the base signature string."""
64+ def _build_digest(self, oauth_request, consumer, token):
65+ '''Generates the HMAC digest for the signature.'''
66 key, raw = self.build_signature_base_string(oauth_request, consumer,
67 token)
68
69@@ -629,9 +635,18 @@
70 except:
71 import sha # Deprecated
72 hashed = hmac.new(key, raw, sha)
73+ return hashed.digest()
74
75+ def build_signature(self, oauth_request, consumer, token):
76+ """Builds the base signature string."""
77+ digest = self._build_digest(oauth_request, consumer, token)
78 # Calculate the digest base 64.
79- return binascii.b2a_base64(hashed.digest())[:-1]
80+ return binascii.b2a_base64(digest)[:-1]
81+
82+ def check_signature(self, oauth_request, consumer, token, signature):
83+ '''Verify the signature.'''
84+ digest = self._build_digest(oauth_request, consumer, token)
85+ return digest == binascii.a2b_base64(signature)
86
87
88 class OAuthSignatureMethod_PLAINTEXT(OAuthSignatureMethod):
89
90=== modified file 'setup.py'
91--- setup.py 2009-06-15 15:19:57 +0000
92+++ setup.py 2009-09-24 18:25:19 +0000
93@@ -3,7 +3,7 @@
94 from setuptools import setup, find_packages
95
96 setup(name="oauth",
97- version="1.0",
98+ version="1.0a",
99 description="Library for OAuth",
100 author="Leah Culver",
101 author_email="leah.culver@gmail.com",

Subscribers

People subscribed via source and target branches

to all changes: