+
    Dfj                          R t ^ RIt^ RIHtHtHt ^ RIHtHt ^ RI	H
t
 ^ RIHt  ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      t ! R R]4      tRtR tR tR t ! R R4      tR# )z
Support for resolving command-line strings that represent different
checkers available to cred.

Examples:
 - passwd:/etc/passwd
 - memory:admin:asdf:user:lkj
 - unix
N)OptionalSequenceType)	Attribute	Interface)
getPlugins)usagec                   j   a  ] tR t^t o Rt]! R4      t]! R4      t]! R4      t]! R4      t	R t
RtV tR# )	ICheckerFactoryz
A factory for objects which provide
L{twisted.cred.checkers.ICredentialsChecker}.

It's implemented by twistd plugins creating checkers.
z0A tag that identifies the authentication method.zmA detailed (potentially multi-line) description of precisely what functionality this CheckerFactory provides.z=A short (one-line) description of the argument string format.z@A list of credentials interfaces that this factory will support.c                    R# )ze
Return an L{twisted.cred.checkers.ICredentialsChecker} provider using the supplied
argument string.
N )	argstrings   &6/usr/lib/python3/dist-packages/twisted/cred/strcred.pygenerateCheckerICheckerFactory.generateChecker2   s        r   N)__name__
__module____qualname____firstlineno____doc__r   authTypeauthHelpargStringFormatcredentialInterfacesr   __static_attributes____classdictcell____classdict__s   @r   r
   r
      sO      KLH	;H
  GO %J r   r
   c                       ] tR t^9tRtRtR# )StrcredExceptionz#
Base exception class for strcred.
r   Nr   r   r   r   r   r   r   r   r   r    r    9   s    r   r    c                       ] tR t^?tRtRtR# )InvalidAuthTypezj
Raised when a user provides an invalid identifier for the
authentication plugin (known as the authType).
r   Nr!   r   r   r   r#   r#   ?       r   r#   c                       ] tR t^FtRtRtR# )InvalidAuthArgumentStringz`
Raised by an authentication plugin when the argument string
provided is formatted incorrectly.
r   Nr!   r   r   r   r&   r&   F   r$   r   r&   c                       ] tR t^MtRtRtR# )UnsupportedInterfacesz
Raised when an application is given a checker to use that does not
provide any of the application's supported credentials interfaces.
r   Nr!   r   r   r   r(   r(   M   r$   r   r(   z<WARNING: This authType is not supported by this application.c                      \        \        4      # )z5
Find all objects that implement L{ICheckerFactory}.
)r   r
   r   r   r   findCheckerFactoriesr*   Y   s     o&&r   c                d    \        4        F  pVP                  V 8X  g   K  Vu # 	  \        V 4      h)zB
Find the first checker factory that supports the given authType.
)r*   r   r#   )r   factorys   & r   findCheckerFactoryr-   `   s1     ()x'N * (
##r   c                v    RV 9   d   V P                  R^4      w  rMT pRp\        V4      P                  V4      # )z
Returns an L{twisted.cred.checkers.ICredentialsChecker} based on the
contents of a descriptive string. Similar to
L{twisted.application.strports}.
: )splitr-   r   )descriptionr   r   s   &  r   makeCheckerr3   j   sC     k)//Q7)	h'77	BBr   c                   v   a  ] tR t^xt o RtRt]P                  tR t	R t
R tR tR tR tR	 tV 3R
 ltRtV tR# )AuthOptionMixina+  
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}
Nc                J    V P                   RJ ;'       g    WP                   9   # )zB
Returns whether a particular credentials interface is supported.
N)supportedInterfaces)self	interfaces   &&r   supportsInterface!AuthOptionMixin.supportsInterface   s&     ''4/XX9@X@X3XXr   c                `    VP                    F  pV P                  V4      '       g   K   R# 	  R# )zo
Returns whether a checker factory will provide at least one of
the credentials interfaces that we care about.
TF)r   r:   r8   r,   r9   s   && r   supportsCheckerFactory&AuthOptionMixin.supportsCheckerFactory   s-    
 !55I%%i00 6 r   c                   . pV P                   f   VP                  pM=VP                   F-  pV P                  V4      '       g   K  VP                  V4       K/  	  V'       g   \	        VP                  4      hRV 9  d   / V R&   RV 9  d   . V R&   V R,          P                  V4       V F+  pV R,          P                  V. 4      P                  V4       K-  	  R# )z=
Supply a supplied credentials checker to the Options class.
NcredInterfacescredCheckers)r7   r   r:   appendr(   
setdefault)r8   checker	supportedr9   s   &&  r   
addCheckerAuthOptionMixin.addChecker   s    
 	##+44I$99	)))44$$Y/ : '(D(DEE4'%'D!"%#%D ^##G,"I!"--i<CCGL #r   c                    V P                  \        V4      4       R#   \         d4   p\        P                  ! RTP
                  ^ ,          ,          4      hRp?i\         d4   p\        P                  ! RTP
                  ^ ,          ,          4      hRp?i\         d#   p\        P                  ! RT,          4      hRp?ii ; i)z2
Specify an authentication method for the server.
zAuth plugin not supported: %sNzAuth plugin not recognized: %szUnexpected error: %s)rG   r3   r(   r   
UsageErrorargsr#   	Exception)r8   r2   es   && r   opt_authAuthOptionMixin.opt_auth   s    	?OOK45$ 	P""#BQVVAY#NOO 	Q""#CaffQi#OPP 	?""#9A#=>>	?s8    C.AC$C%.BC C!B>>Cc              #     "   \        4        F4  pVP                   F!  pV P                  V4      '       g   K  Vx   K2  	  K6  	  R# 5i)zt
Return a list of which authTypes will be displayed by --help-auth.
This makes it a lot easier to test this module.
N)r*   r   r:   r=   s   &  r   _checkerFactoriesForOptHelpAuth/AuthOptionMixin._checkerFactoriesForOptHelpAuth   s=     
 ,-G$99	)))44!M : .s
   1AAc                   V P                   P                  R4       V P                   P                  R4       V P                   P                  R4       ^ pV P                  4        F4  p\        VP                  4      V8  g   K  \        VP                  4      pK6  	  RV,          pV P                   P                  VR,          4       V P                   P                  VR,          4       V P                  4        F:  pV P                   P                  W2P                  VP
                  3,          4       K<  	  V P                   P                  R4       \        ^ 4      h)z,
Show all authentication methods available.
z#Usage: --auth AuthType[:ArgString]
z-For detailed help: --help-auth-type AuthType

z  %%-%is	%%s
)AuthTypezArgString format)z========z================)
authOutputwriterQ   lenr   r   
SystemExit)r8   firstLengthr,   formatStrings   &   r   opt_help_authAuthOptionMixin.opt_help_auth   s    	DENOd#;;=G7##${2!'"2"23 > );6l-MMNl-MMN;;=GOO!! 0 0'2I2IJJ > 	d#mr   c                    \        V4      pT P                  P                  RT,          4       T P                  P                  RTP                  ,          4       T P                  P                  R4       TP                  P                  4       P                  4        F3  pT P                  P                  RTP                  4       ,          4       K5  	  T P                  P                  R4       T P                  T4      '       gB   T P                  P                  R\        ,          4       T P                  P                  R4       \        ^ 4      h  \         d    \        P                  ! RT,          4      hi ; i)z1
Show help for a particular authentication type.
zInvalid auth type: %szUsage: --auth %s[:ArgString]
zArgString format: %s
rT   z  %s
)r-   r#   r   rJ   rV   rW   r   r   strip
splitlinesrstripr>   notSupportedWarningrY   )r8   r   cflines   &&  r   opt_help_auth_type"AuthOptionMixin.opt_help_auth_type   s   	G#H-B 	>IJ69K9KKLd#KK%%'224DOO!!(T[[]":; 5d#**2..OO!!(-@"@AOO!!$'m  	G""#:X#EFF	Gs   E )E<c                V   < V ^8  d   Qh/ S[ S[S[S[,          ,          ,          ;R&   # )   r7   )r   r   r   r   )formatr   s   "r   __annotate__AuthOptionMixin.__annotate__x   s      2 "(4	?";<C3 r   r   )r   r   r   r   r   r7   sysstdoutrV   r:   r>   rG   rN   rQ   r\   re   __annotate_func__r   r   r   s   @r   r5   r5   x   sJ     0 @DJYM.?	,c  r   r5   )r   rl   typingr   r   r   zope.interfacer   r   twisted.pluginr   twisted.pythonr   r
   rL   r    r#   r&   r(   rb   r*   r-   r3   r5   r   r   r   <module>rs      s     + + / %  i <y &  0 ,  X '$CB Br   