Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(30)

Issue 6373049: Token refresh to work with 'old' GData API

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by alexv
Modified:
12 years, 11 months ago
Reviewers:
jcgregorio_google
CC:
google-api-python-client_googlegroups.com
Visibility:
Public.

Description

These changes would make oauth2client work seemlessly with "old" GData API, e.g. BASE_URL = 'https://picasaweb.google.com/data/feed/api' albums_feed = BASE_URL + '/user/default?alt=json&max-results=10' http = decorator.http() resp, content = http.request(albums_feed, headers={'GData-Version': '2'}) feed = json.loads(content)['feed'] for entry in feed['entry']: photo_id = entry['gphoto$id']['$t'] title = entry['title']['$t'] thumb = entry['media$group']['media$thumbnail'][0]['url'] The difference is in token refresh. GData API would return 403 (forbidden) instead of 401.

Patch Set 1 #

Total comments: 1

Patch Set 2 : With tests #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -33 lines) Patch
M oauth2client/client.py View 1 1 chunk +3 lines, -2 lines 0 comments Download
M tests/test_oauth2client.py View 1 2 chunks +37 lines, -31 lines 1 comment Download

Messages

Total messages: 4
alexv
Joe, is this something worth changing? I can provide unit tests If this makes sense. ...
12 years, 11 months ago (2012-07-16 07:50:39 UTC) #1
jcgregorio_google
Yes, this is a good change. Please add unit tests. Thanks!
12 years, 11 months ago (2012-07-16 16:01:47 UTC) #2
alexv
http://codereview.appspot.com/6373049/diff/5001/tests/test_oauth2client.py File tests/test_oauth2client.py (right): http://codereview.appspot.com/6373049/diff/5001/tests/test_oauth2client.py#newcode85 tests/test_oauth2client.py:85: for status_code in ['401', '403']: Not sure if this ...
12 years, 11 months ago (2012-07-16 16:51:26 UTC) #3
jcgregorio_google
12 years, 11 months ago (2012-07-16 20:32:02 UTC) #4
LGTM.

Committed at
http://code.google.com/p/google-api-python-client/source/detail?r=bb41188ba8e....

  Thanks!

On 2012/07/16 16:51:26, crhyme wrote:
> http://codereview.appspot.com/6373049/diff/5001/tests/test_oauth2client.py
> File tests/test_oauth2client.py (right):
> 
>
http://codereview.appspot.com/6373049/diff/5001/tests/test_oauth2client.py#ne...
> tests/test_oauth2client.py:85: for status_code in ['401', '403']:
> Not sure if this is a "common practice", otherwise I can split it into
different
> tests.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b