Fixed OAuth access_token duplicate route
Changed route name to "[...]list_connections"
This commit is contained in:
parent
0d857844b1
commit
d56e82635f
@ -93,6 +93,7 @@ class MediaGoblinApp(object):
|
|||||||
self.url_map = url_map
|
self.url_map = url_map
|
||||||
|
|
||||||
for route in PluginManager().get_routes():
|
for route in PluginManager().get_routes():
|
||||||
|
_log.debug('adding plugin route: {0}'.format(route))
|
||||||
add_route(*route)
|
add_route(*route)
|
||||||
|
|
||||||
# set up staticdirector tool
|
# set up staticdirector tool
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
|
|
||||||
auth_routes = [
|
auth_routes = [
|
||||||
('mediagoblin.auth.logout',
|
|
||||||
'/logout/', 'mediagoblin.auth.views:logout'),
|
|
||||||
('mediagoblin.auth.register', '/register/',
|
('mediagoblin.auth.register', '/register/',
|
||||||
'mediagoblin.auth.views:register'),
|
'mediagoblin.auth.views:register'),
|
||||||
('mediagoblin.auth.login', '/login/',
|
('mediagoblin.auth.login', '/login/',
|
||||||
|
@ -33,11 +33,14 @@ def setup_plugin():
|
|||||||
_log.debug('API config: {0}'.format(config))
|
_log.debug('API config: {0}'.format(config))
|
||||||
|
|
||||||
routes = [
|
routes = [
|
||||||
('mediagoblin.plugins.api.test', '/api/test',
|
('mediagoblin.plugins.api.test',
|
||||||
|
'/api/test',
|
||||||
'mediagoblin.plugins.api.views:api_test'),
|
'mediagoblin.plugins.api.views:api_test'),
|
||||||
('mediagoblin.plugins.api.entries', '/api/entries',
|
('mediagoblin.plugins.api.entries',
|
||||||
|
'/api/entries',
|
||||||
'mediagoblin.plugins.api.views:get_entries'),
|
'mediagoblin.plugins.api.views:get_entries'),
|
||||||
('mediagoblin.plugins.api.post_entry', '/api/submit',
|
('mediagoblin.plugins.api.post_entry',
|
||||||
|
'/api/submit',
|
||||||
'mediagoblin.plugins.api.views:post_entry')]
|
'mediagoblin.plugins.api.views:post_entry')]
|
||||||
|
|
||||||
pluginapi.register_routes(routes)
|
pluginapi.register_routes(routes)
|
||||||
|
@ -36,13 +36,16 @@ def setup_plugin():
|
|||||||
_log.debug('OAuth config: {0}'.format(config))
|
_log.debug('OAuth config: {0}'.format(config))
|
||||||
|
|
||||||
routes = [
|
routes = [
|
||||||
('mediagoblin.plugins.oauth.authorize', '/oauth/authorize',
|
('mediagoblin.plugins.oauth.authorize',
|
||||||
|
'/oauth/authorize',
|
||||||
'mediagoblin.plugins.oauth.views:authorize'),
|
'mediagoblin.plugins.oauth.views:authorize'),
|
||||||
('mediagoblin.plugins.oauth.authorize_client', '/oauth/client/authorize',
|
('mediagoblin.plugins.oauth.authorize_client',
|
||||||
|
'/oauth/client/authorize',
|
||||||
'mediagoblin.plugins.oauth.views:authorize_client'),
|
'mediagoblin.plugins.oauth.views:authorize_client'),
|
||||||
('mediagoblin.plugins.oauth.access_token', '/oauth/access_token',
|
|
||||||
'mediagoblin.plugins.oauth.views:access_token'),
|
|
||||||
('mediagoblin.plugins.oauth.access_token',
|
('mediagoblin.plugins.oauth.access_token',
|
||||||
|
'/oauth/access_token',
|
||||||
|
'mediagoblin.plugins.oauth.views:access_token'),
|
||||||
|
('mediagoblin.plugins.oauth.list_connections',
|
||||||
'/oauth/client/connections',
|
'/oauth/client/connections',
|
||||||
'mediagoblin.plugins.oauth.views:list_connections'),
|
'mediagoblin.plugins.oauth.views:list_connections'),
|
||||||
('mediagoblin.plugins.oauth.register_client',
|
('mediagoblin.plugins.oauth.register_client',
|
||||||
|
@ -18,12 +18,14 @@ from werkzeug.routing import Map, Rule
|
|||||||
|
|
||||||
url_map = Map()
|
url_map = Map()
|
||||||
|
|
||||||
view_functions = {'index': 'mediagoblin.views:index'}
|
view_functions = {}
|
||||||
|
|
||||||
def add_route(endpoint, url, controller):
|
def add_route(endpoint, url, controller):
|
||||||
"""
|
"""
|
||||||
Add a route to the url mapping
|
Add a route to the url mapping
|
||||||
"""
|
"""
|
||||||
|
#assert endpoint not in view_functions.keys(), 'Trying to overwrite a rule'
|
||||||
|
|
||||||
view_functions.update({endpoint: controller})
|
view_functions.update({endpoint: controller})
|
||||||
|
|
||||||
url_map.add(Rule(url, endpoint=endpoint))
|
url_map.add(Rule(url, endpoint=endpoint))
|
||||||
|
@ -125,6 +125,7 @@ class PluginManager(object):
|
|||||||
|
|
||||||
def register_route(self, route):
|
def register_route(self, route):
|
||||||
"""Registers a single route"""
|
"""Registers a single route"""
|
||||||
|
_log.debug('registering route: {0}'.format(route))
|
||||||
self.routes.append(route)
|
self.routes.append(route)
|
||||||
|
|
||||||
def get_routes(self):
|
def get_routes(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user