linotp.lib.policy.maxtoken module

maxtoken policy processing

linotp.lib.policy.maxtoken.check_maxtoken(method, user, param)

maxtoken policy restricts the tokennumber for the user in a realm

Parameters
  • method – scope of the controller actions

  • user – the user to whom the new token should belong

  • param – the calling parameters, which contains either ‘serial’ for assignment or ‘type’ for enrollment

Raises

PolicyException – if maxtoken policy would be violated

linotp.lib.policy.maxtoken.check_maxtoken_for_user(user)

This internal function checks the number of assigned tokens to a user restricted by the policies:

“scope = enrollment”, action = “maxtoken = <number>”

Parameters

user – to whom the token should belong

Raises

PolicyException – if maxtoken policy would be violated

linotp.lib.policy.maxtoken.check_maxtoken_for_user_by_type(user, type_of_token)

This internal function checks the number of assigned tokens to a user restricted by the policies:

“scope = enrollment”, action = “maxtokenTOKENTYPE = <number>”

Parameters
  • user – to whom the token should belong

  • type_of_token – which type of token should be enrolled or assigned

Raises

PolicyException – if maxtoken policy would be violated