From f1bd912c85710bee5aae7a3112bdcfacd062c466 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 17 Nov 2016 16:42:38 +0800 Subject: webui: Move "password" option definition to "login.py" NOTE: By using the "tornado.options", each module can defines its own options, which are added to the global namespace. And the defined options can also be used by other modules. --- fg21sim/webui/handlers/login.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'fg21sim/webui') diff --git a/fg21sim/webui/handlers/login.py b/fg21sim/webui/handlers/login.py index 4529005..5a9987a 100644 --- a/fg21sim/webui/handlers/login.py +++ b/fg21sim/webui/handlers/login.py @@ -3,14 +3,22 @@ """ Login handler + +Currently, the login is simply authenticated by a plain password. """ -from tornado.options import options +from tornado.options import define, options from tornado.escape import xhtml_escape from .base import BaseRequestHandler +# Each module defines its own options, which are added to the global namespace +define("password", type=str, + help=("Password authentication to access the Web UI. " + "If not specified, then all accesses are allowed.")) + + class LoginHandler(BaseRequestHandler): """ Login page handler of the Web UI. -- cgit v1.2.2