Skip to content
Snippets Groups Projects
Commit f8bd7df3 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

ganeti.http: Prepare authentication for HTTP server

The authentication class will override PreHandleRequest.

Reviewed-by: amishchenko
parent dd875d32
No related branches found
No related tags found
No related merge requests found
......@@ -308,6 +308,10 @@ class _HttpServerRequestExecutor(object):
handler_context = _HttpServerRequest(self.request_msg)
try:
# Authentication, etc.
self.server.PreHandleRequest(handler_context)
# Call actual request handler
result = self.server.HandleRequest(handler_context)
except (http.HttpException, KeyboardInterrupt, SystemExit):
raise
......@@ -501,6 +505,13 @@ class HttpServer(http.HttpBase):
else:
self._children.append(pid)
def PreHandleRequest(self, req):
"""Called before handling a request.
Can be overriden by a subclass.
"""
def HandleRequest(self, req):
"""Handles a request.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment