Make the scopes dynamic based on app config.

This commit is contained in:
Jake Moshenko 2015-07-15 18:13:15 -04:00
parent 053ceb6220
commit f5ee7a6697
3 changed files with 14 additions and 7 deletions

View file

@ -220,7 +220,8 @@ def swagger_route_data(include_internal=False, compact=False):
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "%s://%s/oauth/authorize" % (PREFERRED_URL_SCHEME, SERVER_HOSTNAME),
'scopes': {scope.scope:scope.description for scope in scopes.ALL_SCOPES.values()},
'scopes': {scope.scope:scope.description
for scope in scopes.app_scopes(app.config).values()},
},
},
'paths': paths,