"Fossies" - the Fresh Open Source Software Archive  

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

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

__init__.py  (LinOTP-release-2.11.1):__init__.py  (LinOTP-release-2.11.2)
skipping to change at line 69 skipping to change at line 69
from linotp.lib.policy.util import _get_pin_values from linotp.lib.policy.util import _get_pin_values
from linotp.lib.policy.util import _getDefaultRealm from linotp.lib.policy.util import _getDefaultRealm
from linotp.lib.policy.util import _getLinotpConfig from linotp.lib.policy.util import _getLinotpConfig
from linotp.lib.policy.util import _getRealms from linotp.lib.policy.util import _getRealms
from linotp.lib.policy.util import _getUserFromParam from linotp.lib.policy.util import _getUserFromParam
from linotp.lib.policy.util import _getUserRealms from linotp.lib.policy.util import _getUserRealms
from linotp.lib.policy.util import letters, digits, special_characters from linotp.lib.policy.util import letters, digits, special_characters
from linotp.lib.policy.util import ascii_lowercase, ascii_uppercase from linotp.lib.policy.util import ascii_lowercase, ascii_uppercase
from linotp.lib.policy.maxtoken import check_maxtoken
# for generating random passwords # for generating random passwords
from linotp.lib.crypto import urandom from linotp.lib.crypto import urandom
from linotp.lib.util import uniquify from linotp.lib.util import uniquify
from linotp.lib.util import generate_password from linotp.lib.util import generate_password
from linotp.lib.context import request_context from linotp.lib.context import request_context
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
skipping to change at line 338 skipping to change at line 340
param = {} param = {}
serial = param.get("serial") serial = param.get("serial")
if user is None: if user is None:
user = _getUserFromParam() user = _getUserFromParam()
realm = param.get("realm") realm = param.get("realm")
if realm is None or len(realm) == 0: if realm is None or len(realm) == 0:
realm = _getDefaultRealm() realm = _getDefaultRealm()
# ---------------------------------------------------------------------- --
# check the maxtoken policy
# which restricts the number of tokens for the user in a realm
check_maxtoken(method, user=user or authUser, param=param)
# ---------------------------------------------------------------------- --
if method == "show": if method == "show":
log.debug("[checkPolicyPre] entering method %s", method) log.debug("[checkPolicyPre] entering method %s", method)
# get the realms for this administrator # get the realms for this administrator
policies = getAdminPolicies('') policies = getAdminPolicies('')
log.debug("[checkPolicyPre] The admin >%s< may manage the " log.debug("[checkPolicyPre] The admin >%s< may manage the "
"following realms: %s", "following realms: %s",
policies['admin'], policies['realms']) policies['admin'], policies['realms'])
skipping to change at line 1106 skipping to change at line 1117
ret = {} ret = {}
_ = context['translate'] _ = context['translate']
controller = 'selfservice' controller = 'selfservice'
client = _get_client() client = _get_client()
if not param: if not param:
param = {} param = {}
log.debug("entering controller %s", controller) log.debug("entering controller %s", controller)
# ---------------------------------------------------------------------- --
# check the maxtoken policy
# which restricts the number of tokens for the user in a realm
check_maxtoken(method, user=user or authUser, param=param)
# ---------------------------------------------------------------------- --
if method[0: len('max_count')] == 'max_count': if method[0: len('max_count')] == 'max_count':
ret = 0 ret = 0
serial = param.get("serial") serial = param.get("serial")
ttype = linotp.lib.token.getTokenType(serial).lower() ttype = linotp.lib.token.getTokenType(serial).lower()
urealm = authUser.realm urealm = authUser.realm
pol_action = MAP_TYPE_GETOTP_ACTION.get(ttype, "") pol_action = MAP_TYPE_GETOTP_ACTION.get(ttype, "")
if pol_action == "": if pol_action == "":
raise PolicyException(_("There is no policy selfservice/" raise PolicyException(_("There is no policy selfservice/"
"max_count definable for the token " "max_count definable for the token "
 End of changes. 3 change blocks. 
0 lines changed or deleted 20 lines changed or added

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