From 433cdfe87dfc4401c9c85f898800a1de2de63adc Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Thu, 31 Dec 2015 08:57:16 -0500 Subject: [PATCH] define UBER_SCOPES to cut down on unnecessary scope overlap --- src/gam.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gam.py b/src/gam.py index 0a068edb..920e86de 100755 --- a/src/gam.py +++ b/src/gam.py @@ -8686,8 +8686,16 @@ def OAuthInfo(): # TODO eventually would be good if this did something to test admin-selected scopes pass +UBER_SCOPES = { + u'gmail-v1': [u'https://mail.google.com/'], + u'drive-v2': [u'https://www.googleapis.com/auth/drive'] + } + def select_default_scopes(all_apis): for api_name, api in all_apis.items(): + if api_name in UBER_SCOPES.keys(): + all_apis[api_name][u'use_scopes'] = UBER_SCOPES[api_name] + continue all_apis[api_name][u'use_scopes'] = [] scopes = api[u'auth'][u'oauth2'][u'scopes'].keys() if len(scopes) == 1: