allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [3/3] allura git commit: [#7805] ticket:696 Add ability to request scopes
Date Tue, 09 Dec 2014 14:17:10 GMT
[#7805] ticket:696 Add ability to request scopes


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a650ad5c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a650ad5c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a650ad5c

Branch: refs/heads/ib/7805
Commit: a650ad5caea40ff0a1488b7a8f5aad959d57edf5
Parents: 5407aa9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Dec 4 15:45:32 2014 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Dec 9 09:36:49 2014 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/a650ad5c/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 46a9706..6dae509 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -181,7 +181,7 @@ class GitHubOAuthMixin(object):
 
     '''Support for github oauth web application flow.'''
 
-    def oauth_begin(self):
+    def oauth_begin(self, scope=None):
         client_id = config.get('github_importer.client_id')
         secret = config.get('github_importer.client_secret')
         if not client_id or not secret:
@@ -189,7 +189,7 @@ class GitHubOAuthMixin(object):
         if c.user.get_tool_data('GitHubProjectImport', 'token'):
             return  # token already exists, nothing to do
         redirect_uri = request.url.rstrip('/') + '/oauth_callback'
-        oauth = OAuth2Session(client_id, redirect_uri=redirect_uri)
+        oauth = OAuth2Session(client_id, redirect_uri=redirect_uri, scope=scope)
         auth_url, state = oauth.authorization_url(
             'https://github.com/login/oauth/authorize')
         # Used in callback to prevent CSRF


Mime
View raw message