linotp.lib.policy.definitions module¶
static policy definitions
- linotp.lib.policy.definitions.convert_policy_value(value, value_type)¶
convert the value to the type definition of the policy
- Returns
converted value
- linotp.lib.policy.definitions.get_policy_definitions(scope: Optional[str] = None) Dict ¶
cache the policy definitions access in the local request context.
as the evaluation of the policy definition is resource intensive we cache the outcome on a per request base.
- Parameters
scope – select only a scope of the definitions
- Returns
the policy definition dict
- Sideeffect
the local request context is extendend by the dict of the policy definitions. As they are pretty stable, there is no interference expected
- linotp.lib.policy.definitions.validate_policy_definition(policy)¶
verify that the to be stored policy values is compliant to the policy definitions, describing the action value and type.