linotp.lib.policy.filter module

user entry comparison processing

class linotp.lib.policy.filter.AttributeCompare

Bases: object

Policy Attribute Comparison to support user filter like

support for comparrison operation like * exist: has this attribute * equal: user attribute is same as in policy defintion * not equal: negative of equal * is_in: regex search of defintion in user attribute

support for user format like * user@domain user at domain * user.resolver: user in resolver * user simple username

support for regex match in username

compare(userObj, user_def)

comparison method - the single entry of this class

Parameters
  • userObj – the user Class object

  • user_def – user definition from the policy entry ‘user’

Returns

bool

set_key_val_compare(key, val, operator)

internal method to establish the function overloading for the comparison of key and value

Parameters
  • key – the, to be searched key

  • val – the to be compared value definition

  • operator – literal, which defines what comparison function to be used

Returns

  • nothing -

set_user_access(user_spec, typ='attribute_only')

setup, which user lookup should be made by function overloading

called from the parser

Parameters
  • user_spec – the user secification from the policy

  • typ – parameter from the parser to control, which function to use

class linotp.lib.policy.filter.UserDomainCompare

Bases: object

compare(userObj, user_def)

comparison method - the single entry of this class

Parameters
  • userObj – the user Class object

  • user_def – user definition from the policy entry ‘user’

Returns

bool

exists(userObj, user_def)

existance test is the same as the attribute search for userid