rtCommon.webHttpHandlers

This module provides the callback handlers that the web server will utilize

when handling and rendering html page reqeusts.

Module Contents

Classes

HttpHandler

Generic web handler object that is initialized with the page name to render when called.

LoginHandler

Renders a login page and authenticates users. Sets a secure-cookie to remeber authenticated users.

LogoutHandler

Clears the secure-cookie so that users will need to re-authenticate.

Functions

loadPasswdFile(filename)

storePasswdFile(filename, passwdDict)

Attributes

maxDaysLoginCookieValid

rtCommon.webHttpHandlers.maxDaysLoginCookieValid = 0.5
class rtCommon.webHttpHandlers.HttpHandler

Bases: tornado.web.RequestHandler

Generic web handler object that is initialized with the page name to render when called.

initialize(self, htmlDir, page)
get_current_user(self)
get(self)

Handle a web GET request by returning the appropriate web content to render

class rtCommon.webHttpHandlers.LoginHandler

Bases: tornado.web.RequestHandler

Renders a login page and authenticates users. Sets a secure-cookie to remeber authenticated users.

loginAttempts
loginRetryDelay = 10
initialize(self, htmlDir, page, testMode)
get(self)
post(self)
checkRetry(self, user)

Keep a dictionary with one entry per username. Any user not in the passwd file will be entered as ‘invalid_user’. Record login failure count and timestamp for when the next retry is allowed. Reset failed retry count on successful login. Return message with how many seconds until next login attempt is allowed.

class rtCommon.webHttpHandlers.LogoutHandler

Bases: tornado.web.RequestHandler

Clears the secure-cookie so that users will need to re-authenticate.

initialize(self)
get(self)
rtCommon.webHttpHandlers.loadPasswdFile(filename)
rtCommon.webHttpHandlers.storePasswdFile(filename, passwdDict)