mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-09 14:13:35 +00:00
dynamically get API scopes for "gam oauth request"
This commit is contained in:
21
src/gam.py
21
src/gam.py
@ -8712,7 +8712,26 @@ def OAuthInfo():
|
|||||||
print u'Google Apps Admin: Unknown'
|
print u'Google Apps Admin: Unknown'
|
||||||
|
|
||||||
def doRequestOAuth():
|
def doRequestOAuth():
|
||||||
pass
|
admin_email = raw_input(u'Please enter your admin email address: ')
|
||||||
|
apis = API_VER_MAPPING.keys()
|
||||||
|
apis.remove(u'oauth2')
|
||||||
|
for api in apis:
|
||||||
|
version = getAPIVer(api)
|
||||||
|
if api in [u'directory', u'reports', u'datatransfer']:
|
||||||
|
api = u'admin'
|
||||||
|
http = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL],
|
||||||
|
cache=GC_Values[GC_CACHE_DIR])
|
||||||
|
try:
|
||||||
|
service = googleapiclient.discovery.build(api, version, http=http, cache_discovery=False)
|
||||||
|
except googleapiclient.errors.UnknownApiNameOrVersion:
|
||||||
|
service = getServiceFromDiscoveryDocument(api, version, http)
|
||||||
|
print u'%s: %s' % (service._rootDesc['title'], service._rootDesc['description'])
|
||||||
|
for scope in service._rootDesc[u'auth'][u'oauth2'][u'scopes'].items():
|
||||||
|
scope_value = scope[0]
|
||||||
|
scope_description = scope[1][u'description']
|
||||||
|
print u' %s\n %s' % (scope_value, scope_description)
|
||||||
|
print
|
||||||
|
print
|
||||||
|
|
||||||
def batch_worker():
|
def batch_worker():
|
||||||
while True:
|
while True:
|
||||||
|
Reference in New Issue
Block a user