Projet

Général

Profil

0001-add-minimalistic-logging-for-login-failures-23407.patch

Frédéric Péters, 25 avril 2018 14:32

Télécharger (1,15 ko)

Voir les différences:

Subject: [PATCH] add minimalistic logging for login failures (#23407)

 src/authentic2/user_login_failure.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/authentic2/user_login_failure.py
15 15
def user_login_failure(identifier):
16 16
    cache.add(key(identifier), 0)
17 17
    count = cache.incr(key(identifier))
18
    logger = logging.getLogger('authentic2.user_login_failure')
19
    logger.info(u'user %s failed to login', identifier)
18 20
    if app_settings.A2_LOGIN_FAILURE_COUNT_BEFORE_WARNING and count >= app_settings.A2_LOGIN_FAILURE_COUNT_BEFORE_WARNING:
19
        logger = logging.getLogger('authentic2.user_login_failure')
20 21
        logger.warning(u'user %s failed to login more than %d times in a row',
21 22
                       identifier, count)
22 23

  
23
-