linotp.lib.resolver module¶
resolver objects and processing
- linotp.lib.resolver.closeResolvers()¶
hook to close the resolvers at the end of the request
- linotp.lib.resolver.defineResolver(params)¶
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
- linotp.lib.resolver.deleteResolver(resolvername)¶
delete a resolver and all related config entries
- Paramm resolvername
the name of the to be deleted resolver
- Returns
sucess or fail
- Return type
boolean
- linotp.lib.resolver.getResolverInfo(resolvername, passwords=False)¶
return the resolver info of the given resolvername
- Parameters
resolvername (string) – the requested resolver
:return : dict of resolver description
- linotp.lib.resolver.getResolverList(filter_resolver_type=None, config=None)¶
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.getResolverObject(resolver_spec, config=None, load_config=True)¶
get the resolver instance from a resolver specification.
- Remark
internally this function uses the request context for caching.
- Parameters
resolver_spec –
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)
- linotp.lib.resolver.initResolvers()¶
- hook for the request start -
create a deep copy of the dict with the global resolver classes
- linotp.lib.resolver.parse_resolver_spec(resolver_spec)¶
expects a resolver specification and returns a tuple containing the resolver class identifier and the config identifier
- Parameters
resolver_spec –
a resolver specification
format: <resolver class identifier>.<config identifier>
- Returns
(cls_identifier, config_identifier)
- linotp.lib.resolver.setupResolvers(config=None, cache_dir='/tmp')¶
hook at the server start to initialize the resolvers classes - the resolver class setup should only be called once
- Parameters
config – the linotp config
cache_dir – the cache directory, which could be used in each resolver
- Returns
-nothing-