HypeTutorials / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Let OAuth2Decorator take a list of scopes #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I want a user to grant access to my app for multiple scopes (like, 
posts.readonly and circles.readwrite) I currently have to do:

decorator = OAuth2Decorator(
  client_id='...',
  client_secret='...',
  scope='posts.readonly circles.readwrite')

or:
  scope=' '.join(['posts.readonly', 'circles.readwrite']))

This feels sort of clumsy. I'd much prefer to be able to specify either a 
string or list of strings for the scope, like so:

decorator = OAuth2Decorator(
  client_id='...',
  client_secret='...',
  scope=['posts.readonly', 'circles.readwrite'])

I'm willing to write a patch for this since it should be pretty easy but I 
figured I'd file an issue to see if there was any more discussion on the topic 
first.

Original issue reported on code.google.com by jasonhall@google.com on 10 Oct 2011 at 9:38

GoogleCodeExporter commented 8 years ago
Really good idea, and I'd love a patch for this!

Original comment by jcgregorio@google.com on 14 Oct 2011 at 2:57

GoogleCodeExporter commented 8 years ago
Here's a simple patch to get the wheels turning, let me know if you'd prefer to 
do a real code review.

Original comment by jasonhall@google.com on 14 Oct 2011 at 4:17

Attachments:

GoogleCodeExporter commented 8 years ago
Yeah, if you could upload this to codereview.appspot.com that would be great. 
Use the upload-diffs.py included in the project for uploading.

Original comment by jcgregorio@google.com on 14 Oct 2011 at 5:39

GoogleCodeExporter commented 8 years ago
http://codereview.appspot.com/5277045/

Original comment by jasonhall@google.com on 14 Oct 2011 at 5:47

GoogleCodeExporter commented 8 years ago

Original comment by jcgregorio@google.com on 30 Oct 2011 at 3:29

GoogleCodeExporter commented 8 years ago
Issue 47 has been merged into this issue.

Original comment by jcgregorio@google.com on 7 Nov 2011 at 9:39