Mercurial > p > roundup > code
annotate website/issues/html/home.about.html @ 6823:fe0091279f50
Refactor session db logging and key generation for sessions/otks
While I was working on the redis sessiondb stuff, I noticed that
log_wanrning, get_logger ... was duplicated. Also there was code to
generate a unique key for otks that was duplicated.
Changes:
creating new sessions_common.py and SessionsCommon class to provide
methods:
log_warning, log_info, log_debug, get_logger, getUniqueKey
getUniqueKey method is closer to the method used to make
session keys in client.py.
sessions_common.py now report when random_.py chooses a weak
random number generator. Removed same from rest.py.
get_logger reconciles all logging under
roundup.hyperdb.backends.<name of BasicDatabase class>
some backends used to log to root logger.
have BasicDatabase in other sessions_*.py modules inherit from
SessionCommon.
change logging to use log_* methods.
In addition:
remove unused imports reported by flake8 and other formatting
changes
modify actions.py, rest.py, templating.py to use getUniqueKey
method.
add tests for new methods
test_redis_session.py
swap out ModuleNotFoundError for ImportError to prevent crash in
python2 when redis is not present.
allow injection of username:password or just password into redis
connection URL. set pytest_redis_pw envirnment variable to password
or user:password when running test.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 07 Aug 2022 01:51:11 -0400 |
| parents | 4155ed7f00f4 |
| children |
| rev | line source |
|---|---|
| 6246 | 1 <!-- dollarId: issue.index,v 1.2 2001/07/29 04:07:37 richard Exp dollar--> |
| 2 | |
| 3 <tal:block metal:use-macro="templates/page/macros/icing"> | |
| 4 | |
| 5 <title metal:fill-slot="head_title" i18n:translate="" > | |
| 6 About this Tracker | |
| 7 </title> | |
| 8 <tal:block metal:fill-slot="body_title" i18n:translate=""> | |
| 9 About this Tracker | |
| 10 </tal:block> | |
| 11 | |
| 12 <div class="content" metal:fill-slot="content"> | |
| 13 | |
| 14 <span tal:condition="not:python:request.user.hasRole('Admin')" | |
| 15 tal:omit-tag="python:1" i18n:translate=""> | |
| 16 Please login with your username and password to find out about | |
| 17 this tracker. | |
| 18 </span> | |
| 19 | |
| 20 <div tal:condition="python:request.user.hasRole('Admin')" | |
| 21 tal:omit-tag="python:1" i18n:translate=""> | |
| 22 <div tal:replace="structure python:utils.AboutPage(db)"></div> | |
| 23 </div> | |
| 24 </div> | |
| 25 | |
| 26 </tal:block> |
