linotp.lib.resolver module

resolver objects and processing


set up a new resolver from request parameters

the setup of the resolver includes the loading of the resolver config. this is required to allow the resolver to check if all required parameters are available.

As the resolver (for historical reasons) has access to the overall LinOTP config, we have to prepare the resolver definition, which is done by the Resolver() class. Thus during the defineResolver, we have first to merge the LinOTP config with the new resolver config (from the params) and if the loading of the config went well, we will do the saving of the resolver.

Parameters:params – dict of request parameters

expects a resolver specification and returns a tuple containing the resolver class identifier and the config identifier


a resolver specification

format: <resolver class identifier>.<config identifier>

Returns:(cls_identifier, config_identifier)

Gets the list of configured resolvers

Parameters:filter_resolver_type (string) – Only resolvers of the given type are returned
Return type:Dictionary of the resolvers and their configuration
linotp.lib.resolver.getResolverInfo(resolvername, passwords=False)[source]

return the resolver info of the given resolvername

Parameters:resolvername (string) – the requested resolver

:return : dict of resolver description


delete a resolver and all related config entries

Paramm resolvername:
 the name of the to be deleted resolver
Returns:sucess or fail
Return type:boelean
linotp.lib.resolver.getResolverObject(resolver_spec, config=None, load_config=True)[source]

get the resolver instance from a resolver specification.

Remark:internally this function uses the request context for caching.

the resolver string as from the token including the config identifier.

format: <resolver class identifier>.<config identifier>

Returns:instance of the resolver with the loaded config (or None if specification was invalid or didn’t match a resolver)
hook for the request start -
create a deep copy of the dict with the global resolver classes

hook to close the resolvers at the end of the request

linotp.lib.resolver.setupResolvers(config=None, cache_dir='/tmp')[source]

hook at the server start to initialize the resolvers classes

  • config – the linotp config
  • cache_dir – the cache directory, which could be used in each resolver