X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=xonstat%2F__init__.py;h=f72e5b95b9b8718b48f342ed1fe7bffb0e554508;hb=e9ccf6b67114c697fab89c3a06a450fddfde2be3;hp=2b26e29822ffadb5ca1f242d2daecb2f43cff06f;hpb=0b5f3a39ba78031d83e9a2f84088f30d4bd4cfb2;p=xonotic%2Fxonstat.git diff --git a/xonstat/__init__.py b/xonstat/__init__.py index 2b26e29..f72e5b9 100644 --- a/xonstat/__init__.py +++ b/xonstat/__init__.py @@ -1,6 +1,5 @@ import sqlahelper from pyramid_beaker import set_cache_regions_from_settings -from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.config import Configurator from pyramid.httpexceptions import HTTPNotFound from pyramid.renderers import JSONP @@ -28,15 +27,6 @@ def main(global_config, **settings): # mako for templating config.include('pyramid_mako') - # Mozilla Persona as the login verifier. It defines default - # authentication and authorization policies. - config.include('pyramid_persona') - - # override the authn policy to provide a callback - secret = settings.get('persona.secret', None) - authn_policy = AuthTktAuthenticationPolicy(secret, callback=groupfinder, hashalg='sha512') - config.set_authentication_policy(authn_policy) - # for json-encoded responses config.add_renderer('jsonp', JSONP(param_name='callback')) @@ -138,38 +128,44 @@ def main(global_config, **settings): config.add_view(view=ServerIndex, route_name="server_index", attr="html", renderer="server_index.mako", accept="text/html") config.add_view(view=ServerIndex, route_name="server_index", attr="json", renderer="json", - accept="text/json") + accept="application/json") config.add_route("server_top_maps", "/server/{id:\d+}/topmaps") config.add_view(view=ServerTopMaps, route_name="server_top_maps", attr="html", renderer="server_top_maps.mako", accept="text/html") config.add_view(view=ServerTopMaps, route_name="server_top_maps", attr="json", renderer="json", - accept="text/json") + accept="application/json") config.add_route("server_top_active", "/server/{id:\d+}/topactive") config.add_view(view=ServerTopPlayers, route_name="server_top_active", attr="html", renderer="server_top_active.mako", accept="text/html") config.add_view(view=ServerTopPlayers, route_name="server_top_active", attr="json", - renderer="json", accept="text/json") + renderer="json", accept="application/json") config.add_route("server_top_scorers", "/server/{id:\d+}/topscorers") config.add_view(view=ServerTopScorers, route_name="server_top_scorers", attr="html", renderer="server_top_scorers.mako", accept="text/html") config.add_view(view=ServerTopScorers, route_name="server_top_scorers", attr="json", - renderer="json", accept="text/json") + renderer="json", accept="application/json") config.add_route("server_info", "/server/{id:\d+}") config.add_view(view=ServerInfo, route_name="server_info", attr="html", renderer="server_info.mako", accept="text/html") config.add_view(view=ServerInfo, route_name="server_info", attr="json", renderer="json", - accept="text/json") + accept="application/json") # MAP ROUTES - config.add_route("map_index", "/maps") - config.add_view(map_index, route_name="map_index", renderer="map_index.mako") - - config.add_route("map_index_json", "/maps.json") - config.add_view(map_index_json, route_name="map_index_json", renderer="jsonp") + config.add_route("map_index", "/maps") + config.add_view(view=MapIndex, route_name="map_index", attr="html", + renderer="map_index.mako", accept="text/html") + config.add_view(view=MapIndex, route_name="map_index", attr="json", renderer="json", + accept="application/json") + + config.add_route("map_top_scorers", "/map/{id:\d+}/topscorers") + config.add_view(view=MapTopScorers, route_name="map_top_scorers", attr="html", + renderer="map_top_scorers.mako", accept="text/html") + config.add_view(view=MapTopScorers, route_name="map_top_scorers", attr="json", + renderer="json", accept="application/json") config.add_route("map_info", "/map/{id:\d+}") config.add_view(map_info, route_name="map_info", renderer="map_info.mako")