Permalink
Browse files

Fix the failing tests.

 * Order of values returned from client.sign() were changed
 * Call to Client.get_oauth_signature() in
   Server.check_request_signature() needs to take a Request()
  • Loading branch information...
1 parent 4f3c81a commit 41576dbcd659dc09a042191d41f460f138b96102 @calebbrown calebbrown committed Apr 24, 2012
Showing with 6 additions and 4 deletions.
  1. +4 −2 oauthlib/oauth1/rfc5849/__init__.py
  2. +2 −2 tests/oauth1/rfc5849/test_server.py
View
6 oauthlib/oauth1/rfc5849/__init__.py
@@ -308,8 +308,10 @@ def check_request_signature(self, uri, http_method=u'GET', body='',
signature_type=signature_type,
verifier=verifier)
- client_signature = oauth_client.get_oauth_signature(uri,
- http_method=http_method, body=body, headers=headers)
+ request = Request(uri, http_method, body, headers)
+ request.oauth_params = params
+
+ client_signature = oauth_client.get_oauth_signature(request)
# FIXME: use near constant time string compare to avoid timing attacks
return client_signature == request_signature
View
4 tests/oauth1/rfc5849/test_server.py
@@ -38,7 +38,7 @@ def test_basic_server_request(self):
resource_owner_secret=self.RESOURCE_OWNER_SECRET,
)
- uri, body, headers = c.sign(u'http://server.example.com:80/init')
+ uri, headers, body = c.sign(u'http://server.example.com:80/init')
s = self.TestServer()
self.assertTrue(s.check_request_signature(uri, body=body,
@@ -52,7 +52,7 @@ def test_server_callback_request(self):
callback_uri=u'http://client.example.com/callback'
)
- uri, body, headers = c.sign(u'http://server.example.com:80/init')
+ uri, headers, body = c.sign(u'http://server.example.com:80/init')
s = self.TestServer()
self.assertTrue(s.check_request_signature(uri, body=body,

0 comments on commit 41576db

Please sign in to comment.