Renamed templates.

This commit is contained in:
Nick Daly 2012-06-18 09:10:45 -05:00
parent 075ca80812
commit 278f060fbd
8 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,6 @@
"""The HTTPS Santiago listener and sender. """The HTTPS Santiago listener and sender.
TODO: add JSON output.
FIXME: add real authentication. FIXME: add real authentication.
FIXME: sanitize or properly escape user input (XSS, attacks on the client). FIXME: sanitize or properly escape user input (XSS, attacks on the client).
FIXME: make sure we never try to execute user input (injection, attacks on the FIXME: make sure we never try to execute user input (injection, attacks on the
@ -8,7 +9,6 @@ FIXME: all the Blammos. They're terrible, unacceptable failures.
""" """
import santiago import santiago
from Cheetah.Template import Template from Cheetah.Template import Template
@ -17,6 +17,7 @@ import httplib, urllib, urlparse
import sys import sys
import logging import logging
def allow_ips(ips = None): def allow_ips(ips = None):
"""Refuse connections from non-whitelisted IPs. """Refuse connections from non-whitelisted IPs.
@ -224,7 +225,7 @@ class RestMonitor(santiago.RestController):
class HostedService(RestMonitor): class HostedService(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self, client, service): def GET(self, client, service):
return self.respond("hostedService-get.tmpl", { return self.respond("hostedService.tmpl", {
"service": service, "service": service,
"client": client, "client": client,
"locations": self.santiago.hosting[client][service] }) "locations": self.santiago.hosting[client][service] })
@ -251,7 +252,7 @@ class HostedService(RestMonitor):
class HostedClient(RestMonitor): class HostedClient(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self, client): def GET(self, client):
return self.respond("hostedClient-get.tmpl", return self.respond("hostedClient.tmpl",
{ "client": client, { "client": client,
"services": self.santiago.hosting[client] }) "services": self.santiago.hosting[client] })
@ -276,7 +277,7 @@ class HostedClient(RestMonitor):
class Hosting(RestMonitor): class Hosting(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self): def GET(self):
return self.respond("hosting-get.tmpl", return self.respond("hosting.tmpl",
{"clients": [x for x in self.santiago.hosting]}) {"clients": [x for x in self.santiago.hosting]})
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
@ -300,7 +301,7 @@ class Hosting(RestMonitor):
class ConsumedService(RestMonitor): class ConsumedService(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self, host, service): def GET(self, host, service):
return self.respond("consumedService-get.tmpl", return self.respond("consumedService.tmpl",
{ "service": service, { "service": service,
"host": host, "host": host,
"locations": "locations":
@ -328,7 +329,7 @@ class ConsumedService(RestMonitor):
class ConsumedHost(RestMonitor): class ConsumedHost(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self, host): def GET(self, host):
return self.respond("consumedHost-get.tmpl", return self.respond("consumedHost.tmpl",
{ "services": self.santiago.consuming[host], { "services": self.santiago.consuming[host],
"host": host }) "host": host })
@ -353,7 +354,7 @@ class ConsumedHost(RestMonitor):
class Consuming(RestMonitor): class Consuming(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self): def GET(self):
return self.respond("consuming-get.tmpl", return self.respond("consuming.tmpl",
{ "hosts": [x for x in self.santiago.consuming]}) { "hosts": [x for x in self.santiago.consuming]})
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
@ -377,7 +378,7 @@ class Consuming(RestMonitor):
class Root(RestMonitor): class Root(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()
def GET(self): def GET(self):
return self.respond("root-get.tmpl", {}) return self.respond("root.tmpl", {})
class Stop(RestMonitor): class Stop(RestMonitor):
@cherrypy.tools.ip_filter() @cherrypy.tools.ip_filter()