"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "linotpd/src/linotp/lib/userservice.py" between
LinOTP-release-2.11.2.tar.gz and LinOTP-release-2.12.tar.gz

About: LinOTP is a flexible and versatile OTP-platform for strong user authentication (two-factor authentication with one time passwords).

userservice.py  (LinOTP-release-2.11.2):userservice.py  (LinOTP-release-2.12)
skipping to change at line 72 skipping to change at line 72
from linotp.tokens import tokenclass_registry from linotp.tokens import tokenclass_registry
from linotp.lib.user import (getUserInfo, from linotp.lib.user import (getUserInfo,
User, User,
getUserId) getUserId)
from linotp.lib.realm import getDefaultRealm from linotp.lib.realm import getDefaultRealm
from linotp.lib.context import request_context from linotp.lib.context import request_context
from linotp.lib.type_utils import DEFAULT_TIMEFORMAT as TIMEFORMAT
import logging import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
# const for encryption and iv # const for encryption and iv
SECRET_LEN = 32 SECRET_LEN = 32
# const - timeformat used in session cookie Cookie_Secret = binascii.hexlify(os.urandom(SECRET_LEN))
TIMEFORMAT = "%a, %d %b %Y %H:%M:%S GMT"
Cookie_Cache = {} Cookie_Cache = {}
def get_userinfo(user): def get_userinfo(user):
(uid, resolver, resolver_class) = getUserId(user) (uid, resolver, resolver_class) = getUserId(user)
uinfo = getUserInfo(uid, resolver, resolver_class) uinfo = getUserInfo(uid, resolver, resolver_class)
if 'cryptpass' in uinfo: if 'cryptpass' in uinfo:
del uinfo['cryptpass'] del uinfo['cryptpass']
return uinfo return uinfo
skipping to change at line 260 skipping to change at line 260
return (user == cookie_user and cookie_client == client) return (user == cookie_user and cookie_client == client)
def get_cookie_secret(): def get_cookie_secret():
""" """
get the cookie encryption secret from the config get the cookie encryption secret from the config
- if the selfservice is droped from running localy, this - if the selfservice is droped from running localy, this
configuration option might not exist anymore configuration option might not exist anymore
:return: return the cookie encryption secret :return: return the cookie encryption secret
""" """
config = request_context['Config'] return Cookie_Secret
if not config.get('selfservice_auth_secret'):
secret = binascii.hexlify(os.urandom(SECRET_LEN))
config['selfservice_auth_secret'] = secret
return config.get('selfservice_auth_secret')
def get_cookie_expiry(): def get_cookie_expiry():
""" """
get the cookie encryption expiry from the config get the cookie encryption expiry from the config
- if the selfservice is dropped from running locally, this - if the selfservice is dropped from running locally, this
configuration option might not exist anymore configuration option might not exist anymore
:return: return the cookie encryption expiry :return: return the cookie encryption expiry
""" """
config = request_context['Config'] config = request_context['Config']
 End of changes. 3 change blocks. 
10 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)