launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #16650
[Merge] lp:~xnox/launchpad/devel into lp:launchpad
Dimitri John Ledkov has proposed merging lp:~xnox/launchpad/devel into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~xnox/launchpad/devel/+merge/217079
--
https://code.launchpad.net/~xnox/launchpad/devel/+merge/217079
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~xnox/launchpad/devel into lp:launchpad.
=== modified file 'lib/lp/services/oauth/browser/__init__.py'
--- lib/lp/services/oauth/browser/__init__.py 2013-04-11 02:12:09 +0000
+++ lib/lp/services/oauth/browser/__init__.py 2014-04-24 15:55:55 +0000
@@ -416,7 +416,7 @@
(or is not associated with the consumer), the signature does not match
or no permission has been granted by the user, respond with a 401.
"""
- form = self.request.form
+ form = get_oauth_authorization(self.request)
consumer = getUtility(IOAuthConsumerSet).getByKey(
form.get('oauth_consumer_key'))
=== modified file 'lib/lp/services/oauth/doc/oauth.txt'
--- lib/lp/services/oauth/doc/oauth.txt 2014-01-30 15:04:06 +0000
+++ lib/lp/services/oauth/doc/oauth.txt 2014-04-24 15:55:55 +0000
@@ -1,7 +1,7 @@
= OAuth =
Most of the OAuth doctests have been converted into unit tests and
-moved to test_oauth_tokens.py
+moved to test_tokens.py
== Nonces and timestamps ==
=== modified file 'lib/lp/services/oauth/stories/access-token.txt'
--- lib/lp/services/oauth/stories/access-token.txt 2011-12-24 17:49:30 +0000
+++ lib/lp/services/oauth/stories/access-token.txt 2014-04-24 15:55:55 +0000
@@ -28,17 +28,19 @@
... oauth_signature='&'.join([consumer.secret, token.secret]),
... oauth_timestamp=time.time(),
... oauth_nonce='4572616e48616d6d65724c61686176')
- >>> anon_browser.open(
- ... 'http://launchpad.dev/+access-token', data=urlencode(data))
+ >>> auth = 'OAuth '+', '.join(['%s="%s"' % item for item in data.items()])
+ >>> auth_browser = setupBrowser(auth=auth)
+ >>> auth_browser.open(
+ ... 'http://launchpad.dev/+access-token')
- >>> print anon_browser.contents
+ >>> print auth_browser.contents
oauth_token=...&oauth_token_secret=...
Any further attempt to exchange that request token for an access token
will fail because request tokens can be used only once.
- >>> anon_browser.open(
- ... 'http://launchpad.dev/+access-token', data=urlencode(data))
+ >>> auth_browser.open(
+ ... 'http://launchpad.dev/+access-token')
Traceback (most recent call last):
...
HTTPError: HTTP Error 401: Unauthorized
Follow ups