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
=== modified file 'friends/protocols/flickr.py'
--- friends/protocols/flickr.py 2013-06-18 22:00:44 +0000
+++ friends/protocols/flickr.py 2014-02-17 03:59:18 +0000
@@ -25,6 +25,8 @@
25import time25import time
26import logging26import logging
2727
28from urllib.parse import urlencode
29
28from friends.utils.base import Base, feature30from friends.utils.base import Base, feature
29from friends.utils.http import Downloader, Uploader31from friends.utils.http import Downloader, Uploader
30from friends.utils.time import iso8601utc, parsetime32from friends.utils.time import iso8601utc, parsetime
@@ -65,8 +67,7 @@
65 method = 'GET'67 method = 'GET'
66 headers = self._get_oauth_headers(68 headers = self._get_oauth_headers(
67 method=method,69 method=method,
68 url=REST_SERVER,70 url='{}?{}'.format(REST_SERVER, urlencode(params)),
69 data=params or {},
70 )71 )
7172
72 response = Downloader(73 response = Downloader(

Subscribers

People subscribed via source and target branches

to all changes: