2 from forum.modules import get_modules_script_classes
\r
3 from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext
\r
5 class ConsumerAndContext():
\r
6 def __init__(self, id, consumer, context):
\r
8 self.consumer = consumer()
\r
11 self.context = context
\r
14 (re.sub('AuthConsumer$', '', name).lower(), cls) for name, cls
\r
15 in get_modules_script_classes('authentication', AuthenticationConsumer).items()
\r
16 if not re.search('AbstractAuthConsumer$', name)
\r
20 (re.sub('AuthContext$', '', name).lower(), cls) for name, cls
\r
21 in get_modules_script_classes('authentication', ConsumerTemplateContext).items()
\r
24 AUTH_PROVIDERS = dict([
\r
25 (name, ConsumerAndContext(name, consumers[name], contexts[name])) for name in consumers.keys()
\r