python-oauth2
python-oauth2 copied to clipboard
get_normalized_parameters does not take into account the 2 legged OAuth with oauth params in the URL
hello,
While tweaking around to get two legs OAuth working I realised that get_normalized_parameters in Request does not take into accoutn the case where the URL has oauth authentification GET variables like the following:
api/v2.1/users?oauth_nonce=34400401&oauth_timestamp=1276109986&oauth_consumer_key=N_S3ZhJypOv1CW3IWa&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_signature=AuJ6QulDbLkWz9Ss%2FbbBMKerLKw%3D HTTP/1.1"
Which is valid.
We just need to add something like
get_items = self._split_url_string(query).items()
non_getl_items = list([(k, v) for k, v in url_items if not k.startswith('oauth_')])
Or i missed something obvious.
I was wrong,
I just added a _check_two_legged_signature with a small tweak where
request.url = request.normalized_url
Part of the normalisation issues... #111