aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-17 16:42:38 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-17 16:42:38 +0800
commitf1bd912c85710bee5aae7a3112bdcfacd062c466 (patch)
treeff039a8fb3284f0d454966e8650c8e96a302722a /fg21sim
parenta8ca7e38d78abf58ebe432aa261a1e0d3cd6b7fc (diff)
downloadfg21sim-f1bd912c85710bee5aae7a3112bdcfacd062c466.tar.bz2
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.
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/webui/handlers/login.py10
1 files changed, 9 insertions, 1 deletions
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.