Merge ~cjwatson/launchpad:fix-oauthlib into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 98e0aa032c1df9202435d97769e9b2089da3fa81
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-oauthlib
Merge into: launchpad:master
Diff against target: 13 lines (+1/-1)
1 file modified
lib/lp/services/webapp/servers.py (+1/-1)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+394061@code.launchpad.net

Commit message

Fix handling of anonymous requests with oauthlib

Description of the change

RFC 5849 allows omitting the "oauth_token" parameter when empty, whereas OAuth Core 1.0 Revision A didn't; we started running into this in the test suite now that LaunchpadWebServiceCaller uses oauthlib to sign its requests. It's clearly harmless either way, so accept it.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/services/webapp/servers.py b/lib/lp/services/webapp/servers.py
index bcf1621..9c47f21 100644
--- a/lib/lp/services/webapp/servers.py
+++ b/lib/lp/services/webapp/servers.py
@@ -1286,7 +1286,7 @@ class WebServicePublication(WebServicePublicationMixin,
1286 consumers = getUtility(IOAuthConsumerSet)1286 consumers = getUtility(IOAuthConsumerSet)
1287 consumer = consumers.getByKey(consumer_key)1287 consumer = consumers.getByKey(consumer_key)
1288 token_key = form.get('oauth_token')1288 token_key = form.get('oauth_token')
1289 anonymous_request = (token_key == '')1289 anonymous_request = not token_key
12901290
1291 if consumer_key is None:1291 if consumer_key is None:
1292 # Either the client's OAuth implementation is broken, or1292 # Either the client's OAuth implementation is broken, or

Subscribers

People subscribed via source and target branches

to status/vote changes: