ó [³XMc@sîdZddlZddlmZmZddlmZddlmZdefd„ƒYZ de fd „ƒYZ d e fd „ƒYZ d e fd „ƒYZ de fd„ƒYZdZd„Zd„Zd„Zddd„ƒYZdS(s¨ Support for resolving command-line strings that represent different checkers available to cred. Examples: - passwd:/etc/passwd - memory:admin:asdf:user:lkj - unix iÿÿÿÿN(t Interfacet Attribute(t getPlugins(tusagetICheckerFactorycBsGeZdZedƒZedƒZedƒZedƒZd„ZRS(sš A factory for objects which provide L{twisted.cred.checkers.ICredentialsChecker}. It's implemented by twistd plugins creating checkers. s0A tag that identifies the authentication method.smA detailed (potentially multi-line) description of precisely what functionality this CheckerFactory provides.s=A short (one-line) description of the argument string format.s@A list of credentials interfaces that this factory will support.cCsdS(sf Return an L{ICredentialChecker} provider using the supplied argument string. N((t argstring((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pytgenerateChecker3s( t__name__t __module__t__doc__RtauthTypetauthHelptargStringFormattcredentialInterfacesR(((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyRs    tStrcredExceptioncBseZdZRS(s+ Base exception class for strcred. (RRR (((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyR;stInvalidAuthTypecBseZdZRS(sv Raised when a user provides an invalid identifier for the authentication plugin (known as the authType). (RRR (((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyRBstInvalidAuthArgumentStringcBseZdZRS(sl Raised by an authentication plugin when the argument string provided is formatted incorrectly. (RRR (((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyRJstUnsupportedInterfacescBseZdZRS(s“ Raised when an application is given a checker to use that does not provide any of the application's supported credentials interfaces. (RRR (((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyRRss<WARNING: This authType is not supported by this application.cCs ttƒS(s= Find all objects that implement L{ICheckerFactory}. (RR(((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pytfindCheckerFactoriesascCs7x$tƒD]}|j|kr |Sq Wt|ƒ‚dS(sJ Find the first checker factory that supports the given authType. N(RR R(R tfactory((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pytfindCheckerFactoryiscCsFd|kr'|jddƒ\}}n |}d}t|ƒj|ƒS(s¤ Returns an L{twisted.cred.checkers.ICredentialsChecker} based on the contents of a descriptive string. Similar to L{twisted.application.strports}. t:it(tsplitRR(t descriptionR R((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyt makeCheckerts  tAuthOptionMixincBs\eZdZdZejZd„Zd„Z d„Z d„Z d„Z d„Z d„ZRS( sk Defines helper methods that can be added on to any L{usage.Options} subclass that needs authentication. This mixin implements three new options methods: The opt_auth method (--auth) will write two new values to the 'self' dictionary: C{credInterfaces} (a dict of lists) and C{credCheckers} (a list). The opt_help_auth method (--help-auth) will search for all available checker plugins and list them for the user; it will exit when finished. The opt_help_auth_type method (--help-auth-type) will display detailed help for a particular checker plugin. @cvar supportedInterfaces: An iterable object that returns credential interfaces which this application is able to support. @cvar authOutput: A writeable object to which this options class will send all help-related output. Default: L{sys.stdout} cCs|jdkp||jkS(sR Returns whether a particular credentials interface is supported. N(tsupportedInterfacestNone(tselft interface((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pytsupportsInterface scCs+x$|jD]}|j|ƒr tSq WtS(s‡ Returns whether a checker factory will provide at least one of the credentials interfaces that we care about. (R RtTruetFalse(RRR((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pytsupportsCheckerFactory¨scCság}|jdkr!|j}n3x0|jD]%}|j|ƒr+|j|ƒq+q+W|slt|jƒ‚nd|kr…i|d(((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyRƒs     ((R R?tzope.interfaceRRttwisted.pluginRttwisted.pythonRRR,RRRRR;RRRR(((s8/usr/lib/python2.7/dist-packages/twisted/cred/strcred.pyts !