mirror of
https://github.com/yweber/lodel2.git
synced 2025-10-26 09:39:01 +01:00
Updated netipy client to disables console logging + add a security logging instruction to dummy_auth plugin
This commit is contained in:
parent
0df2ffbf32
commit
1d6dc1ad89
3 changed files with 12 additions and 2 deletions
|
|
@ -1,13 +1,17 @@
|
|||
#-*- coding: utf-8 -*-
|
||||
|
||||
from Lodel.user import authentication_method, identification_method, UserIdentity
|
||||
from Lodel import logger
|
||||
|
||||
@authentication_method
|
||||
def dummy_auth(identifier, proof):
|
||||
print("Trying to authenticate user %s" % identifier)
|
||||
logger.info("User '%s' is trying to authenticate" % identifier)
|
||||
if identifier == proof:
|
||||
print("%s authenticated" % identifier)
|
||||
return UserIdentity(identifier, identifier, "User %s" % identifier, authenticated = True)
|
||||
else:
|
||||
logger.security("Authentication failed for user '%s'" % identifier)
|
||||
|
||||
return False
|
||||
|
||||
@identification_method
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue