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

Proposed by dobey
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~dobey/ubuntu/karmic/python-oauth/svn1124
Merge into: lp://staging/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://staging/~dobey/ubuntu/karmic/python-oauth/svn1124
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+12365@code.staging.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
=== modified file 'debian/changelog'
--- debian/changelog 2009-09-10 17:45:33 +0000
+++ debian/changelog 2009-09-24 18:25:19 +0000
@@ -1,3 +1,20 @@
1python-oauth (1.0a~svn1124-0ubuntu2) karmic; urgency=low
2
3 * oauth/oauth.py: Fix typo and argument handling creating invalid
4 OAuthRequests with from_consumer_and_token staticmethod().
5 (LP: #435994, http://code.google.com/p/oauth/issues/detail?id=117)
6 * oauth/oauth.py: Fix HMAC-SHA1 verification to follow OAuth Core 1.0 spec
7 (LP: #435992, http://code.google.com/p/oauth/issues/detail?id=125)
8
9 -- Rodney Dawes <rodney.dawes@canonical.com> Thu, 24 Sep 2009 14:15:33 -0400
10
11python-oauth (1.0a~svn1124-0ubuntu1) karmic; urgency=low
12
13 * New upsream snapshot, includes partial fix for issue 117, and fixes
14 an error being raised when no verifier is sent to the server
15
16 -- Rodney Dawes <rodney.dawes@canonical.com> Thu, 24 Sep 2009 14:09:33 -0400
17
1python-oauth (1.0~svn1092-0ubuntu2) karmic; urgency=low18python-oauth (1.0~svn1092-0ubuntu2) karmic; urgency=low
219
3 * oauth/oauth.py: Fix invalid OAuthRequests being constructed by20 * oauth/oauth.py: Fix invalid OAuthRequests being constructed by
421
=== modified file 'oauth/oauth.py'
--- oauth/oauth.py 2009-09-10 17:45:33 +0000
+++ oauth/oauth.py 2009-09-24 18:25:19 +0000
@@ -320,10 +320,13 @@
320 parameters['oauth_callback'] = token.callback320 parameters['oauth_callback'] = token.callback
321 # 1.0a support for verifier.321 # 1.0a support for verifier.
322 if token.verifier:322 if token.verifier:
323 parameters['oauth_verifier'] = token.verifier
324 else:
325 if callback:
326 # 1.0a support for callback in the request token request.
327 parameters['oauth_callback'] = callback
328 if verifier:
323 parameters['oauth_verifier'] = verifier329 parameters['oauth_verifier'] = verifier
324 elif callback:
325 # 1.0a support for callback in the request token request.
326 parameters['oauth_callback'] = callback
327330
328 return OAuthRequest(http_method, http_url, parameters)331 return OAuthRequest(http_method, http_url, parameters)
329 from_consumer_and_token = staticmethod(from_consumer_and_token)332 from_consumer_and_token = staticmethod(from_consumer_and_token)
@@ -413,7 +416,10 @@
413 """416 """
414 version = self._get_version(oauth_request)417 version = self._get_version(oauth_request)
415 consumer = self._get_consumer(oauth_request)418 consumer = self._get_consumer(oauth_request)
416 verifier = self._get_verifier(oauth_request)419 try:
420 verifier = self._get_verifier(oauth_request)
421 except OAuthError:
422 verifier = None
417 # Get the request token.423 # Get the request token.
418 token = self._get_token(oauth_request, 'request')424 token = self._get_token(oauth_request, 'request')
419 self._check_signature(oauth_request, consumer, token)425 self._check_signature(oauth_request, consumer, token)
@@ -617,8 +623,8 @@
617 raw = '&'.join(sig)623 raw = '&'.join(sig)
618 return key, raw624 return key, raw
619625
620 def build_signature(self, oauth_request, consumer, token):626 def _build_digest(self, oauth_request, consumer, token):
621 """Builds the base signature string."""627 '''Generates the HMAC digest for the signature.'''
622 key, raw = self.build_signature_base_string(oauth_request, consumer,628 key, raw = self.build_signature_base_string(oauth_request, consumer,
623 token)629 token)
624630
@@ -629,9 +635,18 @@
629 except:635 except:
630 import sha # Deprecated636 import sha # Deprecated
631 hashed = hmac.new(key, raw, sha)637 hashed = hmac.new(key, raw, sha)
638 return hashed.digest()
632639
640 def build_signature(self, oauth_request, consumer, token):
641 """Builds the base signature string."""
642 digest = self._build_digest(oauth_request, consumer, token)
633 # Calculate the digest base 64.643 # Calculate the digest base 64.
634 return binascii.b2a_base64(hashed.digest())[:-1]644 return binascii.b2a_base64(digest)[:-1]
645
646 def check_signature(self, oauth_request, consumer, token, signature):
647 '''Verify the signature.'''
648 digest = self._build_digest(oauth_request, consumer, token)
649 return digest == binascii.a2b_base64(signature)
635650
636651
637class OAuthSignatureMethod_PLAINTEXT(OAuthSignatureMethod):652class OAuthSignatureMethod_PLAINTEXT(OAuthSignatureMethod):
638653
=== modified file 'setup.py'
--- setup.py 2009-06-15 15:19:57 +0000
+++ setup.py 2009-09-24 18:25:19 +0000
@@ -3,7 +3,7 @@
3from setuptools import setup, find_packages3from setuptools import setup, find_packages
44
5setup(name="oauth",5setup(name="oauth",
6 version="1.0",6 version="1.0a",
7 description="Library for OAuth",7 description="Library for OAuth",
8 author="Leah Culver",8 author="Leah Culver",
9 author_email="leah.culver@gmail.com",9 author_email="leah.culver@gmail.com",

Subscribers

People subscribed via source and target branches

to all changes: