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,

View file

@ -182,7 +182,7 @@ def render_page_template(name, **kwargs):
feature_set=json.dumps(features.get_features()),
config_set=json.dumps(getFrontendVisibleConfig(app.config)),
oauth_set=json.dumps(get_oauth_config()),
scope_set=json.dumps(scopes.ALL_SCOPES),
scope_set=json.dumps(scopes.app_scopes(app.config)),
mixpanel_key=app.config.get('MIXPANEL_KEY', ''),
google_analytics_key=app.config.get('GOOGLE_ANALYTICS_KEY', ''),
sentry_public_dsn=app.config.get('SENTRY_PUBLIC_DSN', ''),