-
Notifications
You must be signed in to change notification settings - Fork 329
Add Support for Scopes #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rogebrd
commented
Mar 30, 2020
- Add option for requesting specific scopes and including already granted scopes in pauth flow
- Add support for default scope list in Dropbox client
- Add support for requesting specific scopes on token refresh
- Update oauth command line documentation to work with python3
- Update tox.ini to run pytest instead of outdated python setup.py test
- Add venv to .gitignore
- Add option for requesting specific scopes and including already granted scopes in pauth flow - Add support for default scope list in Dropbox client - Add support for requesting specific scopes on token refresh - Update oauth command line documentation to work with python3 - Update tox.ini to run pytest instead of outdated python setup.py test - Add venv to .gitignore
dropbox/oauth.py
Outdated
@@ -108,14 +120,22 @@ def __repr__(self): | |||
|
|||
class DropboxOAuth2FlowBase(object): | |||
|
|||
def __init__(self, consumer_key, consumer_secret, locale=None, token_access_type='legacy'): | |||
def __init__(self, consumer_key, consumer_secret, locale=None, token_access_type='legacy', | |||
scope_list=None, include_granted_scopes=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you name it scope
to make it consistent with OAuth2 Spec
dropbox/oauth.py
Outdated
@@ -163,6 +189,11 @@ def _finish(self, code, redirect_uri): | |||
else: | |||
expires_in = None | |||
|
|||
if 'scope' in d: | |||
scope_list = d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope_list = d["scope"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reveals that we might need some test coverage on finish
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, changed and can add some coverage
@@ -0,0 +1,26 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding document right now. Saying that this example is only for certain partners.
Otherwise this might confuse people. The example/readme part in Github is educational. So we want to make sure they are as clear as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually will change this to a working example so people can use it today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
super(DropboxOAuth2Flow, self).__init__(consumer_key, consumer_secret, | ||
locale, token_access_type) | ||
super(DropboxOAuth2Flow, self).__init__(consumer_key, consumer_secret, locale, | ||
token_access_type, scope, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest passing kwargs with keyword