def _flush_user_resolver_cache(resolver_spec): """ flush the user realm cache in case of a change of the resolver, all realms which use this resolver must be flushed :param resolver_spec: the resolve which has been updated :return: - nothing - """ from linotp.lib.user import ( delete_realm_resolver_cache, delete_resolver_user_cache, ) delete_resolver_user_cache(resolver_spec) config = context["Config"] realms = config.getRealms() # if a resolver is redefined, we have to refresh the related realm cache for realm_name, realm_spec in list(realms.items()): resolvers = realm_spec.get("useridresolver", []) if resolver_spec in resolvers: delete_realm_resolver_cache(realm_name)
def _flush_user_resolver_cache(resolver_spec): """ flush the user realm cache in case of a change of the resolver, all realms which use this resolver must be flushed :param resolver_spec: the resolve which has been updated :return: - nothing - """ from linotp.lib.user import delete_resolver_user_cache from linotp.lib.user import delete_realm_resolver_cache delete_resolver_user_cache(resolver_spec) config = context["Config"] realms = config.getRealms() # if a resolver is redefined, we have to refresh the related realm cache for realm_name, realm_spec in realms.items(): resolvers = realm_spec.get('useridresolver', []) if resolver_spec in resolvers: delete_realm_resolver_cache(realm_name)