Merge lp:~ssweeny/friends/fix-lp1258657 into lp:friends

Proposed by Scott Sweeny
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 253
Merged at revision: 253
Proposed branch: lp:~ssweeny/friends/fix-lp1258657
Merge into: lp:friends
Diff against target: 22 lines (+3/-2)
1 file modified
friends/protocols/flickr.py (+3/-2)
To merge this branch: bzr merge lp:~ssweeny/friends/fix-lp1258657
Reviewer Review Type Date Requested Status
Robert Bruce Park Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+206650@code.launchpad.net

Commit message

Flickr: Fix oauth signing for a GET request.

According to [1] the base string for the OAuth signature must include all of the parameters, but oauthlib won't sign a GET request that includes a body. Instead pass the parameters as part of the URL.

[1] https://secure.flickr.com/services/api/auth.oauth.html

Description of the change

Flickr: Fix oauth signing for a GET request.

According to [1] the base string for the OAuth signature must include all of the parameters, but oauthlib won't sign a GET request that includes a body. Instead pass the parameters as part of the URL.

[1] https://secure.flickr.com/services/api/auth.oauth.html

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:253
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~ssweeny/friends/fix-lp1258657/+merge/206650/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/friends-ci/56/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/friends-trusty-amd64-ci/4

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/friends-ci/56/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:253
http://jenkins.qa.ubuntu.com/job/friends-ci/57/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/friends-trusty-amd64-ci/5

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/friends-ci/57/rebuild

review: Approve (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

Buh. I've been putting this off because I was worried the fix would be harder than this (I forgot you could just do the urlencode before the signing, I thought I was going to have to tear up the Downloader class, and also oauthlib is generally a nightmare to deal with).

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'friends/protocols/flickr.py'
2--- friends/protocols/flickr.py 2013-06-18 22:00:44 +0000
3+++ friends/protocols/flickr.py 2014-02-17 03:59:18 +0000
4@@ -25,6 +25,8 @@
5 import time
6 import logging
7
8+from urllib.parse import urlencode
9+
10 from friends.utils.base import Base, feature
11 from friends.utils.http import Downloader, Uploader
12 from friends.utils.time import iso8601utc, parsetime
13@@ -65,8 +67,7 @@
14 method = 'GET'
15 headers = self._get_oauth_headers(
16 method=method,
17- url=REST_SERVER,
18- data=params or {},
19+ url='{}?{}'.format(REST_SERVER, urlencode(params)),
20 )
21
22 response = Downloader(

Subscribers

People subscribed via source and target branches

to all changes: