1
# -*- test-case-name: twisted.test.test_strcred -*-
3
# Copyright (c) Twisted Matrix Laboratories.
4
# See LICENSE for details.
7
Cred plugin for anonymous logins.
10
from __future__ import absolute_import, division
12
from zope.interface import implementer
14
from twisted import plugin
15
from twisted.cred.checkers import AllowAnonymousAccess
16
from twisted.cred.strcred import ICheckerFactory
17
from twisted.cred.credentials import IAnonymous
20
anonymousCheckerFactoryHelp = """
21
This allows anonymous authentication for servers that support it.
25
@implementer(ICheckerFactory, plugin.IPlugin)
26
class AnonymousCheckerFactory(object):
28
Generates checkers that will authenticate an anonymous request.
30
authType = 'anonymous'
31
authHelp = anonymousCheckerFactoryHelp
32
argStringFormat = 'No argstring required.'
33
credentialInterfaces = (IAnonymous,)
36
def generateChecker(self, argstring=''):
37
return AllowAnonymousAccess()
41
theAnonymousCheckerFactory = AnonymousCheckerFactory()